wifi: mt76: usb: create a dedicated queue for psd traffic
authorLorenzo Bianconi <lorenzo@kernel.org>
Sat, 23 Dec 2023 03:43:06 +0000 (11:43 +0800)
committerFelix Fietkau <nbd@nbd.name>
Thu, 22 Feb 2024 08:55:16 +0000 (09:55 +0100)
Create a dedicate queue for psd/mgmt traffic and do not rely on voice
one. This is a preliminary patch to fix mt7921u/mt7925 usb dmasl
configuration.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/usb.c

index 5a0bcb5071bd7d5ee8c22ef54ad3e05b3ea96cf4..684e56af193b5a1b9c1f3e036c4fc176220b2912 100644 (file)
@@ -767,7 +767,7 @@ static void mt76u_status_worker(struct mt76_worker *w)
        if (!test_bit(MT76_STATE_RUNNING, &dev->phy.state))
                return;
 
-       for (i = 0; i < IEEE80211_NUM_ACS; i++) {
+       for (i = 0; i <= MT_TXQ_PSD; i++) {
                q = dev->phy.q_tx[i];
                if (!q)
                        continue;
@@ -928,14 +928,11 @@ static u8 mt76u_ac_to_hwq(struct mt76_dev *dev, u8 ac)
 
 static int mt76u_alloc_tx(struct mt76_dev *dev)
 {
-       struct mt76_queue *q;
-       int i, j, err;
+       int i;
 
        for (i = 0; i <= MT_TXQ_PSD; i++) {
-               if (i >= IEEE80211_NUM_ACS) {
-                       dev->phy.q_tx[i] = dev->phy.q_tx[0];
-                       continue;
-               }
+               struct mt76_queue *q;
+               int j, err;
 
                q = devm_kzalloc(dev->dev, sizeof(*q), GFP_KERNEL);
                if (!q)
@@ -969,7 +966,7 @@ static void mt76u_free_tx(struct mt76_dev *dev)
 
        mt76_worker_teardown(&dev->usb.status_worker);
 
-       for (i = 0; i < IEEE80211_NUM_ACS; i++) {
+       for (i = 0; i <= MT_TXQ_PSD; i++) {
                struct mt76_queue *q;
                int j;
 
@@ -999,7 +996,7 @@ void mt76u_stop_tx(struct mt76_dev *dev)
 
                dev_err(dev->dev, "timed out waiting for pending tx\n");
 
-               for (i = 0; i < IEEE80211_NUM_ACS; i++) {
+               for (i = 0; i <= MT_TXQ_PSD; i++) {
                        q = dev->phy.q_tx[i];
                        if (!q)
                                continue;
@@ -1013,7 +1010,7 @@ void mt76u_stop_tx(struct mt76_dev *dev)
                /* On device removal we maight queue skb's, but mt76u_tx_kick()
                 * will fail to submit urb, cleanup those skb's manually.
                 */
-               for (i = 0; i < IEEE80211_NUM_ACS; i++) {
+               for (i = 0; i <= MT_TXQ_PSD; i++) {
                        q = dev->phy.q_tx[i];
                        if (!q)
                                continue;