Skip to contentSkip to conversation

wifi: rtw88: Fix USB/SDIO devices not transmitting beacons

PATCH In review Bitterblue Smith 2 participants 4 messages Aug 21, 2024 – Sep 2, 2024 Realtek wireless driver (rtw88)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 wifi: rtw88: Fix USB/SDIO devices not transmitting beacons

All USB devices supported by rtw88 have the same problem: they don't transmit beacons in AP mode. (Some?) SDIO devices are also affected. The cause appears to be clearing BIT_EN_BCNQ_DL of REG_FWHW_TXQ_CTRL before uploading the beacon reserved page, so don't clear the bit for USB and SDIO devices.

Tested with RTL8811CU and RTL8723DU.

---
v2:
- Only clear BIT_EN_BCNQ_DL for PCIE devices:
https://lore.kernel.org/linux-wireless/CAP8xZ6n8utvFJCmTwnRzFccRkZZzk+R5Bf69UArbbzd4Ev9aRQ@mail.gmail.com/
- Update the commit message.

---
 drivers/net/wireless/realtek/rtw88/fw.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/net/wireless/realtek/rtw88/fw.c +8 -5
index ab7d414d0ba6..b9b0114e253b 100644
@@ -1468,10 +1468,12 @@ int rtw_fw_write_data_rsvd_page(struct rtw_dev *rtwdev, u16 pg_addr,
 	val |= BIT_ENSWBCN >> 8;
 	rtw_write8(rtwdev, REG_CR + 1, val);
 
-	val = rtw_read8(rtwdev, REG_FWHW_TXQ_CTRL + 2);
-	bckp[1] = val;
-	val &= ~(BIT_EN_BCNQ_DL >> 16);
-	rtw_write8(rtwdev, REG_FWHW_TXQ_CTRL + 2, val);
+	if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_PCIE) {
+		val = rtw_read8(rtwdev, REG_FWHW_TXQ_CTRL + 2);
+		bckp[1] = val;
+		val &= ~(BIT_EN_BCNQ_DL >> 16);
+		rtw_write8(rtwdev, REG_FWHW_TXQ_CTRL + 2, val);
+	}
 
 	ret = rtw_hci_write_data_rsvd_page(rtwdev, buf, size);
 	if (ret) {
@@ -1496,7 +1498,8 @@ int rtw_fw_write_data_rsvd_page(struct rtw_dev *rtwdev, u16 pg_addr,
 	rsvd_pg_head = rtwdev->fifo.rsvd_boundary;
 	rtw_write16(rtwdev, REG_FIFOPAGE_CTRL_2,
 		    rsvd_pg_head | BIT_BCN_VALID_V1);
-	rtw_write8(rtwdev, REG_FWHW_TXQ_CTRL + 2, bckp[1]);
+	if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_PCIE)
+		rtw_write8(rtwdev, REG_FWHW_TXQ_CTRL + 2, bckp[1]);
 	rtw_write8(rtwdev, REG_CR + 1, bckp[0]);
 
 	return ret;
Signature · 1 line
2.46.0
maintainer
#1 lore raw

Hi Bitterblue,

Quoted 11 lines · Bitterblue Smith

All USB devices supported by rtw88 have the same problem: they don't transmit beacons in AP mode. (Some?) SDIO devices are also affected. The cause appears to be clearing BIT_EN_BCNQ_DL of REG_FWHW_TXQ_CTRL before uploading the beacon reserved page, so don't clear the bit for USB and SDIO devices.

Tested with RTL8811CU and RTL8723DU.

Can I say two below patchset are equivalent in your side?

[Patchset 1: your v1]
13744097 New [1/2] wifi: rtw88: Fix USB devices not transmitting beacons
13744098 New [2/2] wifi: rtw88: Avoid using macid 0 in AP mode

[Patchset 2: your v2 + mine]
13771597 New [v2] wifi: rtw88: Fix USB/SDIO devices not transmitting beacons
13767746 New wifi: rtw88: assign mac_id for vif/sta and update to TX desc

If this can make AP mode on USB devices step forward, I will merge them ahead.

#2 lore raw
Quoted 21 lines · Ping-Ke Shih

Hi Bitterblue,

Quoted 11 lines · Bitterblue Smith

All USB devices supported by rtw88 have the same problem: they don't transmit beacons in AP mode. (Some?) SDIO devices are also affected. The cause appears to be clearing BIT_EN_BCNQ_DL of REG_FWHW_TXQ_CTRL before uploading the beacon reserved page, so don't clear the bit for USB and SDIO devices.

Tested with RTL8811CU and RTL8723DU.

Can I say two below patchset are equivalent in your side?

[Patchset 1: your v1]
13744097 New [1/2] wifi: rtw88: Fix USB devices not transmitting beacons
13744098 New [2/2] wifi: rtw88: Avoid using macid 0 in AP mode

Quoted 6 lines

[Patchset 2: your v2 + mine]
13771597 New [v2] wifi: rtw88: Fix USB/SDIO devices not transmitting beacons
13767746 New wifi: rtw88: assign mac_id for vif/sta and update to TX desc

If this can make AP mode on USB devices step forward, I will merge them ahead.

Yes, patchset 2 works for me.

maintainer
#3 lore raw
In reply to Bitterblue Smith
Quoted 10 lines · Bitterblue Smith

All USB devices supported by rtw88 have the same problem: they don't transmit beacons in AP mode. (Some?) SDIO devices are also affected. The cause appears to be clearing BIT_EN_BCNQ_DL of REG_FWHW_TXQ_CTRL before uploading the beacon reserved page, so don't clear the bit for USB and SDIO devices.

Tested with RTL8811CU and RTL8723DU.

1 patch(es) applied to rtw-next branch of rtw.git, thanks.

faa2e484b393 wifi: rtw88: Fix USB/SDIO devices not transmitting beacons

---
https://github.com/pkshih/rtw.git