From patchwork Sat Oct 22 07:27:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7567 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1106082wrr; Sat, 22 Oct 2022 01:36:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4PRDza7+ts8rh9MYWa89nPkRK8mW5J6vZuVCCydGcNc8Ib/NmfQcrAARtDUMxAdf8NTZav X-Received: by 2002:a17:90b:3e82:b0:20d:2fa1:d071 with SMTP id rj2-20020a17090b3e8200b0020d2fa1d071mr62593301pjb.58.1666427812556; Sat, 22 Oct 2022 01:36:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427812; cv=none; d=google.com; s=arc-20160816; b=SGMdy8v8JLwIiM7DFHzoK+rkF19x9498cnIL3TP/8D4YgCSWkLylaPfwCfn/paiLR6 Bf1vmc3qmS5R7tIIyTCGnfdpGs/Ky5vneNFnz5GciojxlBBlP9IJZYSVXdZbkc3hED5A rpSmKlNZr6GdLbKWwx1toxU+GuJo3vcMwrCM5zp5cQ2s/5M0xzqsf0xGRupuw06ZpDad nE5Atdo7cY5kU1et9EOxGNo57Yzr3MJD35bbxf0UzU6t4kxrvmPncDQQtrdpb1qxuFM0 MhsS+xnE1Le6YIC+VDvlCYqN9xDdtGEb+5Uydj7eoeUDfbhNAuHx8QoC/mnbgRr6NGZW z9bg== 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=LXnCEAx+IYbyZQ3Nlb+J5mZCfELkW2ZqxzVZlWMS+G0=; b=RRr52+H+/c9XoZ/gdTgBoeBwGrH6asS+3h5JLW714cXN3OXBMCGwXHNcTw0ZJ/zyUj xJQ44tHwvKuNVYGa33qyQXZieen1I3dhjYMNSo9/3txRIAgLVkk2YXcWoWhZR+vgGCCm tlEZNqbqyx3sxtOHs3EmLtxvND4MxpHkx1EaMGKRa7VHQ9BBmiCHPkbGwbdqcjK6hrvj rZb1yF/Lw7ufLs2e0yAWIzglF7aqNYZtfw5Z25ypxCNles34sIckDGCYvLac3OIYkCKW 7MIAbG7oYcDPmv7sKXVvPBUCbubDVNOMZOS8Ech4eu1XkqR2ScFwi7EnPuh2besfiVGI P3ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TU5uXb3v; 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 n38-20020a635926000000b0041da571906fsi335816pgb.121.2022.10.22.01.36.37; Sat, 22 Oct 2022 01:36:52 -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=TU5uXb3v; 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 S233937AbiJVIbw (ORCPT + 99 others); Sat, 22 Oct 2022 04:31:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233954AbiJVI27 (ORCPT ); Sat, 22 Oct 2022 04:28:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB8392E22AC; Sat, 22 Oct 2022 01:01:42 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 1B7B560BA7; Sat, 22 Oct 2022 08:01:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D24FC433C1; Sat, 22 Oct 2022 08:01:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425680; bh=f2P4qW12vwATxExY6+WR4wROaknevNhDDR2RJccBt28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TU5uXb3vC5F3gRcr20CqGYINbREDdgut0oJdd1r6nzI1l9YOaXPML8ktIhX3Fv5c3 0UiwtlPkdHM/MVMNw/YMuWHungG9xkdyv+dr/PksN/j4KGy63bbBHLbbfGxsF8f/Sy VPxEcQPZSLPiTfJtde2ELraGziLfHKX6Pz1y+B9A= 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 5.19 580/717] wifi: rtw89: fix rx filter after scan Date: Sat, 22 Oct 2022 09:27:39 +0200 Message-Id: <20221022072524.085568032@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747376210136121427?= X-GMAIL-MSGID: =?utf-8?q?1747376210136121427?= 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 4718aced1428..e7f86d84d91d 100644 --- a/drivers/net/wireless/realtek/rtw89/fw.c +++ b/drivers/net/wireless/realtek/rtw89/fw.c @@ -2288,6 +2288,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; @@ -2302,13 +2303,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, @@ -2322,9 +2323,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,