@@ -370,6 +370,7 @@ mt7915_init_wiphy(struct mt7915_phy *phy)
wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_FILS_DISCOVERY);
wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT);
wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_CAN_REPLACE_PTK0);
+ wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER);
if (!is_mt7915(&dev->mt76))
wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_STA_TX_PWR);
@@ -592,6 +592,34 @@ mt7915_update_bss_color(struct ieee80211_hw *hw,
}
}
+static void
+mt7915_update_mu_group(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+ struct ieee80211_bss_conf *info)
+{
+ struct mt7915_phy *phy = mt7915_hw_phy(hw);
+ struct mt7915_dev *dev = mt7915_hw_dev(hw);
+ u8 i, band = phy->mt76->band_idx;
+ u32 *mu;
+
+ mu = (u32 *)info->mu_group.membership;
+ for (i = 0; i < WLAN_MEMBERSHIP_LEN / sizeof(*mu); i++) {
+ if (is_mt7916(&dev->mt76))
+ mt76_wr(dev, MT_WF_PHY_RX_GID_TAB_VLD_MT7916(band, i),
+ mu[i]);
+ else
+ mt76_wr(dev, MT_WF_PHY_RX_GID_TAB_VLD(band, i), mu[i]);
+ }
+
+ mu = (u32 *)info->mu_group.position;
+ for (i = 0; i < WLAN_USER_POSITION_LEN / sizeof(*mu); i++) {
+ if (is_mt7916(&dev->mt76))
+ mt76_wr(dev, MT_WF_PHY_RX_GID_TAB_POS_MT7916(band, i),
+ mu[i]);
+ else
+ mt76_wr(dev, MT_WF_PHY_RX_GID_TAB_POS(band, i), mu[i]);
+ }
+}
+
static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *info,
@@ -650,6 +678,9 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
BSS_CHANGED_FILS_DISCOVERY))
mt7915_mcu_add_beacon(hw, vif, info->enable_beacon, changed);
+ if (changed & BSS_CHANGED_MU_GROUPS)
+ mt7915_update_mu_group(hw, vif, info);
+
mutex_unlock(&dev->mt76.mutex);
}
@@ -1183,6 +1183,16 @@ enum offs_rev {
#define MT_WF_PHY_BASE 0x83080000
#define MT_WF_PHY(ofs) (MT_WF_PHY_BASE + (ofs))
+#define MT_WF_PHY_RX_GID_TAB_VLD(_phy, i) MT_WF_PHY(0x1054 + \
+ (i) * 4 + ((_phy) << 16))
+#define MT_WF_PHY_RX_GID_TAB_VLD_MT7916(_phy, i) MT_WF_PHY(0x1054 + \
+ (i) * 4 + ((_phy) << 20))
+
+#define MT_WF_PHY_RX_GID_TAB_POS(_phy, i) MT_WF_PHY(0x105c + \
+ (i) * 4 + ((_phy) << 16))
+#define MT_WF_PHY_RX_GID_TAB_POS_MT7916(_phy, i) MT_WF_PHY(0x105c + \
+ (i) * 4 + ((_phy) << 20))
+
#define MT_WF_PHY_RX_CTRL1(_phy) MT_WF_PHY(0x2004 + ((_phy) << 16))
#define MT_WF_PHY_RX_CTRL1_MT7916(_phy) MT_WF_PHY(0x2004 + ((_phy) << 20))
#define MT_WF_PHY_RX_CTRL1_IPI_EN GENMASK(2, 0)