From nobody Wed Apr 24 15:48:04 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA155C433EF for ; Sat, 14 May 2022 16:47:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234411AbiENQr5 (ORCPT ); Sat, 14 May 2022 12:47:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234376AbiENQrx (ORCPT ); Sat, 14 May 2022 12:47:53 -0400 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34FEB326C6 for ; Sat, 14 May 2022 09:47:52 -0700 (PDT) Received: from dslb-188-097-047-153.188.097.pools.vodafone-ip.de ([188.97.47.153] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1npuvj-0003kw-07; Sat, 14 May 2022 18:47:47 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 1/7] staging: r8188eu: get addba resp status from ieee80211_mgmt Date: Sat, 14 May 2022 18:47:34 +0200 Message-Id: <20220514164740.282552-2-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220514164740.282552-1-martin@kaiser.cx> References: <20220514164740.282552-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Read the addba response status from struct ieee80211_mgmt instead of parsing the incoming frame ourselves. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/= r8188eu/core/rtw_mlme_ext.c index 8a9236ba7c66..4d8337d0dc20 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1471,7 +1471,7 @@ unsigned int OnAction_back(struct adapter *padapter, = struct recv_frame *precv_fr struct sta_info *psta =3D NULL; struct recv_reorder_ctrl *preorder_ctrl; unsigned char *frame_body; - unsigned short tid, status; + unsigned short tid; struct mlme_ext_priv *pmlmeext =3D &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo =3D &pmlmeext->mlmext_info; u8 *pframe =3D precv_frame->rx_data; @@ -1505,9 +1505,8 @@ unsigned int OnAction_back(struct adapter *padapter, = struct recv_frame *precv_fr issue_action_BA(padapter, mgmt->sa, WLAN_ACTION_ADDBA_RESP, 37);/* reje= ct ADDBA Req */ break; case WLAN_ACTION_ADDBA_RESP: - status =3D get_unaligned_le16(&frame_body[3]); tid =3D ((frame_body[5] >> 2) & 0x7); - if (status =3D=3D 0) { /* successful */ + if (mgmt->u.action.u.addba_resp.status =3D=3D 0) { /* successful */ psta->htpriv.agg_enable_bitmap |=3D 1 << tid; psta->htpriv.candidate_tid_bitmap &=3D ~BIT(tid); } else { --=20 2.30.2 From nobody Wed Apr 24 15:48:04 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A226BC433EF for ; Sat, 14 May 2022 16:47:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234388AbiENQrz (ORCPT ); Sat, 14 May 2022 12:47:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234381AbiENQrx (ORCPT ); Sat, 14 May 2022 12:47:53 -0400 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79B0232077 for ; Sat, 14 May 2022 09:47:52 -0700 (PDT) Received: from dslb-188-097-047-153.188.097.pools.vodafone-ip.de ([188.97.47.153] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1npuvj-0003kw-Rh; Sat, 14 May 2022 18:47:47 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 2/7] staging: r8188eu: read addba resp tid from ieee80211_mgmt Date: Sat, 14 May 2022 18:47:35 +0200 Message-Id: <20220514164740.282552-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220514164740.282552-1-martin@kaiser.cx> References: <20220514164740.282552-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Use the same code as ieee80211_process_addba_resp to calculate the tid from the capability field of an addba response message. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/= r8188eu/core/rtw_mlme_ext.c index 4d8337d0dc20..03c9b2d0d4e8 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1505,7 +1505,8 @@ unsigned int OnAction_back(struct adapter *padapter, = struct recv_frame *precv_fr issue_action_BA(padapter, mgmt->sa, WLAN_ACTION_ADDBA_RESP, 37);/* reje= ct ADDBA Req */ break; case WLAN_ACTION_ADDBA_RESP: - tid =3D ((frame_body[5] >> 2) & 0x7); + tid =3D u16_get_bits(le16_to_cpu(mgmt->u.action.u.addba_resp.capab), + IEEE80211_ADDBA_PARAM_TID_MASK); if (mgmt->u.action.u.addba_resp.status =3D=3D 0) { /* successful */ psta->htpriv.agg_enable_bitmap |=3D 1 << tid; psta->htpriv.candidate_tid_bitmap &=3D ~BIT(tid); --=20 2.30.2 From nobody Wed Apr 24 15:48:04 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D62DC433EF for ; Sat, 14 May 2022 16:48:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234499AbiENQsK (ORCPT ); Sat, 14 May 2022 12:48:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234373AbiENQry (ORCPT ); Sat, 14 May 2022 12:47:54 -0400 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09C9032079 for ; Sat, 14 May 2022 09:47:52 -0700 (PDT) Received: from dslb-188-097-047-153.188.097.pools.vodafone-ip.de ([188.97.47.153] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1npuvk-0003kw-Ju; Sat, 14 May 2022 18:47:48 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 3/7] staging: r8188eu: merge process_addba_req into OnAction_back Date: Sat, 14 May 2022 18:47:36 +0200 Message-Id: <20220514164740.282552-4-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220514164740.282552-1-martin@kaiser.cx> References: <20220514164740.282552-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The process_addba_req function is called only by OnAction_back. Merge the two functions. OnAction_back has already checked that psta !=3D NULL, we can drop the check in process_addba_req before merging the functions. We can also simplify the parsing of the tid by using struct ieee80211. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 6 ++++- drivers/staging/r8188eu/core/rtw_wlan_util.c | 22 ------------------- .../staging/r8188eu/include/rtw_mlme_ext.h | 2 -- 3 files changed, 5 insertions(+), 25 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/= r8188eu/core/rtw_mlme_ext.c index 03c9b2d0d4e8..77f229121b4d 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1497,7 +1497,11 @@ unsigned int OnAction_back(struct adapter *padapter,= struct recv_frame *precv_fr switch (mgmt->u.action.u.addba_req.action_code) { case WLAN_ACTION_ADDBA_REQ: memcpy(&pmlmeinfo->ADDBA_req, &frame_body[2], sizeof(struct ADDBA_reques= t)); - process_addba_req(padapter, (u8 *)&pmlmeinfo->ADDBA_req, mgmt->sa); + tid =3D u16_get_bits(le16_to_cpu(mgmt->u.action.u.addba_req.capab), + IEEE80211_ADDBA_PARAM_TID_MASK); + preorder_ctrl =3D &psta->recvreorder_ctrl[tid]; + preorder_ctrl->indicate_seq =3D 0xffff; + preorder_ctrl->enable =3D pmlmeinfo->bAcceptAddbaReq; =20 if (pmlmeinfo->bAcceptAddbaReq) issue_action_BA(padapter, mgmt->sa, WLAN_ACTION_ADDBA_RESP, 0); diff --git a/drivers/staging/r8188eu/core/rtw_wlan_util.c b/drivers/staging= /r8188eu/core/rtw_wlan_util.c index 27035eac6e61..9585ab41cd3f 100644 --- a/drivers/staging/r8188eu/core/rtw_wlan_util.c +++ b/drivers/staging/r8188eu/core/rtw_wlan_util.c @@ -1464,28 +1464,6 @@ int update_sta_support_rate(struct adapter *padapter= , u8 *pvar_ie, uint var_ie_l return _SUCCESS; } =20 -void process_addba_req(struct adapter *padapter, u8 *paddba_req, u8 *addr) -{ - struct sta_info *psta; - u16 tid; - u16 param; - struct recv_reorder_ctrl *preorder_ctrl; - struct sta_priv *pstapriv =3D &padapter->stapriv; - struct ADDBA_request *preq =3D (struct ADDBA_request *)paddba_req; - struct mlme_ext_priv *pmlmeext =3D &padapter->mlmeextpriv; - struct mlme_ext_info *pmlmeinfo =3D &pmlmeext->mlmext_info; - - psta =3D rtw_get_stainfo(pstapriv, addr); - - if (psta) { - param =3D le16_to_cpu(preq->BA_para_set); - tid =3D (param >> 2) & 0x0f; - preorder_ctrl =3D &psta->recvreorder_ctrl[tid]; - preorder_ctrl->indicate_seq =3D 0xffff; - preorder_ctrl->enable =3D pmlmeinfo->bAcceptAddbaReq; - } -} - void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len) { u8 *pIE; diff --git a/drivers/staging/r8188eu/include/rtw_mlme_ext.h b/drivers/stagi= ng/r8188eu/include/rtw_mlme_ext.h index 888b12a9f755..573d65b175cc 100644 --- a/drivers/staging/r8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/r8188eu/include/rtw_mlme_ext.h @@ -592,8 +592,6 @@ void addba_timer_hdl(struct sta_info *psta); bool cckrates_included(unsigned char *rate, int ratelen); bool cckratesonly_included(unsigned char *rate, int ratelen); =20 -void process_addba_req(struct adapter *padapter, u8 *paddba_req, u8 *addr); - void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len); void correct_TSF(struct adapter *padapter, struct mlme_ext_priv *pmlmeext); =20 --=20 2.30.2 From nobody Wed Apr 24 15:48:04 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B3BDC433F5 for ; Sat, 14 May 2022 16:48:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234215AbiENQsF (ORCPT ); Sat, 14 May 2022 12:48:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234374AbiENQry (ORCPT ); Sat, 14 May 2022 12:47:54 -0400 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 694D6326D1 for ; Sat, 14 May 2022 09:47:53 -0700 (PDT) Received: from dslb-188-097-047-153.188.097.pools.vodafone-ip.de ([188.97.47.153] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1npuvl-0003kw-CW; Sat, 14 May 2022 18:47:49 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 4/7] staging: r8188eu: replace if with ternary operator Date: Sat, 14 May 2022 18:47:37 +0200 Message-Id: <20220514164740.282552-5-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220514164740.282552-1-martin@kaiser.cx> References: <20220514164740.282552-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Replace an if statement with a ternary operator, making the code a tiny bit shorter. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/= r8188eu/core/rtw_mlme_ext.c index 77f229121b4d..d5ea074c62f4 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1503,10 +1503,8 @@ unsigned int OnAction_back(struct adapter *padapter,= struct recv_frame *precv_fr preorder_ctrl->indicate_seq =3D 0xffff; preorder_ctrl->enable =3D pmlmeinfo->bAcceptAddbaReq; =20 - if (pmlmeinfo->bAcceptAddbaReq) - issue_action_BA(padapter, mgmt->sa, WLAN_ACTION_ADDBA_RESP, 0); - else - issue_action_BA(padapter, mgmt->sa, WLAN_ACTION_ADDBA_RESP, 37);/* reje= ct ADDBA Req */ + issue_action_BA(padapter, mgmt->sa, WLAN_ACTION_ADDBA_RESP, + pmlmeinfo->bAcceptAddbaReq ? 0 : 37); break; case WLAN_ACTION_ADDBA_RESP: tid =3D u16_get_bits(le16_to_cpu(mgmt->u.action.u.addba_resp.capab), --=20 2.30.2 From nobody Wed Apr 24 15:48:04 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6A7FC433F5 for ; Sat, 14 May 2022 16:48:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234530AbiENQsV (ORCPT ); Sat, 14 May 2022 12:48:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234384AbiENQry (ORCPT ); Sat, 14 May 2022 12:47:54 -0400 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BE1B3207E for ; Sat, 14 May 2022 09:47:53 -0700 (PDT) Received: from dslb-188-097-047-153.188.097.pools.vodafone-ip.de ([188.97.47.153] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1npuvm-0003kw-3Q; Sat, 14 May 2022 18:47:50 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 5/7] staging: r8188eu: use BIT(tid) instead of manual shift Date: Sat, 14 May 2022 18:47:38 +0200 Message-Id: <20220514164740.282552-6-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220514164740.282552-1-martin@kaiser.cx> References: <20220514164740.282552-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Use BIT(tid) instead of 1 << tid when we process an addba response. Signed-off-by: Martin Kaiser --- 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 d5ea074c62f4..9aa6d09b2e74 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1510,7 +1510,7 @@ unsigned int OnAction_back(struct adapter *padapter, = struct recv_frame *precv_fr tid =3D u16_get_bits(le16_to_cpu(mgmt->u.action.u.addba_resp.capab), IEEE80211_ADDBA_PARAM_TID_MASK); if (mgmt->u.action.u.addba_resp.status =3D=3D 0) { /* successful */ - psta->htpriv.agg_enable_bitmap |=3D 1 << tid; + psta->htpriv.agg_enable_bitmap |=3D BIT(tid); psta->htpriv.candidate_tid_bitmap &=3D ~BIT(tid); } else { psta->htpriv.agg_enable_bitmap &=3D ~BIT(tid); --=20 2.30.2 From nobody Wed Apr 24 15:48:04 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1464C433EF for ; Sat, 14 May 2022 16:48:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234541AbiENQsa (ORCPT ); Sat, 14 May 2022 12:48:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234397AbiENQrz (ORCPT ); Sat, 14 May 2022 12:47:55 -0400 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E106326D6 for ; Sat, 14 May 2022 09:47:54 -0700 (PDT) Received: from dslb-188-097-047-153.188.097.pools.vodafone-ip.de ([188.97.47.153] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1npuvm-0003kw-T1; Sat, 14 May 2022 18:47:50 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 6/7] staging: r8188eu: check for initiator vs recipient Date: Sat, 14 May 2022 18:47:39 +0200 Message-Id: <20220514164740.282552-7-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220514164740.282552-1-martin@kaiser.cx> References: <20220514164740.282552-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" For an incoming delba message, the code checks if the delba was sent by the data initiator or by the data recipient. Rewrite this check using the ieee80211 helpers, making the code easier to understand. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/= r8188eu/core/rtw_mlme_ext.c index 9aa6d09b2e74..af525d633fd7 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1517,10 +1517,11 @@ unsigned int OnAction_back(struct adapter *padapter= , struct recv_frame *precv_fr } break; case WLAN_ACTION_DELBA: - if ((frame_body[3] & BIT(3)) =3D=3D 0) { + if (u16_get_bits(le16_to_cpu(mgmt->u.action.u.delba.params), + IEEE80211_DELBA_PARAM_INITIATOR_MASK) =3D=3D WLAN_BACK_RECIPIENT) { psta->htpriv.agg_enable_bitmap &=3D ~(1 << ((frame_body[3] >> 4) & 0xf)= ); psta->htpriv.candidate_tid_bitmap &=3D ~(1 << ((frame_body[3] >> 4) & 0= xf)); - } else if ((frame_body[3] & BIT(3)) =3D=3D BIT(3)) { + } else { tid =3D (frame_body[3] >> 4) & 0x0F; preorder_ctrl =3D &psta->recvreorder_ctrl[tid]; preorder_ctrl->enable =3D false; --=20 2.30.2 From nobody Wed Apr 24 15:48:04 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7420C433F5 for ; Sat, 14 May 2022 16:48:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234554AbiENQsd (ORCPT ); Sat, 14 May 2022 12:48:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234400AbiENQr4 (ORCPT ); Sat, 14 May 2022 12:47:56 -0400 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49DB2326DA for ; Sat, 14 May 2022 09:47:55 -0700 (PDT) Received: from dslb-188-097-047-153.188.097.pools.vodafone-ip.de ([188.97.47.153] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1npuvn-0003kw-N9; Sat, 14 May 2022 18:47:51 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 7/7] staging: r8188eu: use the tid in delba processing Date: Sat, 14 May 2022 18:47:40 +0200 Message-Id: <20220514164740.282552-8-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220514164740.282552-1-martin@kaiser.cx> References: <20220514164740.282552-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Extract the tid from the delba frame regardless of the recipient/initiator setting. Use the extracted tid when we process the delba frame. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/= r8188eu/core/rtw_mlme_ext.c index af525d633fd7..b24c6a79646d 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1517,12 +1517,13 @@ unsigned int OnAction_back(struct adapter *padapter= , struct recv_frame *precv_fr } break; case WLAN_ACTION_DELBA: + tid =3D u16_get_bits(le16_to_cpu(mgmt->u.action.u.delba.params), + IEEE80211_DELBA_PARAM_TID_MASK); if (u16_get_bits(le16_to_cpu(mgmt->u.action.u.delba.params), IEEE80211_DELBA_PARAM_INITIATOR_MASK) =3D=3D WLAN_BACK_RECIPIENT) { - psta->htpriv.agg_enable_bitmap &=3D ~(1 << ((frame_body[3] >> 4) & 0xf)= ); - psta->htpriv.candidate_tid_bitmap &=3D ~(1 << ((frame_body[3] >> 4) & 0= xf)); + psta->htpriv.agg_enable_bitmap &=3D ~BIT(tid); + psta->htpriv.candidate_tid_bitmap &=3D ~BIT(tid); } else { - tid =3D (frame_body[3] >> 4) & 0x0F; preorder_ctrl =3D &psta->recvreorder_ctrl[tid]; preorder_ctrl->enable =3D false; preorder_ctrl->indicate_seq =3D 0xffff; --=20 2.30.2