From nobody Mon Feb 9 12:09:12 2026 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