On 19.08.2024 04:59, Ping-Ke Shih wrote:
Maciej S. Szmigiero <mail@xxxxxxxxxxxxxxxxxxxxx> wrote:
On 31.07.2024 14:20, Bitterblue Smith wrote:
On 31/07/2024 03:47, Ping-Ke Shih wrote:
Bitterblue Smith <rtl8821cerfe2@xxxxxxxxx> wrote:
On 30/07/2024 09:33, Ping-Ke Shih wrote:
Bitterblue Smith <rtl8821cerfe2@xxxxxxxxx> wrote:
In AP mode, the firmware stops transmitting beacons if it receives
H2C_CMD_RA_INFO for macid 0.
Leave macid 0 unused in AP mode. Macid 1 is already reserved for
broadcast/multicast. Assign macid 2 to the first connected client.
Seemingly we missed to set mac_id in TX desc for a long time.
+#define RTW_TX_DESC_W1_MACID GENMASK(7, 0)
#define RTW_TX_DESC_W1_QSEL GENMASK(12, 8)
#define RTW_TX_DESC_W1_RATE_ID GENMASK(20, 16)
The mac_id should be from rtwvif->mac_id or si->mac_id according to
operating mode and role.
And I suppose mac_id assignment for AP is mac_id 0 for broadcast/multicast, and
other mac_id can be used by connected stations regularly.
What about the concurrent AP + station scenario? Will the
station vif use the next available macid, whatever that is?
Just wondering, I don't use concurrent mode.
My basic idea is to assign mac_id to each vif when adding vif. For station mode,
sta->mac_id will reuse vif->mac_id. For AP mode, I will dynamically allocate an
sta->mac_id to a station, and vif->mac_id is to send broadcast/multicast packets
that are not belong to a sta. For example,
vif->mac_id sta->mac_id
vif0 (STA mode) 0 0
vif1 (AP mode) 1 2...
Also, do you mean that you will do all this? It's not clear to me.
I can do it. Or are you interested in this?
No, no, it's all yours. :)
It would be nice to have either this submitted fix or alternative one merged soon
since the AP mode is completely broken otherwise (at least on RTL8821CU).
I have sent a patch [2] to replace this one, but still needs
patch 1/2 "wifi: rtw88: Fix USB devices not transmitting beacons". [1]
I have tested [1] + [2] can work on PCI devices.
Can anyone help to test if [1] + [2] also works on USB devices?
I tested these patches on USB RTL8821CU and can confirm that the AP mode seems to
work as good with your patch [2] as it did with the Bitterblue's one.
The only issue with either your or Bitterblue's patches is that I occasionally get the
following messages in the kernel log in the AP mode:
kernel: [T1234] rtw_8821cu 4-1.2:1.2: error beacon valid
kernel: [T1234] rtw_8821cu 4-1.2:1.2: failed to download drv rsvd page
kernel: [T1234] rtw_8821cu 4-1.2:1.2: failed to download beacon
Around the time these messages are logged ping RTT of a connected (battery powered)
STA climbs into multiple seconds range so I guess there might be something wrong
with beacon DTIM update here.
[1] https://lore.kernel.org/linux-wireless/9174a776-4771-4351-85fa-476e240d8ace@xxxxxxxxx/
[2] https://lore.kernel.org/linux-wireless/20240819025248.17939-1-pkshih@xxxxxxxxxxx/T/#u
Thanks,
Maciej