[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220403164526.357371-5-martin@kaiser.cx>
Date: Sun, 3 Apr 2022 18:45:25 +0200
From: Martin Kaiser <martin@...ser.cx>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Larry Finger <Larry.Finger@...inger.net>,
Phillip Potter <phil@...lpotter.co.uk>,
Michael Straube <straube.linux@...il.com>,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
Martin Kaiser <martin@...ser.cx>
Subject: [PATCH 4/5] staging: r8188eu: use ieee80211 structs for addresses
Map the incoming frame data to a struct ieee80211_hdr and extract
the addresses.
Signed-off-by: Martin Kaiser <martin@...ser.cx>
---
drivers/staging/r8188eu/core/rtw_recv.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
index 39834771519f..a8ab1be33cfb 100644
--- a/drivers/staging/r8188eu/core/rtw_recv.c
+++ b/drivers/staging/r8188eu/core/rtw_recv.c
@@ -801,22 +801,21 @@ static void validate_recv_ctrl_frame(struct adapter *padapter,
struct rx_pkt_attrib *pattrib = &precv_frame->attrib;
struct sta_priv *pstapriv = &padapter->stapriv;
u8 *pframe = precv_frame->rx_data;
- __le16 fc = *(__le16 *)pframe;
- /* uint len = precv_frame->len; */
u16 aid;
+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precv_frame->rx_data;
u8 wmmps_ac;
struct sta_info *psta;
/* receive the frames that ra(a1) is my address */
- if (memcmp(GetAddr1Ptr(pframe), myid(&padapter->eeprompriv), ETH_ALEN))
+ if (memcmp(hdr->addr1, myid(&padapter->eeprompriv), ETH_ALEN))
return;
/* only handle ps-poll */
- if (!ieee80211_is_pspoll(fc))
+ if (!ieee80211_is_pspoll(hdr->frame_control))
return;
aid = GetAid(pframe);
- psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
+ psta = rtw_get_stainfo(pstapriv, hdr->addr2);
if (!psta || psta->aid != aid)
return;
--
2.30.2
Powered by blists - more mailing lists