From patchwork Sat Oct 29 17:23:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 12750 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1439390wru; Sat, 29 Oct 2022 10:24:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4SwKdvMFZpvLqjnqKZ0KZsM6hjFjAB9cggg3jYRH6J2SdM7L2XGJKmekcnk77HF9UaIaAC X-Received: by 2002:a17:903:247:b0:186:dd94:bc06 with SMTP id j7-20020a170903024700b00186dd94bc06mr5310241plh.98.1667064296007; Sat, 29 Oct 2022 10:24:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064296; cv=none; d=google.com; s=arc-20160816; b=ZKh4MKURYkH+gvBeIEb21fiC+O3uz44ia2sW/9yzCgv2Eoxjubb7NESBh+9VAt2jhG JdLHF6HiENMLIAp7N5EF/IpDTPqxHa0Ls3mtYtbSL2I/CVveebT0m253JP3azYjo1DT4 CC3gv2j4FounKKkqZSdSj0G0YZ4NegYvzGnTlstCccrwK0WGloH45qh+KiycJqwD86Df auwjQOnzbA9oYBRGE9NjhFV+y2tOnE/iQEU+WAZHahO7fpyE2GuKPZ2A8U1L5cgdsQnU KFUFjYW/95nYi1Du4H6N1x7gsvUzchYIuR267vjiE+1Kn9esUCHNdaBVQBDueQsMPsxa o6oQ== 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=+4nFpzvycB+rWza2dr2Uynel0dTJ66Cwt69EkBFU7MY=; b=xGkbsYIGdf1bX1Xk2rKt73iY72Ic2c2JIuLKhOGR4RaCGTPKFi8DxR8kkfTHFDX/LL lZOwqJIT5UipGQb/dB4wU+DDkPQNQnFiIzvgLZKQvDfI5J88f29s6p+510nvvWP+PjX8 8iNd99S/GhKTRSz8QclddOKTKgeBK05MNFkKtet7m8taeGhsMoa1OXJCu5gpStzwdVM+ vhzzLcxg7BC5Af9J4wss1XI81BJcDDO0MdFBQAB1boo0Ft4ZzHfptUxGRumMiRK7DkZM kfuOnz17gr1cRqeOIPIhc/B9yjA8RWQkAjfhtyxqlldSf61+QuPsoPDvuXJdIndCOJbp NlfA== 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 b23-20020a170902b61700b00186a2d376afsi2426009pls.273.2022.10.29.10.24.43; Sat, 29 Oct 2022 10:24:55 -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 S229744AbiJ2RYA (ORCPT + 99 others); Sat, 29 Oct 2022 13:24:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229727AbiJ2RX7 (ORCPT ); Sat, 29 Oct 2022 13:23:59 -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 947F5402E5 for ; Sat, 29 Oct 2022 10:23:57 -0700 (PDT) Received: from dslb-188-097-213-253.188.097.pools.vodafone-ip.de ([188.97.213.253] 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 1oopYn-00074v-S8; Sat, 29 Oct 2022 19:23: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 01/13] staging: r8188eu: replace a GetAddr1Ptr call Date: Sat, 29 Oct 2022 19:23:25 +0200 Message-Id: <20221029172337.1574593-2-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221029172337.1574593-1-martin@kaiser.cx> References: <20221029172337.1574593-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?1748043611601805468?= X-GMAIL-MSGID: =?utf-8?q?1748043611601805468?= Define a struct ieee80211_mgmt and use it to read the destination address. This replaces one call to the driver-specific GetAddr1Ptr function, which should eventually be removed. 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 127dbc4e8b9a..5a366688a3f7 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3815,13 +3815,14 @@ static unsigned int on_action_public_default(struct recv_frame *precv_frame) unsigned int on_action_public(struct adapter *padapter, struct recv_frame *precv_frame) { + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; unsigned int ret = _FAIL; u8 *pframe = precv_frame->rx_data; u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); u8 category, action; /* check RA matches or not */ - if (memcmp(myid(&padapter->eeprompriv), GetAddr1Ptr(pframe), ETH_ALEN)) + if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN)) goto exit; category = frame_body[0]; From patchwork Sat Oct 29 17:23:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 12753 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1439599wru; Sat, 29 Oct 2022 10:25:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM78vpU547pWIvEdpAAhwWrz4L1vYrL+S4ZJ0cLDRcXY/87V55BT1PtHP1Akr5r17QEG3Cpu X-Received: by 2002:aa7:9212:0:b0:562:b5f6:f7d7 with SMTP id 18-20020aa79212000000b00562b5f6f7d7mr5402915pfo.70.1667064339955; Sat, 29 Oct 2022 10:25:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064339; cv=none; d=google.com; s=arc-20160816; b=Cp5x4/ZntRu7YYqmMoc0HA4Q1NxV3DAHxI+U/0Chr8wZSSGxEp90WM2zoGnYneag0B +yi7Tm9YtQljwPaHXNdPH0pctxX54rr4OlJYr//vAcNXAblMdtXMJStDHdRl2/3A3M4A n3ezw00GRuDW4q28KacwBm/APgnMx7b39ukAIGh4mv9EKSLA0vaGlCIIjrdyhcj11bhb ViqejsqnBK+pMo3Ug6Ky9L1sn3144z6mmn6iiNp8ibbvfGrf6J+mDmVlsNDA+BmnBAIc KMmMDb23lnHb//lzcc3mqm50+v2l/7ADbAPoVCBSRCQc5YLxeDWuCEVjj5Ri2hodiejk 7uHA== 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=c/etGoh4+SPCqPzmtQ82eLnf8KVfmpLT/m+vzxeS/9Y=; b=unIj9r9+tg0ftI9zdpChAVbHf9VgjST/l/T6vzY/4/lqvQJtqPC+xvGpxzKMi+/kXb pLtYC2K9dyJp6f8IEBGi2+YGnJD1US8iHzaMO/3tagu2zSKs+LZLyJXGTjhkGU++uzW0 eO9EPU4W3Ev/ghi6zHYVkaKVDZFIlHbfrZTDN2ZKlyYKjGr09JPK008gyxJA7xkckQz9 tRRPCFnIQBzj+DQfvaFgcG/AKAngvrZw78ieCNkDYrXdRHpAaU/CY1CK2ZrufRW+szAZ Z7kU950Q5wQy9YE6qmlI05PcutrQn1xjUYV/HAVO4WVJXQZrkJwfdW3OS9i2wl3rgOxx qk9w== 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 f21-20020a056a00239500b00543bb97c41esi3001907pfc.30.2022.10.29.10.25.27; Sat, 29 Oct 2022 10:25: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 S229919AbiJ2RYU (ORCPT + 99 others); Sat, 29 Oct 2022 13:24:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229727AbiJ2RYH (ORCPT ); Sat, 29 Oct 2022 13:24:07 -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 8353840E11 for ; Sat, 29 Oct 2022 10:24:00 -0700 (PDT) Received: from dslb-188-097-213-253.188.097.pools.vodafone-ip.de ([188.97.213.253] 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 1oopYo-00074v-QI; Sat, 29 Oct 2022 19:23: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 02/13] staging: r8188eu: remove duplicate category check Date: Sat, 29 Oct 2022 19:23:26 +0200 Message-Id: <20221029172337.1574593-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221029172337.1574593-1-martin@kaiser.cx> References: <20221029172337.1574593-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?1748043657318653479?= X-GMAIL-MSGID: =?utf-8?q?1748043657318653479?= The caller of on_action_public has already checked the action category. We can remove the check in on_action_public. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 5a366688a3f7..7d4f208d161b 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3819,16 +3819,12 @@ unsigned int on_action_public(struct adapter *padapter, struct recv_frame *precv unsigned int ret = _FAIL; u8 *pframe = precv_frame->rx_data; u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); - u8 category, action; + u8 action; /* check RA matches or not */ if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN)) goto exit; - category = frame_body[0]; - if (category != WLAN_CATEGORY_PUBLIC) - goto exit; - action = frame_body[1]; switch (action) { case ACT_PUBLIC_VENDOR: From patchwork Sat Oct 29 17:23:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 12751 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1439445wru; Sat, 29 Oct 2022 10:25:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7H9QroQTLGIwF8hHstwUwyupZe+WZQ3yMVT0ZCUEX53sSNPBNikLuxaxm0Tl8JX843VDsJ X-Received: by 2002:aa7:96c7:0:b0:56b:c569:99c with SMTP id h7-20020aa796c7000000b0056bc569099cmr5587712pfq.4.1667064309665; Sat, 29 Oct 2022 10:25:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064309; cv=none; d=google.com; s=arc-20160816; b=RX7yoawh/CvxOWr7iJJs5RhfPOLtIntqf0hR1z3ZV75Kw/zsVrfNRJrJ/PzistO7Mx PnonP+nDaib+L5fsev59TPj77g8TVlL3F2sYX3Ep8t0YIDnltZGgbaptTW+YyLxmCSI2 PjAADSUJ0zFbqKiBRcPp1mJ+yNg/PqE/eW26PYRLEUAVXE2zT10EFuH3PLdJTVniEWae FXsHxrrSMahPCiwu5/Gw9mqpbsueXVevyZoOch9FCUJZkNeiN22Czj9VDQY2xTtVs0lt CcxSpk3Tl4hNp5ZDNQEpfVk4pcMo8U35iAh7hgmuZ2XjyEKKX11bBJx9fRefzGWRhBNn GtEg== 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=bXFd3Ix7kOj7CNBfVVlExclB3nWxC9cfg9NT3nZbvSg=; b=WIN9uM8loUcmpB132NSN+7aUudMSoX4yNK7hP/mZlEr5XuL/wa1fWG8xZNNb020Byl 6d8RWUPVGt2aal7X0cvLr1mib1mSutQIEA5D0QAF8AGvoRFIABuaVXVjaNqK2U3dSeFS p9e4svciX0+D9SjZg9UrFoJSfdx0B5GehKF16rOthIW7M94eqzihYYZc/QOh7aToPuAA am9qmKNW8z/12YW3xxkl8Wxh6x+23v5YA380UkKRArecT58wiaykkEqfcY/ZsH26KIEd l74iJmxkdw6ZP2ewu3HiMVi5gV25Oq0xJemRdtPPrQR0g1pe3ulB+X2KqjpvzVSS8bd2 UdoQ== 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 z8-20020a170902d54800b00180556e1b6bsi2247465plf.609.2022.10.29.10.24.56; Sat, 29 Oct 2022 10:25:09 -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 S229915AbiJ2RYQ (ORCPT + 99 others); Sat, 29 Oct 2022 13:24:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229823AbiJ2RYD (ORCPT ); Sat, 29 Oct 2022 13:24:03 -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 6F6C340E01 for ; Sat, 29 Oct 2022 10:24:00 -0700 (PDT) Received: from dslb-188-097-213-253.188.097.pools.vodafone-ip.de ([188.97.213.253] 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 1oopYp-00074v-NW; Sat, 29 Oct 2022 19:23: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 03/13] staging: r8188eu: make on_action_public static void Date: Sat, 29 Oct 2022 19:23:27 +0200 Message-Id: <20221029172337.1574593-4-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221029172337.1574593-1-martin@kaiser.cx> References: <20221029172337.1574593-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?1748043625218612702?= X-GMAIL-MSGID: =?utf-8?q?1748043625218612702?= The on_action_public function is called only by OnAction. This function also lives in rtw_mlme_ext.c and does not check the return value from on_action_public. We can make on_action_public a static void function. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 7 ++----- drivers/staging/r8188eu/include/rtw_mlme_ext.h | 2 -- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 7d4f208d161b..caa73f16dbf9 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3813,7 +3813,7 @@ static unsigned int on_action_public_default(struct recv_frame *precv_frame) return ret; } -unsigned int on_action_public(struct adapter *padapter, struct recv_frame *precv_frame) +static void on_action_public(struct adapter *padapter, struct recv_frame *precv_frame) { struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; unsigned int ret = _FAIL; @@ -3823,7 +3823,7 @@ unsigned int on_action_public(struct adapter *padapter, struct recv_frame *precv /* check RA matches or not */ if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN)) - goto exit; + return; action = frame_body[1]; switch (action) { @@ -3834,9 +3834,6 @@ unsigned int on_action_public(struct adapter *padapter, struct recv_frame *precv ret = on_action_public_default(precv_frame); break; } - -exit: - return ret; } unsigned int OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame) diff --git a/drivers/staging/r8188eu/include/rtw_mlme_ext.h b/drivers/staging/r8188eu/include/rtw_mlme_ext.h index c8beaa927cba..ec2e9352011b 100644 --- a/drivers/staging/r8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/r8188eu/include/rtw_mlme_ext.h @@ -538,8 +538,6 @@ void start_create_ibss(struct adapter *padapter); unsigned int OnAction_back(struct adapter *padapter, struct recv_frame *precv_frame); -unsigned int on_action_public(struct adapter *padapter, - struct recv_frame *precv_frame); unsigned int OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame); From patchwork Sat Oct 29 17:23:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 12752 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1439500wru; Sat, 29 Oct 2022 10:25:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5FJDKISMqS25dYmd7Dw61pn/7vsVKMUvnPbN7GOYnntHBA4HtmbzC1sIP04bGKC1XBsU/P X-Received: by 2002:a17:90b:4a92:b0:213:54f:ddd8 with SMTP id lp18-20020a17090b4a9200b00213054fddd8mr23239898pjb.234.1667064323352; Sat, 29 Oct 2022 10:25:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064323; cv=none; d=google.com; s=arc-20160816; b=ENjE0Em6CdpG6G/sopzUK8bQrkiiRXf+rCXIEF/Wa9SkwZm0PPjeOyblyE3ZdalRuN JPbdYz52qh/k2VwV9bZ305sJ7Zgm0m/5aW5CeFlFMtKFET6LDbVKvnlYQsJfeR8TQEBw YEdgLrr5TOk60MIUhrk5iJModYgWRYMP1Er5AFGAeek4TTQC4dwSzg7dkl7/sLYX6qcQ rGyWxhaXqeHYdDSN6bssj0spQC35GEx5F9bMdI/xdL0N5pKQatDadfvXckDSYp71IuNx mGP/clp/kXmOEYke/YjVtpeOIY5FtMwdtAKhyvUhwddbyiucZYFptjdM7auXiNu3a/xy 5ntg== 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=l05IXPt2sLdwVAHDMO3mhiRA234Z7R9DYZO8oEC2y8w=; b=OVPrnUHcko/TPmTwRSF+q31X7xHS5gtbcNQ7mKMzN83AnLeTgxQPaaalvTkvrw7HQO QG66eV4tRvL4X+lxInSPw7NsW2dP2qd9oBKWEZ/MCoJ7OcuoPRf0DlZj4eKcVBC9EUuT K1RHk27Caod9SWGGLJQVYdc8hhW5/5p+TJ96EYauQ1mJpQx/D5/ZCxRxVGDT17sP7iPs dZjmzNDK6uOQrSmpx6z7IisTB2Ob3kOS1DNDNK+FfRH8hxWf7mhgL4gPYO3EjbCiojU7 ul1x73kxZanyAP9hjQL5Z5lskmEbz/sXuVT39Z2ThQK2UD1V94atjGMhqebW1hnFxil7 Hd1Q== 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 b19-20020a170902d89300b0016ee19bc5f9si2160067plz.553.2022.10.29.10.25.10; Sat, 29 Oct 2022 10:25:23 -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 S229937AbiJ2RYZ (ORCPT + 99 others); Sat, 29 Oct 2022 13:24:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229783AbiJ2RYK (ORCPT ); Sat, 29 Oct 2022 13:24:10 -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 422B640E2F for ; Sat, 29 Oct 2022 10:24:01 -0700 (PDT) Received: from dslb-188-097-213-253.188.097.pools.vodafone-ip.de ([188.97.213.253] 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 1oopYq-00074v-Fq; Sat, 29 Oct 2022 19:23: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 04/13] staging: r8188eu: make OnAction_back static void Date: Sat, 29 Oct 2022 19:23:28 +0200 Message-Id: <20221029172337.1574593-5-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221029172337.1574593-1-martin@kaiser.cx> References: <20221029172337.1574593-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?1748043639886276321?= X-GMAIL-MSGID: =?utf-8?q?1748043639886276321?= OnAction_back is called only by OnAction, its return value is not checked. We can make it a static void function. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 13 +++++-------- drivers/staging/r8188eu/include/rtw_mlme_ext.h | 2 -- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index caa73f16dbf9..b13593523fd0 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1481,7 +1481,7 @@ static void OnDisassoc(struct adapter *padapter, struct recv_frame *precv_frame) pmlmepriv->LinkDetectInfo.bBusyTraffic = false; } -unsigned int OnAction_back(struct adapter *padapter, struct recv_frame *precv_frame) +static void OnAction_back(struct adapter *padapter, struct recv_frame *precv_frame) { struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; struct sta_info *psta = NULL; @@ -1494,21 +1494,20 @@ unsigned int OnAction_back(struct adapter *padapter, struct recv_frame *precv_fr struct sta_priv *pstapriv = &padapter->stapriv; /* check RA matches or not */ if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN))/* for if1, sta/ap mode */ - return _SUCCESS; + return; if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE) if (!(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) - return _SUCCESS; + return; psta = rtw_get_stainfo(pstapriv, mgmt->sa); - if (!psta) - return _SUCCESS; + return; frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); if (!pmlmeinfo->HT_enable) - return _SUCCESS; + return; /* All union members start with an action code, it's ok to use addba_req. */ switch (mgmt->u.action.u.addba_req.action_code) { case WLAN_ACTION_ADDBA_REQ: @@ -1550,8 +1549,6 @@ unsigned int OnAction_back(struct adapter *padapter, struct recv_frame *precv_fr default: break; } - - return _SUCCESS; } static int get_reg_classes_full_count(struct p2p_channels *channel_list) diff --git a/drivers/staging/r8188eu/include/rtw_mlme_ext.h b/drivers/staging/r8188eu/include/rtw_mlme_ext.h index ec2e9352011b..4ccdce1ad9be 100644 --- a/drivers/staging/r8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/r8188eu/include/rtw_mlme_ext.h @@ -536,8 +536,6 @@ void start_clnt_auth(struct adapter *padapter); void start_clnt_join(struct adapter *padapter); void start_create_ibss(struct adapter *padapter); -unsigned int OnAction_back(struct adapter *padapter, - struct recv_frame *precv_frame); unsigned int OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame); From patchwork Sat Oct 29 17:23:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 12754 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1439673wru; Sat, 29 Oct 2022 10:25:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6p5VPh+YgaPgrb8w1DWll6hWiFbM8r+0TITqTQP9e6IreAMfCQt3PAdeDMwZoZHJVhSwTa X-Received: by 2002:a05:6a00:1589:b0:56d:2:bc7d with SMTP id u9-20020a056a00158900b0056d0002bc7dmr5196466pfk.38.1667064354892; Sat, 29 Oct 2022 10:25:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064354; cv=none; d=google.com; s=arc-20160816; b=pvU5IcpX0m+kZCEUkqKm4dDADL6NyAilSV+JLzDjRkux94wwu9P1sA3YSmjvHFV/HO Iv9yOCk52Hw4r6Gpr3qz1uTsdO2u6Po1aTZua4QojkowLi/PqYmX9/4FlG914VH9QRIU gE/5ZN2txjI2SX+a7XmEZKL17KTmsvNbpwPZ24XvNYxfyFLG4v1CvAXMdwoRE0f2Jerb VZmQYVPfuAKFUJpcOpsT4HGiPHQwtCpu6FdUj/o+kPnlnIrd8SQrE5pqx508gDSfPdv0 az8YfEzZdXWTZqIyLV57P606/s8LqWFq7VlW6Zy031YlbL4e7zQT462HCZk7Ehp5P15m KnEw== 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=imZuMOpk19oa2aTG88g/PghFckseg7nD0vFNW1LmSm8=; b=bVigtcWw6Ik2fI4S64ibmkMlLQGRnEkI/11P4iAU7hVy7JkGnqLZ+UvMaT42eCZJW+ GtVS3G7Rq5qWq1siyPbRylVUjkcS5mUaanzlfklvoBKKSMzbfBTWgTGbfXrJGpS5IGpL 0dk8A4EYXFLpp2CSNAt/A5CtnvRnzFMTB0YEIbdtK0UGZe8y+bd8Bhm+A5DJu8YWkVfN 4nZ2OPuherBAjFbeecBmMiQDCSJLJhqdEoDxanyIJ5vyj4ByLrsFPANSmsdRqSH9mYmA 4UFLVzFDb1ClisJbVpE+J/Kokvif9bn1gR89OSBgg+VbWlAmpH+ZnDkuu1D65YhLU3+n alTg== 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 s189-20020a635ec6000000b0046b041e1123si2632864pgb.452.2022.10.29.10.25.42; Sat, 29 Oct 2022 10:25:54 -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 S229610AbiJ2RYM (ORCPT + 99 others); Sat, 29 Oct 2022 13:24:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbiJ2RYD (ORCPT ); Sat, 29 Oct 2022 13:24:03 -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 0A23F402D1 for ; Sat, 29 Oct 2022 10:23:59 -0700 (PDT) Received: from dslb-188-097-213-253.188.097.pools.vodafone-ip.de ([188.97.213.253] 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 1oopYr-00074v-9L; Sat, 29 Oct 2022 19:23:57 +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 05/13] staging: r8188eu: make OnAction_p2p static void Date: Sat, 29 Oct 2022 19:23:29 +0200 Message-Id: <20221029172337.1574593-6-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221029172337.1574593-1-martin@kaiser.cx> References: <20221029172337.1574593-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?1748043673177663750?= X-GMAIL-MSGID: =?utf-8?q?1748043673177663750?= OnAction_p2p is called only by OnAction, its return value is not checked. We can make it a static void function. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 9 ++++----- drivers/staging/r8188eu/include/rtw_mlme_ext.h | 3 --- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index b13593523fd0..0c2db015656f 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3833,7 +3833,7 @@ static void on_action_public(struct adapter *padapter, struct recv_frame *precv_ } } -unsigned int OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame) +static void OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame) { u8 *frame_body; u8 category, OUI_Subtype; @@ -3843,16 +3843,16 @@ unsigned int OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_fra /* check RA matches or not */ if (memcmp(myid(&padapter->eeprompriv), GetAddr1Ptr(pframe), ETH_ALEN))/* for if1, sta/ap mode */ - return _SUCCESS; + return; frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); category = frame_body[0]; if (category != RTW_WLAN_CATEGORY_P2P) - return _SUCCESS; + return; if (be32_to_cpu(*((__be32 *)(frame_body + 1))) != P2POUI) - return _SUCCESS; + return; len -= sizeof(struct ieee80211_hdr_3addr); OUI_Subtype = frame_body[5]; @@ -3870,7 +3870,6 @@ unsigned int OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_fra default: break; } - return _SUCCESS; } static void OnAction(struct adapter *padapter, struct recv_frame *precv_frame) diff --git a/drivers/staging/r8188eu/include/rtw_mlme_ext.h b/drivers/staging/r8188eu/include/rtw_mlme_ext.h index 4ccdce1ad9be..ce5b57e23e53 100644 --- a/drivers/staging/r8188eu/include/rtw_mlme_ext.h +++ b/drivers/staging/r8188eu/include/rtw_mlme_ext.h @@ -536,9 +536,6 @@ void start_clnt_auth(struct adapter *padapter); void start_clnt_join(struct adapter *padapter); void start_create_ibss(struct adapter *padapter); -unsigned int OnAction_p2p(struct adapter *padapter, - struct recv_frame *precv_frame); - void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res); void mlmeext_sta_del_event_callback(struct adapter *padapter); void mlmeext_sta_add_event_callback(struct adapter *padapter, From patchwork Sat Oct 29 17:23:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 12756 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1439766wru; Sat, 29 Oct 2022 10:26:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7zijODWdXkjMmPuH6Tf7/otoCZzIZcmsfHDUhHgbt342M6gS8ghSsj92KVHTiKEZE8eskQ X-Received: by 2002:a05:6a00:a94:b0:562:dcbb:47c3 with SMTP id b20-20020a056a000a9400b00562dcbb47c3mr5600349pfl.79.1667064374822; Sat, 29 Oct 2022 10:26:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064374; cv=none; d=google.com; s=arc-20160816; b=TuMFPj4dVdMwWQ1ZoGHvEiY3i25dGWLMUfSbTKSF+0f/a5l6CkTWEVartKq5dQf//v d0LdTFDTUBEaVWUN093jN/t6/ZhslP/ah6hr0/1WSiz9p+879QSZgIDijuhVffTh/ldb Ar5pLJQAnRkeEbtood7BQCpAt3H214kvF9+biA8vBwOCrtYrKQFQoWgCGtO2LZ0DXrfN ZLU6V36+j2E7NZZ1RP9h0Uz+rZKikr+acTCLhaARd9SHcg1fn9rxfKyQyPGloS9u/AP4 9lbjJdAi0M5zMk0u/tkA99YxZ48ZSQDPSOLl84Mi4+IpIKPcq0L9BHFSEMlpLoGaxsqI Wt/w== 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=xucvsVs4NhnGYaPGBS0xBYYt3ezp5YpiLO2H6O3Jwo0=; b=KAoeOnUrAT4Oj3BapRI0kuVcRieU4Q1Eqqw6EWgVxgA+h37jw34FigcXbnPIfdBBUU /fJVgD7aj5SriPgVoIalE6qidSPWMYMeWKkW9Mn3/lummLjM12Os9v7CRNmaZVvKx+Au BEn4Lf5GNz4Q1ZPprSCYLF6iUFUlClzc8mszl6ToH3c0GYmGBWY2nvFMfIyHRzK+1d2x aW0Ugl0GTw1ufrNvWBaN9Tz3uunQn7ZC6tltFkfqRBLHDghRD/Me2rZHg8D6oGA3YYD8 KtJ8bSGhbjhj63u5NUFr5ehRFlEWMFomGnsl6uJtHhKp+b3W7HpGUg8PvRcDny8QKylW uifg== 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 oa7-20020a17090b1bc700b0021311a385c3si2707305pjb.46.2022.10.29.10.26.02; Sat, 29 Oct 2022 10:26:14 -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 S229934AbiJ2RYW (ORCPT + 99 others); Sat, 29 Oct 2022 13:24:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbiJ2RYI (ORCPT ); Sat, 29 Oct 2022 13:24: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 41D9A40E24 for ; Sat, 29 Oct 2022 10:24:01 -0700 (PDT) Received: from dslb-188-097-213-253.188.097.pools.vodafone-ip.de ([188.97.213.253] 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 1oopYs-00074v-2S; Sat, 29 Oct 2022 19:23:58 +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 06/13] staging: r8188eu: remove category check in OnAction_p2p Date: Sat, 29 Oct 2022 19:23:30 +0200 Message-Id: <20221029172337.1574593-7-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221029172337.1574593-1-martin@kaiser.cx> References: <20221029172337.1574593-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?1748043694282753864?= X-GMAIL-MSGID: =?utf-8?q?1748043694282753864?= The caller of OnAction_p2p has already checked the action category. We can remove the check in OnAction_p2p. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 0c2db015656f..97bcef078ea2 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3836,7 +3836,7 @@ static void on_action_public(struct adapter *padapter, struct recv_frame *precv_ static void OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame) { u8 *frame_body; - u8 category, OUI_Subtype; + u8 OUI_Subtype; u8 *pframe = precv_frame->rx_data; uint len = precv_frame->len; struct wifidirect_info *pwdinfo = &padapter->wdinfo; @@ -3847,10 +3847,6 @@ static void OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_fram frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); - category = frame_body[0]; - if (category != RTW_WLAN_CATEGORY_P2P) - return; - if (be32_to_cpu(*((__be32 *)(frame_body + 1))) != P2POUI) return; From patchwork Sat Oct 29 17:23:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 12758 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1439790wru; Sat, 29 Oct 2022 10:26:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5TU6IDGrDdtMky6OcwvIzlQADMpN7kewi7aQj24oXsAM5/kHgyYvdOlAqWi6vybYtpt/EG X-Received: by 2002:a65:6bd4:0:b0:443:94a1:429c with SMTP id e20-20020a656bd4000000b0044394a1429cmr4830926pgw.606.1667064380536; Sat, 29 Oct 2022 10:26:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064380; cv=none; d=google.com; s=arc-20160816; b=IncVXdMxehqR5hicPNwKOi94Da6LCcukt57iIQl49wABWBoEEZGsaOHYf7BEN2Hggd TUh+WC6zzeiB6WBUVt6lTmoq0jUvnxzj85FXJKT9OTyjWDp0cfiu/SfYI+ZLnpWkhL1Q vw+CmGwwi5WVAuanU0v0srO/CpxmIGsipWR4+5nlaZ0p6ixN0YSclJz3FNoxrUvj+bIV ClANj2AY8pgtLFq7Kc26lCqWVn1+xq2UuC4MG9nIShux6bDZ0uN+HljichaRdQ4rQF7r Y7/XoCdRnQUpNhfgNNRqJ6nweOAD34oOaj/XrRWfNFEK5om/mlLLcwPlZleDFBp9klte l73w== 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=E5uDM+O5N2X5f/xg1N3gADhUuYgG3v2KYKPJKNaBQOU=; b=UMd1lbUL3EMjh6+pX7xEM9J23mEULgQtkLvJqzEIUQYTa30mjzNl+S8ua1xwkAACiy mxT0uYOQvKlRigGuukzLyfTgzm5KDiYJ4+Wumreu8VciyajM6VMrZVFsUXag1aTuTfJu ZYd4vfoXx0Gmp1Bjd+3JjSrozdpXD17Fj63FIdaWOg+ge6s9tqHBFSPdPJX7N2ZTL8qk f9l2/pCN9G3a6XV7U42XTMfOzZLgvKuXmUwON5sLzWS+vlxIHH7dggqcpaVofiS98Z45 qOT2XxkKBzBu/Y30IG8pRuoSgGVpRVo4NnzcZ2v5Id6mg2Q7miFUHuszJdoPnhGl79l3 qt1g== 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 i1-20020a170902c94100b00176c0e055d8si3012978pla.102.2022.10.29.10.26.07; Sat, 29 Oct 2022 10:26:20 -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 S229944AbiJ2RY2 (ORCPT + 99 others); Sat, 29 Oct 2022 13:24:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229842AbiJ2RYK (ORCPT ); Sat, 29 Oct 2022 13:24:10 -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 4C59541514 for ; Sat, 29 Oct 2022 10:24:02 -0700 (PDT) Received: from dslb-188-097-213-253.188.097.pools.vodafone-ip.de ([188.97.213.253] 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 1oopYs-00074v-RW; Sat, 29 Oct 2022 19:23:58 +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 07/13] staging: r8188eu: replace switch-case with if Date: Sat, 29 Oct 2022 19:23:31 +0200 Message-Id: <20221029172337.1574593-8-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221029172337.1574593-1-martin@kaiser.cx> References: <20221029172337.1574593-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?1748043699879271453?= X-GMAIL-MSGID: =?utf-8?q?1748043699879271453?= OnAction_p2p has a switch-case statement where only a single case is handled. Use if instead, this makes the code shorter and easier to read. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 97bcef078ea2..7b05f847a8e6 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3853,19 +3853,8 @@ static void OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_fram len -= sizeof(struct ieee80211_hdr_3addr); OUI_Subtype = frame_body[5]; - switch (OUI_Subtype) { - case P2P_NOTICE_OF_ABSENCE: - break; - case P2P_PRESENCE_REQUEST: + if (OUI_Subtype == P2P_PRESENCE_REQUEST) process_p2p_presence_req(pwdinfo, pframe, len); - break; - case P2P_PRESENCE_RESPONSE: - break; - case P2P_GO_DISC_REQUEST: - break; - default: - break; - } } static void OnAction(struct adapter *padapter, struct recv_frame *precv_frame) From patchwork Sat Oct 29 17:23: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: 12759 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1439837wru; Sat, 29 Oct 2022 10:26:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7GcVCMlXYCA+M8m6/RofBDmqVenjqCuQMZ37QQiLxmEv0gCflUa8Bbu9tkZbK54cHTQuPd X-Received: by 2002:a17:902:e74e:b0:186:f3f4:f7fc with SMTP id p14-20020a170902e74e00b00186f3f4f7fcmr5310932plf.130.1667064394759; Sat, 29 Oct 2022 10:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064394; cv=none; d=google.com; s=arc-20160816; b=P+tBkiFJdW/18TrUOxHdUKwyo2rRSvq1fc4rVvpBWBp0yTULGwzvKXGRCmCm/lBZSj 8tApO9PHS/gAas877Sy2qzoJ/ETQfliOyfysI/T4XjNhM/GX6npi4Fz5XZvNAqAAq2aU IsIWt0AxjhJWYzkQqI1IMxPSrt5hlEB1vGdEUW/r+ysYDBIKpEhGfKhUROIR7OtHoU8R DPqRAf4TAgNdb37kE+wD+jdyFAzJ9i9Q9qT+F0hHLdjAUsq4VB3+PVkKOVKc/3D9vhQj glT7xVFF8jeRyzj28wriSLe3B4yP9Gm5v+mQQdyQ8DkxArVaXr+8BZ62/p/9pE3iTDiP u4hw== 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=l8TujWbUaRSRTlTHOdwYiEYJpevuA130ZFpicQLK8Qo=; b=swcwlk8KRb5aaQaF+Vkzqb3G7szODdMonmiV/dyQ2WXpWPN9g08TYLPz3XCLqcKyJj X2IExKRs0GX/ejj+cEsiPNUKb6OofiD3UCW5HBNK14A+FfzmgR0duP4NrvQ2qxtZb+yK 8p9QJ3d9BH59HP1GIIDGUQtE4YpGCvqWu2GuApIuYo6DiGCK+kPxXtmyNjuld+iaTDSf Abam9uIXk4RIL4uEeQDUc8Dzx7bjbWcvrczsk6FsmiYY3kdo+wRUKdOKeizt/dIVe5cT rqXikxMpCUcL3c6VTIXM4jUXyhqnB91B4mgEirZwNfu4r/mdhngQk1R56YopLVQeOYVE V3pQ== 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 d19-20020a656b93000000b00454649777ddsi2253110pgw.601.2022.10.29.10.26.22; Sat, 29 Oct 2022 10:26:34 -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 S229948AbiJ2RYb (ORCPT + 99 others); Sat, 29 Oct 2022 13:24:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229877AbiJ2RYM (ORCPT ); Sat, 29 Oct 2022 13:24:12 -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 1C54250F9C for ; Sat, 29 Oct 2022 10:24:04 -0700 (PDT) Received: from dslb-188-097-213-253.188.097.pools.vodafone-ip.de ([188.97.213.253] 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 1oopYt-00074v-Jk; Sat, 29 Oct 2022 19:23:59 +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 08/13] staging: r8188eu: replace GetAddr1Ptr call in OnAction_p2p Date: Sat, 29 Oct 2022 19:23:32 +0200 Message-Id: <20221029172337.1574593-9-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221029172337.1574593-1-martin@kaiser.cx> References: <20221029172337.1574593-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?1748043714333994078?= X-GMAIL-MSGID: =?utf-8?q?1748043714333994078?= Define a struct ieee80211_mgmt in OnAction_p2p and use it to check the destination address. This replaces a call to the driver-specific GetAddr1Ptr function. 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 7b05f847a8e6..40539fa3b5a2 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3835,6 +3835,7 @@ static void on_action_public(struct adapter *padapter, struct recv_frame *precv_ static void OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame) { + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; u8 *frame_body; u8 OUI_Subtype; u8 *pframe = precv_frame->rx_data; @@ -3842,7 +3843,7 @@ static void OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_fram struct wifidirect_info *pwdinfo = &padapter->wdinfo; /* check RA matches or not */ - if (memcmp(myid(&padapter->eeprompriv), GetAddr1Ptr(pframe), ETH_ALEN))/* for if1, sta/ap mode */ + if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN))/* for if1, sta/ap mode */ return; frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); From patchwork Sat Oct 29 17:23: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: 12757 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1439774wru; Sat, 29 Oct 2022 10:26:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM72IZJpILWRaXqJpNHTtK0brfpFlZ/KMY6nt8iNe8pqM8bDA2ikejnCvD4NmPAL3i/8mKl8 X-Received: by 2002:a17:902:ea06:b0:185:4c1f:7460 with SMTP id s6-20020a170902ea0600b001854c1f7460mr5349187plg.99.1667064375709; Sat, 29 Oct 2022 10:26:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064375; cv=none; d=google.com; s=arc-20160816; b=z8gI7XDUOvZVOnfVPBcNKoNtM696OGZd9/mCx2ZkEYdOAIFulNGJngMclTrxk4ErL8 gexyn64ft7CPSmHsADsVIaY9n1lhP5YBQLsUkjmZFpuySqSL3u40k3rnTFUuvPlAauXk BgO3X+ZZl6zYAMXK4lL2YHoyRCHJqDf/riD7HXEQKgU23UVX07lZs910FpyLNpFBvrDK 7s20eIabVCBBnH2rcCiNg/R1U1n9GWe+PlmTEiQZHOzGt+MgSrUQqb8+JS6jtxO8aBB/ wUHsgI/1ZgGEefLrYSjLZa2o1PK+cok8lsu55wDXdvDveHJ7u3BPoBZxGp0uUoLRISis IhpA== 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=FkrmJMZAdfdPZ4DqRcA1q6PC2/U6TCB84npT0+HwJd4=; b=HSpHHbS3Si8m+Rv5rXCM8cgd3sXgVP0CTO7vySg6nm14uLAVETyG+AKxwxKIfRaxlQ 3PBIfL2IznCAmhd6ECw/T9kj9oWzddkmxMpr7z6f6QbtHaf9myCnQaCyHCFu5iN1f19m vEeV/pyzoAdNuMcNY3MrCukQFf+EAnLGGAlY8OG/g/bKWuesPMTp8UntLQF1bwuuCxsR dwsG4jZlFUy31OiCZZfsthSv94YYKgt8CaBLEEDRG6nwFwKJkSQG8lnKHALeRKofgaC2 8s86hwX95hMyRJTdYs4LeTWhk6V4sVaLs80h29fgDCusZkqCBccUSqJVEHbZPqXpyDEm HuAg== 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 eb9-20020a056a004c8900b0056cb09fe0besi2473328pfb.191.2022.10.29.10.26.03; Sat, 29 Oct 2022 10:26:15 -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 S229536AbiJ2RYi (ORCPT + 99 others); Sat, 29 Oct 2022 13:24:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229886AbiJ2RYN (ORCPT ); Sat, 29 Oct 2022 13:24: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 1C2384CA0A for ; Sat, 29 Oct 2022 10:24:04 -0700 (PDT) Received: from dslb-188-097-213-253.188.097.pools.vodafone-ip.de ([188.97.213.253] 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 1oopYu-00074v-Cy; Sat, 29 Oct 2022 19:24:00 +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 09/13] staging: r8188eu: clean up on_action_public Date: Sat, 29 Oct 2022 19:23:33 +0200 Message-Id: <20221029172337.1574593-10-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221029172337.1574593-1-martin@kaiser.cx> References: <20221029172337.1574593-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?1748043694716741156?= X-GMAIL-MSGID: =?utf-8?q?1748043694716741156?= Use the struct mgmt to read the action_code. This is much simpler than parsing the message ourselves. Add a comment about reading the action code. All members of the action enum start with an action_code byte. It does not matter which member we use. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 40539fa3b5a2..b3cef3504ad3 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3813,24 +3813,16 @@ static unsigned int on_action_public_default(struct recv_frame *precv_frame) static void on_action_public(struct adapter *padapter, struct recv_frame *precv_frame) { struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; - unsigned int ret = _FAIL; - u8 *pframe = precv_frame->rx_data; - u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); - u8 action; /* check RA matches or not */ if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN)) return; - action = frame_body[1]; - switch (action) { - case ACT_PUBLIC_VENDOR: - ret = on_action_public_vendor(precv_frame); - break; - default: - ret = on_action_public_default(precv_frame); - break; - } + /* All members of the action enum start with action_code. */ + if (mgmt->u.action.u.s1g.action_code == WLAN_PUB_ACTION_VENDOR_SPECIFIC) + on_action_public_vendor(precv_frame); + else + on_action_public_default(precv_frame); } static void OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame) From patchwork Sat Oct 29 17:23: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: 12760 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1439838wru; Sat, 29 Oct 2022 10:26:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7ThXvMmMaMrteFw0DSGe2thxhVDOF7xxQFNodPYVJwoOZvIxJdwxgSLjLw31GmaUkB1f+Q X-Received: by 2002:a17:902:ec86:b0:185:483e:e4ec with SMTP id x6-20020a170902ec8600b00185483ee4ecmr5380281plg.164.1667064395231; Sat, 29 Oct 2022 10:26:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064395; cv=none; d=google.com; s=arc-20160816; b=kOfKMUKUlH9B7hZSZhUnty7d/mstfbSmKOFqbz0aRb0pjkUoL98a3ddr+J7sldJVrb 0n906mFqJpOB/B/bjjHgHoYjZkskBsR1Yn9Ua/4BMmT8sQeeJExTjroQw56WQULk7kRp Yj/OssRkrYPq83OIWATGcpVb7OXNSR3jGtqFHP9/OcKNabdrseNx115FsnYwOq2n/dN+ IiZF/Vq7D0SRVMJEABjYvXgoJnWawrVYaEREN8x+QUerxxmrajvmYwNM9bjmh1+Fhxaj At3+onKqnw4dhfnuiXAVrWbVvbp9dvpm4XiriLfncUaHmoWAQC9TIVGAWkk/gvIgh3nq 4o6A== 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=DMZUsJNikyQLrk20aOH886hKhnIgPHP49kGmFXo+Dg0=; b=MuMlMT2lV5lgAyq3Bume+9pwAhZFwhlA+yfjym5ShYqoEwKQI400WTsKTRddGUZLxp upjC6meQPLaCnhuFXStZ+23u7Va0iyj6g6ArXCx6fsSOtI3ws9GvWg8sP3XPTZO9xB0p z3TMPkY5pku2dFLx7BNiipCQ6hrxY0vnem/vG7q4Su2kYiWFNXXMMh0R6vHvhAbYDOQP I9IF+gms/Ioi5rnrZTxOOr2hej4cPb9iPKISkilukApL8K/+y2EH3OzuVH+EzxnctvZf lHmvlmBeWhG0Vr9TBeR64147GnYO3EKe8LrxjXGWjn9FJsRPdCDU8/b8Gm/rLETJy5Zq 4Y+Q== 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 h30-20020a63575e000000b00463f080c19esi2423433pgm.559.2022.10.29.10.26.23; Sat, 29 Oct 2022 10:26:35 -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 S229970AbiJ2RYe (ORCPT + 99 others); Sat, 29 Oct 2022 13:24:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229876AbiJ2RYM (ORCPT ); Sat, 29 Oct 2022 13:24:12 -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 1C42050BB5 for ; Sat, 29 Oct 2022 10:24:04 -0700 (PDT) Received: from dslb-188-097-213-253.188.097.pools.vodafone-ip.de ([188.97.213.253] 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 1oopYv-00074v-7z; Sat, 29 Oct 2022 19:24:01 +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 10/13] staging: r8188eu: remove return value from on_action_public_vendor Date: Sat, 29 Oct 2022 19:23:34 +0200 Message-Id: <20221029172337.1574593-11-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221029172337.1574593-1-martin@kaiser.cx> References: <20221029172337.1574593-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?1748043715252760636?= X-GMAIL-MSGID: =?utf-8?q?1748043715252760636?= The only caller of on_action_public_vendor does not check the return value. We can make it a void function. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index b3cef3504ad3..b395457a6a60 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3779,17 +3779,13 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame) return _SUCCESS; } -static unsigned int on_action_public_vendor(struct recv_frame *precv_frame) +static void on_action_public_vendor(struct recv_frame *precv_frame) { - unsigned int ret = _FAIL; u8 *pframe = precv_frame->rx_data; u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); - if (!memcmp(frame_body + 2, P2P_OUI, 4)) { - ret = on_action_public_p2p(precv_frame); - } - - return ret; + if (!memcmp(frame_body + 2, P2P_OUI, 4)) + on_action_public_p2p(precv_frame); } static unsigned int on_action_public_default(struct recv_frame *precv_frame) From patchwork Sat Oct 29 17:23: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: 12762 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1439981wru; Sat, 29 Oct 2022 10:27:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4J2hiatrIjw88hlvQ8Kx73bUn9ocx56nPmkB+rzvxFtIowzEzRlCDrEbZaktdSrrb0cAHg X-Received: by 2002:a05:6a00:8cb:b0:52c:6962:2782 with SMTP id s11-20020a056a0008cb00b0052c69622782mr5252066pfu.81.1667064421986; Sat, 29 Oct 2022 10:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064421; cv=none; d=google.com; s=arc-20160816; b=y8XLzRct3Rwx4/Z0RhEOgLX7PeWd5iirbTFXkx5q4ynM6Xg2b1sG/OBlz11+3Pjyr+ wlA+IGEEFGIMDenUiE3R6lT9pH/OJciZTR4Iyn0uBDLxQCTcGIoF8CswPS0Gr6gz8OTU wKOSj4UA+YYmJKj852/+dgF/oRcvQFoVn7zJZ+/7HfrVR5zYFTBJxzwUZnCSax2G1TSK +Ht17Fykd1Z4wYrp+TAgCYM84jThVif6SDOCB6crnHJg631kEql6njFVMGiNPtFVTjQg XF/AAnOhCec5ORkRde+6q+/cMS4Sfv/Jo3CIJCW7SxCzRrMxHgm0gqdQrDEF8sp/4cop gm8g== 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=yBnzgeOVv70gnxTpcK6WQn8BCY9lk3Ouvi6oxwV0GhY=; b=SStuuQEdDDHgAhZjRbVXbYiBpDtirmWDE3hs/gghwEnxXPJ7+ap6qtH528WaIB000N 4doTpm7jaD69bDw95oelEoUePp+OcvHMgl7HBf5Ivpx0moWW/+uM05eTRfhTPd/rbb2m kpBglOy/hg7huGhy3jQkbv/43h7h9Kbs3Gk380LaCNp3BhIKRRahrhFPWAfWxbmY0Ofo RQoGDz/pE2pIZSW8RJb3Oqr+Kj276gJOWFDj+aB13gDjxQQvG9OAFkMbuFpkuS/WC2kv k6CZ4kzo/HIiRGCX4kq6OtUTLMHVYgQ8y1/pu5Gc7ghEJ1qOrm0BYR16LVy0zgEqdG9O trCg== 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 w127-20020a636285000000b0046f55fec417si2544776pgb.650.2022.10.29.10.26.49; Sat, 29 Oct 2022 10:27:01 -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 S230013AbiJ2RYt (ORCPT + 99 others); Sat, 29 Oct 2022 13:24:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229763AbiJ2RYO (ORCPT ); Sat, 29 Oct 2022 13:24:14 -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 3095940009 for ; Sat, 29 Oct 2022 10:24:06 -0700 (PDT) Received: from dslb-188-097-213-253.188.097.pools.vodafone-ip.de ([188.97.213.253] 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 1oopYw-00074v-1b; Sat, 29 Oct 2022 19:24:02 +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 11/13] staging: r8188eu: remove return value from on_action_public_default Date: Sat, 29 Oct 2022 19:23:35 +0200 Message-Id: <20221029172337.1574593-12-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221029172337.1574593-1-martin@kaiser.cx> References: <20221029172337.1574593-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?1748043743620318367?= X-GMAIL-MSGID: =?utf-8?q?1748043743620318367?= The only caller of on_action_public_default does not check the return value. We can make it a void function. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index b395457a6a60..f5923792f067 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3788,22 +3788,15 @@ static void on_action_public_vendor(struct recv_frame *precv_frame) on_action_public_p2p(precv_frame); } -static unsigned int on_action_public_default(struct recv_frame *precv_frame) +static void on_action_public_default(struct recv_frame *precv_frame) { - unsigned int ret = _FAIL; u8 *pframe = precv_frame->rx_data; u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); u8 token; token = frame_body[2]; - if (rtw_action_public_decache(precv_frame, token) == _FAIL) - goto exit; - - ret = _SUCCESS; - -exit: - return ret; + rtw_action_public_decache(precv_frame, token); } static void on_action_public(struct adapter *padapter, struct recv_frame *precv_frame) From patchwork Sat Oct 29 17:23: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: 12761 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1439980wru; Sat, 29 Oct 2022 10:27:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7hrXp23JgQ5JJEjyCu/FwZnprvAUUw6DP1JzvZKwjeTF7ijFV95lq3yslHi3tR308CO24A X-Received: by 2002:a17:902:ec86:b0:185:483e:e4ec with SMTP id x6-20020a170902ec8600b00185483ee4ecmr5381985plg.164.1667064421571; Sat, 29 Oct 2022 10:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064421; cv=none; d=google.com; s=arc-20160816; b=P7Kz8wTtHA4LVucshBKfEnAqpdcILt/JkiQhQ6e3TDxYWOsVOQSRZxlIsAnBaipy1G nOVI+bsz5OlOyUp26votGVybdRRUTJLgihGUweNkABWxgbcVn6jrWY1HHq0C2ieo7x79 MiY3ry08bm6RoJaWdcSRP4F5fOBBUc4XnwZGH6c7HwUD6w4an+FVXO0uWwpirQnrgNxe MkIsJE4zQQOGJvo2UnWcQr1ZB/N9EH//nXjBzl8cM5mbooHJeV0Mn1YjQvoi9uhXXW7D J/bGBboqXsXbZKTtBmftuF86dSGGy/MWjtSS7T/vXsiSzMisMHuxYBOTCCtUyP6HNEFt f5Lg== 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=N8k5BQiASjLfk9ZeQkhld1UxXUO9WHtld1W1SEJUdg8=; b=rD1fZaH5YD6mwh6DI16dPGsg6F5TtfwIRT9P7RRiafOZcUwoaM6femIyj2JQSvuiGb L2rJWJtZKl45Y5n1uL2DdkO7ubOxHxPqKoW+pagB3WnYaLDFpPvcRkDDOTsVteEBB1Vc 0z/5mq6R/hiGxs6KNsc0aoKnMzboXhJfoVwVTKWkBjiQsIrohK3CGkKcEkHSZg/uVl9/ v7QxN3Bidj8/1EZT0UJjZ7ocvJHmfChZNEfYhEfDGsabGTl8ABj/EHtWwXiG+f+wNm+v hnpw9AnzxrRE4oZ5TtgTVro3bNnCvBif8Ggd/994MqmtkT8AHhHsM4dfl42NdJf5TbjJ drcg== 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 q128-20020a632a86000000b004599da2b2b6si2634634pgq.716.2022.10.29.10.26.49; Sat, 29 Oct 2022 10:27:01 -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 S230005AbiJ2RYm (ORCPT + 99 others); Sat, 29 Oct 2022 13:24:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229862AbiJ2RYO (ORCPT ); Sat, 29 Oct 2022 13:24:14 -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 53D8941510 for ; Sat, 29 Oct 2022 10:24:07 -0700 (PDT) Received: from dslb-188-097-213-253.188.097.pools.vodafone-ip.de ([188.97.213.253] 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 1oopYw-00074v-SJ; Sat, 29 Oct 2022 19:24:02 +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 12/13] staging: r8188eu: rtw_action_public_decache's token is a u8 Date: Sat, 29 Oct 2022 19:23:36 +0200 Message-Id: <20221029172337.1574593-13-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221029172337.1574593-1-martin@kaiser.cx> References: <20221029172337.1574593-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?1748043743092077916?= X-GMAIL-MSGID: =?utf-8?q?1748043743092077916?= Both callers of rtw_action_public_decache pass a u8 value for the token parameter. We can change token from s32 to u8 and remove the code for token < 0. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index f5923792f067..93f3d387e92d 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3490,7 +3490,7 @@ inline void issue_probereq_p2p(struct adapter *adapter, u8 *da) _issue_probereq_p2p(adapter, da); } -static s32 rtw_action_public_decache(struct recv_frame *recv_frame, s32 token) +static s32 rtw_action_public_decache(struct recv_frame *recv_frame, u8 token) { struct adapter *adapter = recv_frame->adapter; struct mlme_ext_priv *mlmeext = &adapter->mlmeextpriv; @@ -3499,21 +3499,13 @@ static s32 rtw_action_public_decache(struct recv_frame *recv_frame, s32 token) (recv_frame->attrib.frag_num & 0xf); if (GetRetry(frame)) { - if (token >= 0) { - if ((seq_ctrl == mlmeext->action_public_rxseq) && - (token == mlmeext->action_public_dialog_token)) - return _FAIL; - } else { - if (seq_ctrl == mlmeext->action_public_rxseq) - return _FAIL; - } + if ((seq_ctrl == mlmeext->action_public_rxseq) && + (token == mlmeext->action_public_dialog_token)) + return _FAIL; } mlmeext->action_public_rxseq = seq_ctrl; - - if (token >= 0) - mlmeext->action_public_dialog_token = token; - + mlmeext->action_public_dialog_token = token; return _SUCCESS; } From patchwork Sat Oct 29 17:23: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: 12755 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1439755wru; Sat, 29 Oct 2022 10:26:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Nlu39BXAFw+5EOavW7VNqWboK/X44JTcEkz7wYOiI4AAQyXjTB/IwiPPRFNhcS+fuv04X X-Received: by 2002:a17:90b:4d87:b0:212:d62a:8612 with SMTP id oj7-20020a17090b4d8700b00212d62a8612mr23304109pjb.35.1667064372812; Sat, 29 Oct 2022 10:26:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064372; cv=none; d=google.com; s=arc-20160816; b=s7MOpJhyOVlbCEe8dQPyN+ATrbWxd7j+AJ8WQQpZYGDpMbrkMFvVmA0BRGPg5pQUwP cDhBbITml9CqQVakTNj7ywPpoQiSab3T7K7X2C0gF2tjSMPEWD2WFA6i6nv3VMDOOnHW PysKEaOybTqT7p9ilrIUHtFbXG/lWSQ8AJOUefnwICY2pubWTZpbpImMcOvxNVYF06G6 DFcmDbf2HLJXXDqN0/BZqul98iq/xoksM4Y0hZDJXAA36ZJdwi440S/4szMTKZ7R98bX i8s/e3Fq29IbB7mSeA8UbQgEHZqbwVagPBkOtPGAcyCeVhmFXOR904dAa0BDRfprRO24 nSHA== 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=XEEr+6ilrEHWzb8gusSS9Q9Fm4iEeIJnwWVdTU4i58Y=; b=qj0geTIUZ48ZN8zquQpaUlsoZWi4UEsyJPupfn/E7bcHiomms1SVFUdwBy4XWBTJgd COLn4gEvnsFnN/7/uTWkgO1ew3RLsFqftIndhSDGzO0A46dnxHJbDA7r4r1svxzvbqf7 QvOAXdA21Two7D+uyx3Va/hIyYSwjj/vkYWLdWZADtJZog5xQn7exhwAQLac44RzM4bS lYOoN2P6mGaALi5X4qMLIkEJLb7CXcTbn9ypmHQdyEgipnMUuEi5gYAfhnk0Mwo/e/VL oVUU2nvrDhaCf2ByCoMcMxUDpENoYa0DEruCySKSd8qQaIyuaBzZzzHJROt6Oxe3tO8B lPUA== 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 pw1-20020a17090b278100b00212ca8e7457si2731815pjb.133.2022.10.29.10.25.59; Sat, 29 Oct 2022 10:26:12 -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 S229880AbiJ2RYq (ORCPT + 99 others); Sat, 29 Oct 2022 13:24:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229853AbiJ2RYO (ORCPT ); Sat, 29 Oct 2022 13:24:14 -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 53E6152DFB for ; Sat, 29 Oct 2022 10:24:07 -0700 (PDT) Received: from dslb-188-097-213-253.188.097.pools.vodafone-ip.de ([188.97.213.253] 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 1oopYx-00074v-Qd; Sat, 29 Oct 2022 19:24:03 +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 13/13] staging: r8188eu: check destination address in OnAction Date: Sat, 29 Oct 2022 19:23:37 +0200 Message-Id: <20221029172337.1574593-14-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221029172337.1574593-1-martin@kaiser.cx> References: <20221029172337.1574593-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?1748043692050459146?= X-GMAIL-MSGID: =?utf-8?q?1748043692050459146?= All subfunctions of OnAction check if the destination address matches the local interface's address. It's simpler to move this check to OnAction. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 93f3d387e92d..e985fc5fc575 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1492,9 +1492,6 @@ static void OnAction_back(struct adapter *padapter, struct recv_frame *precv_fra struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; u8 *pframe = precv_frame->rx_data; struct sta_priv *pstapriv = &padapter->stapriv; - /* check RA matches or not */ - if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN))/* for if1, sta/ap mode */ - return; if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE) if (!(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) @@ -3795,10 +3792,6 @@ static void on_action_public(struct adapter *padapter, struct recv_frame *precv_ { struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; - /* check RA matches or not */ - if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN)) - return; - /* All members of the action enum start with action_code. */ if (mgmt->u.action.u.s1g.action_code == WLAN_PUB_ACTION_VENDOR_SPECIFIC) on_action_public_vendor(precv_frame); @@ -3808,17 +3801,12 @@ static void on_action_public(struct adapter *padapter, struct recv_frame *precv_ static void OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame) { - struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; u8 *frame_body; u8 OUI_Subtype; u8 *pframe = precv_frame->rx_data; uint len = precv_frame->len; struct wifidirect_info *pwdinfo = &padapter->wdinfo; - /* check RA matches or not */ - if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN))/* for if1, sta/ap mode */ - return; - frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); if (be32_to_cpu(*((__be32 *)(frame_body + 1))) != P2POUI) @@ -3835,6 +3823,9 @@ static void OnAction(struct adapter *padapter, struct recv_frame *precv_frame) { struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; + if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN)) + return; + switch (mgmt->u.action.category) { case WLAN_CATEGORY_BACK: OnAction_back(padapter, precv_frame);