Skip to content

Commit d873697

Browse files
jwrdegoedejmberg-intel
authored andcommitted
wifi: mac80211: fix regression with non-QoS drivers
Commit 10cb8e6 ("mac80211: enable QoS support for nl80211 ctrl port") changed ieee80211_tx_control_port() to aways call __ieee80211_select_queue() without checking local->hw.queues. __ieee80211_select_queue() returns a queue-id between 0 and 3, which means that now ieee80211_tx_control_port() may end up setting the queue-mapping for a skb to a value higher then local->hw.queues if local->hw.queues is less then 4. Specifically this is a problem for ralink rt2500-pci cards where local->hw.queues is 2. There 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. Other callers of __ieee80211_select_queue() skip calling it when local->hw.queues < IEEE80211_NUM_ACS, add the same check to ieee80211_tx_control_port(). This fixes ralink rt2500-pci and similar cards when less then 4 tx-queues no longer working. Fixes: 10cb8e6 ("mac80211: enable QoS support for nl80211 ctrl port") Cc: Markus Theil <markus.theil@tu-ilmenau.de> Suggested-by: Stanislaw Gruszka <stf_xl@wp.pl> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20220918192052.443529-1-hdegoede@redhat.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 527008e commit d873697

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/mac80211/tx.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5878,6 +5878,9 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
58785878
skb_reset_network_header(skb);
58795879
skb_reset_mac_header(skb);
58805880

5881+
if (local->hw.queues < IEEE80211_NUM_ACS)
5882+
goto start_xmit;
5883+
58815884
/* update QoS header to prioritize control port frames if possible,
58825885
* priorization also happens for control port frames send over
58835886
* AF_PACKET
@@ -5905,6 +5908,7 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev,
59055908
}
59065909
rcu_read_unlock();
59075910

5911+
start_xmit:
59085912
/* mutex lock is only needed for incrementing the cookie counter */
59095913
mutex_lock(&local->mtx);
59105914

0 commit comments

Comments
 (0)