From patchwork Sat Oct 15 15:24:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2957 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp684162wrs; Sat, 15 Oct 2022 08:27:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Wz4SAbnX19pfR1WPNbsSgnA5cEJIf2+9JLCMssAFkA6qCM/dhuilhulX0+8DdxdzjvxeP X-Received: by 2002:aa7:818f:0:b0:562:dc99:8a84 with SMTP id g15-20020aa7818f000000b00562dc998a84mr3489549pfi.30.1665847626225; Sat, 15 Oct 2022 08:27:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665847626; cv=none; d=google.com; s=arc-20160816; b=AIcZCHVqacbUyfm97rtzGJYj91teDGDDERH/oJtUsl8bYgbaOB3PElzWR47aGYzGtt xQZxfB5dG0bAyrrJWliyicwqir6ndC4kZ6Ysgaw7JpazvSvHhYHDK0/8g9GjFnhroE6z gIm2Pcus7euywBQnbhviqEtX9OvUI5LHQ/gaYP/mqTVCWOVHhvJMYILfy0Mr7dXZ7xdU q0R1F9TLL8t/l6TDL/ghchf2nqjA0GX/hjwCSUUeWkREsityO6XByg3jympPDYrYByx7 MxQL+SnIht1TaN5dVEQhZ+PdEoE2A7eCway3VzK3yQ7dKPCDhSho58OjoeVS5vL0khNR GGCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=L0tbaHNtRG3f8JBk9J1jvbQ/YOqeYd5VfTmHojp70DM=; b=BAd0LrD15Kv8OgGxsu2dJGWsYekRCN6YTGSri0JAyu9cfdW5oGiCVvy537951O1tgc zuQmIMuVqXSa/1BLvRFfIMZtlPr1lQAccYmGWpSdDBpWx4Yp8M6jmDwZ82ETNhPVq7/i WPJnbJ7d/wu9Nkt8+6ULZHORWV+IUNFZYIgSOiRZJYPdQMrhEH+Ve6QG/6vCM5X78/e7 fW83oufWghlKE3NqHMTtB/xf5CEJ5bOj6QhWDv3QHoJgY5jeDPFSKqj2TanksKp8m27T ADBXGjesisY71p1gl1tIpf1KlvAsz0bIv/JMsW183gYYSnbsOkAn7ED0MuJDJJY1vIi1 WayQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v24-20020a631518000000b0046aeec7fe3dsi6086458pgl.703.2022.10.15.08.26.53; Sat, 15 Oct 2022 08:27:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229662AbiJOPZA (ORCPT + 99 others); Sat, 15 Oct 2022 11:25:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229671AbiJOPY6 (ORCPT ); Sat, 15 Oct 2022 11:24:58 -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 A1EB424BE5 for ; Sat, 15 Oct 2022 08:24:55 -0700 (PDT) Received: from ipservice-092-217-066-135.092.217.pools.vodafone-ip.de ([92.217.66.135] 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 1ojj1t-000722-Vp; Sat, 15 Oct 2022 17:24:50 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 1/9] staging: r8188eu: replace one GetAddr3Ptr call Date: Sat, 15 Oct 2022 17:24:32 +0200 Message-Id: <20221015152440.232281-2-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221015152440.232281-1-martin@kaiser.cx> References: <20221015152440.232281-1-martin@kaiser.cx> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746767840487781139?= X-GMAIL-MSGID: =?utf-8?q?1746767840487781139?= Define a struct ieee80211_mgmt for the message that we process in OnDeAuth. Use this struct to read the bssid. This patch removes one GetAddr3Ptr call, getting us a tiny step closer to removing GetAddr3Ptr. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 07905e2ae8e0..0c4b3b99150d 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1457,6 +1457,7 @@ unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame) { + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; unsigned short reason; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; @@ -1464,8 +1465,7 @@ unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame) u8 *pframe = precv_frame->rx_data; struct wifidirect_info *pwdinfo = &padapter->wdinfo; - /* check A3 */ - if (!(!memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN))) + if (memcmp(mgmt->bssid, get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) return _SUCCESS; if (pwdinfo->rx_invitereq_info.scan_op_ch_only) { From patchwork Sat Oct 15 15:24:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2958 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp684246wrs; Sat, 15 Oct 2022 08:27:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5p1zwIipgAfbVeduaAHUOm9HrJfApnt6TZiW9uBLkZYyFfHpsR74MZdGPiCB6O55PJ/IJW X-Received: by 2002:a65:554b:0:b0:46a:f646:6374 with SMTP id t11-20020a65554b000000b0046af6466374mr3054876pgr.356.1665847639862; Sat, 15 Oct 2022 08:27:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665847639; cv=none; d=google.com; s=arc-20160816; b=nuPR00f4kktMS56EsSe/o70oARF6eFC6ILzoT5cYiTsBORBCfbPd6mq+WQbYNbv02L gAPZK8cc49vkXEvEi44qEIL1BVxeGMFXmp+HxcXuzpUOOGYjFvZc0ydDCCFyOqg8CXkV jtU86ZaR13spB247H+iwM2ahAfoHzLMQmsIu/3YdI9Fhd3uB8E9n1/W07EZYBF0kCBK8 FUxuP2XJOQrCbrbSIxnEPqn2A78oy6o64SPX+qfAnhJtEai1+03eBFOG9bcTntyJEHjR dTgYTqzI60xiktGqF8NdVwzg/WA44YTj67s5b2UfGH1bm1q8pDfba9Ft/R/xm7y4yuT9 CsUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=+O9tsDWkpMlvziEol7v6+/ak83cH1zkQGI5zBJ6WhZc=; b=x/lbZoe2zedmfcvlI8cp4xkAGn6+78rE+Esfq8eIwOx7nqPFex9eW2b9/DH6EF3Sc8 0V5IrzFgY6ME6ueiC3f9G+Uch8BzKeXt/yrfKe0AglZAcye/0cQLJ5R/OYqJa9R1l6KM VRAHbGwNxnZvIEeQ9RhuZKGp1C0a0YVssqNrpqhVebCCweIN0CQW6cy8j908wr1h9k93 KxzUmz3f0pk0uyn+skSs/ESnZe7kpA6Hc3HwgrID1Z7FB88fl9fA2GQsLJW1k+0LZm4U H3ll5+VWVx1tNUAz2JsN/AojXAtpVhHGOLKx8iTW7f5yZ5zskBa0kDbrIIweh3CIVjKI s8QQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k69-20020a633d48000000b0046b2f9a5040si3554469pga.545.2022.10.15.08.27.07; Sat, 15 Oct 2022 08:27:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229827AbiJOPZK (ORCPT + 99 others); Sat, 15 Oct 2022 11:25:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229751AbiJOPZF (ORCPT ); Sat, 15 Oct 2022 11:25:05 -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 22B4815A04 for ; Sat, 15 Oct 2022 08:24:56 -0700 (PDT) Received: from ipservice-092-217-066-135.092.217.pools.vodafone-ip.de ([92.217.66.135] 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 1ojj1u-000722-Rn; Sat, 15 Oct 2022 17:24:50 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 2/9] staging: r8188eu: get reason code from mgmt struct Date: Sat, 15 Oct 2022 17:24:33 +0200 Message-Id: <20221015152440.232281-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221015152440.232281-1-martin@kaiser.cx> References: <20221015152440.232281-1-martin@kaiser.cx> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746767854648387546?= X-GMAIL-MSGID: =?utf-8?q?1746767854648387546?= Read the deauth reson code from the newly added mgmt structure instead of calculating the offset ourselves. 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 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; From patchwork Sat Oct 15 15:24:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2956 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp683950wrs; Sat, 15 Oct 2022 08:26:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4H7usP6CGfG6XRiTADTHYOKSNrwhqbd2/qg0SptfRX7ZK6rbCsVj12nDCPFlJdZS6IGjku X-Received: by 2002:a63:2483:0:b0:461:ab67:ccfb with SMTP id k125-20020a632483000000b00461ab67ccfbmr2864789pgk.341.1665847592164; Sat, 15 Oct 2022 08:26:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665847592; cv=none; d=google.com; s=arc-20160816; b=yGBZ2/AZy+8dyif6HeRP2Hp/9I1TWgYyOoDAEOMBVsH+AxYOyi+bSIDW1eHbrf3vWO 1WlkzzPDM9nX1MSDkDcsAWq8TnPJj92elk0Nt5TvhVlS+b2S9dAuaUEKowq4R+CAlhBs jA8aMtK2Wsm8URvpleoRhLzLsrp7BKRgC/sgYUlYa0il+gam+NdrHpcQDkwhb1xkH4tC ujuePkMt5LVLHi2HnpFpX1+x305RNexbr+RY9YUkMS+aJXbKEr46DjV7hqQLOTeocl2w DWZjEAkB272L6C533IEtkfhl3p5SupSfZMOalbp5Sw58XQ/jTeQOGx1zhco/VZtqLdNG dzVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=rB7LMUcvaWnEedKivvwD5nTa+uNG7X06O/VAU4cgWJM=; b=pHDdtG7PLVafIGJsnZ4UI4XH1OvAmn+Wd+Gwkyw6ry/NvAmT/9kHbsBlkm7vnyXInt A1IMvBnE3d3efda1DV+VPOIuoOrMiqZZY7bvFh4nqUFihrfTSXkXW3cSefodpHxhZlPM wtrV1yg1UX5X9uBuW1OpbuL6dbONmov4RiIfFOvtORqYhDGpeo3YFhllFmEXwvqv2tKN lI5igVIJky8c1D1+N5O/sJGsmT8GcTOrys/VC7443aUac/2EYdYaSaESwwUBcVCrcbGb 0e4TZqQz749mqXfZCsXJUhzRzbPqYqXFJIPtzQZlohYoiaC48HqHnSqIBFwp68AU3Db9 8tYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q10-20020a056a00084a00b00561c2d86801si6539628pfk.315.2022.10.15.08.26.19; Sat, 15 Oct 2022 08:26:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229864AbiJOPZO (ORCPT + 99 others); Sat, 15 Oct 2022 11:25:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229762AbiJOPZF (ORCPT ); Sat, 15 Oct 2022 11:25:05 -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 DC32633A11 for ; Sat, 15 Oct 2022 08:24:56 -0700 (PDT) Received: from ipservice-092-217-066-135.092.217.pools.vodafone-ip.de ([92.217.66.135] 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 1ojj1v-000722-Kn; Sat, 15 Oct 2022 17:24:51 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 3/9] staging: r8188eu: clarify the bBusyTraffic assignment Date: Sat, 15 Oct 2022 17:24:34 +0200 Message-Id: <20221015152440.232281-4-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221015152440.232281-1-martin@kaiser.cx> References: <20221015152440.232281-1-martin@kaiser.cx> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746767804881521430?= X-GMAIL-MSGID: =?utf-8?q?1746767804881521430?= bBusyTraffic is set only if we're not in WIFI_AP_STATE, i.e. in the else branch. If we were not in WIFI_AP_STATE, we'd go into the if branch and return _SUCCESS before making it to the bBusyTraffic assignment. Move the assignment into the else branch to make this clearer. 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 5c59fc91ecae..fd2daeca7112 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1515,8 +1515,9 @@ unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame) if (!ignore_received_deauth) receive_disconnect(padapter, GetAddr3Ptr(pframe), reason); + + pmlmepriv->LinkDetectInfo.bBusyTraffic = false; } - pmlmepriv->LinkDetectInfo.bBusyTraffic = false; return _SUCCESS; } From patchwork Sat Oct 15 15:24:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2954 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp683854wrs; Sat, 15 Oct 2022 08:26:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4y8pQ986oYw6YiGC9QrNKwFdNYL19VPvWtgxJ+qyY12bhA99wVKqaWI0ofcaznVkf3wK5E X-Received: by 2002:a17:90a:a415:b0:20a:f813:83a3 with SMTP id y21-20020a17090aa41500b0020af81383a3mr4003210pjp.238.1665847578231; Sat, 15 Oct 2022 08:26:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665847578; cv=none; d=google.com; s=arc-20160816; b=ZRw96rYxNKJgyFknvl0E6fB/Eg6sm4+v72d1MwqbZ2Flu+qDBjHMmHXQ14Nt+hWT5O 4fnEe5MNJ1THYVZWwarHNpu9kxZRq7gTO1gLiRqrEfqJrRM3CECiQA/k7gOXbxIlP8+J iPiTQchzlvBmEU+s+DLTlK3Eno3qFKvp3iGmqLJXeWSAH9axTiIcFre8OfqwNwmNyeBy mB7lafemJGchAXeSbqiO8OJRraBBpREClmEVzP1gIKkWrttLI47eSDeKacCaPx2CirTo fB2D84jjDuEPV6JZKl8yGb7yVwmUuvyPq/TOUbwJDaMUuWs8fTAfW6Oox9cMiEOFaHCs QgTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=rumPT1IMPmbW7LSJo1fyPgLXKZtCizJE++z5olHpC+U=; b=lD1FPzN0tNkmZU+Tb9YJLDjnGWMcoQyJ4maTSd7b42BtOXvS1zvjE1ADayk2l/V7wM iqT/0Ma9ueWl/hxvEhCadLtDsR7lEtQCwQSgFxnP25VlPW9gP1Y+B6ew0sT8NCQth2ng 4kqlPHXYPuSf2Hu39ewrTEILOsNtTaMcTI8Agxo1VYr96YoM7hMBVH137+iWKFvsg7m1 A5b4en612zG0mHbpE6C1thmARcXb5AdWz+n3FoOMzFguXhV2Yw5RKLEmukgNfiTmzoIV rbWogHUYAPCqNhkRoDTRVm2z012VjmvuQzrFA756c6nAyy9cJtPNYMNKAKINYP+FallE /Z8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bf11-20020a656d0b000000b0042ac5a24f3fsi6478013pgb.493.2022.10.15.08.26.02; Sat, 15 Oct 2022 08:26:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229717AbiJOPZD (ORCPT + 99 others); Sat, 15 Oct 2022 11:25:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229673AbiJOPY6 (ORCPT ); Sat, 15 Oct 2022 11:24:58 -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 0B8BC27DD7 for ; Sat, 15 Oct 2022 08:24:55 -0700 (PDT) Received: from ipservice-092-217-066-135.092.217.pools.vodafone-ip.de ([92.217.66.135] 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 1ojj1w-000722-DE; Sat, 15 Oct 2022 17:24:52 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 4/9] staging: r8188eu: use sa instead of Addr2 Date: Sat, 15 Oct 2022 17:24:35 +0200 Message-Id: <20221015152440.232281-5-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221015152440.232281-1-martin@kaiser.cx> References: <20221015152440.232281-1-martin@kaiser.cx> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746767790084056247?= X-GMAIL-MSGID: =?utf-8?q?1746767790084056247?= For management frames, Addr2 is the Source Address (SA). Use sa from the mgmt structure and remove the GetAddr2Ptr call. GetAddr2Ptr is a driver-specific function that we should eventually remove. 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 fd2daeca7112..732ada6ab932 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1479,7 +1479,7 @@ unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame) struct sta_info *psta; struct sta_priv *pstapriv = &padapter->stapriv; - psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); + psta = rtw_get_stainfo(pstapriv, mgmt->sa); if (psta) { u8 updated = 0; From patchwork Sat Oct 15 15:24:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2963 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp684545wrs; Sat, 15 Oct 2022 08:28:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM73uwEY2lWA5K3S/dscIRrma9dbkpVPSk0BEGXpuFG2tZonHUZ4fEc+R2n0S35AGq7sM+/Y X-Received: by 2002:a17:90b:128d:b0:20a:da54:788 with SMTP id fw13-20020a17090b128d00b0020ada540788mr4016484pjb.65.1665847693925; Sat, 15 Oct 2022 08:28:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665847693; cv=none; d=google.com; s=arc-20160816; b=UrtvTlFR3Iewgwfn0kjugO0NlLW8Kb5asYLOUy9H7LtDc8e5QzWeaCICDiK+a6Hhc4 +Cg4T0d3D2E/+LyHlJ/mG7GLDTWzNgz79uy8Jdhp8RYHVhhpiCJO5nkC04tNJD5YOtho LWrVJZmKvoJxlwfSx9SYaT8ILetwi9Mhcm9fNWk1QVSaVxkrEeAOKaSOh9SMi93zKft+ 7Y6cTDqIz+OgttCg/MFRco18yFgbzVtnc/I7gTEHTkb91L/A+Dy4xIZ2QIGV6JJmCfyV 91aFO5qI7N5pzywVtoDIR5xdC2IvAzM3EztqIZ0wyJMtVeQ4UAwdzXPn28sEHUYnVZWD uP1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=BITPpihr0bzemqLpJHDbddmz7hAzCG2dbCkDYLAzYHc=; b=XqVVBWVMcxHLYkkOrO3bgZjN+SUbBYoGcvf0pHIraf2CgnFKddyFq3RclEV7qvkHHn 1R4WaTzqSY4TX2vSP1Y/Yylpx1VeR1Wn6FWAwKV3m9NSQt3IhdsnjLRaYHFfNRnqHAZr +RS5c73sjesfqnmUsSZX0ukESFt9TJjek7XFpwP33d+/qddi/Y3YE1PkDc0UjbhZdUw0 d/XAl4qzNiGX3Nm1ES23MOXFHvKussdBeYQA7TFVSww2J4YIyg1TGfg58MIEwuIxvD+w z45gfHP4rZmVQMOuX5b549Dgr6ZbQav/LZUyGW31fTyY+lbBxv5kcMcsubGGBoBppE+M wk2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c13-20020a170902b68d00b0018040bdb798si6138635pls.242.2022.10.15.08.28.02; Sat, 15 Oct 2022 08:28:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229902AbiJOPZ3 (ORCPT + 99 others); Sat, 15 Oct 2022 11:25:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229849AbiJOPZN (ORCPT ); Sat, 15 Oct 2022 11:25:13 -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 564EF186C9 for ; Sat, 15 Oct 2022 08:24:57 -0700 (PDT) Received: from ipservice-092-217-066-135.092.217.pools.vodafone-ip.de ([92.217.66.135] 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 1ojj1x-000722-5T; Sat, 15 Oct 2022 17:24:53 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 5/9] staging: r8188eu: get bssid from mgmt struct Date: Sat, 15 Oct 2022 17:24:36 +0200 Message-Id: <20221015152440.232281-6-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221015152440.232281-1-martin@kaiser.cx> References: <20221015152440.232281-1-martin@kaiser.cx> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746767911836607767?= X-GMAIL-MSGID: =?utf-8?q?1746767911836607767?= For management frames, Addr3 is the BSSID. Read it from the mgmt structure instead of calling GetAddr3Ptr. The pframe variable is now unused and can be removed. Signed-off-by: Martin Kaiser --- 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 732ada6ab932..742976c38cd5 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1462,7 +1462,6 @@ unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; - u8 *pframe = precv_frame->rx_data; struct wifidirect_info *pwdinfo = &padapter->wdinfo; if (memcmp(mgmt->bssid, get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) @@ -1514,7 +1513,7 @@ unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame) } if (!ignore_received_deauth) - receive_disconnect(padapter, GetAddr3Ptr(pframe), reason); + receive_disconnect(padapter, mgmt->bssid, reason); pmlmepriv->LinkDetectInfo.bBusyTraffic = false; } From patchwork Sat Oct 15 15:24:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2955 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp683855wrs; Sat, 15 Oct 2022 08:26:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7alXQeaXuI/B9su38jL1mslfc2SxUQn9oeyOd7mnVhC+Lt3w2gfm7OK6xcGb+fOpbgj84z X-Received: by 2002:a17:90a:e291:b0:20a:acde:1c43 with SMTP id d17-20020a17090ae29100b0020aacde1c43mr3948996pjz.62.1665847578227; Sat, 15 Oct 2022 08:26:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665847578; cv=none; d=google.com; s=arc-20160816; b=CQzSjJX7fjSducuO/qTLS6azGeraVtvY3TJ3m3jgKSrYMGnJfNffa0jl0YJ09Zqgqi qWIcJC5nPBbYJotZEhZDbJ21rouq2CKizV78SEGac50jwC5JkYJ7nF4jre+vIlBEyRoL DiXaEwDEl3/eApaPsSn1O93Y6CBjUpRalvW8n1C5YEcKkwglRjef2x+2bsgM0YncQ8jE hbJxuC0eBCvLtydARo/leW6+Lni/aotb64/05nnnMNuERA/Ae/6US6BgqexTCUXy+tXg HIS/ML8VC0SCk6yWZOxegqfOjFbQ9aEG5v3Bi3yOiUzxwVqIhHEHAuDiasEADV1X09jv yRqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=pQjsJp6id7u0oojWfZhKZK0A70u/JRdAN34BpTJ5H5U=; b=dEqUg7Rjuv+Zcqd5YGmbvUw/6oFkTBDJ8Bzfcw0hKqqqhsc7TYpsl4PqI3+5uHC0GN afSfXsRFRCQwAzfhNZsPpvhkbBuS0TcTMdxsBFJKBkbSCTYouJ7J/e0Y3xzs/TXDa2S2 p9FyySmyjBfgOYsF+95HehDE7qvHVMxxy1RJO/MbBQlLQKt6F3lPQDMWl7c0pJMN0q0T Iu2tWZMahyJSynsXk82yGMMYSVNO6UvWm0TEA6wBvcB2DAmrJV+ySGKNgOdMt08qnHke jqUBrgyxBxIs7QZmla7j1yZxMgvwjtDE9K7l7D+jvnhsJwW5EMGQVpJYdeB9LAebZ8Uh bNPw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jj5-20020a170903048500b00179f69eae64si6637214plb.620.2022.10.15.08.26.03; Sat, 15 Oct 2022 08:26:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229673AbiJOPZI (ORCPT + 99 others); Sat, 15 Oct 2022 11:25:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229744AbiJOPZF (ORCPT ); Sat, 15 Oct 2022 11:25:05 -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 A8034175B8 for ; Sat, 15 Oct 2022 08:24:57 -0700 (PDT) Received: from ipservice-092-217-066-135.092.217.pools.vodafone-ip.de ([92.217.66.135] 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 1ojj1x-000722-Ra; Sat, 15 Oct 2022 17:24:53 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 6/9] staging: r8188eu: exit for deauth from unknown station Date: Sat, 15 Oct 2022 17:24:37 +0200 Message-Id: <20221015152440.232281-7-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221015152440.232281-1-martin@kaiser.cx> References: <20221015152440.232281-1-martin@kaiser.cx> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746767790340954708?= X-GMAIL-MSGID: =?utf-8?q?1746767790340954708?= If we receive a deauth message from an unknown station, we can drop this message and exit immediately. Reorder the code to make this clearer, don't wrap everything in an if statement. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 742976c38cd5..40df0f9982f4 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1477,21 +1477,21 @@ unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame) if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { struct sta_info *psta; struct sta_priv *pstapriv = &padapter->stapriv; + u8 updated = 0; psta = rtw_get_stainfo(pstapriv, mgmt->sa); - if (psta) { - u8 updated = 0; - - spin_lock_bh(&pstapriv->asoc_list_lock); - if (!list_empty(&psta->asoc_list)) { - list_del_init(&psta->asoc_list); - pstapriv->asoc_list_cnt--; - updated = ap_free_sta(padapter, psta, false, reason); - } - spin_unlock_bh(&pstapriv->asoc_list_lock); + if (!psta) + return _SUCCESS; - associated_clients_update(padapter, updated); + spin_lock_bh(&pstapriv->asoc_list_lock); + if (!list_empty(&psta->asoc_list)) { + list_del_init(&psta->asoc_list); + pstapriv->asoc_list_cnt--; + updated = ap_free_sta(padapter, psta, false, reason); } + spin_unlock_bh(&pstapriv->asoc_list_lock); + + associated_clients_update(padapter, updated); return _SUCCESS; } else { From patchwork Sat Oct 15 15:24:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2959 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp684316wrs; Sat, 15 Oct 2022 08:27:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4rSvQeIO0Q3a/8nz/e03ZGTM2OBBseUtEiBDm/8yCIeF1ty9Z4dLaDm9dZoKqvn/GRiYYm X-Received: by 2002:a05:6a00:4192:b0:563:5e95:1db3 with SMTP id ca18-20020a056a00419200b005635e951db3mr3563915pfb.14.1665847651359; Sat, 15 Oct 2022 08:27:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665847651; cv=none; d=google.com; s=arc-20160816; b=u0VXjF1MECGz99oudT3Ad/M8r0GHUAoFzdjdB6yps5yXWW5yIBbP9jXStn29qlcN4T LRVy8bCeq/EXn7JfUx72SQlUA+SGu09QdTqZvrHZJ2CqTG4r+P+x8oldw1qt7oN/AwqY tEdvGmHvxYLmjiFUaw50nswtod+vDVOYDgWJjgNRfq0vzCZWLvKjvA87xP9lOM2BsDAC bOP2CmC4DYqgyNQuD98SYdC8UjFZXgnDbYLpZGlyZhyYyewTYEMzUCOupDNhjIxb1/LM qR0yIMpjSn3yacpiNjYykZ1OIDOBOGOz+98dbz5tAsljJbuevWxLwXAmSQy0Nf0Ocn7M /2dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=+kOxqTPzChPpYIlMVHXi5trr5sjn9Cw+WSB8uFKN0C8=; b=a1TE2F0x8ctPbDa84R/USOrL4glIWsxGtN7xXCXMunFqvH6DOkSdtiX1YNV6O96fXA DLh05lDxpPnHuwTixL2Us+hITUvHsxQv1IT2ck1vY7yC2CchC/YMOsZeQwm9S/JR3mgQ 38B8ifCx5roMuwZfcbomPUkS3ggePlE/hKNN3avzgBpm7fwZDU23o3aPtyHcItqtXhpf fHMhIp18qssiEPMgbe1RDBwV66iLg7iRHzqztEQkXVi95OV4zTienwL35VsWgeo69zGq 8x0+syxHQSYc25ysFPCUGFWKtrN3GMmDwuuv9dqoRVGOHAKfoIOLYQWeWXsrz+CzWWM6 8Zlg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020a170902e94500b00174ab1a7deasi6085121pll.316.2022.10.15.08.27.19; Sat, 15 Oct 2022 08:27:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229884AbiJOPZS (ORCPT + 99 others); Sat, 15 Oct 2022 11:25:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229800AbiJOPZI (ORCPT ); Sat, 15 Oct 2022 11:25:08 -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 56A961AF02 for ; Sat, 15 Oct 2022 08:24:57 -0700 (PDT) Received: from ipservice-092-217-066-135.092.217.pools.vodafone-ip.de ([92.217.66.135] 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 1ojj1y-000722-Im; Sat, 15 Oct 2022 17:24:54 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 7/9] staging: r8188eu: remove unnecessary return Date: Sat, 15 Oct 2022 17:24:38 +0200 Message-Id: <20221015152440.232281-8-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221015152440.232281-1-martin@kaiser.cx> References: <20221015152440.232281-1-martin@kaiser.cx> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746767866963501113?= X-GMAIL-MSGID: =?utf-8?q?1746767866963501113?= Remove the return statement at the end of the if branch. We can continue to the final return after the if-else. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 40df0f9982f4..465f51bce0e3 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1492,8 +1492,6 @@ unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame) spin_unlock_bh(&pstapriv->asoc_list_lock); associated_clients_update(padapter, updated); - - return _SUCCESS; } else { int ignore_received_deauth = 0; From patchwork Sat Oct 15 15:24:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2960 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp684362wrs; Sat, 15 Oct 2022 08:27:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7OKo1Hoad9hrFzM65RHrKdqlDMDWFb8yd+8ob6wmdQ7Y9lMDyoLuhoecMnG6k6afVLBzuL X-Received: by 2002:a17:90a:ea95:b0:20a:f65b:143b with SMTP id h21-20020a17090aea9500b0020af65b143bmr4016903pjz.230.1665847659390; Sat, 15 Oct 2022 08:27:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665847659; cv=none; d=google.com; s=arc-20160816; b=b8OeRFcmAw511UmLmEE60oPiuF03W703Bo0C2/WBU5KXQIqCL9mT+19F59yaWyrhNa JGBJCYoIHPR1Hw+2q2TI5iaPEW9o8s/+UjkGnsQLJW3BCG2jpVn289LYPhP5C8HRmZ1A AujzNxxuMAVtOjIQSIk3VTc0m+jZIEgKZb3Us8SucC1wMCmphCGkPk3f/52D2vXdqT8n /yRF126Z2jNxgmZzAZsqaQLajbPz/e5nCpEuHKe83yprOY/Fo1e6lBh+ja4S6AmAarzs 4NQIIkPi/aflrIOsooNnknHSKFQvUfgVPf4dS9KZE+zCODNHtpZqDu0BKA4iPrmpUa01 j0Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=zmrwNOjCRKEAB8w0yOrogGbJ542RwKPjsqdHZVDfmnE=; b=NhUrvWCW1jyzVfKH17jW6Ks6RgPM+o22tgOjml1Umf7A0UE9MnaiMDOZdwWtfVbdm3 2SkVBwBhCWrO7UxUsdYABI1aU9XftzRrQQ/Pddg0Nn2nWLb0ImvFCtKn1yrswYE4DEiz KAvYVV/FsjTk4j55TT7nh8VIt+AyZEsc3r5dwywdsKCZGeL4dI27tVEN3E1nohGbyYa3 dOCatuTIcR7MNhbxk4x/XmcnOAPYVakzZnP7MfT6k8TkvYV2T6homog+LdsGafOz/rjq Ez2eQT4aWYeINhHqbDhUrAiJMGfe5CHLE/VU/2gfbSiaTmgOnEewRCehhUFmBpHb8FYH xAOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l4-20020a63ba44000000b0044ed36e5a29si6406678pgu.715.2022.10.15.08.27.26; Sat, 15 Oct 2022 08:27:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229894AbiJOPZY (ORCPT + 99 others); Sat, 15 Oct 2022 11:25:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229751AbiJOPZN (ORCPT ); Sat, 15 Oct 2022 11:25:13 -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 574E5175B8 for ; Sat, 15 Oct 2022 08:25:00 -0700 (PDT) Received: from ipservice-092-217-066-135.092.217.pools.vodafone-ip.de ([92.217.66.135] 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 1ojj1z-000722-Cb; Sat, 15 Oct 2022 17:24:55 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 8/9] staging: r8188eu: summarize two flags checks Date: Sat, 15 Oct 2022 17:24:39 +0200 Message-Id: <20221015152440.232281-9-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221015152440.232281-1-martin@kaiser.cx> References: <20221015152440.232281-1-martin@kaiser.cx> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746767875082105362?= X-GMAIL-MSGID: =?utf-8?q?1746767875082105362?= Summarize the two statements to check if either WIFI_FW_AUTH_STATE or WIFI_FW_ASSOC_STATE is set. Signed-off-by: Martin Kaiser --- 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) { From patchwork Sat Oct 15 15:24:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2961 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp684461wrs; Sat, 15 Oct 2022 08:27:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Ni6WzaWPtQ2yS2VpJTE/UtRwQO8/g0asUrmkSZRz1yqz32mcLjFTobtDtx0E4p48vCKZ1 X-Received: by 2002:aa7:810a:0:b0:55b:674d:d123 with SMTP id b10-20020aa7810a000000b0055b674dd123mr3616992pfi.52.1665847677811; Sat, 15 Oct 2022 08:27:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665847677; cv=none; d=google.com; s=arc-20160816; b=X38wc2sMbcN9mos/igHehpDOd6qyJitDfJTQuNcPSEdsSjEsngQSM/LI51VB/4wEnm Y77nuF7DLa2+pDeK4vaIV8DjJc+EBV0GTM+PODmST44jeiKEeVj1JJx5BqwWpsQot0ZK fY8VGBcloM0Jp+Y6gbn3gjt2Kz+d9Tv8g2fRsT87IVcsXT+9QLnMO8zoHGkZxnQBHFUx wC2/GxWMkQ9H7C/6VYfivpYmnIE5tzmFx8A/Buz3HH6gg2XILmRNd01vDevqZu8jGe7X SWkzwlhwdK/tkB6jyn4REFa5MGBoC0nTVFxaLutPxm61/uwDrvGVLX5/5Y8U1jM6g+y9 n2Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=yqp9dmkl7qd/HaymImbEEaUL250kdLg+h2qGxfwLXMo=; b=Wv1pSWWCZusFf0d52D7tqdVeA8l1slKL+cp5JlpT1Sh/t5Z4b6KPEVgbOItIeWnb2m vlzhCnei4IMGsHOi9kidvg7JpyRP1/jIFEa/CBFbeD2uqvXc+hAzBURDIfBsCHfjogag ohZrWBgB5Rsqff2iJFy7IpKU8mPJI+rivBEI4X9FvCIFCJ004bhmfiQhE0FEPHb7QZL4 lY7bStBHQdKXK9pXPGIfzvrThH39oKUb7k4hPl8E92C7GbRUwEqhxKJdthQ3b7Kxojby sXeaD8W9DTVUr6XeqaFjO55n8v9brYp03/PfSLNb2r1sIWSwFxMmwPUO1DMObzC+HxsX Qxtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 131-20020a621789000000b00561a2341e81si5220123pfx.125.2022.10.15.08.27.45; Sat, 15 Oct 2022 08:27:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229939AbiJOPZj (ORCPT + 99 others); Sat, 15 Oct 2022 11:25:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbiJOPZX (ORCPT ); Sat, 15 Oct 2022 11:25:23 -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 5701D1AF38 for ; Sat, 15 Oct 2022 08:24:59 -0700 (PDT) Received: from ipservice-092-217-066-135.092.217.pools.vodafone-ip.de ([92.217.66.135] 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 1ojj20-000722-7k; Sat, 15 Oct 2022 17:24:56 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 9/9] staging: r8188eu: ignore_received_deauth is a boolean Date: Sat, 15 Oct 2022 17:24:40 +0200 Message-Id: <20221015152440.232281-10-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221015152440.232281-1-martin@kaiser.cx> References: <20221015152440.232281-1-martin@kaiser.cx> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746767894625694816?= X-GMAIL-MSGID: =?utf-8?q?1746767894625694816?= The ignore_received_deauth is in fact a boolean variable. Change its type to bool and use true, false for its values. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 09ffecc5b2b3..fda446b6779c 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1493,7 +1493,7 @@ unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame) associated_clients_update(padapter, updated); } else { - int ignore_received_deauth = 0; + bool ignore_received_deauth = false; /* Before sending the auth frame to start the STA/GC mode connection with AP/GO, * we will send the deauth first. @@ -1502,10 +1502,10 @@ unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame) */ if (pmlmeinfo->state & (WIFI_FW_AUTH_STATE | WIFI_FW_ASSOC_STATE)) { if (reason == WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA) { - ignore_received_deauth = 1; + ignore_received_deauth = true; } else if (reason == WLAN_REASON_PREV_AUTH_NOT_VALID) { // TODO: 802.11r - ignore_received_deauth = 1; + ignore_received_deauth = true; } }