summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2018-11-15 19:01:21 +0100
committerFelix Fietkau <nbd@nbd.name>2018-11-30 12:29:37 +0100
commit54f1bf8a9fddf6e9af5b037a47be3074b1aabe96 (patch)
treef8d9fb89b8b4270336b17f6eb14b510ff85aac20 /drivers/net/wireless/mediatek/mt76/mt76x02_util.c
parentc30bdfea80cca1348ef6e0c611d75793e533e4c7 (diff)
downloadlinux-stable-54f1bf8a9fddf6e9af5b037a47be3074b1aabe96.tar.gz
linux-stable-54f1bf8a9fddf6e9af5b037a47be3074b1aabe96.tar.bz2
linux-stable-54f1bf8a9fddf6e9af5b037a47be3074b1aabe96.zip
mt76: mt76x02: remove mt76x02_txq_init
Open-coding it simplifies the code Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76x02_util.c')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76x02_util.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
index 0ea7ab9cf0c6..6eb892d6b676 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
@@ -191,8 +191,16 @@ int mt76x02_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
msta->wcid.hw_key_idx = -1;
mt76x02_mac_wcid_setup(dev, idx, mvif->idx, sta->addr);
mt76x02_mac_wcid_set_drop(dev, idx, false);
- for (i = 0; i < ARRAY_SIZE(sta->txq); i++)
- mt76x02_txq_init(dev, sta->txq[i]);
+ for (i = 0; i < ARRAY_SIZE(sta->txq); i++) {
+ struct mt76_txq *mtxq;
+
+ if (!sta->txq[i])
+ continue;
+
+ mtxq = (struct mt76_txq *) sta->txq[i]->drv_priv;
+ mtxq->wcid = &msta->wcid;
+ mt76_txq_init(&dev->mt76, sta->txq[i]);
+ }
if (vif->type == NL80211_IFTYPE_AP)
set_bit(MT_WCID_FLAG_CHECK_PS, &msta->wcid.flags);
@@ -230,11 +238,15 @@ void mt76x02_vif_init(struct mt76x02_dev *dev, struct ieee80211_vif *vif,
unsigned int idx)
{
struct mt76x02_vif *mvif = (struct mt76x02_vif *)vif->drv_priv;
+ struct mt76_txq *mtxq;
mvif->idx = idx;
mvif->group_wcid.idx = MT_VIF_WCID(idx);
mvif->group_wcid.hw_key_idx = -1;
- mt76x02_txq_init(dev, vif->txq);
+ mtxq = (struct mt76_txq *) vif->txq->drv_priv;
+ mtxq->wcid = &mvif->group_wcid;
+
+ mt76_txq_init(&dev->mt76, vif->txq);
}
EXPORT_SYMBOL_GPL(mt76x02_vif_init);