aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath6kl
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/ath/ath6kl
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/ath/ath6kl')
-rw-r--r--drivers/net/wireless/ath/ath6kl/cfg80211.c6
-rw-r--r--drivers/net/wireless/ath/ath6kl/cfg80211.h1
-rw-r--r--drivers/net/wireless/ath/ath6kl/core.c4
3 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index ff7ba5c195c6..d740f14f3539 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -1496,6 +1496,7 @@ static int ath6kl_cfg80211_set_power_mgmt(struct wiphy *wiphy,
1496 1496
1497static struct wireless_dev *ath6kl_cfg80211_add_iface(struct wiphy *wiphy, 1497static struct wireless_dev *ath6kl_cfg80211_add_iface(struct wiphy *wiphy,
1498 const char *name, 1498 const char *name,
1499 unsigned char name_assign_type,
1499 enum nl80211_iftype type, 1500 enum nl80211_iftype type,
1500 u32 *flags, 1501 u32 *flags,
1501 struct vif_params *params) 1502 struct vif_params *params)
@@ -1514,7 +1515,7 @@ static struct wireless_dev *ath6kl_cfg80211_add_iface(struct wiphy *wiphy,
1514 return ERR_PTR(-EINVAL); 1515 return ERR_PTR(-EINVAL);
1515 } 1516 }
1516 1517
1517 wdev = ath6kl_interface_add(ar, name, type, if_idx, nw_type); 1518 wdev = ath6kl_interface_add(ar, name, name_assign_type, type, if_idx, nw_type);
1518 if (!wdev) 1519 if (!wdev)
1519 return ERR_PTR(-ENOMEM); 1520 return ERR_PTR(-ENOMEM);
1520 1521
@@ -3634,13 +3635,14 @@ void ath6kl_cfg80211_vif_cleanup(struct ath6kl_vif *vif)
3634} 3635}
3635 3636
3636struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name, 3637struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name,
3638 unsigned char name_assign_type,
3637 enum nl80211_iftype type, 3639 enum nl80211_iftype type,
3638 u8 fw_vif_idx, u8 nw_type) 3640 u8 fw_vif_idx, u8 nw_type)
3639{ 3641{
3640 struct net_device *ndev; 3642 struct net_device *ndev;
3641 struct ath6kl_vif *vif; 3643 struct ath6kl_vif *vif;
3642 3644
3643 ndev = alloc_netdev(sizeof(*vif), name, NET_NAME_UNKNOWN, ether_setup); 3645 ndev = alloc_netdev(sizeof(*vif), name, name_assign_type, ether_setup);
3644 if (!ndev) 3646 if (!ndev)
3645 return NULL; 3647 return NULL;
3646 3648
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.h b/drivers/net/wireless/ath/ath6kl/cfg80211.h
index b59becd91aea..5aa57a7639bf 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.h
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.h
@@ -25,6 +25,7 @@ enum ath6kl_cfg_suspend_mode {
25}; 25};
26 26
27struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name, 27struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name,
28 unsigned char name_assign_type,
28 enum nl80211_iftype type, 29 enum nl80211_iftype type,
29 u8 fw_vif_idx, u8 nw_type); 30 u8 fw_vif_idx, u8 nw_type);
30void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq, 31void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq,
diff --git a/drivers/net/wireless/ath/ath6kl/core.c b/drivers/net/wireless/ath/ath6kl/core.c
index 0df74b245af4..4ec02cea0f43 100644
--- a/drivers/net/wireless/ath/ath6kl/core.c
+++ b/drivers/net/wireless/ath/ath6kl/core.c
@@ -211,8 +211,8 @@ int ath6kl_core_init(struct ath6kl *ar, enum ath6kl_htc_type htc_type)
211 rtnl_lock(); 211 rtnl_lock();
212 212
213 /* Add an initial station interface */ 213 /* Add an initial station interface */
214 wdev = ath6kl_interface_add(ar, "wlan%d", NL80211_IFTYPE_STATION, 0, 214 wdev = ath6kl_interface_add(ar, "wlan%d", NET_NAME_ENUM,
215 INFRA_NETWORK); 215 NL80211_IFTYPE_STATION, 0, INFRA_NETWORK);
216 216
217 rtnl_unlock(); 217 rtnl_unlock();
218 218