]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mt76: mt76x02: remove mt76x02_txq_init
authorFelix Fietkau <nbd@nbd.name>
Thu, 15 Nov 2018 18:01:21 +0000 (19:01 +0100)
committerFelix Fietkau <nbd@nbd.name>
Fri, 30 Nov 2018 11:29:37 +0000 (12:29 +0100)
Open-coding it simplifies the code

Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
drivers/net/wireless/mediatek/mt76/mt76x02_mac.h
drivers/net/wireless/mediatek/mt76/mt76x02_util.c

index 4c35d3f7fb15dad76e0a73b49e9f977dd7b670f4..c08bf371e527f0f57ea8e45cc662e7ee686c1ccf 100644 (file)
@@ -126,29 +126,6 @@ void mt76x02_mac_wcid_set_drop(struct mt76x02_dev *dev, u8 idx, bool drop)
                mt76_wr(dev, MT_WCID_DROP(idx), (val & ~bit) | (bit * drop));
 }
 
-void mt76x02_txq_init(struct mt76x02_dev *dev, struct ieee80211_txq *txq)
-{
-       struct mt76_txq *mtxq;
-
-       if (!txq)
-               return;
-
-       mtxq = (struct mt76_txq *) txq->drv_priv;
-       if (txq->sta) {
-               struct mt76x02_sta *sta;
-
-               sta = (struct mt76x02_sta *) txq->sta->drv_priv;
-               mtxq->wcid = &sta->wcid;
-       } else {
-               struct mt76x02_vif *mvif;
-
-               mvif = (struct mt76x02_vif *) txq->vif->drv_priv;
-               mtxq->wcid = &mvif->group_wcid;
-       }
-
-       mt76_txq_init(&dev->mt76, txq);
-}
-
 static __le16
 mt76x02_mac_tx_rate_val(struct mt76x02_dev *dev,
                        const struct ieee80211_tx_rate *rate, u8 *nss_val)
index cf5c06a0a58ad92f9c4ca3daff9076792092fd15..4e597004c4459dd8533c6375f9e19a4cd3829cff 100644 (file)
@@ -178,8 +178,6 @@ static inline bool mt76x02_wait_for_mac(struct mt76_dev *dev)
        return false;
 }
 
-void mt76x02_txq_init(struct mt76x02_dev *dev, struct ieee80211_txq *txq);
-
 void mt76x02_mac_set_short_preamble(struct mt76x02_dev *dev, bool enable);
 int mt76x02_mac_shared_key_setup(struct mt76x02_dev *dev, u8 vif_idx,
                                 u8 key_idx, struct ieee80211_key_conf *key);
index 0ea7ab9cf0c6536495e380dcd316edac56aac3a3..6eb892d6b676c080d75ae97adf54f04a64f21966 100644 (file)
@@ -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);