lkml.org 
[lkml]   [2023]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 4/8] 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: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtllib_rx.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 89c8d66765fe..80eee43ee444 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -904,11 +904,8 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
{
struct rtllib_hdr_4addr *hdr = (struct rtllib_hdr_4addr *)skb->data;
u16 fc, sc;
- u8 frag, type, stype;
+ u8 frag;

- 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);
frag = WLAN_GET_SEQ_FRAG(sc);

@@ -916,8 +913,7 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
!ieee->current_network.qos_data.active ||
!IsDataFrame(skb->data) ||
IsLegacyDataFrame(skb->data)) {
- if (!((type == RTLLIB_FTYPE_MGMT) &&
- (stype == RTLLIB_STYPE_BEACON))) {
+ if (!ieee80211_is_beacon(hdr->frame_ctl)) {
if (is_duplicate_packet(ieee, hdr))
return -1;
}
--
2.41.0
\
 
 \ /
  Last update: 2023-09-09 20:20    [W:0.057 / U:2.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site