Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5235363pxb; Wed, 19 Jan 2022 14:05:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzSjjBeS8cVEi4zORYb0BObE5xhtyQTWRYhNcGj6xFEDT7eOBdHUO5BEm6w8IITJyyrxcYr X-Received: by 2002:a63:b57:: with SMTP id a23mr29221221pgl.443.1642629922508; Wed, 19 Jan 2022 14:05:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642629922; cv=none; d=google.com; s=arc-20160816; b=o2cmeaPguOg07tW6Z44t3BtHyE+mqAlwXaFVKDPODspGr2TxeCXpXwvyA4ZHzpcNCd rmeSca39sgJgIiIPWKHP/LCuQngXQd5/DNKmE81LlaW178MhTDs/1YaCZRmJV3UI+ZDF 7oMLry2Zvl7MO71La55Wi7xMuUb7od5I0juxrNvAGSjcJRfo7t9OcF2Hn49dqAL96U6b 4u3s3ypfBWdXKV3UG186CCV55huwp/WrxDPSAoaKdSQA947m1mfGM0hrBSpv5/CY022c aHUoJtC1HRnI23S0rdyYFoY1mBFGZWmV4B1rY/WLKWIakFdHMG6IuA4A2SBRzLWJh+k3 4Mmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=yrXZH7cqfDvxuoOTeQKwarIlHSq0GBVZD9vMhChJtFY=; b=NtU41cZuX+OA/vld/r3IjhNwCkAp+lzkTmXfTmTmJH/t9Bi33x3D1Jcqviwr5O3f0s AgXcpwdV6aUsEtnLHqiMVp6Eo0e4aH+rDfQlU3yud3ZASrMDBqdgOqoNvKcsHtCQ8X4F 2/4c/vyB4DOR0xCPub82LQ2ERcjLzhLoJf3UfmsKk6vsaH/Qg5hkbZG9x1tMdld5/WdS d1AHw54qI4iU3XbBXH634vYb9OCjGFmj04Xabwr8dEScgzPK3MksKIx8c3zi6j7waeAN evZfOCES1Sz5WfyY5ZtdBQnDLZZ4X4PjUT1UoooOC+F+JBnuBAQuKYZYdqWNF1+FGP5I ERvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r187si1197871pgr.683.2022.01.19.14.05.06; Wed, 19 Jan 2022 14:05:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245511AbiARH6v (ORCPT + 70 others); Tue, 18 Jan 2022 02:58:51 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:39828 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S238767AbiARH6v (ORCPT ); Tue, 18 Jan 2022 02:58:51 -0500 X-UUID: e0b731c4d03743e6ae5f4cef3af10eae-20220118 X-UUID: e0b731c4d03743e6ae5f4cef3af10eae-20220118 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1200913783; Tue, 18 Jan 2022 15:58:48 +0800 Received: from mtkexhb01.mediatek.inc (172.21.101.102) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 18 Jan 2022 15:58:47 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkexhb01.mediatek.inc (172.21.101.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 18 Jan 2022 15:58:46 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 18 Jan 2022 15:58:46 +0800 From: Ryder Lee To: Felix Fietkau CC: Lorenzo Bianconi , Shayne Chen , Evelyn Tsai , , , "Ryder Lee" Subject: [PATCH] mt76: mt7915: check band idx for bcc event Date: Tue, 18 Jan 2022 15:58:45 +0800 Message-ID: <74293a8c02d0e6ca3460aa30bd374cddec9a0a1e.1642485678.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Add missing band idx check for DBDC cases. Signed-off-by: Ryder Lee --- This depends on https://patchwork.kernel.org/project/linux-wireless/patch/055b47746ca7756fd8ed14ff197c0c090393369d.1642128031.git.Bo.Jiao@mediatek.com/ --- .../net/wireless/mediatek/mt76/mt7915/mcu.c | 20 ++++++++++++++++--- .../net/wireless/mediatek/mt76/mt7915/mcu.h | 9 +++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c index 43c95bd15170..6c5568d6abde 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c @@ -422,6 +422,22 @@ mt7915_mcu_cca_finish(void *priv, u8 *mac, struct ieee80211_vif *vif) ieee80211_color_change_finish(vif); } +static void +mt7915_mcu_rx_bcc_notify(struct mt7915_dev *dev, struct sk_buff *skb) +{ + struct mt76_phy *mphy = &dev->mt76.phy; + struct mt7915_mcu_bcc_notify *b; + + b = (struct mt7915_mcu_bcc_notify *)skb->data; + + if ((b->band_idx && !dev->phy.band_idx) && dev->mt76.phy2) + mphy = dev->mt76.phy2; + + ieee80211_iterate_active_interfaces_atomic(mphy->hw, + IEEE80211_IFACE_ITER_RESUME_ALL, + mt7915_mcu_cca_finish, mphy->hw); +} + static void mt7915_mcu_rx_ext_event(struct mt7915_dev *dev, struct sk_buff *skb) { @@ -441,9 +457,7 @@ mt7915_mcu_rx_ext_event(struct mt7915_dev *dev, struct sk_buff *skb) mt7915_mcu_rx_log_message(dev, skb); break; case MCU_EXT_EVENT_BCC_NOTIFY: - ieee80211_iterate_active_interfaces_atomic(dev->mt76.hw, - IEEE80211_IFACE_ITER_RESUME_ALL, - mt7915_mcu_cca_finish, dev); + mt7915_mcu_rx_bcc_notify(dev, skb); break; default: break; diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h index aa05c6ceebb9..fb558a6945fd 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h @@ -79,6 +79,15 @@ struct mt7915_mcu_csa_notify { u8 rsv; } __packed; +struct mt7915_mcu_bcc_notify { + struct mt7915_mcu_rxd rxd; + + u8 band_idx; + u8 omac_idx; + u8 cca_count; + u8 rsv; +} __packed; + struct mt7915_mcu_rdd_report { struct mt7915_mcu_rxd rxd; -- 2.29.2