Thread (8 messages) flat view 8 messages, 2 authors, 14d ago
COOLING14d

[RFC PATCH 1/4] wifi: rtw89: declare P2P_DEVICE in interface modes/combinations

From: andres parra <hidden>
Date: 2026-08-22 17:42:54
Subsystem: the rest · Maintainer: Linus Torvalds

Add BIT(NL80211_IFTYPE_P2P_DEVICE) to hw->wiphy->interface_modes, and a
dedicated { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_DEVICE) } limit
entry to both rtw89_iface_limits[] and rtw89_iface_limits_mcc[],
mirroring how mt792x (mt7921/7922/7925) scopes the same interface type
in its own iface_limit tables rather than merging it into the existing
AP/P2P_CLIENT/P2P_GO bucket.

RTW89_MAX_INTERFACE_NUM (2) is left untouched: it also sizes
rtw89_entity_mgnt's active_roles[]/chanctx_tbl[][] arrays, a real
firmware-resource-tracking constraint, not just a wiphy-advertised
limit. This keeps the new P2P-Device bucket within the existing cap
(e.g. STATION + P2P-Device concurrently), and explicitly defers full
3-way concurrency (STATION + P2P-Client/GO + P2P-Device at once) to a
later change, rather than growing those tracking arrays speculatively.

This commit is purely declarative: no code path creates a P2P-Device
vif yet, so no runtime behavior change is expected for any existing
interface type. Part 1 of 2 for NL80211_IFTYPE_P2P_DEVICE support;
see rtw89-p2p-device-project's PLAN.md/BUILD_LOG.md for the full
research and design behind this change.

Signed-off-by: andres parra <redacted>
---
 core.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/core.c b/core.c
index 397ebbf..5cf29bf 100644
--- a/core.c
+++ b/core.c
@@ -176,6 +176,10 @@ static const struct ieee80211_iface_limit rtw89_iface_limits[] = {
 			 BIT(NL80211_IFTYPE_P2P_GO) |
 			 BIT(NL80211_IFTYPE_AP),
 	},
+	{
+		.max = 1,
+		.types = BIT(NL80211_IFTYPE_P2P_DEVICE),
+	},
 };
 
 static const struct ieee80211_iface_limit rtw89_iface_limits_mcc[] = {
@@ -188,6 +192,10 @@ static const struct ieee80211_iface_limit rtw89_iface_limits_mcc[] = {
 		.types = BIT(NL80211_IFTYPE_P2P_CLIENT) |
 			 BIT(NL80211_IFTYPE_P2P_GO),
 	},
+	{
+		.max = 1,
+		.types = BIT(NL80211_IFTYPE_P2P_DEVICE),
+	},
 };
 
 static const struct ieee80211_iface_combination rtw89_iface_combs[] = {
@@ -7517,7 +7525,8 @@ static int rtw89_core_register_hw(struct rtw89_dev *rtwdev)
 	hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
 				     BIT(NL80211_IFTYPE_AP) |
 				     BIT(NL80211_IFTYPE_P2P_CLIENT) |
-				     BIT(NL80211_IFTYPE_P2P_GO);
+				     BIT(NL80211_IFTYPE_P2P_GO) |
+				     BIT(NL80211_IFTYPE_P2P_DEVICE);
 
 	if (hal->ant_diversity) {
 		hw->wiphy->available_antennas_tx = 0x3;
-- 
2.55.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help