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;