Search Linux Wireless

[PATCH 1/2] wifi: rtw88: Fix USB devices not transmitting beacons

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx # 6.6.x
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@xxxxxxxxx>
---
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





[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux