summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8192e/rtllib_rx.c
diff options
context:
space:
mode:
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>2023-09-15 19:09:50 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-09-17 10:47:57 +0300
commit3f48cad5497a54830f9ce8666c1b7907041c25fc (patch)
tree3fd48417f310aa11c69ef080f0de95d538dee8cc /drivers/staging/rtl8192e/rtllib_rx.c
parent87f8e11d5147992fe0b8c232e656be96f778408e (diff)
downloadlinux-3f48cad5497a54830f9ce8666c1b7907041c25fc.tar.xz
staging: rtl8192e: Replace usage of RTLLIB_FCTL_DSTODS with function
Replace usage of RTLLIB_FCTL_DSTODS with function ieee80211_has_a4() to avoid proprietary code and to increase readability. To achieve this goal it was required to change a parameter of function rtllib_rx_data_filter(). Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/69f72a352b8129bcc6610c1355a41d966abf24d8.1694792595.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8192e/rtllib_rx.c')
-rw-r--r--drivers/staging/rtl8192e/rtllib_rx.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 4d8c3869eb83..ef042dfd89cb 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -97,7 +97,7 @@ rtllib_frag_cache_get(struct rtllib_device *ieee,
struct ieee80211_qos_hdr_4addr *hdr_4addrqos;
u8 tid;
- if (((fc & RTLLIB_FCTL_DSTODS) == RTLLIB_FCTL_DSTODS) &&
+ if (ieee80211_has_a4(hdr->frame_control) &&
RTLLIB_QOS_HAS_SEQ(fc)) {
hdr_4addrqos = (struct ieee80211_qos_hdr_4addr *)hdr;
tid = le16_to_cpu(hdr_4addrqos->qos_ctrl) & RTLLIB_QCTL_TID;
@@ -166,7 +166,7 @@ static int rtllib_frag_cache_invalidate(struct rtllib_device *ieee,
struct ieee80211_qos_hdr_4addr *hdr_4addrqos;
u8 tid;
- if (((fc & RTLLIB_FCTL_DSTODS) == RTLLIB_FCTL_DSTODS) &&
+ if (ieee80211_has_a4(hdr->frame_control) &&
RTLLIB_QOS_HAS_SEQ(fc)) {
hdr_4addrqos = (struct ieee80211_qos_hdr_4addr *)hdr;
tid = le16_to_cpu(hdr_4addrqos->qos_ctrl) & RTLLIB_QCTL_TID;
@@ -359,7 +359,7 @@ static int is_duplicate_packet(struct rtllib_device *ieee,
struct ieee80211_qos_hdr_4addr *hdr_4addrqos;
u8 tid;
- if (((fc & RTLLIB_FCTL_DSTODS) == RTLLIB_FCTL_DSTODS) &&
+ if (ieee80211_has_a4(header->frame_control) &&
RTLLIB_QOS_HAS_SEQ(fc)) {
hdr_4addrqos = (struct ieee80211_qos_hdr_4addr *)header;
tid = le16_to_cpu(hdr_4addrqos->qos_ctrl) & RTLLIB_QCTL_TID;
@@ -968,16 +968,16 @@ static void rtllib_rx_extract_addr(struct rtllib_device *ieee,
}
}
-static int rtllib_rx_data_filter(struct rtllib_device *ieee, u16 fc,
+static int rtllib_rx_data_filter(struct rtllib_device *ieee, struct ieee80211_hdr *hdr,
u8 *dst, u8 *src, u8 *bssid, u8 *addr2)
{
u8 type, stype;
-
+ u16 fc = le16_to_cpu(hdr->frame_control);
type = WLAN_FC_GET_TYPE(fc);
stype = WLAN_FC_GET_STYPE(fc);
/* Filter frames from different BSS */
- if (((fc & RTLLIB_FCTL_DSTODS) != RTLLIB_FCTL_DSTODS) &&
+ if (ieee80211_has_a4(hdr->frame_control) &&
!ether_addr_equal(ieee->current_network.bssid, bssid) &&
!is_zero_ether_addr(ieee->current_network.bssid)) {
return -1;
@@ -1341,7 +1341,7 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb,
rtllib_rx_extract_addr(ieee, hdr, dst, src, bssid);
/* Filter Data frames */
- ret = rtllib_rx_data_filter(ieee, fc, dst, src, bssid, hdr->addr2);
+ ret = rtllib_rx_data_filter(ieee, hdr, dst, src, bssid, hdr->addr2);
if (ret < 0)
goto rx_dropped;