]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mt76: mt7915: add spatial reuse support
authorRyder Lee <ryder.lee@mediatek.com>
Fri, 15 May 2020 19:33:28 +0000 (03:33 +0800)
committerFelix Fietkau <nbd@nbd.name>
Thu, 28 May 2020 15:55:30 +0000 (17:55 +0200)
Enable or disable OBSS PD when the bss config changes or we
assoc to an AP that broadcasts the IE.

With this patch, we can get ~20% gain in OBSS OTA environment.

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

index 98567374c2c9a2681851cd56196422144d936aa8..e045dc23410000ce9548f560a3af671dca550a9d 100644 (file)
@@ -437,8 +437,10 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
                mt7915_mcu_add_sta(dev, vif, NULL, join);
        }
 
-       if (changed & BSS_CHANGED_ASSOC)
+       if (changed & BSS_CHANGED_ASSOC) {
                mt7915_mcu_add_bss_info(phy, vif, info->assoc);
+               mt7915_mcu_add_obss_spr(dev, vif, info->he_obss_pd.enable);
+       }
 
        if (changed & BSS_CHANGED_ERP_SLOT) {
                int slottime = info->use_short_slot ? 9 : 20;
@@ -458,6 +460,9 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
        if (changed & (BSS_CHANGED_QOS | BSS_CHANGED_BEACON_ENABLED))
                mt7915_mcu_set_tx(dev, vif);
 
+       if (changed & BSS_CHANGED_HE_OBSS_PD)
+               mt7915_mcu_add_obss_spr(dev, vif, info->he_obss_pd.enable);
+
        if (changed & (BSS_CHANGED_BEACON |
                       BSS_CHANGED_BEACON_ENABLED))
                mt7915_mcu_add_beacon(hw, vif, info->enable_beacon);
index 99eeea42478f8536f9d432d5b5f1588b8617fe35..2edff868b7c9830868badafed58ce11f937886f7 100644 (file)
@@ -3159,3 +3159,28 @@ int mt7915_mcu_set_txbf_sounding(struct mt7915_dev *dev)
        return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_TXBF_ACTION,
                                   &req, sizeof(req), true);
 }
+
+int mt7915_mcu_add_obss_spr(struct mt7915_dev *dev, struct ieee80211_vif *vif,
+                           bool enable)
+{
+#define MT_SPR_ENABLE          1
+       struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
+       struct {
+               u8 action;
+               u8 arg_num;
+               u8 band_idx;
+               u8 status;
+               u8 drop_tx_idx;
+               u8 sta_idx;     /* 256 sta */
+               u8 rsv[2];
+               u32 val;
+       } __packed req = {
+               .action = MT_SPR_ENABLE,
+               .arg_num = 1,
+               .band_idx = mvif->band_idx,
+               .val = enable,
+       };
+
+       return __mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_SET_SPR,
+                                  &req, sizeof(req), true);
+}
index 34ace6e672d03dc55ddff25b9a4d15a82eccd277..c241dd7c4c36484c83a88dbeb25594366f6919cf 100644 (file)
@@ -212,6 +212,7 @@ enum {
        MCU_EXT_CMD_RATE_CTRL = 0x87,
        MCU_EXT_CMD_FW_DBG_CTRL = 0x95,
        MCU_EXT_CMD_SET_RDD_TH = 0x9d,
+       MCU_EXT_CMD_SET_SPR = 0xa8,
 };
 
 enum {
index 5392292a838eecc8f347bf040ecee2f2c4eba38e..85d74ecd03515ae6a9fbeb227836906041bd4297 100644 (file)
@@ -301,6 +301,8 @@ int mt7915_mcu_add_key(struct mt7915_dev *dev, struct ieee80211_vif *vif,
                       enum set_key_cmd cmd);
 int mt7915_mcu_add_beacon(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
                          int enable);
+int mt7915_mcu_add_obss_spr(struct mt7915_dev *dev, struct ieee80211_vif *vif,
+                            bool enable);
 int mt7915_mcu_add_rate_ctrl(struct mt7915_dev *dev, struct ieee80211_vif *vif,
                             struct ieee80211_sta *sta);
 int mt7915_mcu_add_smps(struct mt7915_dev *dev, struct ieee80211_vif *vif,