mt76: pass original queue id from __mt76_tx_queue_skb to the driver
authorFelix Fietkau <nbd@nbd.name>
Sun, 3 Jul 2022 15:52:24 +0000 (17:52 +0200)
committerFelix Fietkau <nbd@nbd.name>
Mon, 11 Jul 2022 11:40:03 +0000 (13:40 +0200)
MT7615 and newer map multiple software tx queues to the hardware id

Signed-off-by: Felix Fietkau <nbd@nbd.name>
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/sdio.c
drivers/net/wireless/mediatek/mt76/testmode.c
drivers/net/wireless/mediatek/mt76/tx.c
drivers/net/wireless/mediatek/mt76/usb.c

index 30de8be4aac1631706d8283450e52fea00dd6735..f22273cde1a83898e9045ad412d02c9674f4b709 100644 (file)
@@ -349,8 +349,8 @@ error:
 
 static int
 mt76_dma_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q,
-                     struct sk_buff *skb, struct mt76_wcid *wcid,
-                     struct ieee80211_sta *sta)
+                     enum mt76_txq_id qid, struct sk_buff *skb,
+                     struct mt76_wcid *wcid, struct ieee80211_sta *sta)
 {
        struct ieee80211_tx_status status = {
                .sta = sta,
@@ -406,7 +406,7 @@ mt76_dma_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q,
 
        dma_sync_single_for_cpu(dev->dma_dev, t->dma_addr, dev->drv->txwi_size,
                                DMA_TO_DEVICE);
-       ret = dev->drv->tx_prepare_skb(dev, txwi, q->qid, wcid, sta, &tx_info);
+       ret = dev->drv->tx_prepare_skb(dev, txwi, qid, wcid, sta, &tx_info);
        dma_sync_single_for_device(dev->dma_dev, t->dma_addr, dev->drv->txwi_size,
                                   DMA_TO_DEVICE);
        if (ret < 0)
index 4e8997c45c1b679661c4eec534b867bcb4579b78..cb712c0438c2967a525ee1d00e051245eabd106a 100644 (file)
@@ -223,8 +223,8 @@ struct mt76_queue_ops {
                     u32 ring_base);
 
        int (*tx_queue_skb)(struct mt76_dev *dev, struct mt76_queue *q,
-                           struct sk_buff *skb, struct mt76_wcid *wcid,
-                           struct ieee80211_sta *sta);
+                           enum mt76_txq_id qid, struct sk_buff *skb,
+                           struct mt76_wcid *wcid, struct ieee80211_sta *sta);
 
        int (*tx_queue_skb_raw)(struct mt76_dev *dev, struct mt76_queue *q,
                                struct sk_buff *skb, u32 tx_info);
index c67fc29bb7c34edac8723b40b1cd486cc129a20a..b65b0a88c1ded99ceef934367b72876300a57b20 100644 (file)
@@ -24,8 +24,8 @@ mt7603_update_beacon_iter(void *priv, u8 *mac, struct ieee80211_vif *vif)
        if (!skb)
                return;
 
-       mt76_tx_queue_skb(dev, dev->mphy.q_tx[MT_TXQ_BEACON], skb,
-                         &mvif->sta.wcid, NULL);
+       mt76_tx_queue_skb(dev, dev->mphy.q_tx[MT_TXQ_BEACON],
+                         MT_TXQ_BEACON, skb, &mvif->sta.wcid, NULL);
 
        spin_lock_bh(&dev->ps_lock);
        mt76_wr(dev, MT_DMA_FQCR0, MT_DMA_FQCR0_BUSY |
@@ -123,7 +123,7 @@ void mt7603_pre_tbtt_tasklet(struct tasklet_struct *t)
                struct ieee80211_vif *vif = info->control.vif;
                struct mt7603_vif *mvif = (struct mt7603_vif *)vif->drv_priv;
 
-               mt76_tx_queue_skb(dev, q, skb, &mvif->sta.wcid, NULL);
+               mt76_tx_queue_skb(dev, q, MT_TXQ_CAB, skb, &mvif->sta.wcid, NULL);
        }
        mt76_queue_kick(dev, q);
        spin_unlock(&q->lock);
index 96ec96df6a3cfcd9d0ef4e9e3998f7f54d0889c9..e9c5e85ec07c212c5f4f1b7803f8534162c6408f 100644 (file)
@@ -59,7 +59,8 @@ static void mt76x02_pre_tbtt_tasklet(struct tasklet_struct *t)
                struct ieee80211_vif *vif = info->control.vif;
                struct mt76x02_vif *mvif = (struct mt76x02_vif *)vif->drv_priv;
 
-               mt76_tx_queue_skb(dev, q, skb, &mvif->group_wcid, NULL);
+               mt76_tx_queue_skb(dev, q, MT_TXQ_PSD, skb, &mvif->group_wcid,
+                                 NULL);
        }
        spin_unlock(&q->lock);
 }
