Commit 7e4de0c8 authored by Bo Jiao's avatar Bo Jiao Committed by Felix Fietkau

mt76: mt7915: fix calling mt76_wcid_alloc with incorrect parameter

It will cause maximum connectable STA to be one less
when calling mt76_wcid_alloc with parameter MT7915_WTBL_STA - 1.
Signed-off-by: default avatarBo Jiao <Bo.Jiao@mediatek.com>
Signed-off-by: default avatarSujuan Chen <sujuan.chen@mediatek.com>
Reviewed-by: default avatarRyder Lee <ryder.lee@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 3924715f
...@@ -480,7 +480,7 @@ static int mt7915_init_hardware(struct mt7915_dev *dev) ...@@ -480,7 +480,7 @@ static int mt7915_init_hardware(struct mt7915_dev *dev)
} }
/* Beacon and mgmt frames should occupy wcid 0 */ /* 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) if (idx)
return -ENOSPC; return -ENOSPC;
......
...@@ -613,7 +613,7 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif, ...@@ -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; struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
int ret, idx; 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) if (idx < 0)
return -ENOSPC; return -ENOSPC;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment