linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] wifi: rtw88: Fix USB devices not transmitting beacons
@ 2024-07-28 22:49 Bitterblue Smith
  2024-07-28 22:51 ` [PATCH 2/2] wifi: rtw88: Avoid using macid 0 in AP mode Bitterblue Smith
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Bitterblue Smith @ 2024-07-28 22:49 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org
  Cc: Ping-Ke Shih, Sascha Hauer, Martin Blumenstingl

All USB devices supported by rtw88 have the same problem: they don't
transmit beacons in AP mode. 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 devices.

Tested with RTL8811CU and RTL8723DU.

Cc: stable@vger.kernel.org # 6.6.x
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
I'm not sure if SDIO devices have the same problem. Also, should
BIT_EN_BCNQ_DL ever be cleared in this function? The relevant code is
disabled in all these drivers:

https://github.com/morrownr/8821cu-20210916/blob/3eacc28b721950b51b0249508cc31e6e54988a0c/hal/rtl8821c/rtl8821c_ops.c#L1603

https://github.com/tomaspinho/rtl8821ce/blob/f119398d868b1a3395f40c1df2e08b57b2c882cd/hal/rtl8821c/rtl8821c_ops.c#L1668

https://github.com/alireza-tabatabaee/RTL8821CS/blob/2d8a102dd7399a243f11b13314c299e509cc4ef1/rtl8821cs/hal/rtl8821c/rtl8821c_ops.c#L1603

https://github.com/morrownr/88x2bu-20210702/blob/3c8f59b5b05e5090e8593da1940a8d3ccac3f878/hal/rtl8822b/rtl8822b_ops.c#L1771

https://github.com/thales-dis-dr/rtl8822CU/blob/4182c79e0c5362dcea46088dab9fed27795b5579/hal/rtl8822c/rtl8822c_ops.c#L1941
---
 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..782f3776e0a0 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_USB) {
+		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_USB)
+		rtw_write8(rtwdev, REG_FWHW_TXQ_CTRL + 2, bckp[1]);
 	rtw_write8(rtwdev, REG_CR + 1, bckp[0]);
 
 	return ret;
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-08-21 11:17 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-28 22:49 [PATCH 1/2] wifi: rtw88: Fix USB devices not transmitting beacons Bitterblue Smith
2024-07-28 22:51 ` [PATCH 2/2] wifi: rtw88: Avoid using macid 0 in AP mode Bitterblue Smith
2024-07-30  6:33   ` Ping-Ke Shih
2024-07-30 12:55     ` Bitterblue Smith
2024-07-31  0:47       ` Ping-Ke Shih
2024-07-31 12:20         ` Bitterblue Smith
2024-08-08  9:38           ` Maciej S. Szmigiero
2024-08-19  2:59             ` Ping-Ke Shih
2024-08-19 21:20               ` Maciej S. Szmigiero
2024-08-20  0:34                 ` Ping-Ke Shih
2024-08-20 23:15                   ` Bitterblue Smith
2024-07-31  8:10       ` Ping-Ke Shih
2024-07-30  7:36 ` [PATCH 1/2] wifi: rtw88: Fix USB devices not transmitting beacons Ping-Ke Shih
2024-08-21  6:25 ` Ping-Ke Shih
2024-08-21  7:17   ` Michele Bisogno
2024-08-21 11:17   ` Bitterblue Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).