mt76: mt7915: check band idx for bcc event
authorRyder Lee <ryder.lee@mediatek.com>
Tue, 18 Jan 2022 07:58:45 +0000 (15:58 +0800)
committerFelix Fietkau <nbd@nbd.name>
Thu, 24 Feb 2022 13:40:22 +0000 (14:40 +0100)
Add missing band idx check for DBDC cases.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
drivers/net/wireless/mediatek/mt76/mt7915/mcu.h

index 66153e22f1db87db2d86aa53ff8a68076ed0a5ca..96f1fb0d0cee33d1ce9b3b389cd5f2f2112c596b 100644 (file)
@@ -415,6 +415,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)
 {
@@ -434,9 +450,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;
index 9417f7bc807af7e80cf48c2f0f647ee0461c9933..960072a442223a5303429ed50e5fe567370ef5f9 100644 (file)
@@ -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;