From patchwork Mon Oct 31 20:54: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: 13441 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2547297wru; Mon, 31 Oct 2022 14:07:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5t06gbmQWqyoCE3ynQx03uTOYGgVc1XFF7ydKnzZDyGX+2Qf/XYKabHGUnHBQOlcA/SJBZ X-Received: by 2002:a17:907:a0c9:b0:7ad:dc98:d9d2 with SMTP id hw9-20020a170907a0c900b007addc98d9d2mr4777496ejc.310.1667250454309; Mon, 31 Oct 2022 14:07:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667250454; cv=none; d=google.com; s=arc-20160816; b=s1Oh6p5XsxyiiOsdv57RSOBjG7VpIo9GHcwnYMzIpO1Vl36VJSTJTPEh9OzPtL9i58 cEmwkh3GV59LevlROsHq/oIllZ3Vm59a7WKrgd4kgJJ8w1lVi5IuVsaDdcq0tTZZeFXz yL1hTLt283RB0mssA507kS/Kr28cM1j17/ux+oFWNhe9aMTkSwySwGuSJi2LoT4iyaGk 1xA9CSQPOJCyf/evqE+updrEtNgWe+83Iia5PZr4xDhDR6pEKQve86kWuztbwlVuxg1p 1vrmGEDRNDsdakQlt8JmPjUlwfGd/b3Q5bLCpj+qVyHdK9XhB9iyPxQd15aLh9huhk0T Bfog== 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=KG138z2VDLgPQTMe33TSkheuxHiqtYTg+jz69pDePlg=; b=RCpeauXWWi/Xp98w84rAxQq1P7Bgt7pmkqr7bYrqlJu/v45w78XaUYxX0N3JJs9BDd A7EAmP5VnPu7w4oKhbP9SRyjThydE/J+QD3vPZeE8j2Uq3Gi2ZC9f16JtB1zu3D58EHD wQgB7vGJOg9n/Bn5xpp08LkcNJd7O2McDrZBjnCnh+ME6Do6OL4Xm8zSogYV/BrJtYrg Bvjr6QJgnkYin1iHGU4a8hotFwVEdWmDlyYMyEJYED7947h+U/nOmkSHVmEWF6KExule 1ofknEbKbokDqkfcNZfG4TXvl4ZdUsMKLVID1sBzk/iPpLETzQacDqtWUR2rGv2GdNmJ IkAA== 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 z14-20020a056402274e00b0045cecdc1fbcsi11470248edd.9.2022.10.31.14.07.08; Mon, 31 Oct 2022 14:07: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 S230171AbiJaUzO (ORCPT + 99 others); Mon, 31 Oct 2022 16:55:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230106AbiJaUy6 (ORCPT ); Mon, 31 Oct 2022 16:54:58 -0400 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5FCFD10E for ; Mon, 31 Oct 2022 13:54:57 -0700 (PDT) Received: from dslb-084-059-234-234.084.059.pools.vodafone-ip.de ([84.59.234.234] 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 1opbo5-0006z9-R0; Mon, 31 Oct 2022 21:54:53 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser , Joe Perches Subject: [PATCH 1/3] staging: r8188eu: use ether_addr_equal for address comparison Date: Mon, 31 Oct 2022 21:54:10 +0100 Message-Id: <20221031205412.124871-2-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221031205412.124871-1-martin@kaiser.cx> References: <20221031205412.124871-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?1748238812322061649?= X-GMAIL-MSGID: =?utf-8?q?1748238812322061649?= We can use ether_addr_equal instead of memcmp in update_recvframe_phyinfo_88e for comparing the incoming frame's destination address with our local address. Both struct ieee80211_hdr and struct eeprom_priv's mac_addr component are 2-byte aligned. Suggested-by: Joe Perches Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c b/drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c index f01ae71bcdb1..10bb2e602984 100644 --- a/drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c +++ b/drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c @@ -126,8 +126,8 @@ 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(ieee80211_get_DA(hdr), - myid(&padapter->eeprompriv), ETH_ALEN)); + ether_addr_equal(ieee80211_get_DA(hdr), + myid(&padapter->eeprompriv)); pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID && ieee80211_is_beacon(fc); if (pkt_info.bPacketBeacon) { From patchwork Mon Oct 31 20:54: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: 13443 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2547708wru; Mon, 31 Oct 2022 14:08:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Xz3VxjezWc8grwznQMmtUMvg5ruJT7GgO9aXsqu1dnhXhs9FcrZnQzzN8O9eBkzD8Cd1l X-Received: by 2002:a17:907:25c1:b0:77b:9966:ccf1 with SMTP id ae1-20020a17090725c100b0077b9966ccf1mr15289082ejc.763.1667250500053; Mon, 31 Oct 2022 14:08:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667250500; cv=none; d=google.com; s=arc-20160816; b=xQF7Kk0RtaVOvLl4na217B46oe9JvG41KOADYtw4AusygDAkyb/yf9JkzsHULVPmsU Opho1XjOFYALCesbfturdXsrZa3E3KYOdrYv/SUyvsTC7C4F5x14+ogDUm7e3/oTKqhs 74AaUBRCV6roSx8w7qKInf6a0b2Xy5zK3DeItJo49gcLdKcWsB3wkS8Lu0PMxqylX9FN rGMJfgsrKTccuIqQsVG4T0QPqLvvq4E8AIlDozenMYPWpHcwUlZsezfwj3QusD0+oXU7 eKyG6V+Sn7yzq9MEMT4pP2STC5kLlUFs3QHYSr9rvncqr8gqCQykF6iTizBWAcOneXQP 71HQ== 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=nCEXWi77iCYD3L8jo8vNVD/qzJOZQ3kKaThyg7tzAxs=; b=D4fTCAqSsg7xUpFkGCR6Q3/Z1bMDtv+tUl5VvkXbw0Dc/E+5m7/ccwK1USvgIJ9ven CkQzW/PMK+V9o/oRh75K8pEY45sWWZvK0Jf2W3pxXk9942wrGVrxQYSZQv0Xde+/01dl 2u158x5aAz+aa4YMIhWRXpLpM7aCijnTr6V5S4cRKfoWwLFDlc+AwAR1EtRignqN6+bf /sCtiRwcrgYJXCgnAGXUW702xZvgxBrzCJ+Wuonm3IDbeiPKAo2ACzzUJ96BIsESTm8Z +sy6Gt4S++vvjrBMI+OLnEhIvLHu567r7JX2rfDYPByobyPiWU9SfxyZ2HPKpF/2FRs6 B7Ug== 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 h11-20020a056402280b00b00461ed1fe6ffsi11971452ede.85.2022.10.31.14.07.55; Mon, 31 Oct 2022 14:08:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230222AbiJaUzU (ORCPT + 99 others); Mon, 31 Oct 2022 16:55:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230141AbiJaUy7 (ORCPT ); Mon, 31 Oct 2022 16:54: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 F33FDD10E for ; Mon, 31 Oct 2022 13:54:58 -0700 (PDT) Received: from dslb-084-059-234-234.084.059.pools.vodafone-ip.de ([84.59.234.234] 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 1opbo6-0006z9-US; Mon, 31 Oct 2022 21:54:55 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 2/3] staging: r8188eu: use hdr->frame_control instead of fc Date: Mon, 31 Oct 2022 21:54:11 +0100 Message-Id: <20221031205412.124871-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221031205412.124871-1-martin@kaiser.cx> References: <20221031205412.124871-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?1748238860163637894?= X-GMAIL-MSGID: =?utf-8?q?1748238860163637894?= We can remove the fc variable in update_recvframe_phyinfo_88e and use hdr->frame_control instead. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c b/drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c index 10bb2e602984..4e9d8c8285c4 100644 --- a/drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c +++ b/drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c @@ -114,13 +114,12 @@ void update_recvframe_phyinfo_88e(struct recv_frame *precvframe, struct phy_stat struct hal_data_8188e *pHalData = &padapter->haldata; struct phy_info *pPHYInfo = &pattrib->phy_info; u8 *wlanhdr = precvframe->rx_data; - __le16 fc = *(__le16 *)wlanhdr; struct odm_per_pkt_info pkt_info; u8 *sa = NULL; struct sta_priv *pstapriv; struct sta_info *psta; - pkt_info.bPacketMatchBSSID = ((!ieee80211_is_ctl(fc)) && + pkt_info.bPacketMatchBSSID = ((!ieee80211_is_ctl(hdr->frame_control)) && !pattrib->icv_err && !pattrib->crc_err && !memcmp(get_hdr_bssid(wlanhdr), get_bssid(&padapter->mlmepriv), ETH_ALEN)); @@ -129,7 +128,8 @@ void update_recvframe_phyinfo_88e(struct recv_frame *precvframe, struct phy_stat ether_addr_equal(ieee80211_get_DA(hdr), myid(&padapter->eeprompriv)); - pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID && ieee80211_is_beacon(fc); + pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID && + ieee80211_is_beacon(hdr->frame_control); if (pkt_info.bPacketBeacon) { if (check_fwstate(&padapter->mlmepriv, WIFI_STATION_STATE)) sa = padapter->mlmepriv.cur_network.network.MacAddress; From patchwork Mon Oct 31 20:54:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 13442 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2547584wru; Mon, 31 Oct 2022 14:08:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM751Dq6dbcUCbsKxixZ9PH6pmS7zqg8ILydZj/1dUJAwl67uAuZrpBe8ltIeTrb0ZrSWg8E X-Received: by 2002:a17:906:1ec5:b0:78d:b3d1:183b with SMTP id m5-20020a1709061ec500b0078db3d1183bmr15096270ejj.709.1667250483960; Mon, 31 Oct 2022 14:08:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667250483; cv=none; d=google.com; s=arc-20160816; b=0JU5BdNgatBLTJtcqfUAv/k7zgZoxwID24h+wSCxLR+ItWOG5JPGsd+QwK01VXKE5+ 6bqz2ltAzA9yOsuQezhOB3YNBs//L5YFX7ianoJvRiTL2XmX9t8seLqOhRC9QtBcgujb AypIzRZIzen/3blHBHkf2ePJcN+17v2HxxbPF2PZ5OOQVMOOgrgV2Jha/qub2gtcdFVb GMzjd7Twpo3LYpIXFfm4euYeMkYTehHxPer7EEm7Ls0PzI2H6NoW99ZUBfpnv7TouIFk L0QVtARiFNtrJf0CYVaNMCk85n8IU9zCI/KpaqBwjLiMqXcv5bleX9/UMYJBXgb9AUVg kmrA== 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=c0LSCrQPgXIBrJgK5hfU4xeEIysf4FBSfhIFpAhh68c=; b=L4GmCNTcHpw8df8d1EmHK0aREySJDilBMSux1N1ZbdfQGAUOTAoXxEIAI8rcp/OxwI wBQFZHQpyRxnasuse+BpkwxpEc7sWm9z2Jw9UNTPDMQN/WSYEpvhJutdnI8pnBbK9X6Y /VDj8jPBdRKwATX1j1Ghr/tz1z9VeJYyErAytI5MrOQAANyY7XuIpI4JAUwzf34HzDYD jDYnG6txvwVNHELnTr5lU4lKRAlrj/s4WkXbpkDUR0IlLMvmr6VxKqOv/fn8Q5fHDpKB gwJ5PaB/dnVb3YG0B1cqZaV8cbS5vNQIF+OQEMFj4cjhh40SirkatVJD6s1rO8xZ4VPt 98WA== 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 e10-20020a17090658ca00b007a7d37e4684si9547313ejs.803.2022.10.31.14.07.39; Mon, 31 Oct 2022 14:08:03 -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 S230193AbiJaUzR (ORCPT + 99 others); Mon, 31 Oct 2022 16:55:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230162AbiJaUzA (ORCPT ); Mon, 31 Oct 2022 16:55:00 -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 B872C12762 for ; Mon, 31 Oct 2022 13:54:59 -0700 (PDT) Received: from dslb-084-059-234-234.084.059.pools.vodafone-ip.de ([84.59.234.234] 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 1opbo8-0006z9-8f; Mon, 31 Oct 2022 21:54:56 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 3/3] staging: r8188eu: use ieee80211_get_SA Date: Mon, 31 Oct 2022 21:54:12 +0100 Message-Id: <20221031205412.124871-4-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221031205412.124871-1-martin@kaiser.cx> References: <20221031205412.124871-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?1748238843449645209?= X-GMAIL-MSGID: =?utf-8?q?1748238843449645209?= Use ieee80211_get_SA in update_recvframe_phyinfo_88e instead of the driver-specific get_sa function. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c b/drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c index 4e9d8c8285c4..9a61eef8550b 100644 --- a/drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c +++ b/drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c @@ -135,7 +135,7 @@ void update_recvframe_phyinfo_88e(struct recv_frame *precvframe, struct phy_stat sa = padapter->mlmepriv.cur_network.network.MacAddress; /* to do Ad-hoc */ } else { - sa = get_sa(wlanhdr); + sa = ieee80211_get_SA(hdr); } pstapriv = &padapter->stapriv;