net: mac80211: Added p2p0 for ap mode in softmac

Change-Id: I364d7bc0a51907c9518f83e5a49697b00ee9cc11
Signed-off-by: Yao Xiao <xiaoyao@rock-chips.com>
This commit is contained in:
Yao Xiao
2025-06-23 20:17:57 +08:00
committed by Tao Huang
parent c0d2580727
commit 30e769eb27

View File

@@ -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, &params);
if (result)
wiphy_warn(local->hw.wiphy,
"Failed to add p2p virtual iface\n");
}
wiphy_unlock(hw->wiphy);
rtnl_unlock();