RE: [PATCH rtw-next v5 05/10] wifi: rtw89: use AP self role for monitor interfaces

From: Ping-Ke Shih

Date: Sat Nov 14 2026 - 23:08:47 EST


Enver Ikromov <owner@xxxxxxxxxxxxxx> wrote:
> rtw89_vif_type_mapping() leaves net_type and self_role zero for
> NL80211_IFTYPE_MONITOR, i.e. RTW89_NET_TYPE_NO_LINK and
> RTW89_SELF_ROLE_CLIENT. When rtw89_mac_add_vif() initializes the
> interface, rtw89_mac_vif_init() first creates the role via H2C
> ROLE_MAINTAIN and then sends JoinInfo with disassoc set (op == 1) and
> this client role.

Describe why you need this patch. Which problem you encountered and
wanted to fix.

>
> In firmware (verified on RTL8852AE firmware 0.13.36.2), the JoinInfo
> H2C handler treats (self_role != RTW89_SELF_ROLE_AP && op == 1) as a
> station disconnect request (HAL8852A_Role_Disconnect), which clears the
> newly created role's active bit in the firmware role table and skips
> initializing its CMAC control table entry (CCTL_ResetByMacid). Frames
> queued on that MAC ID are then silently dropped instead of transmitted.
>
> With self_role set to RTW89_SELF_ROLE_AP and net_type kept at
> RTW89_NET_TYPE_NO_LINK, the JoinInfo H2C handler initializes the
> MAC ID's CMAC control entry and connects the role without enabling
> client TBTT tracking (gated on RTW89_SELF_ROLE_CLIENT) or AP beacon
> transmission (gated on RTW89_NET_TYPE_AP_MODE). Set both fields
> explicitly for monitor interfaces.

I'll check firmware people the setting.

(I will review remaining patches tomorrow.)

>
> Signed-off-by: Enver Ikromov <owner@xxxxxxxxxxxxxx>
> ---
> drivers/net/wireless/realtek/rtw89/core.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c
> index 3447f0e..9cf2b03 100644
> --- a/drivers/net/wireless/realtek/rtw89/core.c
> +++ b/drivers/net/wireless/realtek/rtw89/core.c
> @@ -5756,6 +5756,8 @@ void rtw89_vif_type_mapping(struct rtw89_vif_link *rtwvif_link, bool assoc)
> rtwvif_link->self_role = RTW89_SELF_ROLE_CLIENT;
> break;
> case NL80211_IFTYPE_MONITOR:
> + rtwvif_link->net_type = RTW89_NET_TYPE_NO_LINK;
> + rtwvif_link->self_role = RTW89_SELF_ROLE_AP;
> break;
> default:
> WARN_ON(1);
> --
> 2.56.0.windows.4