index def7f325f5c546e7062debe70b504b9a08f3e0d0..974fdbf0ffab8e368b4d2c9f11745dc42efce6a2 100644 (file)
@@ -517,8 +517,8 @@ static void mt76s_tx_status_data(struct work_struct *work)
 
 static int
 mt76s_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q,
-                  struct sk_buff *skb, struct mt76_wcid *wcid,
-                  struct ieee80211_sta *sta)
+                  enum mt76_txq_id qid, struct sk_buff *skb,
+                  struct mt76_wcid *wcid, struct ieee80211_sta *sta)
 {
        struct mt76_tx_info tx_info = {
                .skb = skb,
@@ -530,7 +530,7 @@ mt76s_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q,
                return -ENOSPC;
 
        skb->prev = skb->next = NULL;
-       err = dev->drv->tx_prepare_skb(dev, NULL, q->qid, wcid, sta, &tx_info);
+       err = dev->drv->tx_prepare_skb(dev, NULL, qid, wcid, sta, &tx_info);
        if (err < 0)
                return err;
 
index 382b45639f260f2dc745367e359e342ccd6fd1c3..47ac0ca1af3265d81a229e5fa17a9f3299d0c4c3 100644 (file)
@@ -50,8 +50,8 @@ void mt76_testmode_tx_pending(struct mt76_phy *phy)
               q->queued < q->ndesc / 2) {
                int ret;
 
-               ret = dev->queue_ops->tx_queue_skb(dev, q, skb_get(skb), wcid,
-                                                  NULL);
+               ret = dev->queue_ops->tx_queue_skb(dev, q, qid, skb_get(skb),
+                                                  wcid, NULL);
                if (ret < 0)
                        break;
 
index 1d08d99e298cbe6785bb389062b7b776b5f4d2ba..e1d5996c4675afc7a9b6f68176ea69c0213d4ac7 100644 (file)
@@ -284,7 +284,7 @@ __mt76_tx_queue_skb(struct mt76_phy *phy, int qid, struct sk_buff *skb,
        int idx;
 
        non_aql = !info->tx_time_est;
-       idx = dev->queue_ops->tx_queue_skb(dev, q, skb, wcid, sta);
+       idx = dev->queue_ops->tx_queue_skb(dev, q, qid, skb, wcid, sta);
        if (idx < 0 || !sta)
                return idx;
 
index 1bb92ca7451b2f6d2281f2bb5c6a6e63bdd21909..b030b567989b0472d2935a90087cce83629f91bb 100644 (file)
@@ -845,8 +845,8 @@ mt76u_tx_setup_buffers(struct mt76_dev *dev, struct sk_buff *skb,
 
 static int
 mt76u_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q,
-                  struct sk_buff *skb, struct mt76_wcid *wcid,
-                  struct ieee80211_sta *sta)
+                  enum mt76_txq_id qid, struct sk_buff *skb,
+                  struct mt76_wcid *wcid, struct ieee80211_sta *sta)
 {
        struct mt76_tx_info tx_info = {
                .skb = skb,
@@ -858,7 +858,7 @@ mt76u_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q,
                return -ENOSPC;
 
        skb->prev = skb->next = NULL;
-       err = dev->drv->tx_prepare_skb(dev, NULL, q->qid, wcid, sta, &tx_info);
+       err = dev->drv->tx_prepare_skb(dev, NULL, qid, wcid, sta, &tx_info);
        if (err < 0)
                return err;