wifi: mac80211 add p2p0 [5/6]
authorWeiguang Ruan <Weiguang.ruan@amlogic.com>
Thu, 14 Jun 2018 07:48:14 +0000 (15:48 +0800)
committerWeiguang Ruan <Weiguang.ruan@amlogic.com>
Tue, 19 Jun 2018 05:52:54 +0000 (22:52 -0700)
PD#168467: wifi: mac80211 add p2p0

softmac wifi need mac80211 to register cfg80211 interfaeces
wlan0 is default, add p2p0 for Android WIFI P2P

Change-Id: I6fd48f85e010a1ec9e35954b85205634312c73d9
Signed-off-by: Weiguang Ruan <Weiguang.ruan@amlogic.com>
net/mac80211/main.c

index 2bb6899854d43a8bbd64adf65819f350ac2359eb..8cd0ee708d540fa73c899f20ff60e241c0989410 100644 (file)
@@ -1099,6 +1099,14 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
                        wiphy_warn(local->hw.wiphy,
                                   "Failed to add default virtual iface\n");
        }
+       /* add p2p interface for icomm wifi*/
+       if (local->hw.wiphy->interface_modes & (BIT(NL80211_IFTYPE_P2P_GO) |
+               BIT(NL80211_IFTYPE_P2P_CLIENT))) {
+               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 default virtual iface\n");
+       }
 
        rtnl_unlock();