mt: mt7921: Add AP mode support
[platform/kernel/linux-rpi.git] / drivers / net / wireless / mediatek / mt76-6e-usb / mt7921 / mac.c
index 42f7293..a560bb5 100644 (file)
@@ -1361,12 +1361,21 @@ mt7921_vif_connect_iter(void *priv, u8 *mac,
 {
        struct mt7921_vif *mvif = (struct mt7921_vif *)vif->drv_priv;
        struct mt7921_dev *dev = mvif->phy->dev;
+       struct ieee80211_hw *hw = mt76_hw(dev);
 
        if (vif->type == NL80211_IFTYPE_STATION)
                ieee80211_disconnect(vif, true);
 
        mt76_connac_mcu_uni_add_dev(&dev->mphy, vif, &mvif->sta.wcid, true);
        mt7921_mcu_set_tx(dev, vif);
+
+       if (vif->type == NL80211_IFTYPE_AP) {
+               mt76_connac_mcu_uni_add_bss(dev->phy.mt76, vif, &mvif->sta.wcid,
+                                           true);
+               mt7921_mcu_sta_update(dev, NULL, vif, true,
+                                     MT76_STA_INFO_STATE_NONE);
+               mt7921_mcu_uni_add_beacon_offload(dev, hw, vif, true);
+       }
 }
 
 /* system error recovery */