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

Subsystems: realtek wireless driver (rtw88), the rest

STALE772d LANDED

Landed in mainline as faa2e484b393 on 2024-09-02.

4 messages, 2 authors, 2024-09-02 · open the first message on its own page

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

From: Bitterblue Smith <hidden>
Date: 2024-08-21 13:11:08

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.

Cc: <redacted> # 6.6.x
Signed-off-by: Bitterblue Smith <redacted>
---
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(-)
diff --git a/drivers/net/wireless/realtek/rtw88/fw.c b/drivers/net/wireless/realtek/rtw88/fw.c
index ab7d414d0ba6..b9b0114e253b 100644
--- a/drivers/net/wireless/realtek/rtw88/fw.c
+++ b/drivers/net/wireless/realtek/rtw88/fw.c
@@ -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;
-- 
2.46.0

RE: [PATCH v2] wifi: rtw88: Fix USB/SDIO devices not transmitting beacons

From: Ping-Ke Shih <pkshih@realtek.com>
Date: 2024-08-30 00:30:20

Hi Bitterblue, 

Bitterblue Smith [off-list ref] wrote:
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.

Cc: <redacted> # 6.6.x
Signed-off-by: Bitterblue Smith <redacted>
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.  

Re: [PATCH v2] wifi: rtw88: Fix USB/SDIO devices not transmitting beacons

From: Bitterblue Smith <hidden>
Date: 2024-08-30 10:27:19

On 30/08/2024 03:30, Ping-Ke Shih wrote:
Hi Bitterblue, 

Bitterblue Smith [off-list ref] wrote:
quoted
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.

Cc: <redacted> # 6.6.x
Signed-off-by: Bitterblue Smith <redacted>
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.  
Yes, patchset 2 works for me.

Re: [PATCH v2] wifi: rtw88: Fix USB/SDIO devices not transmitting beacons

From: Ping-Ke Shih <pkshih@realtek.com>
Date: 2024-09-02 00:44:42

Bitterblue Smith [off-list ref] wrote:
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.

Cc: <redacted> # 6.6.x
Signed-off-by: Bitterblue Smith <redacted>
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help