This series cleans up the OnDeAuth function and tries to replace
driver-specific parsing code with helpers from ieee80211.h.
Martin Kaiser (9):
staging: r8188eu: replace one GetAddr3Ptr call
staging: r8188eu: get reason code from mgmt struct
staging: r8188eu: clarify the bBusyTraffic assignment
staging: r8188eu: use sa instead of Addr2
staging: r8188eu: get bssid from mgmt struct
staging: r8188eu: exit for deauth from unknown station
staging: r8188eu: remove unnecessary return
staging: r8188eu: summarize two flags checks
staging: r8188eu: ignore_received_deauth is a boolean
drivers/staging/r8188eu/core/rtw_mlme_ext.c | 45 ++++++++++-----------
1 file changed, 21 insertions(+), 24 deletions(-)
--
2.30.2
Read the deauth reson code from the newly added mgmt structure instead of
calculating the offset ourselves.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/core/rtw_mlme_ext.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
index 0c4b3b99150d..5c59fc91ecae 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
@@ -1473,7 +1473,7 @@ unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame)
_set_timer(&pwdinfo->reset_ch_sitesurvey, 10);
}
- reason = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN));
+ reason = le16_to_cpu(mgmt->u.disassoc.reason_code);
if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
struct sta_info *psta;
--
2.30.2
Summarize the two statements to check if either WIFI_FW_AUTH_STATE or
WIFI_FW_ASSOC_STATE is set.
Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/core/rtw_mlme_ext.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
index 465f51bce0e3..09ffecc5b2b3 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
@@ -1500,8 +1500,7 @@ unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame)
* However, the Win8.1 with BRCM Wi-Fi will send the deauth with reason code 6 to us after receieving our deauth.
* Added the following code to avoid this case.
*/
- if ((pmlmeinfo->state & WIFI_FW_AUTH_STATE) ||
- (pmlmeinfo->state & WIFI_FW_ASSOC_STATE)) {
+ if (pmlmeinfo->state & (WIFI_FW_AUTH_STATE | WIFI_FW_ASSOC_STATE)) {
if (reason == WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA) {
ignore_received_deauth = 1;
} else if (reason == WLAN_REASON_PREV_AUTH_NOT_VALID) {
--
2.30.2
Hi Martin,
Martin Kaiser <[email protected]> says:
> This series cleans up the OnDeAuth function and tries to replace
> driver-specific parsing code with helpers from ieee80211.h.
>
> Martin Kaiser (9):
> staging: r8188eu: replace one GetAddr3Ptr call
> staging: r8188eu: get reason code from mgmt struct
> staging: r8188eu: clarify the bBusyTraffic assignment
> staging: r8188eu: use sa instead of Addr2
> staging: r8188eu: get bssid from mgmt struct
> staging: r8188eu: exit for deauth from unknown station
> staging: r8188eu: remove unnecessary return
> staging: r8188eu: summarize two flags checks
> staging: r8188eu: ignore_received_deauth is a boolean
>
> drivers/staging/r8188eu/core/rtw_mlme_ext.c | 45 ++++++++++-----------
> 1 file changed, 21 insertions(+), 24 deletions(-)
>
works for me, thanks
Acked-by: Pavel Skripkin <[email protected]>
With regards,
Pavel Skripkin
On 10/15/22 17:24, Martin Kaiser wrote:
> This series cleans up the OnDeAuth function and tries to replace
> driver-specific parsing code with helpers from ieee80211.h.
>
> Martin Kaiser (9):
> staging: r8188eu: replace one GetAddr3Ptr call
> staging: r8188eu: get reason code from mgmt struct
> staging: r8188eu: clarify the bBusyTraffic assignment
> staging: r8188eu: use sa instead of Addr2
> staging: r8188eu: get bssid from mgmt struct
> staging: r8188eu: exit for deauth from unknown station
> staging: r8188eu: remove unnecessary return
> staging: r8188eu: summarize two flags checks
> staging: r8188eu: ignore_received_deauth is a boolean
>
> drivers/staging/r8188eu/core/rtw_mlme_ext.c | 45 ++++++++++-----------
> 1 file changed, 21 insertions(+), 24 deletions(-)
>
Tested-by: Philipp Hortmann <[email protected]> # Edimax N150