blob: 39d40d1e06dbe78115efbe0e262bca49e4f6270f [file] [log] [blame]
Johannes Berg704232c2007-04-23 12:20:05 -07001/*
2 * This is the linux wireless configuration interface.
3 *
Luis R. Rodriguezf59ac042008-08-29 16:26:43 -07004 * Copyright 2006-2008 Johannes Berg <johannes@sipsolutions.net>
Johannes Berg704232c2007-04-23 12:20:05 -07005 */
6
7#include <linux/if.h>
8#include <linux/module.h>
9#include <linux/err.h>
10#include <linux/mutex.h>
11#include <linux/list.h>
12#include <linux/nl80211.h>
13#include <linux/debugfs.h>
14#include <linux/notifier.h>
15#include <linux/device.h>
16#include <net/genetlink.h>
17#include <net/cfg80211.h>
18#include <net/wireless.h>
Johannes Berg55682962007-09-20 13:09:35 -040019#include "nl80211.h"
Johannes Berg704232c2007-04-23 12:20:05 -070020#include "core.h"
21#include "sysfs.h"
22
23/* name for sysfs, %d is appended */
24#define PHY_NAME "phy"
25
26MODULE_AUTHOR("Johannes Berg");
27MODULE_LICENSE("GPL");
28MODULE_DESCRIPTION("wireless configuration support");
29
30/* RCU might be appropriate here since we usually
31 * only read the list, and that can happen quite
32 * often because we need to do it for each command */
33LIST_HEAD(cfg80211_drv_list);
Luis R. Rodrigueza1794392009-02-21 00:04:21 -050034
35/*
36 * This is used to protect the cfg80211_drv_list, cfg80211_regdomain, and
37 * the last reguluatory request receipt in regd.c
38 */
39DEFINE_MUTEX(cfg80211_mutex);
Johannes Berg704232c2007-04-23 12:20:05 -070040
41/* for debugfs */
42static struct dentry *ieee80211_debugfs_dir;
43
Johannes Berg55682962007-09-20 13:09:35 -040044/* requires cfg80211_drv_mutex to be held! */
Luis R. Rodriguezb5850a72009-02-21 00:04:19 -050045static struct cfg80211_registered_device *
46cfg80211_drv_by_wiphy_idx(int wiphy_idx)
Johannes Berg55682962007-09-20 13:09:35 -040047{
48 struct cfg80211_registered_device *result = NULL, *drv;
49
Luis R. Rodriguez85fd1292009-02-21 00:04:20 -050050 if (!wiphy_idx_valid(wiphy_idx))
51 return NULL;
52
Johannes Berg55682962007-09-20 13:09:35 -040053 list_for_each_entry(drv, &cfg80211_drv_list, list) {
Luis R. Rodriguezb5850a72009-02-21 00:04:19 -050054 if (drv->wiphy_idx == wiphy_idx) {
Johannes Berg55682962007-09-20 13:09:35 -040055 result = drv;
56 break;
57 }
58 }
59
60 return result;
61}
62
Luis R. Rodrigueza1794392009-02-21 00:04:21 -050063/* requires cfg80211_mutex to be held! */
Johannes Berg55682962007-09-20 13:09:35 -040064static struct cfg80211_registered_device *
65__cfg80211_drv_from_info(struct genl_info *info)
66{
67 int ifindex;
Luis R. Rodriguezb5850a72009-02-21 00:04:19 -050068 struct cfg80211_registered_device *bywiphyidx = NULL, *byifidx = NULL;
Johannes Berg55682962007-09-20 13:09:35 -040069 struct net_device *dev;
70 int err = -EINVAL;
71
72 if (info->attrs[NL80211_ATTR_WIPHY]) {
Luis R. Rodriguezb5850a72009-02-21 00:04:19 -050073 bywiphyidx = cfg80211_drv_by_wiphy_idx(
Johannes Berg55682962007-09-20 13:09:35 -040074 nla_get_u32(info->attrs[NL80211_ATTR_WIPHY]));
75 err = -ENODEV;
76 }
77
78 if (info->attrs[NL80211_ATTR_IFINDEX]) {
79 ifindex = nla_get_u32(info->attrs[NL80211_ATTR_IFINDEX]);
80 dev = dev_get_by_index(&init_net, ifindex);
81 if (dev) {
82 if (dev->ieee80211_ptr)
83 byifidx =
84 wiphy_to_dev(dev->ieee80211_ptr->wiphy);
85 dev_put(dev);
86 }
87 err = -ENODEV;
88 }
89
Luis R. Rodriguezb5850a72009-02-21 00:04:19 -050090 if (bywiphyidx && byifidx) {
91 if (bywiphyidx != byifidx)
Johannes Berg55682962007-09-20 13:09:35 -040092 return ERR_PTR(-EINVAL);
93 else
Luis R. Rodriguezb5850a72009-02-21 00:04:19 -050094 return bywiphyidx; /* == byifidx */
Johannes Berg55682962007-09-20 13:09:35 -040095 }
Luis R. Rodriguezb5850a72009-02-21 00:04:19 -050096 if (bywiphyidx)
97 return bywiphyidx;
Johannes Berg55682962007-09-20 13:09:35 -040098
99 if (byifidx)
100 return byifidx;
101
102 return ERR_PTR(err);
103}
104
105struct cfg80211_registered_device *
106cfg80211_get_dev_from_info(struct genl_info *info)
107{
108 struct cfg80211_registered_device *drv;
109
Luis R. Rodrigueza1794392009-02-21 00:04:21 -0500110 mutex_lock(&cfg80211_mutex);
Johannes Berg55682962007-09-20 13:09:35 -0400111 drv = __cfg80211_drv_from_info(info);
112
113 /* if it is not an error we grab the lock on
114 * it to assure it won't be going away while
115 * we operate on it */
116 if (!IS_ERR(drv))
117 mutex_lock(&drv->mtx);
118
Luis R. Rodrigueza1794392009-02-21 00:04:21 -0500119 mutex_unlock(&cfg80211_mutex);
Johannes Berg55682962007-09-20 13:09:35 -0400120
121 return drv;
122}
123
124struct cfg80211_registered_device *
125cfg80211_get_dev_from_ifindex(int ifindex)
126{
127 struct cfg80211_registered_device *drv = ERR_PTR(-ENODEV);
128 struct net_device *dev;
129
Luis R. Rodrigueza1794392009-02-21 00:04:21 -0500130 mutex_lock(&cfg80211_mutex);
Johannes Berg55682962007-09-20 13:09:35 -0400131 dev = dev_get_by_index(&init_net, ifindex);
132 if (!dev)
133 goto out;
134 if (dev->ieee80211_ptr) {
135 drv = wiphy_to_dev(dev->ieee80211_ptr->wiphy);
136 mutex_lock(&drv->mtx);
137 } else
138 drv = ERR_PTR(-ENODEV);
139 dev_put(dev);
140 out:
Luis R. Rodrigueza1794392009-02-21 00:04:21 -0500141 mutex_unlock(&cfg80211_mutex);
Johannes Berg55682962007-09-20 13:09:35 -0400142 return drv;
143}
144
145void cfg80211_put_dev(struct cfg80211_registered_device *drv)
146{
147 BUG_ON(IS_ERR(drv));
148 mutex_unlock(&drv->mtx);
149}
150
151int cfg80211_dev_rename(struct cfg80211_registered_device *rdev,
152 char *newname)
153{
Eric W. Biederman2940bb62008-05-08 14:30:18 -0700154 struct cfg80211_registered_device *drv;
Luis R. Rodriguezb5850a72009-02-21 00:04:19 -0500155 int wiphy_idx, taken = -1, result, digits;
Johannes Berg55682962007-09-20 13:09:35 -0400156
Luis R. Rodrigueza1794392009-02-21 00:04:21 -0500157 mutex_lock(&cfg80211_mutex);
Eric W. Biederman2940bb62008-05-08 14:30:18 -0700158
Johannes Berg55682962007-09-20 13:09:35 -0400159 /* prohibit calling the thing phy%d when %d is not its number */
Luis R. Rodriguezb5850a72009-02-21 00:04:19 -0500160 sscanf(newname, PHY_NAME "%d%n", &wiphy_idx, &taken);
161 if (taken == strlen(newname) && wiphy_idx != rdev->wiphy_idx) {
162 /* count number of places needed to print wiphy_idx */
Johannes Berg55682962007-09-20 13:09:35 -0400163 digits = 1;
Luis R. Rodriguezb5850a72009-02-21 00:04:19 -0500164 while (wiphy_idx /= 10)
Johannes Berg55682962007-09-20 13:09:35 -0400165 digits++;
166 /*
167 * deny the name if it is phy<idx> where <idx> is printed
168 * without leading zeroes. taken == strlen(newname) here
169 */
Eric W. Biederman2940bb62008-05-08 14:30:18 -0700170 result = -EINVAL;
Johannes Berg55682962007-09-20 13:09:35 -0400171 if (taken == strlen(PHY_NAME) + digits)
Eric W. Biederman2940bb62008-05-08 14:30:18 -0700172 goto out_unlock;
Johannes Berg55682962007-09-20 13:09:35 -0400173 }
174
Eric W. Biederman2940bb62008-05-08 14:30:18 -0700175
176 /* Ignore nop renames */
177 result = 0;
178 if (strcmp(newname, dev_name(&rdev->wiphy.dev)) == 0)
179 goto out_unlock;
180
181 /* Ensure another device does not already have this name. */
182 list_for_each_entry(drv, &cfg80211_drv_list, list) {
183 result = -EINVAL;
184 if (strcmp(newname, dev_name(&drv->wiphy.dev)) == 0)
185 goto out_unlock;
186 }
187
188 /* this will only check for collisions in sysfs
189 * which is not even always compiled in.
190 */
Johannes Berg55682962007-09-20 13:09:35 -0400191 result = device_rename(&rdev->wiphy.dev, newname);
192 if (result)
Eric W. Biederman2940bb62008-05-08 14:30:18 -0700193 goto out_unlock;
Johannes Berg55682962007-09-20 13:09:35 -0400194
Johannes Berg33c03602008-10-08 10:23:48 +0200195 if (rdev->wiphy.debugfsdir &&
196 !debugfs_rename(rdev->wiphy.debugfsdir->d_parent,
Johannes Berg55682962007-09-20 13:09:35 -0400197 rdev->wiphy.debugfsdir,
198 rdev->wiphy.debugfsdir->d_parent,
199 newname))
200 printk(KERN_ERR "cfg80211: failed to rename debugfs dir to %s!\n",
201 newname);
202
Eric W. Biederman2940bb62008-05-08 14:30:18 -0700203 result = 0;
204out_unlock:
Luis R. Rodrigueza1794392009-02-21 00:04:21 -0500205 mutex_unlock(&cfg80211_mutex);
Eric W. Biederman2940bb62008-05-08 14:30:18 -0700206 if (result == 0)
207 nl80211_notify_dev_rename(rdev);
Johannes Berg55682962007-09-20 13:09:35 -0400208
Eric W. Biederman2940bb62008-05-08 14:30:18 -0700209 return result;
Johannes Berg55682962007-09-20 13:09:35 -0400210}
211
Johannes Berg704232c2007-04-23 12:20:05 -0700212/* exported functions */
213
214struct wiphy *wiphy_new(struct cfg80211_ops *ops, int sizeof_priv)
215{
Denis ChengRq638af072008-09-23 02:35:37 +0800216 static int wiphy_counter;
217
Johannes Berg704232c2007-04-23 12:20:05 -0700218 struct cfg80211_registered_device *drv;
219 int alloc_size;
220
Johannes Berg41ade002007-12-19 02:03:29 +0100221 WARN_ON(!ops->add_key && ops->del_key);
222 WARN_ON(ops->add_key && !ops->del_key);
223
Johannes Berg704232c2007-04-23 12:20:05 -0700224 alloc_size = sizeof(*drv) + sizeof_priv;
225
226 drv = kzalloc(alloc_size, GFP_KERNEL);
227 if (!drv)
228 return NULL;
229
230 drv->ops = ops;
231
Luis R. Rodrigueza1794392009-02-21 00:04:21 -0500232 mutex_lock(&cfg80211_mutex);
Johannes Berg704232c2007-04-23 12:20:05 -0700233
Luis R. Rodriguezb5850a72009-02-21 00:04:19 -0500234 drv->wiphy_idx = wiphy_counter++;
Johannes Berga4d73ee2007-04-26 20:50:35 -0700235
Luis R. Rodriguez85fd1292009-02-21 00:04:20 -0500236 if (unlikely(!wiphy_idx_valid(drv->wiphy_idx))) {
Denis ChengRq638af072008-09-23 02:35:37 +0800237 wiphy_counter--;
Luis R. Rodrigueza1794392009-02-21 00:04:21 -0500238 mutex_unlock(&cfg80211_mutex);
Johannes Berg704232c2007-04-23 12:20:05 -0700239 /* ugh, wrapped! */
240 kfree(drv);
241 return NULL;
242 }
Johannes Berg704232c2007-04-23 12:20:05 -0700243
Luis R. Rodrigueza1794392009-02-21 00:04:21 -0500244 mutex_unlock(&cfg80211_mutex);
Denis ChengRq638af072008-09-23 02:35:37 +0800245
Johannes Berg704232c2007-04-23 12:20:05 -0700246 /* give it a proper name */
Luis R. Rodriguezb5850a72009-02-21 00:04:19 -0500247 dev_set_name(&drv->wiphy.dev, PHY_NAME "%d", drv->wiphy_idx);
Johannes Berg704232c2007-04-23 12:20:05 -0700248
Johannes Berg704232c2007-04-23 12:20:05 -0700249 mutex_init(&drv->mtx);
250 mutex_init(&drv->devlist_mtx);
251 INIT_LIST_HEAD(&drv->netdev_list);
Johannes Berg2a519312009-02-10 21:25:55 +0100252 spin_lock_init(&drv->bss_lock);
253 INIT_LIST_HEAD(&drv->bss_list);
Johannes Berg704232c2007-04-23 12:20:05 -0700254
255 device_initialize(&drv->wiphy.dev);
256 drv->wiphy.dev.class = &ieee80211_class;
257 drv->wiphy.dev.platform_data = drv;
258
259 return &drv->wiphy;
260}
261EXPORT_SYMBOL(wiphy_new);
262
263int wiphy_register(struct wiphy *wiphy)
264{
265 struct cfg80211_registered_device *drv = wiphy_to_dev(wiphy);
266 int res;
Johannes Berg8318d782008-01-24 19:38:38 +0100267 enum ieee80211_band band;
268 struct ieee80211_supported_band *sband;
269 bool have_band = false;
270 int i;
Luis R. Rodriguezf59ac042008-08-29 16:26:43 -0700271 u16 ifmodes = wiphy->interface_modes;
272
Johannes Berg2a519312009-02-10 21:25:55 +0100273 if (WARN_ON(wiphy->max_scan_ssids < 1))
274 return -EINVAL;
275
Luis R. Rodriguezf59ac042008-08-29 16:26:43 -0700276 /* sanity check ifmodes */
277 WARN_ON(!ifmodes);
278 ifmodes &= ((1 << __NL80211_IFTYPE_AFTER_LAST) - 1) & ~1;
279 if (WARN_ON(ifmodes != wiphy->interface_modes))
280 wiphy->interface_modes = ifmodes;
Johannes Berg8318d782008-01-24 19:38:38 +0100281
282 /* sanity check supported bands/channels */
283 for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
284 sband = wiphy->bands[band];
285 if (!sband)
286 continue;
287
288 sband->band = band;
289
Johannes Berg881d9482009-01-21 15:13:48 +0100290 if (WARN_ON(!sband->n_channels || !sband->n_bitrates))
Johannes Berg8318d782008-01-24 19:38:38 +0100291 return -EINVAL;
Johannes Berg881d9482009-01-21 15:13:48 +0100292
293 /*
294 * Since we use a u32 for rate bitmaps in
295 * ieee80211_get_response_rate, we cannot
296 * have more than 32 legacy rates.
297 */
298 if (WARN_ON(sband->n_bitrates > 32))
299 return -EINVAL;
Johannes Berg8318d782008-01-24 19:38:38 +0100300
301 for (i = 0; i < sband->n_channels; i++) {
302 sband->channels[i].orig_flags =
303 sband->channels[i].flags;
304 sband->channels[i].orig_mag =
305 sband->channels[i].max_antenna_gain;
306 sband->channels[i].orig_mpwr =
307 sband->channels[i].max_power;
308 sband->channels[i].band = band;
309 }
310
311 have_band = true;
312 }
313
314 if (!have_band) {
315 WARN_ON(1);
316 return -EINVAL;
317 }
318
319 /* check and set up bitrates */
320 ieee80211_set_bitrate_flags(wiphy);
321
Luis R. Rodrigueza1794392009-02-21 00:04:21 -0500322 mutex_lock(&cfg80211_mutex);
Johannes Berg704232c2007-04-23 12:20:05 -0700323
Johannes Bergf3b407f2008-10-21 09:57:41 +0200324 /* set up regulatory info */
325 wiphy_update_regulatory(wiphy, REGDOM_SET_BY_CORE);
326
Johannes Berg704232c2007-04-23 12:20:05 -0700327 res = device_add(&drv->wiphy.dev);
328 if (res)
329 goto out_unlock;
330
331 list_add(&drv->list, &cfg80211_drv_list);
332
333 /* add to debugfs */
334 drv->wiphy.debugfsdir =
335 debugfs_create_dir(wiphy_name(&drv->wiphy),
336 ieee80211_debugfs_dir);
Johannes Berg33c03602008-10-08 10:23:48 +0200337 if (IS_ERR(drv->wiphy.debugfsdir))
338 drv->wiphy.debugfsdir = NULL;
Johannes Berg704232c2007-04-23 12:20:05 -0700339
340 res = 0;
341out_unlock:
Luis R. Rodrigueza1794392009-02-21 00:04:21 -0500342 mutex_unlock(&cfg80211_mutex);
Johannes Berg704232c2007-04-23 12:20:05 -0700343 return res;
344}
345EXPORT_SYMBOL(wiphy_register);
346
347void wiphy_unregister(struct wiphy *wiphy)
348{
349 struct cfg80211_registered_device *drv = wiphy_to_dev(wiphy);
350
Johannes Bergf16bfc12007-04-26 20:51:12 -0700351 /* protect the device list */
Luis R. Rodrigueza1794392009-02-21 00:04:21 -0500352 mutex_lock(&cfg80211_mutex);
Johannes Berg704232c2007-04-23 12:20:05 -0700353
Johannes Bergf16bfc12007-04-26 20:51:12 -0700354 BUG_ON(!list_empty(&drv->netdev_list));
355
356 /*
357 * Try to grab drv->mtx. If a command is still in progress,
358 * hopefully the driver will refuse it since it's tearing
359 * down the device already. We wait for this command to complete
360 * before unlinking the item from the list.
361 * Note: as codified by the BUG_ON above we cannot get here if
362 * a virtual interface is still associated. Hence, we can only
363 * get to lock contention here if userspace issues a command
364 * that identified the hardware by wiphy index.
365 */
Johannes Berg704232c2007-04-23 12:20:05 -0700366 mutex_lock(&drv->mtx);
Johannes Bergf16bfc12007-04-26 20:51:12 -0700367 /* unlock again before freeing */
Johannes Berg704232c2007-04-23 12:20:05 -0700368 mutex_unlock(&drv->mtx);
369
Luis R. Rodriguez3f2355c2008-11-12 14:22:02 -0800370 /* If this device got a regulatory hint tell core its
371 * free to listen now to a new shiny device regulatory hint */
372 reg_device_remove(wiphy);
373
Johannes Bergf16bfc12007-04-26 20:51:12 -0700374 list_del(&drv->list);
Johannes Berg704232c2007-04-23 12:20:05 -0700375 device_del(&drv->wiphy.dev);
376 debugfs_remove(drv->wiphy.debugfsdir);
377
Luis R. Rodrigueza1794392009-02-21 00:04:21 -0500378 mutex_unlock(&cfg80211_mutex);
Johannes Berg704232c2007-04-23 12:20:05 -0700379}
380EXPORT_SYMBOL(wiphy_unregister);
381
382void cfg80211_dev_free(struct cfg80211_registered_device *drv)
383{
Johannes Berg2a519312009-02-10 21:25:55 +0100384 struct cfg80211_internal_bss *scan, *tmp;
Johannes Berg704232c2007-04-23 12:20:05 -0700385 mutex_destroy(&drv->mtx);
386 mutex_destroy(&drv->devlist_mtx);
Johannes Berg2a519312009-02-10 21:25:55 +0100387 list_for_each_entry_safe(scan, tmp, &drv->bss_list, list)
Johannes Berg78c1c7e2009-02-10 21:25:57 +0100388 cfg80211_put_bss(&scan->pub);
Johannes Berg704232c2007-04-23 12:20:05 -0700389 kfree(drv);
390}
391
392void wiphy_free(struct wiphy *wiphy)
393{
394 put_device(&wiphy->dev);
395}
396EXPORT_SYMBOL(wiphy_free);
397
398static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
399 unsigned long state,
400 void *ndev)
401{
402 struct net_device *dev = ndev;
403 struct cfg80211_registered_device *rdev;
404
405 if (!dev->ieee80211_ptr)
406 return 0;
407
408 rdev = wiphy_to_dev(dev->ieee80211_ptr->wiphy);
409
Johannes Berg60719ff2008-09-16 14:55:09 +0200410 WARN_ON(dev->ieee80211_ptr->iftype == NL80211_IFTYPE_UNSPECIFIED);
411
Johannes Berg704232c2007-04-23 12:20:05 -0700412 switch (state) {
413 case NETDEV_REGISTER:
414 mutex_lock(&rdev->devlist_mtx);
415 list_add(&dev->ieee80211_ptr->list, &rdev->netdev_list);
416 if (sysfs_create_link(&dev->dev.kobj, &rdev->wiphy.dev.kobj,
417 "phy80211")) {
418 printk(KERN_ERR "wireless: failed to add phy80211 "
419 "symlink to netdev!\n");
420 }
421 dev->ieee80211_ptr->netdev = dev;
422 mutex_unlock(&rdev->devlist_mtx);
423 break;
424 case NETDEV_UNREGISTER:
425 mutex_lock(&rdev->devlist_mtx);
426 if (!list_empty(&dev->ieee80211_ptr->list)) {
427 sysfs_remove_link(&dev->dev.kobj, "phy80211");
428 list_del_init(&dev->ieee80211_ptr->list);
429 }
430 mutex_unlock(&rdev->devlist_mtx);
431 break;
432 }
433
434 return 0;
435}
436
437static struct notifier_block cfg80211_netdev_notifier = {
438 .notifier_call = cfg80211_netdev_notifier_call,
439};
440
441static int cfg80211_init(void)
442{
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -0700443 int err;
444
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -0700445 err = wiphy_sysfs_init();
Johannes Berg704232c2007-04-23 12:20:05 -0700446 if (err)
447 goto out_fail_sysfs;
448
449 err = register_netdevice_notifier(&cfg80211_netdev_notifier);
450 if (err)
451 goto out_fail_notifier;
452
Johannes Berg55682962007-09-20 13:09:35 -0400453 err = nl80211_init();
454 if (err)
455 goto out_fail_nl80211;
456
Johannes Berg704232c2007-04-23 12:20:05 -0700457 ieee80211_debugfs_dir = debugfs_create_dir("ieee80211", NULL);
458
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -0700459 err = regulatory_init();
460 if (err)
461 goto out_fail_reg;
462
Johannes Berg704232c2007-04-23 12:20:05 -0700463 return 0;
464
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -0700465out_fail_reg:
466 debugfs_remove(ieee80211_debugfs_dir);
Johannes Berg55682962007-09-20 13:09:35 -0400467out_fail_nl80211:
468 unregister_netdevice_notifier(&cfg80211_netdev_notifier);
Johannes Berg704232c2007-04-23 12:20:05 -0700469out_fail_notifier:
470 wiphy_sysfs_exit();
471out_fail_sysfs:
472 return err;
473}
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -0700474
Johannes Berg3a462462007-09-10 13:44:45 +0200475subsys_initcall(cfg80211_init);
Johannes Berg704232c2007-04-23 12:20:05 -0700476
477static void cfg80211_exit(void)
478{
479 debugfs_remove(ieee80211_debugfs_dir);
Johannes Berg55682962007-09-20 13:09:35 -0400480 nl80211_exit();
Johannes Berg704232c2007-04-23 12:20:05 -0700481 unregister_netdevice_notifier(&cfg80211_netdev_notifier);
482 wiphy_sysfs_exit();
Luis R. Rodriguezb2e1b302008-09-09 23:19:48 -0700483 regulatory_exit();
Johannes Berg704232c2007-04-23 12:20:05 -0700484}
485module_exit(cfg80211_exit);