]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mt76: remove mt76_queue dependency from tx_queue_skb function pointer
authorLorenzo Bianconi <lorenzo@kernel.org>
Sat, 2 Mar 2019 13:47:38 +0000 (14:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:43:18 +0000 (06:43 -0700)
[ Upstream commit 89a37842b0c13c9e568bf12f4fcbe6507147e41d ]

Remove mt76_queue dependency from tx_queue_skb function pointer and
rely on mt76_tx_qid instead. This is a preliminary patch to introduce
mt76_sw_queue support

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/mediatek/mt76/dma.c
drivers/net/wireless/mediatek/mt76/mt76.h
drivers/net/wireless/mediatek/mt76/mt7603/beacon.c
drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
drivers/net/wireless/mediatek/mt76/tx.c
drivers/net/wireless/mediatek/mt76/usb.c

index 76629b98c78d78d81d7c61e0cd4771ba8d5f3c39..8c7ee8302fb87695c2e7b3dcfbfc1fd814af5667 100644 (file)
@@ -271,10 +271,11 @@ mt76_dma_tx_queue_skb_raw(struct mt76_dev *dev, enum mt76_txq_id qid,
        return 0;
 }
 
-int mt76_dma_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q,
+int mt76_dma_tx_queue_skb(struct mt76_dev *dev, enum mt76_txq_id qid,
                          struct sk_buff *skb, struct mt76_wcid *wcid,
                          struct ieee80211_sta *sta)
 {
+       struct mt76_queue *q = &dev->q_tx[qid];
        struct mt76_queue_entry e;
        struct mt76_txwi_cache *t;
        struct mt76_queue_buf buf[32];
index bcbfd3c4a44b68199dbc53e0e5ea498cc9e78e89..eb882b2cbc0ec3398d6801fee7605756b3c948c6 100644 (file)
@@ -156,7 +156,7 @@ struct mt76_queue_ops {
                       struct mt76_queue_buf *buf, int nbufs, u32 info,
                       struct sk_buff *skb, void *txwi);
 
-       int (*tx_queue_skb)(struct mt76_dev *dev, struct mt76_queue *q,
+       int (*tx_queue_skb)(struct mt76_dev *dev, enum mt76_txq_id qid,
                            struct sk_buff *skb, struct mt76_wcid *wcid,
                            struct ieee80211_sta *sta);
 
@@ -645,7 +645,7 @@ static inline struct mt76_tx_cb *mt76_tx_skb_cb(struct sk_buff *skb)
        return ((void *) IEEE80211_SKB_CB(skb)->status.status_driver_data);
 }
 
-int mt76_dma_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q,
+int mt76_dma_tx_queue_skb(struct mt76_dev *dev, enum mt76_txq_id qid,
                          struct sk_buff *skb, struct mt76_wcid *wcid,
                          struct ieee80211_sta *sta);
 
index 4dcb465095d19e9a0fe88c15a757a59fec802d87..99c0a3ba37cb778de9f5de21531e8e8b7e398f82 100644 (file)
@@ -23,7 +23,7 @@ mt7603_update_beacon_iter(void *priv, u8 *mac, struct ieee80211_vif *vif)
        if (!skb)
                return;
 
-       mt76_dma_tx_queue_skb(&dev->mt76, &dev->mt76.q_tx[MT_TXQ_BEACON], skb,
+       mt76_dma_tx_queue_skb(&dev->mt76, MT_TXQ_BEACON, skb,
                              &mvif->sta.wcid, NULL);
 
        spin_lock_bh(&dev->ps_lock);
@@ -118,8 +118,8 @@ void mt7603_pre_tbtt_tasklet(unsigned long arg)
                struct ieee80211_vif *vif = info->control.vif;
                struct mt7603_vif *mvif = (struct mt7603_vif *)vif->drv_priv;
 
-               mt76_dma_tx_queue_skb(&dev->mt76, q, skb, &mvif->sta.wcid,
-                                     NULL);
+               mt76_dma_tx_queue_skb(&dev->mt76, MT_TXQ_CAB, skb,
+                                     &mvif->sta.wcid, NULL);
        }
        mt76_queue_kick(dev, q);
        spin_unlock_bh(&q->lock);
index daaed1220147ea914c32f13f32f04bd5a360d7fb..952fe19cba9b6525b869e8a02c417300891f18aa 100644 (file)
@@ -146,8 +146,8 @@ static void mt76x02_pre_tbtt_tasklet(unsigned long arg)
                struct ieee80211_vif *vif = info->control.vif;
                struct mt76x02_vif *mvif = (struct mt76x02_vif *)vif->drv_priv;
 
-               mt76_dma_tx_queue_skb(&dev->mt76, q, skb, &mvif->group_wcid,
-                                     NULL);
+               mt76_dma_tx_queue_skb(&dev->mt76, MT_TXQ_PSD, skb,
+                                     &mvif->group_wcid, NULL);
        }
        spin_unlock_bh(&q->lock);
 }
