Re: [PATCH 04/19] wifi: rtw88: fw: handle the RTL8723BS management TX reports
From: Bitterblue Smith
Date: Fri Jul 24 2026 - 18:55:34 EST
On 24/07/2026 21:18, luka.gejak@xxxxxxxxx wrote:
> From: Luka Gejak <luka.gejak@xxxxxxxxx>
>
> The vendor firmware used by the RTL8723BS does not report management
> frame transmission through C2H_CCX_TX_RPT. It uses event 0x12, and
> reuses 0x32 for scan probe reports, which rtw88 otherwise treats as a
> WLAN_RFON event and completes the LPS leave check with.
>
> Route both events to the existing TX report handler for this chip, and
> defer 0x32 to the worker instead of consuming it in the interrupt path,
> so the reports are decoded and the LPS handshake is left alone. The
> payload layout is the same as C2H_CCX_TX_RPT, so no separate decode is
> needed.
>
This is not right. 0x12 and 0x32 are not C2H IDs, they are the first
byte of the C2H_CCX_TX_RPT payload.
Since this patch changes the way C2H_WLAN_RFON is handled, it might
be responsible for some "failed to leave lps" messages? Maybe extending
the timeout (patch 3/19) is not necessary after all?
> Signed-off-by: Luka Gejak <luka.gejak@xxxxxxxxx>
> ---
> drivers/net/wireless/realtek/rtw88/fw.c | 18 ++++++++++++++++++
> drivers/net/wireless/realtek/rtw88/fw.h | 4 ++++
> 2 files changed, 22 insertions(+)
>
> diff --git a/drivers/net/wireless/realtek/rtw88/fw.c b/drivers/net/wireless/realtek/rtw88/fw.c
> index 945fedcd375b..a81ff15218e1 100644
> --- a/drivers/net/wireless/realtek/rtw88/fw.c
> +++ b/drivers/net/wireless/realtek/rtw88/fw.c
> @@ -317,6 +317,15 @@ void rtw_fw_c2h_cmd_handle(struct rtw_dev *rtwdev, struct sk_buff *skb)
> case C2H_CCX_TX_RPT:
> rtw_tx_report_handle(rtwdev, skb, C2H_CCX_TX_RPT);
> break;
> + case C2H_VENDOR_TX_RPT:
> + case C2H_WLAN_RFON:
> + /*
> + * The RTL8723BS firmware reports management TX through these
> + * two events instead, using the same payload layout.
> + */
> + if (rtw_is_8723bs(rtwdev))
> + rtw_tx_report_handle(rtwdev, skb, C2H_CCX_TX_RPT);
> + break;
> case C2H_BT_INFO:
> rtw_coex_bt_info_notify(rtwdev, c2h->payload, len);
> break;
> @@ -365,6 +374,15 @@ void rtw_fw_c2h_cmd_rx_irqsafe(struct rtw_dev *rtwdev, u32 pkt_offset,
> rtw_coex_info_response(rtwdev, skb);
> break;
> case C2H_WLAN_RFON:
> + /* On 8723BS SDIO with v41 firmware, C2H 0x32 carries a scan TX
> + * report, not a WLAN_RFON event: defer it to rtw_fw_c2h_cmd_handle().
> + */
> + if (rtw_is_8723bs(rtwdev)) {
> + *((u32 *)skb->cb) = pkt_offset;
> + skb_queue_tail(&rtwdev->c2h_queue, skb);
> + ieee80211_queue_work(rtwdev->hw, &rtwdev->c2h_work);
> + break;
> + }
> complete(&rtwdev->lps_leave_check);
> dev_kfree_skb_any(skb);
> break;
> diff --git a/drivers/net/wireless/realtek/rtw88/fw.h b/drivers/net/wireless/realtek/rtw88/fw.h
> index 48ad9ceab6ea..6927d2041d24 100644
> --- a/drivers/net/wireless/realtek/rtw88/fw.h
> +++ b/drivers/net/wireless/realtek/rtw88/fw.h
> @@ -54,6 +54,10 @@ enum rtw_c2h_cmd_id {
> C2H_BT_MP_INFO = 0x0b,
> C2H_BT_HID_INFO = 0x45,
> C2H_RA_RPT = 0x0c,
> + /* 8723BS SDIO vendor v41 firmware management TX report (0x32 is
> + * reported as C2H_WLAN_RFON, handled per-chip in the C2H dispatch).
> + */
> + C2H_VENDOR_TX_RPT = 0x12,
> C2H_HW_FEATURE_REPORT = 0x19,
> C2H_WLAN_INFO = 0x27,
> C2H_WLAN_RFON = 0x32,