Skip to content

Commit 28818b4

Browse files
Bitterblue SmithPing-Ke Shih
authored andcommitted
wifi: rtw88: usb: Fix disconnection after beacon loss
When there is beacon loss, for example due to unrelated Bluetooth devices transmitting music nearby, the wifi connection dies soon after the first beacon loss message: Apr 28 20:47:14 ideapad2 wpa_supplicant[1161]: wlp3s0f3u4: CTRL-EVENT-BEACON-LOSS Apr 28 20:47:15 ideapad2 wpa_supplicant[1161]: wlp3s0f3u4: CTRL-EVENT-DISCONNECTED bssid=... reason=4 locally_generated=1 Apr 28 20:47:24 ideapad2 wpa_supplicant[1161]: wlp3s0f3u4: CTRL-EVENT-BEACON-LOSS Apr 28 20:47:25 ideapad2 wpa_supplicant[1161]: wlp3s0f3u4: CTRL-EVENT-DISCONNECTED bssid=... reason=4 locally_generated=1 Apr 28 20:47:34 ideapad2 wpa_supplicant[1161]: wlp3s0f3u4: CTRL-EVENT-BEACON-LOSS Apr 28 20:47:35 ideapad2 wpa_supplicant[1161]: wlp3s0f3u4: CTRL-EVENT-DISCONNECTED bssid=... reason=4 locally_generated=1 When the beacon loss happens, mac80211 makes rtw88 transmit a QOS NULL frame and asks to confirm the ACK status. Even though rtw88 confirms to mac80211 that the QOS NULL was transmitted successfully, the connection still dies. This is because rtw88 is handing the QOS NULL back to mac80211 with skb->data pointing to the headroom (the TX descriptor) instead of ieee80211_hdr. Fix the disconnection by moving skb->data to the correct position before ieee80211_tx_status_irqsafe(). The problem was observed with RTL8811AU (TP-Link Archer T2U Nano) and the potential future rtw88_8821au driver. Also tested with RTL8811CU (Tenda U9). Cc: [email protected] Signed-off-by: Bitterblue Smith <[email protected]> Signed-off-by: Ping-Ke Shih <[email protected]> Link: https://msgid.link/[email protected]
1 parent a892f6f commit 28818b4

File tree

1 file changed

+2
-0
lines changed
  • drivers/net/wireless/realtek/rtw88

1 file changed

+2
-0
lines changed

drivers/net/wireless/realtek/rtw88/usb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ static void rtw_usb_write_port_tx_complete(struct urb *urb)
273273
info = IEEE80211_SKB_CB(skb);
274274
tx_data = rtw_usb_get_tx_data(skb);
275275

276+
skb_pull(skb, rtwdev->chip->tx_pkt_desc_sz);
277+
276278
/* enqueue to wait for tx report */
277279
if (info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS) {
278280
rtw_tx_report_enqueue(rtwdev, skb, tx_data->sn);

0 commit comments

Comments
 (0)