[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210227222236.581490-2-insafonov@gmail.com>
Date: Sun, 28 Feb 2021 01:22:34 +0300
From: Ivan Safonov <insafonov@...il.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
Larry Finger <Larry.Finger@...inger.net>,
Michael Straube <straube.linux@...il.com>,
Pascal Terjan <pterjan@...gle.com>, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org, Ivan Safonov <insafonov@...il.com>
Subject: [PATCH 1/4] staging:rtl8712: replace get_(d|s)a with ieee80211_get_(D|S)A
get_da()/get_sa() duplicate native ieee80211_get_(D|S)A functions.
Remove get_(d|s)a, use ieee80211_get_(D|S)A instead.
Signed-off-by: Ivan Safonov <insafonov@...il.com>
---
drivers/staging/rtl8712/rtl871x_recv.c | 4 +--
drivers/staging/rtl8712/wifi.h | 45 --------------------------
2 files changed, 2 insertions(+), 47 deletions(-)
diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers/staging/rtl8712/rtl871x_recv.c
index eb4e46a7f743..efd783e7ccbc 100644
--- a/drivers/staging/rtl8712/rtl871x_recv.c
+++ b/drivers/staging/rtl8712/rtl871x_recv.c
@@ -466,8 +466,8 @@ static sint validate_recv_data_frame(struct _adapter *adapter,
struct security_priv *psecuritypriv = &adapter->securitypriv;
bretry = GetRetry(ptr);
- pda = get_da(ptr);
- psa = get_sa(ptr);
+ pda = ieee80211_get_DA((struct ieee80211_hdr *)ptr);
+ psa = ieee80211_get_SA((struct ieee80211_hdr *)ptr);
pbssid = get_hdr_bssid(ptr);
if (!pbssid)
return _FAIL;
diff --git a/drivers/staging/rtl8712/wifi.h b/drivers/staging/rtl8712/wifi.h
index 1b32b3510093..5de0e67b1876 100644
--- a/drivers/staging/rtl8712/wifi.h
+++ b/drivers/staging/rtl8712/wifi.h
@@ -264,51 +264,6 @@ static inline unsigned char get_tofr_ds(unsigned char *pframe)
#define GetAddr4Ptr(pbuf) ((unsigned char *)((addr_t)(pbuf) + 24))
-static inline unsigned char *get_da(unsigned char *pframe)
-{
- unsigned char *da;
- unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe);
-
- switch (to_fr_ds) {
- case 0x00: /* ToDs=0, FromDs=0 */
- da = GetAddr1Ptr(pframe);
- break;
- case 0x01: /* ToDs=0, FromDs=1 */
- da = GetAddr1Ptr(pframe);
- break;
- case 0x02: /* ToDs=1, FromDs=0 */
- da = GetAddr3Ptr(pframe);
- break;
- default: /* ToDs=1, FromDs=1 */
- da = GetAddr3Ptr(pframe);
- break;
- }
- return da;
-}
-
-static inline unsigned char *get_sa(unsigned char *pframe)
-{
- unsigned char *sa;
- unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe);
-
- switch (to_fr_ds) {
- case 0x00: /* ToDs=0, FromDs=0 */
- sa = GetAddr2Ptr(pframe);
- break;
- case 0x01: /* ToDs=0, FromDs=1 */
- sa = GetAddr3Ptr(pframe);
- break;
- case 0x02: /* ToDs=1, FromDs=0 */
- sa = GetAddr2Ptr(pframe);
- break;
- default: /* ToDs=1, FromDs=1 */
- sa = GetAddr4Ptr(pframe);
- break;
- }
-
- return sa;
-}
-
static inline unsigned char *get_hdr_bssid(unsigned char *pframe)
{
unsigned char *sa;
--
2.26.2
Powered by blists - more mailing lists