index 2585df5123350ba8adf52cf14ef6133de7e03f77..0c1036da9a92a3d05b46599975916947d8d912df 100644 (file)
@@ -286,7 +286,7 @@ mt76_tx(struct mt76_dev *dev, struct ieee80211_sta *sta,
        q = &dev->q_tx[qid];
 
        spin_lock_bh(&q->lock);
-       dev->queue_ops->tx_queue_skb(dev, q, skb, wcid, sta);
+       dev->queue_ops->tx_queue_skb(dev, qid, skb, wcid, sta);
        dev->queue_ops->kick(dev, q);
 
        if (q->queued > q->ndesc - 8 && !q->stopped) {
@@ -327,7 +327,6 @@ mt76_queue_ps_skb(struct mt76_dev *dev, struct ieee80211_sta *sta,
 {
        struct mt76_wcid *wcid = (struct mt76_wcid *) sta->drv_priv;
        struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
-       struct mt76_queue *hwq = &dev->q_tx[MT_TXQ_PSD];
 
        info->control.flags |= IEEE80211_TX_CTRL_PS_RESPONSE;
        if (last)
@@ -335,7 +334,7 @@ mt76_queue_ps_skb(struct mt76_dev *dev, struct ieee80211_sta *sta,
                               IEEE80211_TX_CTL_REQ_TX_STATUS;
 
        mt76_skb_set_moredata(skb, !last);
-       dev->queue_ops->tx_queue_skb(dev, hwq, skb, wcid, sta);
+       dev->queue_ops->tx_queue_skb(dev, MT_TXQ_PSD, skb, wcid, sta);
 }
 
 void
@@ -390,6 +389,7 @@ mt76_txq_send_burst(struct mt76_dev *dev, struct mt76_queue *hwq,
                    struct mt76_txq *mtxq, bool *empty)
 {
        struct ieee80211_txq *txq = mtxq_to_txq(mtxq);
+       enum mt76_txq_id qid = mt76_txq_get_qid(txq);
        struct ieee80211_tx_info *info;
        struct mt76_wcid *wcid = mtxq->wcid;
        struct sk_buff *skb;
@@ -423,7 +423,7 @@ mt76_txq_send_burst(struct mt76_dev *dev, struct mt76_queue *hwq,
        if (ampdu)
                mt76_check_agg_ssn(mtxq, skb);
 
-       idx = dev->queue_ops->tx_queue_skb(dev, hwq, skb, wcid, txq->sta);
+       idx = dev->queue_ops->tx_queue_skb(dev, qid, skb, wcid, txq->sta);
 
        if (idx < 0)
                return idx;
@@ -458,7 +458,7 @@ mt76_txq_send_burst(struct mt76_dev *dev, struct mt76_queue *hwq,
                if (cur_ampdu)
                        mt76_check_agg_ssn(mtxq, skb);
 
-               idx = dev->queue_ops->tx_queue_skb(dev, hwq, skb, wcid,
+               idx = dev->queue_ops->tx_queue_skb(dev, qid, skb, wcid,
                                                   txq->sta);
                if (idx < 0)
                        return idx;
index 4c1abd4924054c6f377ca062ad98ca5bb8446dc7..b1551419338f0a2cbc218f53cfab44e849ceb034 100644 (file)
@@ -726,10 +726,11 @@ mt76u_tx_build_sg(struct mt76_dev *dev, struct sk_buff *skb,
 }
 
 static int
-mt76u_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q,
+mt76u_tx_queue_skb(struct mt76_dev *dev, enum mt76_txq_id qid,
                   struct sk_buff *skb, struct mt76_wcid *wcid,
                   struct ieee80211_sta *sta)
 {
+       struct mt76_queue *q = &dev->q_tx[qid];
        struct mt76u_buf *buf;
        u16 idx = q->tail;
        int err;