Skip to content

Commit a11d965

Browse files
DragonBluepKalle Valo
authored andcommitted
wifi: rt2x00: restart beacon queue when hardware reset
When a hardware reset is triggered, all registers are reset, so all queues are forced to stop in hardware interface. However, mac80211 will not automatically stop the queue. If we don't manually stop the beacon queue, the queue will be deadlocked and unable to start again. This patch fixes the issue where Apple devices cannot connect to the AP after calling ieee80211_restart_hw(). Signed-off-by: Shiji Yang <[email protected]> Acked-by: Stanislaw Gruszka <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/TYAP286MB031530EB6D98DCE4DF20766CBCA4A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM
1 parent 570beb6 commit a11d965

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

drivers/net/wireless/ralink/rt2x00/rt2x00dev.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev)
101101
rt2x00link_stop_tuner(rt2x00dev);
102102
rt2x00queue_stop_queues(rt2x00dev);
103103
rt2x00queue_flush_queues(rt2x00dev, true);
104+
rt2x00queue_stop_queue(rt2x00dev->bcn);
104105

105106
/*
106107
* Disable radio.
@@ -1286,6 +1287,7 @@ int rt2x00lib_start(struct rt2x00_dev *rt2x00dev)
12861287
rt2x00dev->intf_ap_count = 0;
12871288
rt2x00dev->intf_sta_count = 0;
12881289
rt2x00dev->intf_associated = 0;
1290+
rt2x00dev->intf_beaconing = 0;
12891291

12901292
/* Enable the radio */
12911293
retval = rt2x00lib_enable_radio(rt2x00dev);
@@ -1312,6 +1314,7 @@ void rt2x00lib_stop(struct rt2x00_dev *rt2x00dev)
13121314
rt2x00dev->intf_ap_count = 0;
13131315
rt2x00dev->intf_sta_count = 0;
13141316
rt2x00dev->intf_associated = 0;
1317+
rt2x00dev->intf_beaconing = 0;
13151318
}
13161319

13171320
static inline void rt2x00lib_set_if_combinations(struct rt2x00_dev *rt2x00dev)

drivers/net/wireless/ralink/rt2x00/rt2x00mac.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,17 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
598598
*/
599599
if (changes & BSS_CHANGED_BEACON_ENABLED) {
600600
mutex_lock(&intf->beacon_skb_mutex);
601+
602+
/*
603+
* Clear the 'enable_beacon' flag and clear beacon because
604+
* the beacon queue has been stopped after hardware reset.
605+
*/
606+
if (test_bit(DEVICE_STATE_RESET, &rt2x00dev->flags) &&
607+
intf->enable_beacon) {
608+
intf->enable_beacon = false;
609+
rt2x00queue_clear_beacon(rt2x00dev, vif);
610+
}
611+
601612
if (!bss_conf->enable_beacon && intf->enable_beacon) {
602613
rt2x00dev->intf_beaconing--;
603614
intf->enable_beacon = false;

0 commit comments

Comments
 (0)