Re: [PATCH 06/19] wifi: rtw88: fw: send the media status report in the vendor layout
From: Bitterblue Smith
Date: Fri Jul 24 2026 - 19:53:13 EST
On 24/07/2026 21:18, luka.gejak@xxxxxxxxx wrote:
> From: Luka Gejak <luka.gejak@xxxxxxxxx>
>
> As with the rate adaptation commands, the RTL8723BS firmware expects the
> vendor v5.2.17 byte layout for the media status report. The bit packed
> rtw88 form leaves the firmware without a valid connect indication, so
> emit the layout it parses for this chip.
>
> Signed-off-by: Luka Gejak <luka.gejak@xxxxxxxxx>
> ---
> drivers/net/wireless/realtek/rtw88/fw.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtw88/fw.c b/drivers/net/wireless/realtek/rtw88/fw.c
> index 495d26eafdd4..87da0dd82aaa 100644
> --- a/drivers/net/wireless/realtek/rtw88/fw.c
> +++ b/drivers/net/wireless/realtek/rtw88/fw.c
> @@ -839,8 +839,19 @@ void rtw_fw_media_status_report(struct rtw_dev *rtwdev, u8 mac_id, bool connect)
> u8 h2c_pkt[H2C_PKT_SIZE] = {0};
>
> SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_MEDIA_STATUS_RPT);
> - MEDIA_STATUS_RPT_SET_OP_MODE(h2c_pkt, connect);
> - MEDIA_STATUS_RPT_SET_MACID(h2c_pkt, mac_id);
> +
> + if (rtw_is_8723bs(rtwdev)) {
> + /* Vendor v5.2.17 MEDIA_STATUS_RPT: connect = 21 00 00,
> + * disconnect = 00 00 00. Byte1[0]=OPMODE, [5]=ROLE(STA=0),
> + * [1]=MACID_IND; byte2=MACID; byte3=MACID_END.
> + */
> + h2c_pkt[1] = connect ? 0x21 : 0x00;
> + h2c_pkt[2] = mac_id & 0x7f;
> + h2c_pkt[3] = 0x00;
> + } else {
> + MEDIA_STATUS_RPT_SET_OP_MODE(h2c_pkt, connect);
> + MEDIA_STATUS_RPT_SET_MACID(h2c_pkt, mac_id);
> + }
rtw88 doesn't fill the role field, but otherwise the layout is the same.
Not sure how important the role is. The other chips work without it.
>
> rtw_fw_send_h2c_command(rtwdev, h2c_pkt);
> }