[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220403165438.357728-9-martin@kaiser.cx>
Date: Sun, 3 Apr 2022 18:54:35 +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 08/11] staging: r8188eu: ra and ta do not depend on to_ds, from_ds
The "DS bit usage" table in include/linux/ieee80211.h shows that
ra is always addr1 and ta is always addr2.
We can set pattrib->ra and pattrib->ta regardless of the to_ds and
from_ds bits.
Signed-off-by: Martin Kaiser <martin@...ser.cx>
---
drivers/staging/r8188eu/core/rtw_recv.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
index 0098f3de31d7..75c0e0b17185 100644
--- a/drivers/staging/r8188eu/core/rtw_recv.c
+++ b/drivers/staging/r8188eu/core/rtw_recv.c
@@ -962,19 +962,15 @@ static int validate_recv_data_frame(struct adapter *adapter,
if (ieee80211_has_a4(hdr->frame_control))
return _FAIL;
- if (ieee80211_has_fromds(hdr->frame_control)) {
- memcpy(pattrib->ra, pda, ETH_ALEN);
- memcpy(pattrib->ta, pbssid, ETH_ALEN);
+ memcpy(pattrib->ra, hdr->addr1, ETH_ALEN);
+ memcpy(pattrib->ta, hdr->addr2, ETH_ALEN);
+
+ if (ieee80211_has_fromds(hdr->frame_control))
ret = ap2sta_data_frame(adapter, precv_frame, &psta);
- } else if (ieee80211_has_tods(hdr->frame_control)) {
- memcpy(pattrib->ra, pbssid, ETH_ALEN);
- memcpy(pattrib->ta, psa, ETH_ALEN);
+ else if (ieee80211_has_tods(hdr->frame_control))
ret = sta2ap_data_frame(adapter, precv_frame, &psta);
- } else {
- memcpy(pattrib->ra, pda, ETH_ALEN);
- memcpy(pattrib->ta, psa, ETH_ALEN);
+ else
ret = sta2sta_data_frame(adapter, precv_frame, &psta);
- }
if (ret == _FAIL || ret == RTW_RX_HANDLED)
return ret;
--
2.30.2
Powered by blists - more mailing lists