mbox series

[v1,0/3] wifi: rtl8xxxu: AP mode fixes (for gen1 devices)

Message ID 20250219175228.850583-1-ezra@easyb.ch
Headers show
Series wifi: rtl8xxxu: AP mode fixes (for gen1 devices) | expand

Message

Ezra Buehler Feb. 19, 2025, 5:52 p.m. UTC
From: Ezra Buehler <ezra.buehler@husqvarnagroup.com>

As mentioned in the previous patch [1], especially the transmit rate is
rather low in AP mode with gen1 devices like the RTL8192CU. The
following changes seem to fix the issue.

When looking at the patches introducing the initial AP support [2], I
noticed that rtl8xxxu_gen2_report_connect() was altered too. So, now I
am wondering if we need to use `macid` and `role` in
rtl8xxxu_gen1_report_connect() as well...

[1]: https://lore.kernel.org/all/20250122071512.10165-1-ezra@easyb.ch/
[2]: https://lore.kernel.org/all/20230428150833.218605-1-martin.kaistra@linutronix.de/


Ezra Buehler (3):
  wifi: rtl8xxxu: Use macid in rtl8xxxu_update_rate_mask()
  wifi: rtl8xxxu: Use macid in rtl8xxxu_fill_txdesc_v1()
  wifi: rtl8xxxu: Make sure TX rate is reported in AP mode

 drivers/net/wireless/realtek/rtl8xxxu/core.c  | 28 ++++++++++++++++++-
 .../net/wireless/realtek/rtl8xxxu/rtl8xxxu.h  |  1 +
 2 files changed, 28 insertions(+), 1 deletion(-)

--
2.43.0

Comments

Ping-Ke Shih Feb. 20, 2025, 6 a.m. UTC | #1
Ezra Buehler <ezra@easyb.ch> wrote:
> From: Ezra Buehler <ezra.buehler@husqvarnagroup.com>
> 
> This is needed in order for AP mode to work correctly on gen1 devices
> like the RTL8192CU.
> 
> For more information, see the corresponding change for gen2 devices,
> commit 9aa45598d054 ("wifi: rtl8xxxu: Put the macid in txdesc").
> 
> Signed-off-by: Ezra Buehler <ezra.buehler@husqvarnagroup.com>
> ---
>  drivers/net/wireless/realtek/rtl8xxxu/core.c     | 2 ++
>  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/core.c
> b/drivers/net/wireless/realtek/rtl8xxxu/core.c
> index cbd9efd22e3f..2fa22d3145a4 100644
> --- a/drivers/net/wireless/realtek/rtl8xxxu/core.c
> +++ b/drivers/net/wireless/realtek/rtl8xxxu/core.c
> @@ -5302,6 +5302,8 @@ rtl8xxxu_fill_txdesc_v1(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr,
>                 dev_info(dev, "%s: TX rate: %d, pkt size %u\n",
>                          __func__, rate, le16_to_cpu(tx_desc->pkt_size));
> 
> +       tx_desc->txdw1 |= cpu_to_le32(macid & TXDESC32_MACID_MASK);
> +

tx_desc->txdw1 |= le32_encode_bits(macid, TXDESC32_MACID_MASK);
Ping-Ke Shih Feb. 20, 2025, 6:10 a.m. UTC | #2
Ezra Buehler <ezra@easyb.ch> wrote:
> From: Ezra Buehler <ezra.buehler@husqvarnagroup.com>
> 
> Without this change, e.g., "iw station dump" will show "tx bitrate:
> (unknown)" when in AP mode.
> 
> Signed-off-by: Ezra Buehler <ezra.buehler@husqvarnagroup.com>
> ---
> Note: The code was simply copied over from rtl8xxxu_bss_info_changed()

The code seems to report the highest rate as initial (fake) TX rate.
Please add a patch ahead that moves the code into an individual function
but don't change existing logic. Then, this patch can use the function
to get your expectation.
Bitterblue Smith Feb. 20, 2025, 11:28 p.m. UTC | #3
On 19/02/2025 19:52, Ezra Buehler wrote:
> From: Ezra Buehler <ezra.buehler@husqvarnagroup.com>
> 
> As mentioned in the previous patch [1], especially the transmit rate is
> rather low in AP mode with gen1 devices like the RTL8192CU. The
> following changes seem to fix the issue.
> 
> When looking at the patches introducing the initial AP support [2], I
> noticed that rtl8xxxu_gen2_report_connect() was altered too. So, now I
> am wondering if we need to use `macid` and `role` in
> rtl8xxxu_gen1_report_connect() as well...
> 

I don't think these chips have those fields in the "joinbss" command.

> [1]: https://lore.kernel.org/all/20250122071512.10165-1-ezra@easyb.ch/
> [2]: https://lore.kernel.org/all/20230428150833.218605-1-martin.kaistra@linutronix.de/
> 
> 
> Ezra Buehler (3):
>   wifi: rtl8xxxu: Use macid in rtl8xxxu_update_rate_mask()
>   wifi: rtl8xxxu: Use macid in rtl8xxxu_fill_txdesc_v1()
>   wifi: rtl8xxxu: Make sure TX rate is reported in AP mode
> 
>  drivers/net/wireless/realtek/rtl8xxxu/core.c  | 28 ++++++++++++++++++-
>  .../net/wireless/realtek/rtl8xxxu/rtl8xxxu.h  |  1 +
>  2 files changed, 28 insertions(+), 1 deletion(-)
> 
> --
> 2.43.0