Skip to content

Commit 78dae93

Browse files
Stanislaw GruszkaKalle Valo
authored andcommitted
mt76x0: initalize custom tx queues
Signed-off-by: Stanislaw Gruszka <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent b2d91fb commit 78dae93

File tree

1 file changed

+8
-0
lines changed
  • drivers/net/wireless/mediatek/mt76/mt76x0

1 file changed

+8
-0
lines changed

drivers/net/wireless/mediatek/mt76/mt76x0/main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ static int mt76x0_add_interface(struct ieee80211_hw *hw,
6969
mvif->idx = idx;
7070
mvif->group_wcid.idx = GROUP_WCID(idx);
7171
mvif->group_wcid.hw_key_idx = -1;
72+
mt76x02_txq_init(&dev->mt76, vif->txq);
7273

7374
return 0;
7475
}
@@ -81,6 +82,7 @@ static void mt76x0_remove_interface(struct ieee80211_hw *hw,
8182
unsigned int wcid = mvif->group_wcid.idx;
8283

8384
dev->wcid_mask[wcid / BITS_PER_LONG] &= ~BIT(wcid % BITS_PER_LONG);
85+
mt76_txq_remove(&dev->mt76, vif->txq);
8486
}
8587

8688
static int mt76x0_config(struct ieee80211_hw *hw, u32 changed)
@@ -163,6 +165,7 @@ mt76x0_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
163165
struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv;
164166
int ret = 0;
165167
int idx = 0;
168+
int i;
166169

167170
mutex_lock(&dev->mt76.mutex);
168171

@@ -178,6 +181,8 @@ mt76x0_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
178181
mt76x02_mac_wcid_set_drop(&dev->mt76, idx, false);
179182
mt76_clear(dev, MT_WCID_DROP(idx), MT_WCID_DROP_MASK(idx));
180183
rcu_assign_pointer(dev->wcid[idx], &msta->wcid);
184+
for (i = 0; i < ARRAY_SIZE(sta->txq); i++)
185+
mt76x02_txq_init(&dev->mt76, sta->txq[i]);
181186
mt76x0_mac_set_ampdu_factor(dev);
182187

183188
out:
@@ -193,11 +198,14 @@ mt76x0_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
193198
struct mt76x0_dev *dev = hw->priv;
194199
struct mt76_sta *msta = (struct mt76_sta *) sta->drv_priv;
195200
int idx = msta->wcid.idx;
201+
int i;
196202

197203
mutex_lock(&dev->mt76.mutex);
198204
rcu_assign_pointer(dev->wcid[idx], NULL);
199205
mt76x02_mac_wcid_set_drop(&dev->mt76, idx, true);
200206
mt76_wcid_free(dev->wcid_mask, idx);
207+
for (i = 0; i < ARRAY_SIZE(sta->txq); i++)
208+
mt76_txq_remove(&dev->mt76, sta->txq[i]);
201209
mt76x02_mac_wcid_setup(&dev->mt76, idx, 0, NULL);
202210
mt76x0_mac_set_ampdu_factor(dev);
203211
mutex_unlock(&dev->mt76.mutex);

0 commit comments

Comments
 (0)