All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] wifi: rtw88: Fix USB/SDIO devices not transmitting beacons
@ 2024-08-21 13:11 Bitterblue Smith
  2024-08-30  0:30 ` Ping-Ke Shih
  2024-09-02  0:44 ` Ping-Ke Shih
  0 siblings, 2 replies; 4+ messages in thread
From: Bitterblue Smith @ 2024-08-21 13:11 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. (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: <stable@vger.kernel.org> # 6.6.x
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
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


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

* RE: [PATCH v2] wifi: rtw88: Fix USB/SDIO devices not transmitting beacons
  2024-08-21 13:11 [PATCH v2] wifi: rtw88: Fix USB/SDIO devices not transmitting beacons Bitterblue Smith
@ 2024-08-30  0:30 ` Ping-Ke Shih
  2024-08-30 10:27   ` Bitterblue Smith
  2024-09-02  0:44 ` Ping-Ke Shih
  1 sibling, 1 reply; 4+ messages in thread
From: Ping-Ke Shih @ 2024-08-30  0:30 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org
  Cc: Sascha Hauer, Martin Blumenstingl

Hi Bitterblue, 

Bitterblue Smith <rtl8821cerfe2@gmail.com> 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: <stable@vger.kernel.org> # 6.6.x
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>

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.  



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

* Re: [PATCH v2] wifi: rtw88: Fix USB/SDIO devices not transmitting beacons
  2024-08-30  0:30 ` Ping-Ke Shih
@ 2024-08-30 10:27   ` Bitterblue Smith
  0 siblings, 0 replies; 4+ messages in thread
From: Bitterblue Smith @ 2024-08-30 10:27 UTC (permalink / raw)
  To: Ping-Ke Shih, linux-wireless@vger.kernel.org
  Cc: Sascha Hauer, Martin Blumenstingl

On 30/08/2024 03:30, Ping-Ke Shih wrote:
> Hi Bitterblue, 
> 
> Bitterblue Smith <rtl8821cerfe2@gmail.com> 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: <stable@vger.kernel.org> # 6.6.x
>> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> 
> 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.

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

* Re: [PATCH v2] wifi: rtw88: Fix USB/SDIO devices not transmitting beacons
  2024-08-21 13:11 [PATCH v2] wifi: rtw88: Fix USB/SDIO devices not transmitting beacons Bitterblue Smith
  2024-08-30  0:30 ` Ping-Ke Shih
@ 2024-09-02  0:44 ` Ping-Ke Shih
  1 sibling, 0 replies; 4+ messages in thread
From: Ping-Ke Shih @ 2024-09-02  0:44 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org
  Cc: Ping-Ke Shih, Sascha Hauer, Martin Blumenstingl

Bitterblue Smith <rtl8821cerfe2@gmail.com> 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: <stable@vger.kernel.org> # 6.6.x
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>

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


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

end of thread, other threads:[~2024-09-02  0:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-21 13:11 [PATCH v2] wifi: rtw88: Fix USB/SDIO devices not transmitting beacons Bitterblue Smith
2024-08-30  0:30 ` Ping-Ke Shih
2024-08-30 10:27   ` Bitterblue Smith
2024-09-02  0:44 ` Ping-Ke Shih

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.