All of lore.kernel.org
 help / color / mirror / Atom feed
From: andres parra <andres.parrab@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: andres parra <andres.parrab@gmail.com>
Subject: [RFC PATCH 3/4] wifi: rtw89: handle P2P_DEVICE in net_type/self_role switch
Date: Sat, 22 Aug 2026 19:42:28 +0200	[thread overview]
Message-ID: <20260822174229.65643-4-andres.parrab@gmail.com> (raw)
In-Reply-To: <20260822174229.65643-1-andres.parrab@gmail.com>

rtw89_vif_type_mapping() has a second switch (vif->type) beyond the
wifi_role mapping already fixed -- this one sets net_type/self_role
and also ends in a default: WARN_ON(1). Live-tested on real hardware
(RTL8922AE): the moment wpa_supplicant/NetworkManager requested a
P2P-Device wdev (NL80211_CMD_START_P2P_DEVICE), this WARN_ON fired
immediately, confirmed via the exact call chain this project's
BUILD_LOG.md had already traced by hand: nl80211_start_p2p_device ->
ieee80211_start_p2p_device -> ieee80211_do_open -> drv_add_interface ->
rtw89_ops_add_interface -> __rtw89_ops_add_iface_link ->
rtw89_vif_type_mapping.

This second switch was present in the original research grep
(core.c:5702, two switch(vif->type) sites found) but was not actually
read/analyzed at the time -- a real gap in that research pass, caught
by this live test rather than by review.

Add NL80211_IFTYPE_P2P_DEVICE alongside the existing MONITOR case,
which also just breaks without setting net_type/self_role: a
P2P-Device interface has no BSS/association state, so leaving these at
their zero-initialized defaults (RTW89_NET_TYPE_NO_LINK,
RTW89_SELF_ROLE_CLIENT) is correct, same reasoning already applied to
MONITOR.

Verified live: after this fix, wpa_supplicant successfully created a
real P2P-Device wdev (confirmed via `iw dev`: phy#1 now lists a
non-netdev interface, type P2P-device, alongside wlan0), with zero
WARN/BUG in dmesg for the whole boot, and normal STA association/
roaming continuing to work correctly (multiple successful associate/
reassociate cycles observed with this driver loaded).

Signed-off-by: andres parra <andres.parrab@gmail.com>
---
 core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/core.c b/core.c
index c8f12ef..b4f8d27 100644
--- a/core.c
+++ b/core.c
@@ -5734,6 +5734,7 @@ void rtw89_vif_type_mapping(struct rtw89_vif_link *rtwvif_link, bool assoc)
 		rtwvif_link->addr_cam.sec_ent_mode = RTW89_ADDR_CAM_SEC_NORMAL;
 		break;
 	case NL80211_IFTYPE_MONITOR:
+	case NL80211_IFTYPE_P2P_DEVICE:
 		break;
 	default:
 		WARN_ON(1);
-- 
2.55.0


  parent reply	other threads:[~2026-08-22 17:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-22 17:42 [RFC PATCH 0/4] wifi: rtw89: add NL80211_IFTYPE_P2P_DEVICE support andres parra
2026-08-22 17:42 ` [RFC PATCH 1/4] wifi: rtw89: declare P2P_DEVICE in interface modes/combinations andres parra
2026-08-22 17:42 ` [RFC PATCH 2/4] wifi: rtw89: map P2P_DEVICE to RTW89_WIFI_ROLE_P2P_DEVICE andres parra
2026-08-22 17:42 ` andres parra [this message]
2026-08-22 17:42 ` [RFC PATCH 4/4] wifi: rtw89: raise RTW89_MAX_INTERFACE_NUM to 3 for P2P-Device concurrency andres parra
2026-08-26  7:03 ` [RFC PATCH 0/4] wifi: rtw89: add NL80211_IFTYPE_P2P_DEVICE support Ping-Ke Shih

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260822174229.65643-4-andres.parrab@gmail.com \
    --to=andres.parrab@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.