aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_iface.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/ieee80211_iface.c')
-rw-r--r--net/mac80211/ieee80211_iface.c66
1 files changed, 0 insertions, 66 deletions
diff --git a/net/mac80211/ieee80211_iface.c b/net/mac80211/ieee80211_iface.c
index ef618e947e2b..be7e77f66fee 100644
--- a/net/mac80211/ieee80211_iface.c
+++ b/net/mac80211/ieee80211_iface.c
@@ -96,66 +96,6 @@ fail:
96 return ret; 96 return ret;
97} 97}
98 98
99int ieee80211_if_add_mgmt(struct ieee80211_local *local)
100{
101 struct net_device *ndev;
102 struct ieee80211_sub_if_data *nsdata;
103 int ret;
104
105 ASSERT_RTNL();
106
107 ndev = alloc_netdev(sizeof(struct ieee80211_sub_if_data), "wmgmt%d",
108 ieee80211_if_mgmt_setup);
109 if (!ndev)
110 return -ENOMEM;
111 ret = dev_alloc_name(ndev, ndev->name);
112 if (ret < 0)
113 goto fail;
114
115 memcpy(ndev->dev_addr, local->hw.wiphy->perm_addr, ETH_ALEN);
116 SET_NETDEV_DEV(ndev, wiphy_dev(local->hw.wiphy));
117
118 nsdata = IEEE80211_DEV_TO_SUB_IF(ndev);
119 ndev->ieee80211_ptr = &nsdata->wdev;
120 nsdata->wdev.wiphy = local->hw.wiphy;
121 nsdata->type = IEEE80211_IF_TYPE_MGMT;
122 nsdata->dev = ndev;
123 nsdata->local = local;
124 ieee80211_if_sdata_init(nsdata);
125
126 ret = register_netdevice(ndev);
127 if (ret)
128 goto fail;
129
130 /*
131 * Called even when register_netdevice fails, it would
132 * oops if assigned before initialising the rest.
133 */
134 ndev->uninit = ieee80211_if_reinit;
135
136 ieee80211_debugfs_add_netdev(nsdata);
137
138 if (local->open_count > 0)
139 dev_open(ndev);
140 local->apdev = ndev;
141 return 0;
142
143fail:
144 free_netdev(ndev);
145 return ret;
146}
147
148void ieee80211_if_del_mgmt(struct ieee80211_local *local)
149{
150 struct net_device *apdev;
151
152 ASSERT_RTNL();
153 apdev = local->apdev;
154 ieee80211_debugfs_remove_netdev(IEEE80211_DEV_TO_SUB_IF(apdev));
155 local->apdev = NULL;
156 unregister_netdevice(apdev);
157}
158
159void ieee80211_if_set_type(struct net_device *dev, int type) 99void ieee80211_if_set_type(struct net_device *dev, int type)
160{ 100{
161 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 101 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
@@ -247,9 +187,6 @@ void ieee80211_if_reinit(struct net_device *dev)
247 /* cannot happen */ 187 /* cannot happen */
248 WARN_ON(1); 188 WARN_ON(1);
249 break; 189 break;
250 case IEEE80211_IF_TYPE_MGMT:
251 /* nothing to do */
252 break;
253 case IEEE80211_IF_TYPE_AP: { 190 case IEEE80211_IF_TYPE_AP: {
254 /* Remove all virtual interfaces that use this BSS 191 /* Remove all virtual interfaces that use this BSS
255 * as their sdata->bss */ 192 * as their sdata->bss */
@@ -357,11 +294,8 @@ int ieee80211_if_remove(struct net_device *dev, const char *name, int id)
357 294
358void ieee80211_if_free(struct net_device *dev) 295void ieee80211_if_free(struct net_device *dev)
359{ 296{
360 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
361 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 297 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
362 298
363 /* local->apdev must be NULL when freeing management interface */
364 BUG_ON(dev == local->apdev);
365 ieee80211_if_sdata_deinit(sdata); 299 ieee80211_if_sdata_deinit(sdata);
366 free_netdev(dev); 300 free_netdev(dev);
367} 301}