Commit a00e00a2 authored by Philipp Hortmann's avatar Philipp Hortmann Committed by Greg Kroah-Hartman

staging: rtl8192e: Use standard function in rtllib_rx_check_duplicate()

Use standard function ieee80211_is_beacon() to avoid proprietary code and
to increase readability.
Signed-off-by: default avatarPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/b74b6ef5e266504b9e3d84495bcd8fe4978b4ded.1694546300.git.philipp.g.hortmann@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dabd8585
...@@ -904,11 +904,9 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee, ...@@ -904,11 +904,9 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
{ {
struct rtllib_hdr_4addr *hdr = (struct rtllib_hdr_4addr *)skb->data; struct rtllib_hdr_4addr *hdr = (struct rtllib_hdr_4addr *)skb->data;
u16 fc, sc; u16 fc, sc;
u8 frag, type, stype; u8 frag;
fc = le16_to_cpu(hdr->frame_ctl); fc = le16_to_cpu(hdr->frame_ctl);
type = WLAN_FC_GET_TYPE(fc);
stype = WLAN_FC_GET_STYPE(fc);
sc = le16_to_cpu(hdr->seq_ctl); sc = le16_to_cpu(hdr->seq_ctl);
frag = WLAN_GET_SEQ_FRAG(sc); frag = WLAN_GET_SEQ_FRAG(sc);
...@@ -916,8 +914,7 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee, ...@@ -916,8 +914,7 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
!ieee->current_network.qos_data.active || !ieee->current_network.qos_data.active ||
!IsDataFrame(skb->data) || !IsDataFrame(skb->data) ||
IsLegacyDataFrame(skb->data)) { IsLegacyDataFrame(skb->data)) {
if (!((type == RTLLIB_FTYPE_MGMT) && if (!ieee80211_is_beacon(hdr->frame_ctl)) {
(stype == RTLLIB_STYPE_BEACON))) {
if (is_duplicate_packet(ieee, hdr)) if (is_duplicate_packet(ieee, hdr))
return -1; return -1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment