From patchwork Wed Oct 19 08:33:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5012 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp244659wrs; Wed, 19 Oct 2022 03:33:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5AFSnTdPwm/Qib3tX9pcTIfgfBsvc+eO1xL0gN/nsssn8EdkKgJf8gigKPVrWqTxsFNGXR X-Received: by 2002:a05:6402:1356:b0:459:3c9e:81d4 with SMTP id y22-20020a056402135600b004593c9e81d4mr6894495edw.148.1666175610592; Wed, 19 Oct 2022 03:33:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666175610; cv=none; d=google.com; s=arc-20160816; b=LxsDQiPzGTCXwI+3mVk+aYtUPFxlF/L8zbRhCbVnDdbUdWogf96KEMfThwdcgdQ977 KuROyTQf0gaFiIDcspBcpksBNTcTkvxIlTMtrddcpXu52M3ZdkBO+ACtyURq/xKnfrzE bbDmVk5SMXj3R5MXCPbCE/UcoDyFG1GxIGTRje91ZHleQuFYRwuLuVtg7GC78286lCTf 4d4Xi4/nyv+927iTMdTc2jF2kJLwwrbsYbMyD3+YSFsoJn+3bRhanl0L7Ah2b5Tyv81G WvXAu9YIiXnJnqLpDJ7ykJcuPjP6avsZH226OuB4FG5TMWO9YHEwDb89gDVtAKL78y8l MgCg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Fu5f7y3OX1CXfpf+0Y2nRBjO6dnJzN7cHmwtPGvoLQE=; b=bhILrfwRhRxucf+wAa1aJpHjMl0EuGgXJGWiyG0T7GinB1g/ZTfAive3aB4oa/Ztdy zvdcyJNiRHX3+BGh9kJLnqHU991i+EL9nzTMNqPW4iu5HcYprwwErbpCxSGSOEFGDIUs a1FP2LG54HCr4So2TPnGZljrHT70cfdaqrKY93eAmlPJ/YHKwWr2qK13wPPLJ8Oxoj1S rF2jTDKPrcNbWh6l9FHajrjw1uVbuq0M5L/ct9QD1UWyGAL27ZkSGKj6Idd8/drSxhDK dTq4/FrqLKM5XGjBhaCYC+V5ZDpcVnN8vyJyfj4D0fBXffYhnR5mW/M8sXMSVaiUdITP xIow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rOa9WMUB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sz15-20020a1709078b0f00b0078ddc074afdsi10828451ejc.577.2022.10.19.03.33.03; Wed, 19 Oct 2022 03:33:30 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rOa9WMUB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230183AbiJSKNB (ORCPT + 99 others); Wed, 19 Oct 2022 06:13:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232151AbiJSKMd (ORCPT ); Wed, 19 Oct 2022 06:12:33 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C68CE09C4; Wed, 19 Oct 2022 02:52:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 16B65CE21A3; Wed, 19 Oct 2022 09:09:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B89CC433B5; Wed, 19 Oct 2022 09:09:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170595; bh=44uRYNzLL2dyaeADFwbtAehncvGKf6ItaLtVtAl1DKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rOa9WMUBAm2LNOfyNlwnnp0ebKdGdaPzWYuPk+R1kXxZe/1c7NrSd0+37hLTcEHNM wwT48trz+E9eJLZ2dDYCE1zZTJcoihgjL/In5Tw0Col1Oe4kBQcMxcRUaCSlhz7TN6 WcesL+OwyTyIr1JxPwQzOuA5gCdlLlrboqH5z9aU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Po-Hao Huang , Ping-Ke Shih , Kalle Valo , Sasha Levin Subject: [PATCH 6.0 707/862] wifi: rtw89: fix rx filter after scan Date: Wed, 19 Oct 2022 10:33:14 +0200 Message-Id: <20221019083321.204392155@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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?1747111757191144552?= X-GMAIL-MSGID: =?utf-8?q?1747111757191144552?= From: Po-Hao Huang [ Upstream commit 812825c2b204c491f1a5586c602e4ac75060493a ] In monitor mode we should be able to received all packets even if it's not destined to us. But after scan, the configuration was wrongly set, so we fix it. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220916033811.13862-7-pkshih@realtek.com Signed-off-by: Sasha Levin --- drivers/net/wireless/realtek/rtw89/fw.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c index 6473015a6b2a..c993fe9cf6b4 100644 --- a/drivers/net/wireless/realtek/rtw89/fw.c +++ b/drivers/net/wireless/realtek/rtw89/fw.c @@ -2289,6 +2289,7 @@ void rtw89_hw_scan_start(struct rtw89_dev *rtwdev, struct ieee80211_vif *vif, { struct rtw89_vif *rtwvif = (struct rtw89_vif *)vif->drv_priv; struct cfg80211_scan_request *req = &scan_req->req; + u32 rx_fltr = rtwdev->hal.rx_fltr; u8 mac_addr[ETH_ALEN]; rtwdev->scan_info.scanning_vif = vif; @@ -2303,13 +2304,13 @@ void rtw89_hw_scan_start(struct rtw89_dev *rtwdev, struct ieee80211_vif *vif, ether_addr_copy(mac_addr, vif->addr); rtw89_core_scan_start(rtwdev, rtwvif, mac_addr, true); - rtwdev->hal.rx_fltr &= ~B_AX_A_BCN_CHK_EN; - rtwdev->hal.rx_fltr &= ~B_AX_A_BC; - rtwdev->hal.rx_fltr &= ~B_AX_A_A1_MATCH; + rx_fltr &= ~B_AX_A_BCN_CHK_EN; + rx_fltr &= ~B_AX_A_BC; + rx_fltr &= ~B_AX_A_A1_MATCH; rtw89_write32_mask(rtwdev, rtw89_mac_reg_by_idx(R_AX_RX_FLTR_OPT, RTW89_MAC_0), B_AX_RX_FLTR_CFG_MASK, - rtwdev->hal.rx_fltr); + rx_fltr); } void rtw89_hw_scan_complete(struct rtw89_dev *rtwdev, struct ieee80211_vif *vif, @@ -2323,9 +2324,6 @@ void rtw89_hw_scan_complete(struct rtw89_dev *rtwdev, struct ieee80211_vif *vif, if (!vif) return; - rtwdev->hal.rx_fltr |= B_AX_A_BCN_CHK_EN; - rtwdev->hal.rx_fltr |= B_AX_A_BC; - rtwdev->hal.rx_fltr |= B_AX_A_A1_MATCH; rtw89_write32_mask(rtwdev, rtw89_mac_reg_by_idx(R_AX_RX_FLTR_OPT, RTW89_MAC_0), B_AX_RX_FLTR_CFG_MASK,