]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mt76: mt7915: fix calling mt76_wcid_alloc with incorrect parameter
authorBo Jiao <Bo.Jiao@mediatek.com>
Tue, 6 Jul 2021 10:56:54 +0000 (18:56 +0800)
committerFelix Fietkau <nbd@nbd.name>
Wed, 20 Oct 2021 08:36:24 +0000 (10:36 +0200)
It will cause maximum connectable STA to be one less
when calling mt76_wcid_alloc with parameter MT7915_WTBL_STA - 1.

Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7915/init.c
drivers/net/wireless/mediatek/mt76/mt7915/main.c

index 4798d6344305d509c06daf53be98fdec59042c40..1d2214519f5ab32757016a4da83e399eb6397229 100644 (file)
@@ -480,7 +480,7 @@ static int mt7915_init_hardware(struct mt7915_dev *dev)
        }
 
        /* Beacon and mgmt frames should occupy wcid 0 */
-       idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA - 1);
+       idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA);
        if (idx)
                return -ENOSPC;
 
index c25f8da590dd9120bae7265f400ffa27ed5c544d..d8abebcffe4b8fbbd0c738028f3524418ddda746 100644 (file)
@@ -613,7 +613,7 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
        struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
        int ret, idx;
 
-       idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA - 1);
+       idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA);
        if (idx < 0)
                return -ENOSPC;