summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ralink/rt2x00/rt2x00.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2022-09-08 19:36:18 +0200
committerKalle Valo <kvalo@kernel.org>2022-09-19 12:08:57 +0200
commitf2c6e7ca3ee6ebb0a9562f3c0f6d09f15eaed4ed (patch)
treebbde3efdd03eb1bb9a191a460a2beb7eea04cdbb /drivers/net/wireless/ralink/rt2x00/rt2x00.h
parentwifi: rtw89: 8852c: add multi-port ID to TX descriptor (diff)
downloadlinux-f2c6e7ca3ee6ebb0a9562f3c0f6d09f15eaed4ed.tar.xz
linux-f2c6e7ca3ee6ebb0a9562f3c0f6d09f15eaed4ed.zip
wifi: rt2x00: Fix "Error - Attempt to send packet over invalid queue 2"
Even though ieee80211_hw.queues is set to 2, the ralink rt2x00 driver is seeing tx skbs submitted to it with the queue-id set to 2 / set to IEEE80211_AC_BE on a rt2500 card when associating with an access-point. This causes rt2x00queue_get_tx_queue() to return NULL and the following error to be logged: "ieee80211 phy0: rt2x00mac_tx: Error - Attempt to send packet over invalid queue 2", after which association with the AP fails. This patch works around this by mapping QID_AC_BE and QID_AC_BK to QID_AC_VI when there are only 2 tx_queues. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Stanislaw Gruszka <stf_xl@wp.pl> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220908173618.155291-2-hdegoede@redhat.com
Diffstat (limited to 'drivers/net/wireless/ralink/rt2x00/rt2x00.h')
-rw-r--r--drivers/net/wireless/ralink/rt2x00/rt2x00.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00.h b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
index 8f5772b98f58..07a6a5a9ce13 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
@@ -1309,8 +1309,11 @@ void rt2x00queue_unmap_skb(struct queue_entry *entry);
*/
static inline struct data_queue *
rt2x00queue_get_tx_queue(struct rt2x00_dev *rt2x00dev,
- const enum data_queue_qid queue)
+ enum data_queue_qid queue)
{
+ if (queue >= rt2x00dev->ops->tx_queues && queue < IEEE80211_NUM_ACS)
+ queue = rt2x00dev->ops->tx_queues - 1;
+
if (queue < rt2x00dev->ops->tx_queues && rt2x00dev->tx)
return &rt2x00dev->tx[queue];