From 30e769eb272d3c4bd61864490aabbc54c2d4c4b3 Mon Sep 17 00:00:00 2001 From: Yao Xiao Date: Mon, 23 Jun 2025 20:17:57 +0800 Subject: [PATCH] net: mac80211: Added p2p0 for ap mode in softmac Change-Id: I364d7bc0a51907c9518f83e5a49697b00ee9cc11 Signed-off-by: Yao Xiao --- net/mac80211/main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 683301d9f508..c78df0f7494b 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -1406,6 +1406,18 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) "Failed to add default virtual iface\n"); } + /* add one default AP interface if supported */ + if (local->hw.wiphy->interface_modes & (BIT(NL80211_IFTYPE_P2P_GO) | + BIT(NL80211_IFTYPE_P2P_CLIENT)) && !ieee80211_hw_check(hw, NO_AUTO_VIF)) { + struct vif_params params = {0}; + + result = ieee80211_if_add(local, "p2p%d", NET_NAME_ENUM, NULL, + NL80211_IFTYPE_STATION, ¶ms); + if (result) + wiphy_warn(local->hw.wiphy, + "Failed to add p2p virtual iface\n"); + } + wiphy_unlock(hw->wiphy); rtnl_unlock();