On 04/02/2025 21:59, Ezra Buehler wrote: > On Mon, Feb 3, 2025 at 9:51 AM Ping-Ke Shih <pkshih@xxxxxxxxxxx> wrote: >> >> Martin Kaistra <martin.kaistra@xxxxxxxxxxxxx> wrote: >>> >>> Is there a reason for not setting macid in rtl8xxxu_fill_txdesc_v1() and >>> rtl8xxxu_update_rate_mask() like it was done for the gen2 case? >> >> rtl8xxxu_fill_txdesc_v3() doesn't fill macid neither. Quickly search for >> the code filling tx desc [1]. I think we can have a >> #define TXDESC32_MACID_MASK GENMASK(4, 0) >> >> The h2c command format of rtl8xxxu_update_rate_mask() seemingly should be >> equal to rtl8192c_set_raid_cmd() [2], but not. >> >> Can anyone help to spin patches and test if it works? > > The suggested changes seem to help. A quick test shows TX rates of > around 20 Mbits/sec. I will prepare the patches soon. > >> >> [1] https://github.com/lwfinger/rtl8192cu/blob/master/hal/rtl8192cu_xmit.c#L257 >> [2] https://github.com/lwfinger/rtl8192cu/blob/master/hal/rtl8192c_cmd.c#L201 >> > > I've also noticed that the TX rate is not reported correctly. "iw > station dump" shows "tx bitrate: (unknown)" and "hostapd_cli all_sta" > displays "tx_rate_info=0". > > Any ideas why that could be? > > Cheers, > Ezra. Looks like rtl8xxxu_sta_statistics() was not updated for AP mode. See rtw_ops_sta_statistics() and rtw_fw_ra_report_iter() in rtw88 for inspiration. But this chip doesn't report the TX rate, so rtl8xxxu can only report the theoretical maximum. It does this already for station mode in rtl8xxxu_bss_info_changed(). I guess you can do the same for AP mode in rtl8xxxu_sta_add().