diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 2ee53dc1ddf7..7add5a0596cf 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -1083,6 +1083,15 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) "Failed to add default virtual iface\n"); } + if (local->hw.wiphy->interface_modes & (BIT(NL80211_IFTYPE_P2P_GO) | + BIT(NL80211_IFTYPE_P2P_CLIENT)) && + !ieee80211_hw_check(hw, NO_AUTO_VIF)) { + result = ieee80211_if_add(local, "p2p%d", NET_NAME_ENUM, NULL, + NL80211_IFTYPE_STATION, NULL); + + if (result) + wiphy_warn(local->hw.wiphy, "Failed to add p2p iface\n"); + } rtnl_unlock(); #ifdef CONFIG_INET