From patchwork Sat Oct 29 17:10:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 12747 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1439357wru; Sat, 29 Oct 2022 10:24:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4AzgPfMRcX1l8LfC+5Wh93VWomgYPuW9jpqEEg38ILsJVW5CGHo80cdh7YlJPRE8UhaXwq X-Received: by 2002:a63:5246:0:b0:42b:e4a5:7252 with SMTP id s6-20020a635246000000b0042be4a57252mr4666675pgl.566.1667064287972; Sat, 29 Oct 2022 10:24:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064287; cv=none; d=google.com; s=arc-20160816; b=vWJ/prbacxPno4Aiw6iUKe3Xfpr67wPXSLdRsvxwshgLXHbnCldH201rQI2cPx8hVb ZyUBUswSo3r456W9kf4fI8g+t4RGyc6ZTh17ICQORBt+3wqRDTzBWYAp4qEmuZ7V5IOn 25tIdax472NUPYmY2HLP5YTRnx6FhWXOziBofbP/ZIOsghE5Y8P8U50wnZ4qFCza2UUN 3+qKwgGEBfndWFfoszJ8MfEX8AXWILDAFox0gKvxDzf6r6zurB+87+adzeSYH9mcXg+Z NnRSRYgzYz62QQ+RZOA9SBQy36J8CSM7XlpJ79Riyz0/berEI1YT9LHQLVHRfuVyMM0+ MZwg== 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=0fadT0cdu/iex2zpq/vX/siIKyL3tyteuFdKS5ODSqc=; b=y6qPI24N0Dd4dgqOPoE1eDOYyQbMjelSUtqS1Nz6J1ugyJ64L04Nv8YWKHsIWV+egS s5WYciZ/MKAvorFjf0b50Wp8vGnq6PM4sfTw24qtMmeWJWLM4WULrhNvyiVMcl/hbWTg Yx8ZqLETIfFG7sJAzkyKwIJegC/mQE/svGx3ocdU1xvAfjdOU7Is82AY0S9Dw+xFiJpr yyFLZf/Tt5nisuT4c6WIq517MU27VnVlIR3Yx8gQyWF+mtqsFihhH1Sri5MoC6kUmU+l pZzkDd+Jn5sNwrpC87v0Irc3Loa2KBDmavZk7AilXYDo9JABodSG1QbWwXgbi5Aa6xSN 63jg== 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 nd10-20020a17090b4cca00b001fe280041e8si2474899pjb.37.2022.10.29.10.24.33; Sat, 29 Oct 2022 10:24:47 -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 S229588AbiJ2RKo (ORCPT + 99 others); Sat, 29 Oct 2022 13:10:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbiJ2RKk (ORCPT ); Sat, 29 Oct 2022 13:10:40 -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 AE69526563 for ; Sat, 29 Oct 2022 10:10:38 -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 1oopLt-0006xg-TQ; Sat, 29 Oct 2022 19:10:33 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 1/2] staging: r8188eu: replace get_da with ieee80211_get_DA Date: Sat, 29 Oct 2022 19:10:10 +0200 Message-Id: <20221029171011.1572091-2-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221029171011.1572091-1-martin@kaiser.cx> References: <20221029171011.1572091-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?1748043602851993327?= X-GMAIL-MSGID: =?utf-8?q?1748043602851993327?= Replace a call to the driver-specific get_da function with ieee80211_get_DA from ieee80211.h. 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 ffb708f242e6..127dbc4e8b9a 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -798,11 +798,12 @@ static void OnAuthClient(struct adapter *padapter, struct recv_frame *precv_fram unsigned char *p; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precv_frame->rx_data; u8 *pframe = precv_frame->rx_data; uint pkt_len = precv_frame->len; /* check A1 matches or not */ - if (memcmp(myid(&padapter->eeprompriv), get_da(pframe), ETH_ALEN)) + if (memcmp(myid(&padapter->eeprompriv), ieee80211_get_DA(hdr), ETH_ALEN)) return; if (!(pmlmeinfo->state & WIFI_FW_AUTH_STATE)) From patchwork Sat Oct 29 17:10:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 12748 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1439372wru; Sat, 29 Oct 2022 10:24:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7GhfD1r+BDRdLblFPGLCE6eHBz7U7ZGDfieDRmiMCoicfX9JgHVABrAm0Rz7vvApH2WLQh X-Received: by 2002:a17:902:e548:b0:186:f0d5:1ac2 with SMTP id n8-20020a170902e54800b00186f0d51ac2mr5307507plf.144.1667064290859; Sat, 29 Oct 2022 10:24:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064290; cv=none; d=google.com; s=arc-20160816; b=opwur40FKKbXgY3eUB7qo+N0pE+mxALO61sR1ByIeH+vEdKszsm4B7G21+XVU5RbwQ DDL+SEHVAtSrJX8z+Z1feMRFV3EhNLA/moh6bnAdIlAsLWcXwfIj7RjdUwdYaEwgAtiq F26oFMD54cbhszI3nYpxpmb80oP8qF+wF4CWy2XAp5s0C0/GgeAvc4A5ki+Z+BvSiJLL e2662ylwtpjFCvo177KmnGly3FQkE3GpN9UpXpN0y69NU3sFjztpyNLoe4fOXGVG/t9g aNPPfa6VsdmFyA7fjUEwTZ7+0z4VNI1hW/7H/lejZIb6DSdMo3wYquhidGgEO9VE+MWk o+aQ== 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=Sxr1xjpCCzhSSNZjhtpvDER6IT6Hi5X1gAlfkWhVJrQ=; b=lkFHPIQAwub94r2gQLAu36TTaRWA8wVI9Sb9Fl7xYDTWzpbpGAgTpuFVfJaVjp5DDk FaglJG27mS1fAgoAzPn0V54BG8ESRZjc4rO+X6FOShPiiu4fP74M7K26q9D0nPIFa/+i 12ey/OJ+oSXvQLHnw+J4IH+nc/UgbyfQYO0/3W6ZEWjDGXBgkWAWRmo0FUnFDT39MdCG Q5Pz4LqrXLbzisnqOaQrV9aTwIKzeFiVyU2TgDFz658CblqEyQuAmNYIeQDXwyMstZYK 8AOKVvOQZlKitm368KwStmzlQ2WvvnFddZI0hBP4YArU3/TNyWHuCVXbNvElZn84KpCF 9mnQ== 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 o6-20020a17090ac08600b001fe39932aa3si2343757pjs.48.2022.10.29.10.24.38; Sat, 29 Oct 2022 10:24:50 -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 S229838AbiJ2RKt (ORCPT + 99 others); Sat, 29 Oct 2022 13:10:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229726AbiJ2RKl (ORCPT ); Sat, 29 Oct 2022 13:10:41 -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 38C0C27178 for ; Sat, 29 Oct 2022 10:10:39 -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 1oopLu-0006xg-T0; Sat, 29 Oct 2022 19:10:34 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 2/2] staging: r8188eu: remove get_da Date: Sat, 29 Oct 2022 19:10:11 +0200 Message-Id: <20221029171011.1572091-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221029171011.1572091-1-martin@kaiser.cx> References: <20221029171011.1572091-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?1748043605954210146?= X-GMAIL-MSGID: =?utf-8?q?1748043605954210146?= Replace the last get_da call with ieee80211_get_DA and remove the get_da function. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c | 3 ++- drivers/staging/r8188eu/include/wifi.h | 22 ------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c b/drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c index dff0cba751df..f01ae71bcdb1 100644 --- a/drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c +++ b/drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c @@ -108,6 +108,7 @@ void update_recvframe_attrib_88e(struct recv_frame *precvframe, struct recv_stat */ void update_recvframe_phyinfo_88e(struct recv_frame *precvframe, struct phy_stat *pphy_status) { + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precvframe->rx_data; struct adapter *padapter = precvframe->adapter; struct rx_pkt_attrib *pattrib = &precvframe->attrib; struct hal_data_8188e *pHalData = &padapter->haldata; @@ -125,7 +126,7 @@ void update_recvframe_phyinfo_88e(struct recv_frame *precvframe, struct phy_stat get_bssid(&padapter->mlmepriv), ETH_ALEN)); pkt_info.bPacketToSelf = pkt_info.bPacketMatchBSSID && - (!memcmp(get_da(wlanhdr), + (!memcmp(ieee80211_get_DA(hdr), myid(&padapter->eeprompriv), ETH_ALEN)); pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID && ieee80211_is_beacon(fc); diff --git a/drivers/staging/r8188eu/include/wifi.h b/drivers/staging/r8188eu/include/wifi.h index 6b50089cea29..92a584a8b6c0 100644 --- a/drivers/staging/r8188eu/include/wifi.h +++ b/drivers/staging/r8188eu/include/wifi.h @@ -217,28 +217,6 @@ enum WIFI_REG_DOMAIN { #define GetAddr4Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 24)) -static inline unsigned char *get_da(unsigned char *pframe) -{ - unsigned char *da; - unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe); - - switch (to_fr_ds) { - case 0x00: /* ToDs=0, FromDs=0 */ - da = GetAddr1Ptr(pframe); - break; - case 0x01: /* ToDs=0, FromDs=1 */ - da = GetAddr1Ptr(pframe); - break; - case 0x02: /* ToDs=1, FromDs=0 */ - da = GetAddr3Ptr(pframe); - break; - default: /* ToDs=1, FromDs=1 */ - da = GetAddr3Ptr(pframe); - break; - } - return da; -} - static inline unsigned char *get_sa(unsigned char *pframe) { unsigned char *sa;