From patchwork Sat Nov 26 15:42:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 26256 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4699698wrr; Sat, 26 Nov 2022 07:46:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf7QyHyvaQgCGE4WCPRXxZcwgCmeD0uAWRCINDibLfHFUw5qINkD719jX7MCP38Vi5TiVYT7 X-Received: by 2002:a17:906:1cf:b0:7bb:f0eb:a350 with SMTP id 15-20020a17090601cf00b007bbf0eba350mr9258584ejj.575.1669477599586; Sat, 26 Nov 2022 07:46:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669477599; cv=none; d=google.com; s=arc-20160816; b=xzxEFmzh/u7T0VEIeNHdysIJeBtVpSDn8jVwOhl+6rsOA9+HmikLV5QvHywRBFRJd7 6m+y+x0FJMVcqpmOu+sgnkHOTrLub9rqeyHiCcPXYeq72SXffFKJb3k/Yw1niggKkW4n MKsCnHnT/Da9ihBrYxWwtsift43f4M5W6ZK6TWF9qUBGBQJvjS9E70lqptbnI1sWD/Rz GaV5nazspE+BQJn7XQTexO1ApQGNMQdoKfb9IhUeMGqhXDERNJ8DndnSiLif1MkyDWgY Y/BFU7bj11AXPXKgOtlfEQ/INzHJcpyDzL0/7Un8n4GVa6od646qbDY+Vwq32OhRsGyA HNKw== 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=l9s9qy+3Jz4RJBog9TBfLhPJGQcanGVysYb5JzYCXSc=; b=XoKDjn5L26GYph2tVHdyxP8QOq/SyYIO9pXEDA9dfqSz3SswPgnGuucthl6PC7eqIG nuEKlcNRO1FU3FT7VVoLoHWtH3Brxv0fHNu6m/XfvEMeuc6wXXXFRX8fNBov0tTry1Jw 01VMzFxtnp+6/8vmlJp9mSjRGHegPMP3Ss3qWl3OxCHOBjvrlpx3ixZoXbf2/JaE/K1H /lfreQSkXzP8JVzOOxEL148Om+YnyND13958RiPA7i3v0TAUHx4alf3eS9gb9d76c1Dv l0fDrcDucwUHYHLilA6bgxjeocdWf6DQnw6fisMcZ1EdIUhxSDcmFZEi+zLEphmodr8y /5oQ== 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 b12-20020a056402084c00b0046187ab5c1bsi6988227edz.512.2022.11.26.07.46.16; Sat, 26 Nov 2022 07:46:39 -0800 (PST) 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 S229644AbiKZPnI (ORCPT + 99 others); Sat, 26 Nov 2022 10:43:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbiKZPnG (ORCPT ); Sat, 26 Nov 2022 10:43:06 -0500 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 91B13D10C for ; Sat, 26 Nov 2022 07:43:05 -0800 (PST) Received: from dslb-188-096-151-149.188.096.pools.vodafone-ip.de ([188.96.151.149] 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 1oyxKV-0000Lt-1L; Sat, 26 Nov 2022 16:42:59 +0100 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/5] staging: r8188eu: drop return value from issue_probereq_ex Date: Sat, 26 Nov 2022 16:42:49 +0100 Message-Id: <20221126154253.178275-2-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221126154253.178275-1-martin@kaiser.cx> References: <20221126154253.178275-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?1750574143586836502?= X-GMAIL-MSGID: =?utf-8?q?1750574143586836502?= The only caller of issue_probereq_ex does not check the return value. We can remove it and make issue_probereq_ex a void function. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 11 ++--------- drivers/staging/r8188eu/include/rtw_mlme_ext.h | 4 ++-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 161cb67f7882..2f3f7da08d0c 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -4482,8 +4482,8 @@ inline void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *ps _issue_probereq(padapter, pssid, da, false); } -int issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da, - int try_cnt, int wait_ms) +void issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da, + int try_cnt, int wait_ms) { int ret; int i = 0; @@ -4497,13 +4497,6 @@ int issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, msleep(wait_ms); } while ((i < try_cnt) && ((ret == _FAIL) || (wait_ms == 0))); - - if (ret != _FAIL) { - ret = _SUCCESS; - goto exit; - } -exit: - return ret; } /* if psta == NULL, indicate we are station (client) now... */ diff --git a/drivers/staging/r8188eu/include/rtw_mlme_ext.h b/drivers/staging/r8188eu/include/rtw_mlme_ext.h index c46fc1a53085..720610bc8fef 100644 --- a/drivers/staging/r8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/r8188eu/include/rtw_mlme_ext.h @@ -512,8 +512,8 @@ void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short status); void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da); -s32 issue_probereq_ex(struct adapter *adapter, struct ndis_802_11_ssid *pssid, - u8 *da, int try_cnt, int wait_ms); +void issue_probereq_ex(struct adapter *adapter, struct ndis_802_11_ssid *pssid, + u8 *da, int try_cnt, int wait_ms); int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int try_cnt, int wait_ms); int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, From patchwork Sat Nov 26 15:42:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 26258 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4700208wrr; Sat, 26 Nov 2022 07:47:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf7IsmQ82RBEJpwidv9y5iYcMw0qz0gfjjRQeGbYZDYd0IIYNrLu6CAVH3dL0y5prALVbor+ X-Received: by 2002:a05:6402:5308:b0:460:19c3:2992 with SMTP id eo8-20020a056402530800b0046019c32992mr22852478edb.1.1669477669294; Sat, 26 Nov 2022 07:47:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669477669; cv=none; d=google.com; s=arc-20160816; b=NcZJ2kdBM+L8n7wyHHxZha0iJ582+ixrEa8mCeN37NHOrcgNfVNfktliYQSmxsRmR5 /4R+AXZnMQtkuI4qeH2DtW+9Q40igg6kkczotqXPjtAg33KZZa4n5K2Vxj6KGAE08Xkd rX24buPJFWm8gJ5+OiJUuBXXpBysJC3aRSJuvT/R4v/iLn+cd8SCgk/MvbsTS+EVM3Gq XaK+pAoJ6NjX6XzBzzJ7/D8VLyDP2rdgWRv3EqVHZTSDL+7Vfx1yxtHMzqskb8K4fWAx 7WGg6rrB3KjfHa7op+Yq4tEN4Mpt6XdeCfP7IFh+R3cy/s4FTAJjewN2MEmzIu61FU4z SccA== 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=h4qNoa7tZrDDG2UjMz+a8hmcwdbeLgReRKbA3QxReao=; b=jOQBFrvuABeEa4QXCaECS+WGh/oE0jTec0gGlS+U1cJYk/9IuX3qJcAEG9LxB/JlMq vjXZ5fkVEk42RGRW/Fxk0owODnSX4DdSTvx3Zs5lXQGUjgvsqWLZc44gFY2IBdZ541Jo uzw6rCVlV9id9I+qCHqkHdG6kuyoqFUx9XEeUhntInW4LQ3kf1fWX2awNk/H8eWndH93 riK4B9vPW8ntJ48ixL//N4SHcPxpIPC76D4bjVhEAn5fTSQo664EhnldQ5ZuL3kU0j7j SDUplNUBSYalwdSTiGTUVr8xII869bVO/JbWyPEgMOsZ4KSmkmfTmekHlTgPP4YeDw6L fh2w== 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 f8-20020a0564021e8800b0045eec876883si7435620edf.229.2022.11.26.07.47.26; Sat, 26 Nov 2022 07:47:49 -0800 (PST) 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 S229671AbiKZPnL (ORCPT + 99 others); Sat, 26 Nov 2022 10:43:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbiKZPnG (ORCPT ); Sat, 26 Nov 2022 10:43:06 -0500 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 97CE9D13B for ; Sat, 26 Nov 2022 07:43:05 -0800 (PST) Received: from dslb-188-096-151-149.188.096.pools.vodafone-ip.de ([188.96.151.149] 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 1oyxKV-0000Lt-Ry; Sat, 26 Nov 2022 16:42:59 +0100 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/5] staging: r8188eu: remove wait_ms parameter Date: Sat, 26 Nov 2022 16:42:50 +0100 Message-Id: <20221126154253.178275-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221126154253.178275-1-martin@kaiser.cx> References: <20221126154253.178275-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?1750574216188240088?= X-GMAIL-MSGID: =?utf-8?q?1750574216188240088?= Remove the wait_ms parameter from function issue_probereq_ex. There's only one caller, who requests a waiting time of 1 ms. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 12 ++++++------ drivers/staging/r8188eu/include/rtw_mlme_ext.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 2f3f7da08d0c..990336244030 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -4483,20 +4483,20 @@ inline void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *ps } void issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da, - int try_cnt, int wait_ms) + int try_cnt) { int ret; int i = 0; do { - ret = _issue_probereq(padapter, pssid, da, wait_ms > 0); + ret = _issue_probereq(padapter, pssid, da, true); i++; - if (i < try_cnt && wait_ms > 0 && ret == _FAIL) - msleep(wait_ms); + if (i < try_cnt && ret == _FAIL) + msleep(1); - } while ((i < try_cnt) && ((ret == _FAIL) || (wait_ms == 0))); + } while ((i < try_cnt) && (ret == _FAIL)); } /* if psta == NULL, indicate we are station (client) now... */ @@ -7046,7 +7046,7 @@ void linked_status_chk(struct adapter *padapter) } if (rx_chk != _SUCCESS) - issue_probereq_ex(padapter, &pmlmeinfo->network.Ssid, psta->hwaddr, 3, 1); + issue_probereq_ex(padapter, &pmlmeinfo->network.Ssid, psta->hwaddr, 3); if ((tx_chk != _SUCCESS && pmlmeinfo->link_count++ == 0xf) || rx_chk != _SUCCESS) { tx_chk = issue_nulldata(padapter, psta->hwaddr, 0, 3, 1); diff --git a/drivers/staging/r8188eu/include/rtw_mlme_ext.h b/drivers/staging/r8188eu/include/rtw_mlme_ext.h index 720610bc8fef..04fd673d3a04 100644 --- a/drivers/staging/r8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/r8188eu/include/rtw_mlme_ext.h @@ -513,7 +513,7 @@ void issue_auth(struct adapter *padapter, struct sta_info *psta, void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da); void issue_probereq_ex(struct adapter *adapter, struct ndis_802_11_ssid *pssid, - u8 *da, int try_cnt, int wait_ms); + u8 *da, int try_cnt); int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int try_cnt, int wait_ms); int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, From patchwork Sat Nov 26 15:42:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 26259 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4700210wrr; Sat, 26 Nov 2022 07:47:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf5YhYSneQDttvv8GZRsBRIw7ST/gufjBQZj1MEA6xQWWNY5q4r/PCA0SGFVcvm26cF1KjgC X-Received: by 2002:aa7:d816:0:b0:458:4868:814 with SMTP id v22-20020aa7d816000000b0045848680814mr40930899edq.190.1669477669789; Sat, 26 Nov 2022 07:47:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669477669; cv=none; d=google.com; s=arc-20160816; b=uYAvZz4PXlE9anQIhh40Zo8PQl4eivsvfX5BZLLVK8kvXf78SqlwdQfM3n8P8phm7b npiMOxc+R3SIc2ZqGB8ersEmVZ1WIb+EllLaPH2XkjBb0SRwYb0HNbFwTixZoBzuhnFE fJx4jvGJb2x4VC5lXC8ujWUBgl4uDBBsc74f8K0TixIkBp7hA4WGoIvetAxkwD1pCol2 T2wHOX/uGMfYdgRVSc/t93ta+QlRX3Bf3PN4kVbVkC++hget1r5lBp1qK8Fk/JGzpP+e 8jd8NhyoijjkotnV29OXEST9LKEsOJimyv0lcD6ISE5KU0R1Nt438YhJdoKTd/j6KcsL 8q+g== 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=S69bmkHlZtp34tFtJ3CeF0DFu2Udi4pD0wxh0H4wDtg=; b=T7m1GzFbmstXa+h8El2wXO/RM7E9cOnU8SbMjCeFTdH22+dtAVxeOMZbok0IXL1ZYP tjd/D5Nth7LDHVhQYcjr8ypRsFQnM7OrpUGcfNB+hgxbyvMjzTXf9RYVvG5LWCWIaJXs S8nhALhd3Bq0bFxLSyZvfKfw/TWJo6s8fWRZiJWN/Ado4QNC4SIm+grB8v3DVQyLRXsw EZ8P0yflwCHFpkjYueYi3UqgjfNYZFwWomGbR1d8EDMs9jFO5CxIb+DKGtXoANZ4QAzo /kCpMsmFJPGVnayhBf/bLGEBs4J8YzRirVaYtG2PARKAsGj7b9iwQCYXky9+4WZjMhd5 n1IQ== 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 h4-20020aa7c944000000b004692b547022si5583596edt.526.2022.11.26.07.47.26; Sat, 26 Nov 2022 07:47:49 -0800 (PST) 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 S229670AbiKZPnO (ORCPT + 99 others); Sat, 26 Nov 2022 10:43:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229614AbiKZPnH (ORCPT ); Sat, 26 Nov 2022 10:43:07 -0500 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 9E44FCE20 for ; Sat, 26 Nov 2022 07:43:06 -0800 (PST) Received: from dslb-188-096-151-149.188.096.pools.vodafone-ip.de ([188.96.151.149] 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 1oyxKW-0000Lt-Mt; Sat, 26 Nov 2022 16:43:00 +0100 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/5] staging: r8188eu: fix the number of probereq retries Date: Sat, 26 Nov 2022 16:42:51 +0100 Message-Id: <20221126154253.178275-4-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221126154253.178275-1-martin@kaiser.cx> References: <20221126154253.178275-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?1750574216865007107?= X-GMAIL-MSGID: =?utf-8?q?1750574216865007107?= issue_probereq_ex sends a probe request and retries if this fails. There's no point in making the number of retries configurable. Hard-code the value that's used by issue_probereq_ex's only caller. Simplify the code to check the loop condition only once. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 21 +++++++------------ .../staging/r8188eu/include/rtw_mlme_ext.h | 3 +-- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 990336244030..667f54e313ef 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -4482,21 +4482,16 @@ inline void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *ps _issue_probereq(padapter, pssid, da, false); } -void issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da, - int try_cnt) +void issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da) { - int ret; - int i = 0; - - do { - ret = _issue_probereq(padapter, pssid, da, true); - - i++; + int i; - if (i < try_cnt && ret == _FAIL) + for (i = 0; i < 3; i++) { + if (_issue_probereq(padapter, pssid, da, true) == _FAIL) msleep(1); - - } while ((i < try_cnt) && (ret == _FAIL)); + else + break; + } } /* if psta == NULL, indicate we are station (client) now... */ @@ -7046,7 +7041,7 @@ void linked_status_chk(struct adapter *padapter) } if (rx_chk != _SUCCESS) - issue_probereq_ex(padapter, &pmlmeinfo->network.Ssid, psta->hwaddr, 3); + issue_probereq_ex(padapter, &pmlmeinfo->network.Ssid, psta->hwaddr); if ((tx_chk != _SUCCESS && pmlmeinfo->link_count++ == 0xf) || rx_chk != _SUCCESS) { tx_chk = issue_nulldata(padapter, psta->hwaddr, 0, 3, 1); diff --git a/drivers/staging/r8188eu/include/rtw_mlme_ext.h b/drivers/staging/r8188eu/include/rtw_mlme_ext.h index 04fd673d3a04..089bd5446773 100644 --- a/drivers/staging/r8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/r8188eu/include/rtw_mlme_ext.h @@ -512,8 +512,7 @@ void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short status); void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da); -void issue_probereq_ex(struct adapter *adapter, struct ndis_802_11_ssid *pssid, - u8 *da, int try_cnt); +void issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da); int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int try_cnt, int wait_ms); int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, From patchwork Sat Nov 26 15:42:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 26260 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4700243wrr; Sat, 26 Nov 2022 07:47:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf6lRIIG5H6fOL6Jr8vpZ2kUTjYNJUsHforQOVuOSJzhv/kIGxvTJaKaeOsXz5+FYprv3eIe X-Received: by 2002:a17:906:6417:b0:7ae:937f:2c38 with SMTP id d23-20020a170906641700b007ae937f2c38mr21259389ejm.201.1669477675041; Sat, 26 Nov 2022 07:47:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669477675; cv=none; d=google.com; s=arc-20160816; b=ZElMfsCg5QlxuqLlTklMLZDNOk+Kl2E6l3O3tIWukra9CIkGuVLFoyxXMx2ybOfY2D X/5oeGQJyoUDQxb4cg0cVNuH20UKHvY1BSvsO6QxGNiEIR7+O0ap6afjb24Txu3/yBuv Qd9DCLBaFD6HTiPTa4XFBmrFP6ceQEsJebhYt+L4u8imTkCcTYUReCYhu/VApFJb2vz/ VdqPOqnRjLdlDrl5zfG+Bit4Vb1K7bamNk+omTTIgIzIeml0EHz9HcSMnLMhXeV6Qk7t L8Rp8rc2SY6NTO17hrixMjbtMKir5ERL+WXQywVkJKh/B8gTs5WsZ3VtBylL2EkruadS UwVA== 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=NU5AjpdUgRD7xUGKVfgBMfdrcfNgq3hHf+JWjiLlf2s=; b=htP5sC30l1jYRM15vQicAAojL0S+ACjUQqcHwaEWsrHwAYZS7McBJTgwpEJdU9K156 ISYHawWbNX4BXb64hP+ANxtBXlevO7Un6VvJMF8MUMHKcie6eiBpqfRDYUpCA0E/inCD FJSw6MPrYODrYliNUJRt0Z9k1UAI5AcONqAHbeGxdDeElbSKC0g40yRESMJf8t1ICHYl miTuT3rVo4nCr6TglYcnCksdm0vQqFijSohor6zwQmGD4AKrlHSYWKpyTnZ1LwKyXt8y VHnNI4Z9SN7fHJ1ugbUSCsF27jGnvMI8sU2hfha8UkxOydXiPBivj1D0rwrfKNOVaZ6l Fs9A== 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 dp19-20020a170906c15300b007306ac0faa0si7481895ejc.615.2022.11.26.07.47.31; Sat, 26 Nov 2022 07:47:55 -0800 (PST) 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 S229707AbiKZPnQ (ORCPT + 99 others); Sat, 26 Nov 2022 10:43:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbiKZPnI (ORCPT ); Sat, 26 Nov 2022 10:43:08 -0500 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 ACB52CE20 for ; Sat, 26 Nov 2022 07:43:07 -0800 (PST) Received: from dslb-188-096-151-149.188.096.pools.vodafone-ip.de ([188.96.151.149] 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 1oyxKX-0000Lt-K2; Sat, 26 Nov 2022 16:43:01 +0100 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/5] staging: r8188eu: simplify the checks for zero address Date: Sat, 26 Nov 2022 16:42:52 +0100 Message-Id: <20221126154253.178275-5-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221126154253.178275-1-martin@kaiser.cx> References: <20221126154253.178275-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?1750574222726324660?= X-GMAIL-MSGID: =?utf-8?q?1750574222726324660?= In function ap2sta_data_frame, we can use is_zero_ether_addr to check for all-zero ethernet addresses. Both pattrib->bssid and mybssid are 16-bit aligned. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_recv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c index 5b0a66aebff1..631c500dda42 100644 --- a/drivers/staging/r8188eu/core/rtw_recv.c +++ b/drivers/staging/r8188eu/core/rtw_recv.c @@ -779,9 +779,8 @@ static int ap2sta_data_frame( } /* check BSSID */ - if (!memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || - !memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || - (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) { + if (is_zero_ether_addr(pattrib->bssid) || is_zero_ether_addr(mybssid) || + (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) { if (!bmcast) issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA); From patchwork Sat Nov 26 15:42:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 26257 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4699835wrr; Sat, 26 Nov 2022 07:46:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf62gvybRlYENcbIHc/XDD28fqD1YeqAzVywRGMLodA5SGaN7U8/tBsI0FF2eJIQeAcGrDR9 X-Received: by 2002:a05:6402:3203:b0:467:b8c9:a7fa with SMTP id g3-20020a056402320300b00467b8c9a7famr25402639eda.25.1669477617982; Sat, 26 Nov 2022 07:46:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669477617; cv=none; d=google.com; s=arc-20160816; b=XwORGCU3pTGrsRHaIHiOETZZcCPIbL6WqxzduoTiNsRurWaPcCaeZrQxcoWiVGrphz Uy1LJS2JWjKL0mUu5BWYLaZ1om1G6+S3zfzxxshvBeuBbT2mFLDxaIz+T93UB4CXf1iF 4yxgmhzhlPBJz4w+IJoOJrI1smaHBgrohmE44QpzLXLYdh8+VOFjntx/Y8dGgLbV+RUG Z+xOYrQKGFrAfI/cZx6bw5mWvELw9zxXulVhrnAUChr6FgdtXWSH15oCy08GdQUxuiDR 4zLOZOhkCkeLUIupcAxn+E/NfCTFj6NQ969hUkC9zsY3DwPSJRljV7IaPTNQNT3G3Gc4 7mqA== 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=l753tbCo1OB4IKFxAr1TSEAfpZbLkLwJP+fWvZWNETI=; b=uT2w8xHtY4uMajUVplKJbD3x+aru3RdpH/NnjFEmg8GazyTckpuGxfeCRvEganUH5L MiYsB4Ai1knCZD96qm5mhb0d4RyoT4i3YR+AtV0vB3XFSa7KAmCWf0NpxRhqUQcnePuk ZFu0hAKN7f8eU1ONgqYQNzl5v0CZ5+pAHGQPQJDw1cpuiNpuYroQVLO9VfGIfSt3CYqd uXFnjjCkXg507wEA8zjEEFCySKsN/TgBbGtxVcLTwgqFVzlCtBa4TkbidKWUcrGUQe09 4koy8zwXHHN7sU6GRkoa+dN57r7qVkmbasXbrYoeccAhA3oVLk352ql2aJB/FkExRtqQ h12g== 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 dd20-20020a1709069b9400b007ae8b1704d0si6803160ejc.68.2022.11.26.07.46.34; Sat, 26 Nov 2022 07:46:57 -0800 (PST) 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 S229712AbiKZPnT (ORCPT + 99 others); Sat, 26 Nov 2022 10:43:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229642AbiKZPnI (ORCPT ); Sat, 26 Nov 2022 10:43:08 -0500 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 044D9D13B for ; Sat, 26 Nov 2022 07:43:07 -0800 (PST) Received: from dslb-188-096-151-149.188.096.pools.vodafone-ip.de ([188.96.151.149] 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 1oyxKY-0000Lt-Fx; Sat, 26 Nov 2022 16:43:02 +0100 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/5] staging: r8188eu: use ieee80211 helper for protected bit Date: Sat, 26 Nov 2022 16:42:53 +0100 Message-Id: <20221126154253.178275-6-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221126154253.178275-1-martin@kaiser.cx> References: <20221126154253.178275-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?1750574162654585879?= X-GMAIL-MSGID: =?utf-8?q?1750574162654585879?= Use ieee80211_has_protected to check if the "protected" bit is set. Remove the r8188eu driver's internal macro for this check. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 2 +- drivers/staging/r8188eu/include/wifi.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 667f54e313ef..93696892ec7d 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -809,7 +809,7 @@ static void OnAuthClient(struct adapter *padapter, struct recv_frame *precv_fram if (!(pmlmeinfo->state & WIFI_FW_AUTH_STATE)) return; - offset = (GetPrivacy(pframe)) ? 4 : 0; + offset = ieee80211_has_protected(hdr->frame_control) ? 4 : 0; seq = le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN + offset + 2)); status = le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN + offset + 4)); diff --git a/drivers/staging/r8188eu/include/wifi.h b/drivers/staging/r8188eu/include/wifi.h index 2381c519ceaf..254a4bc1a141 100644 --- a/drivers/staging/r8188eu/include/wifi.h +++ b/drivers/staging/r8188eu/include/wifi.h @@ -170,9 +170,6 @@ enum WIFI_REG_DOMAIN { #define SetPrivacy(pbuf) \ *(__le16 *)(pbuf) |= cpu_to_le16(_PRIVACY_) -#define GetPrivacy(pbuf) \ - (((*(__le16 *)(pbuf)) & cpu_to_le16(_PRIVACY_)) != 0) - #define GetFrameType(pbuf) \ (le16_to_cpu(*(__le16 *)(pbuf)) & (BIT(3) | BIT(2)))