aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-03-18 06:13:39 -0400
committerJohannes Berg <johannes.berg@intel.com>2015-03-30 04:36:17 -0400
commit6bab2e19c5ffd1f21b28c2cabb3801a37b77ae69 (patch)
tree6e2f45a9254d9def4beecc02c2e14b2fc78d3be5 /drivers/net/wireless/mwifiex
parent6a8b4adb47aea322e376cd1be62781c50dc1a9b5 (diff)
cfg80211: pass name_assign_type to rdev_add_virtual_intf()
This will expose in /sys whether the ifname of a device is set by userspace or generated by the kernel. The latter kind (wlanX, etc) is not deterministic, so userspace needs to rename these devices to names that are guaranteed to stay the same between reboots. The former, however should never be renamed, so userspace needs to be able to reliably tell the difference. Similar functionality was introduced for the rtnetlink core in commit 5517750f058e ("net: rtnetlink - make create_link take name_assign_type") Signed-off-by: Tom Gundersen <teg@jklm.no> Cc: Kalle Valo <kvalo@qca.qualcomm.com> Cc: Brett Rudley <brudley@broadcom.com> Cc: Arend van Spriel <arend@broadcom.com> Cc: Franky (Zhenhui) Lin <frankyl@broadcom.com> Cc: Hante Meuleman <meuleman@broadcom.com> Cc: Johannes Berg <johannes@sipsolutions.net> [reformat changelog to fit 72 cols] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex')
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c5
-rw-r--r--drivers/net/wireless/mwifiex/main.c6
-rw-r--r--drivers/net/wireless/mwifiex/main.h1
3 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index a47eb55bb6da..2d489bfaea08 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -2399,10 +2399,11 @@ mwifiex_setup_ht_caps(struct ieee80211_sta_ht_cap *ht_info,
2399 2399
2400#define MWIFIEX_MAX_WQ_LEN 30 2400#define MWIFIEX_MAX_WQ_LEN 30
2401/* 2401/*
2402 * create a new virtual interface with the given name 2402 * create a new virtual interface with the given name and name assign type
2403 */ 2403 */
2404struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, 2404struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
2405 const char *name, 2405 const char *name,
2406 unsigned char name_assign_type,
2406 enum nl80211_iftype type, 2407 enum nl80211_iftype type,
2407 u32 *flags, 2408 u32 *flags,
2408 struct vif_params *params) 2409 struct vif_params *params)
@@ -2523,7 +2524,7 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
2523 } 2524 }
2524 2525
2525 dev = alloc_netdev_mqs(sizeof(struct mwifiex_private *), name, 2526 dev = alloc_netdev_mqs(sizeof(struct mwifiex_private *), name,
2526 NET_NAME_UNKNOWN, ether_setup, 2527 name_assign_type, ether_setup,
2527 IEEE80211_NUM_ACS, 1); 2528 IEEE80211_NUM_ACS, 1);
2528 if (!dev) { 2529 if (!dev) {
2529 wiphy_err(wiphy, "no memory available for netdevice\n"); 2530 wiphy_err(wiphy, "no memory available for netdevice\n");
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 7e74b4fccddd..6f55e84fcab1 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -466,7 +466,7 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
466 466
467 rtnl_lock(); 467 rtnl_lock();
468 /* Create station interface by default */ 468 /* Create station interface by default */
469 wdev = mwifiex_add_virtual_intf(adapter->wiphy, "mlan%d", 469 wdev = mwifiex_add_virtual_intf(adapter->wiphy, "mlan%d", NET_NAME_ENUM,
470 NL80211_IFTYPE_STATION, NULL, NULL); 470 NL80211_IFTYPE_STATION, NULL, NULL);
471 if (IS_ERR(wdev)) { 471 if (IS_ERR(wdev)) {
472 dev_err(adapter->dev, "cannot create default STA interface\n"); 472 dev_err(adapter->dev, "cannot create default STA interface\n");
@@ -475,7 +475,7 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
475 } 475 }
476 476
477 if (driver_mode & MWIFIEX_DRIVER_MODE_UAP) { 477 if (driver_mode & MWIFIEX_DRIVER_MODE_UAP) {
478 wdev = mwifiex_add_virtual_intf(adapter->wiphy, "uap%d", 478 wdev = mwifiex_add_virtual_intf(adapter->wiphy, "uap%d", NET_NAME_ENUM,
479 NL80211_IFTYPE_AP, NULL, NULL); 479 NL80211_IFTYPE_AP, NULL, NULL);
480 if (IS_ERR(wdev)) { 480 if (IS_ERR(wdev)) {
481 dev_err(adapter->dev, "cannot create AP interface\n"); 481 dev_err(adapter->dev, "cannot create AP interface\n");
@@ -485,7 +485,7 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
485 } 485 }
486 486
487 if (driver_mode & MWIFIEX_DRIVER_MODE_P2P) { 487 if (driver_mode & MWIFIEX_DRIVER_MODE_P2P) {
488 wdev = mwifiex_add_virtual_intf(adapter->wiphy, "p2p%d", 488 wdev = mwifiex_add_virtual_intf(adapter->wiphy, "p2p%d", NET_NAME_ENUM,
489 NL80211_IFTYPE_P2P_CLIENT, NULL, 489 NL80211_IFTYPE_P2P_CLIENT, NULL,
490 NULL); 490 NULL);
491 if (IS_ERR(wdev)) { 491 if (IS_ERR(wdev)) {
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index f0a6af179af0..3f0625f22265 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -1318,6 +1318,7 @@ u8 mwifiex_chan_type_to_sec_chan_offset(enum nl80211_channel_type chan_type);
1318 1318
1319struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, 1319struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
1320 const char *name, 1320 const char *name,
1321 unsigned char name_assign_type,
1321 enum nl80211_iftype type, 1322 enum nl80211_iftype type,
1322 u32 *flags, 1323 u32 *flags,
1323 struct vif_params *params); 1324 struct vif_params *params);