aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/core.c228
-rw-r--r--net/wireless/core.h26
-rw-r--r--net/wireless/debugfs.c14
-rw-r--r--net/wireless/debugfs.h8
-rw-r--r--net/wireless/nl80211.c340
-rw-r--r--net/wireless/reg.c48
-rw-r--r--net/wireless/sme.c48
7 files changed, 356 insertions, 356 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 9c73769440a8..b5e2f6dfa333 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -30,10 +30,10 @@ MODULE_DESCRIPTION("wireless configuration support");
30/* RCU might be appropriate here since we usually 30/* RCU might be appropriate here since we usually
31 * only read the list, and that can happen quite 31 * only read the list, and that can happen quite
32 * often because we need to do it for each command */ 32 * often because we need to do it for each command */
33LIST_HEAD(cfg80211_drv_list); 33LIST_HEAD(cfg80211_rdev_list);
34 34
35/* 35/*
36 * This is used to protect the cfg80211_drv_list, cfg80211_regdomain, 36 * This is used to protect the cfg80211_rdev_list, cfg80211_regdomain,
37 * country_ie_regdomain, the reg_beacon_list and the the last regulatory 37 * country_ie_regdomain, the reg_beacon_list and the the last regulatory
38 * request receipt (last_request). 38 * request receipt (last_request).
39 */ 39 */
@@ -43,18 +43,18 @@ DEFINE_MUTEX(cfg80211_mutex);
43static struct dentry *ieee80211_debugfs_dir; 43static struct dentry *ieee80211_debugfs_dir;
44 44
45/* requires cfg80211_mutex to be held! */ 45/* requires cfg80211_mutex to be held! */
46struct cfg80211_registered_device *cfg80211_drv_by_wiphy_idx(int wiphy_idx) 46struct cfg80211_registered_device *cfg80211_rdev_by_wiphy_idx(int wiphy_idx)
47{ 47{
48 struct cfg80211_registered_device *result = NULL, *drv; 48 struct cfg80211_registered_device *result = NULL, *rdev;
49 49
50 if (!wiphy_idx_valid(wiphy_idx)) 50 if (!wiphy_idx_valid(wiphy_idx))
51 return NULL; 51 return NULL;
52 52
53 assert_cfg80211_lock(); 53 assert_cfg80211_lock();
54 54
55 list_for_each_entry(drv, &cfg80211_drv_list, list) { 55 list_for_each_entry(rdev, &cfg80211_rdev_list, list) {
56 if (drv->wiphy_idx == wiphy_idx) { 56 if (rdev->wiphy_idx == wiphy_idx) {
57 result = drv; 57 result = rdev;
58 break; 58 break;
59 } 59 }
60 } 60 }
@@ -64,32 +64,32 @@ struct cfg80211_registered_device *cfg80211_drv_by_wiphy_idx(int wiphy_idx)
64 64
65int get_wiphy_idx(struct wiphy *wiphy) 65int get_wiphy_idx(struct wiphy *wiphy)
66{ 66{
67 struct cfg80211_registered_device *drv; 67 struct cfg80211_registered_device *rdev;
68 if (!wiphy) 68 if (!wiphy)
69 return WIPHY_IDX_STALE; 69 return WIPHY_IDX_STALE;
70 drv = wiphy_to_dev(wiphy); 70 rdev = wiphy_to_dev(wiphy);
71 return drv->wiphy_idx; 71 return rdev->wiphy_idx;
72} 72}
73 73
74/* requires cfg80211_drv_mutex to be held! */ 74/* requires cfg80211_rdev_mutex to be held! */
75struct wiphy *wiphy_idx_to_wiphy(int wiphy_idx) 75struct wiphy *wiphy_idx_to_wiphy(int wiphy_idx)
76{ 76{
77 struct cfg80211_registered_device *drv; 77 struct cfg80211_registered_device *rdev;
78 78
79 if (!wiphy_idx_valid(wiphy_idx)) 79 if (!wiphy_idx_valid(wiphy_idx))
80 return NULL; 80 return NULL;
81 81
82 assert_cfg80211_lock(); 82 assert_cfg80211_lock();
83 83
84 drv = cfg80211_drv_by_wiphy_idx(wiphy_idx); 84 rdev = cfg80211_rdev_by_wiphy_idx(wiphy_idx);
85 if (!drv) 85 if (!rdev)
86 return NULL; 86 return NULL;
87 return &drv->wiphy; 87 return &rdev->wiphy;
88} 88}
89 89
90/* requires cfg80211_mutex to be held! */ 90/* requires cfg80211_mutex to be held! */
91struct cfg80211_registered_device * 91struct cfg80211_registered_device *
92__cfg80211_drv_from_info(struct genl_info *info) 92__cfg80211_rdev_from_info(struct genl_info *info)
93{ 93{
94 int ifindex; 94 int ifindex;
95 struct cfg80211_registered_device *bywiphyidx = NULL, *byifidx = NULL; 95 struct cfg80211_registered_device *bywiphyidx = NULL, *byifidx = NULL;
@@ -99,7 +99,7 @@ __cfg80211_drv_from_info(struct genl_info *info)
99 assert_cfg80211_lock(); 99 assert_cfg80211_lock();
100 100
101 if (info->attrs[NL80211_ATTR_WIPHY]) { 101 if (info->attrs[NL80211_ATTR_WIPHY]) {
102 bywiphyidx = cfg80211_drv_by_wiphy_idx( 102 bywiphyidx = cfg80211_rdev_by_wiphy_idx(
103 nla_get_u32(info->attrs[NL80211_ATTR_WIPHY])); 103 nla_get_u32(info->attrs[NL80211_ATTR_WIPHY]));
104 err = -ENODEV; 104 err = -ENODEV;
105 } 105 }
@@ -134,26 +134,26 @@ __cfg80211_drv_from_info(struct genl_info *info)
134struct cfg80211_registered_device * 134struct cfg80211_registered_device *
135cfg80211_get_dev_from_info(struct genl_info *info) 135cfg80211_get_dev_from_info(struct genl_info *info)
136{ 136{
137 struct cfg80211_registered_device *drv; 137 struct cfg80211_registered_device *rdev;
138 138
139 mutex_lock(&cfg80211_mutex); 139 mutex_lock(&cfg80211_mutex);
140 drv = __cfg80211_drv_from_info(info); 140 rdev = __cfg80211_rdev_from_info(info);
141 141
142 /* if it is not an error we grab the lock on 142 /* if it is not an error we grab the lock on
143 * it to assure it won't be going away while 143 * it to assure it won't be going away while
144 * we operate on it */ 144 * we operate on it */
145 if (!IS_ERR(drv)) 145 if (!IS_ERR(rdev))
146 mutex_lock(&drv->mtx); 146 mutex_lock(&rdev->mtx);
147 147
148 mutex_unlock(&cfg80211_mutex); 148 mutex_unlock(&cfg80211_mutex);
149 149
150 return drv; 150 return rdev;
151} 151}
152 152
153struct cfg80211_registered_device * 153struct cfg80211_registered_device *
154cfg80211_get_dev_from_ifindex(int ifindex) 154cfg80211_get_dev_from_ifindex(int ifindex)
155{ 155{
156 struct cfg80211_registered_device *drv = ERR_PTR(-ENODEV); 156 struct cfg80211_registered_device *rdev = ERR_PTR(-ENODEV);
157 struct net_device *dev; 157 struct net_device *dev;
158 158
159 mutex_lock(&cfg80211_mutex); 159 mutex_lock(&cfg80211_mutex);
@@ -161,21 +161,21 @@ cfg80211_get_dev_from_ifindex(int ifindex)
161 if (!dev) 161 if (!dev)
162 goto out; 162 goto out;
163 if (dev->ieee80211_ptr) { 163 if (dev->ieee80211_ptr) {
164 drv = wiphy_to_dev(dev->ieee80211_ptr->wiphy); 164 rdev = wiphy_to_dev(dev->ieee80211_ptr->wiphy);
165 mutex_lock(&drv->mtx); 165 mutex_lock(&rdev->mtx);
166 } else 166 } else
167 drv = ERR_PTR(-ENODEV); 167 rdev = ERR_PTR(-ENODEV);
168 dev_put(dev); 168 dev_put(dev);
169 out: 169 out:
170 mutex_unlock(&cfg80211_mutex); 170 mutex_unlock(&cfg80211_mutex);
171 return drv; 171 return rdev;
172} 172}
173 173
174/* requires cfg80211_mutex to be held */ 174/* requires cfg80211_mutex to be held */
175int cfg80211_dev_rename(struct cfg80211_registered_device *rdev, 175int cfg80211_dev_rename(struct cfg80211_registered_device *rdev,
176 char *newname) 176 char *newname)
177{ 177{
178 struct cfg80211_registered_device *drv; 178 struct cfg80211_registered_device *rdev2;
179 int wiphy_idx, taken = -1, result, digits; 179 int wiphy_idx, taken = -1, result, digits;
180 180
181 assert_cfg80211_lock(); 181 assert_cfg80211_lock();
@@ -201,8 +201,8 @@ int cfg80211_dev_rename(struct cfg80211_registered_device *rdev,
201 return 0; 201 return 0;
202 202
203 /* Ensure another device does not already have this name. */ 203 /* Ensure another device does not already have this name. */
204 list_for_each_entry(drv, &cfg80211_drv_list, list) 204 list_for_each_entry(rdev2, &cfg80211_rdev_list, list)
205 if (strcmp(newname, dev_name(&drv->wiphy.dev)) == 0) 205 if (strcmp(newname, dev_name(&rdev2->wiphy.dev)) == 0)
206 return -EINVAL; 206 return -EINVAL;
207 207
208 result = device_rename(&rdev->wiphy.dev, newname); 208 result = device_rename(&rdev->wiphy.dev, newname);
@@ -224,26 +224,26 @@ int cfg80211_dev_rename(struct cfg80211_registered_device *rdev,
224 224
225static void cfg80211_rfkill_poll(struct rfkill *rfkill, void *data) 225static void cfg80211_rfkill_poll(struct rfkill *rfkill, void *data)
226{ 226{
227 struct cfg80211_registered_device *drv = data; 227 struct cfg80211_registered_device *rdev = data;
228 228
229 drv->ops->rfkill_poll(&drv->wiphy); 229 rdev->ops->rfkill_poll(&rdev->wiphy);
230} 230}
231 231
232static int cfg80211_rfkill_set_block(void *data, bool blocked) 232static int cfg80211_rfkill_set_block(void *data, bool blocked)
233{ 233{
234 struct cfg80211_registered_device *drv = data; 234 struct cfg80211_registered_device *rdev = data;
235 struct wireless_dev *wdev; 235 struct wireless_dev *wdev;
236 236
237 if (!blocked) 237 if (!blocked)
238 return 0; 238 return 0;
239 239
240 rtnl_lock(); 240 rtnl_lock();
241 mutex_lock(&drv->devlist_mtx); 241 mutex_lock(&rdev->devlist_mtx);
242 242
243 list_for_each_entry(wdev, &drv->netdev_list, list) 243 list_for_each_entry(wdev, &rdev->netdev_list, list)
244 dev_close(wdev->netdev); 244 dev_close(wdev->netdev);
245 245
246 mutex_unlock(&drv->devlist_mtx); 246 mutex_unlock(&rdev->devlist_mtx);
247 rtnl_unlock(); 247 rtnl_unlock();
248 248
249 return 0; 249 return 0;
@@ -251,10 +251,10 @@ static int cfg80211_rfkill_set_block(void *data, bool blocked)
251 251
252static void cfg80211_rfkill_sync_work(struct work_struct *work) 252static void cfg80211_rfkill_sync_work(struct work_struct *work)
253{ 253{
254 struct cfg80211_registered_device *drv; 254 struct cfg80211_registered_device *rdev;
255 255
256 drv = container_of(work, struct cfg80211_registered_device, rfkill_sync); 256 rdev = container_of(work, struct cfg80211_registered_device, rfkill_sync);
257 cfg80211_rfkill_set_block(drv, rfkill_blocked(drv->rfkill)); 257 cfg80211_rfkill_set_block(rdev, rfkill_blocked(rdev->rfkill));
258} 258}
259 259
260static void cfg80211_process_events(struct wireless_dev *wdev) 260static void cfg80211_process_events(struct wireless_dev *wdev)
@@ -328,79 +328,79 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv)
328{ 328{
329 static int wiphy_counter; 329 static int wiphy_counter;
330 330
331 struct cfg80211_registered_device *drv; 331 struct cfg80211_registered_device *rdev;
332 int alloc_size; 332 int alloc_size;
333 333
334 WARN_ON(!ops->add_key && ops->del_key); 334 WARN_ON(!ops->add_key && ops->del_key);
335 WARN_ON(ops->add_key && !ops->del_key); 335 WARN_ON(ops->add_key && !ops->del_key);
336 336
337 alloc_size = sizeof(*drv) + sizeof_priv; 337 alloc_size = sizeof(*rdev) + sizeof_priv;
338 338
339 drv = kzalloc(alloc_size, GFP_KERNEL); 339 rdev = kzalloc(alloc_size, GFP_KERNEL);
340 if (!drv) 340 if (!rdev)
341 return NULL; 341 return NULL;
342 342
343 drv->ops = ops; 343 rdev->ops = ops;
344 344
345 mutex_lock(&cfg80211_mutex); 345 mutex_lock(&cfg80211_mutex);
346 346
347 drv->wiphy_idx = wiphy_counter++; 347 rdev->wiphy_idx = wiphy_counter++;
348 348
349 if (unlikely(!wiphy_idx_valid(drv->wiphy_idx))) { 349 if (unlikely(!wiphy_idx_valid(rdev->wiphy_idx))) {
350 wiphy_counter--; 350 wiphy_counter--;
351 mutex_unlock(&cfg80211_mutex); 351 mutex_unlock(&cfg80211_mutex);
352 /* ugh, wrapped! */ 352 /* ugh, wrapped! */
353 kfree(drv); 353 kfree(rdev);
354 return NULL; 354 return NULL;
355 } 355 }
356 356
357 mutex_unlock(&cfg80211_mutex); 357 mutex_unlock(&cfg80211_mutex);
358 358
359 /* give it a proper name */ 359 /* give it a proper name */
360 dev_set_name(&drv->wiphy.dev, PHY_NAME "%d", drv->wiphy_idx); 360 dev_set_name(&rdev->wiphy.dev, PHY_NAME "%d", rdev->wiphy_idx);
361 361
362 mutex_init(&drv->mtx); 362 mutex_init(&rdev->mtx);
363 mutex_init(&drv->devlist_mtx); 363 mutex_init(&rdev->devlist_mtx);
364 INIT_LIST_HEAD(&drv->netdev_list); 364 INIT_LIST_HEAD(&rdev->netdev_list);
365 spin_lock_init(&drv->bss_lock); 365 spin_lock_init(&rdev->bss_lock);
366 INIT_LIST_HEAD(&drv->bss_list); 366 INIT_LIST_HEAD(&rdev->bss_list);
367 INIT_WORK(&drv->scan_done_wk, __cfg80211_scan_done); 367 INIT_WORK(&rdev->scan_done_wk, __cfg80211_scan_done);
368 368
369 device_initialize(&drv->wiphy.dev); 369 device_initialize(&rdev->wiphy.dev);
370 drv->wiphy.dev.class = &ieee80211_class; 370 rdev->wiphy.dev.class = &ieee80211_class;
371 drv->wiphy.dev.platform_data = drv; 371 rdev->wiphy.dev.platform_data = rdev;
372 372
373 drv->rfkill_ops.set_block = cfg80211_rfkill_set_block; 373 rdev->rfkill_ops.set_block = cfg80211_rfkill_set_block;
374 drv->rfkill = rfkill_alloc(dev_name(&drv->wiphy.dev), 374 rdev->rfkill = rfkill_alloc(dev_name(&rdev->wiphy.dev),
375 &drv->wiphy.dev, RFKILL_TYPE_WLAN, 375 &rdev->wiphy.dev, RFKILL_TYPE_WLAN,
376 &drv->rfkill_ops, drv); 376 &rdev->rfkill_ops, rdev);
377 377
378 if (!drv->rfkill) { 378 if (!rdev->rfkill) {
379 kfree(drv); 379 kfree(rdev);
380 return NULL; 380 return NULL;
381 } 381 }
382 382
383 INIT_WORK(&drv->rfkill_sync, cfg80211_rfkill_sync_work); 383 INIT_WORK(&rdev->rfkill_sync, cfg80211_rfkill_sync_work);
384 INIT_WORK(&drv->conn_work, cfg80211_conn_work); 384 INIT_WORK(&rdev->conn_work, cfg80211_conn_work);
385 INIT_WORK(&drv->event_work, cfg80211_event_work); 385 INIT_WORK(&rdev->event_work, cfg80211_event_work);
386 386
387 /* 387 /*
388 * Initialize wiphy parameters to IEEE 802.11 MIB default values. 388 * Initialize wiphy parameters to IEEE 802.11 MIB default values.
389 * Fragmentation and RTS threshold are disabled by default with the 389 * Fragmentation and RTS threshold are disabled by default with the
390 * special -1 value. 390 * special -1 value.
391 */ 391 */
392 drv->wiphy.retry_short = 7; 392 rdev->wiphy.retry_short = 7;
393 drv->wiphy.retry_long = 4; 393 rdev->wiphy.retry_long = 4;
394 drv->wiphy.frag_threshold = (u32) -1; 394 rdev->wiphy.frag_threshold = (u32) -1;
395 drv->wiphy.rts_threshold = (u32) -1; 395 rdev->wiphy.rts_threshold = (u32) -1;
396 396
397 return &drv->wiphy; 397 return &rdev->wiphy;
398} 398}
399EXPORT_SYMBOL(wiphy_new); 399EXPORT_SYMBOL(wiphy_new);
400 400
401int wiphy_register(struct wiphy *wiphy) 401int wiphy_register(struct wiphy *wiphy)
402{ 402{
403 struct cfg80211_registered_device *drv = wiphy_to_dev(wiphy); 403 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
404 int res; 404 int res;
405 enum ieee80211_band band; 405 enum ieee80211_band band;
406 struct ieee80211_supported_band *sband; 406 struct ieee80211_supported_band *sband;
@@ -454,11 +454,11 @@ int wiphy_register(struct wiphy *wiphy)
454 /* check and set up bitrates */ 454 /* check and set up bitrates */
455 ieee80211_set_bitrate_flags(wiphy); 455 ieee80211_set_bitrate_flags(wiphy);
456 456
457 res = device_add(&drv->wiphy.dev); 457 res = device_add(&rdev->wiphy.dev);
458 if (res) 458 if (res)
459 return res; 459 return res;
460 460
461 res = rfkill_register(drv->rfkill); 461 res = rfkill_register(rdev->rfkill);
462 if (res) 462 if (res)
463 goto out_rm_dev; 463 goto out_rm_dev;
464 464
@@ -467,16 +467,16 @@ int wiphy_register(struct wiphy *wiphy)
467 /* set up regulatory info */ 467 /* set up regulatory info */
468 wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE); 468 wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE);
469 469
470 list_add(&drv->list, &cfg80211_drv_list); 470 list_add(&rdev->list, &cfg80211_rdev_list);
471 471
472 mutex_unlock(&cfg80211_mutex); 472 mutex_unlock(&cfg80211_mutex);
473 473
474 /* add to debugfs */ 474 /* add to debugfs */
475 drv->wiphy.debugfsdir = 475 rdev->wiphy.debugfsdir =
476 debugfs_create_dir(wiphy_name(&drv->wiphy), 476 debugfs_create_dir(wiphy_name(&rdev->wiphy),
477 ieee80211_debugfs_dir); 477 ieee80211_debugfs_dir);
478 if (IS_ERR(drv->wiphy.debugfsdir)) 478 if (IS_ERR(rdev->wiphy.debugfsdir))
479 drv->wiphy.debugfsdir = NULL; 479 rdev->wiphy.debugfsdir = NULL;
480 480
481 if (wiphy->custom_regulatory) { 481 if (wiphy->custom_regulatory) {
482 struct regulatory_request request; 482 struct regulatory_request request;
@@ -489,48 +489,48 @@ int wiphy_register(struct wiphy *wiphy)
489 nl80211_send_reg_change_event(&request); 489 nl80211_send_reg_change_event(&request);
490 } 490 }
491 491
492 cfg80211_debugfs_drv_add(drv); 492 cfg80211_debugfs_rdev_add(rdev);
493 493
494 return 0; 494 return 0;
495 495
496 out_rm_dev: 496 out_rm_dev:
497 device_del(&drv->wiphy.dev); 497 device_del(&rdev->wiphy.dev);
498 return res; 498 return res;
499} 499}
500EXPORT_SYMBOL(wiphy_register); 500EXPORT_SYMBOL(wiphy_register);
501 501
502void wiphy_rfkill_start_polling(struct wiphy *wiphy) 502void wiphy_rfkill_start_polling(struct wiphy *wiphy)
503{ 503{
504 struct cfg80211_registered_device *drv = wiphy_to_dev(wiphy); 504 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
505 505
506 if (!drv->ops->rfkill_poll) 506 if (!rdev->ops->rfkill_poll)
507 return; 507 return;
508 drv->rfkill_ops.poll = cfg80211_rfkill_poll; 508 rdev->rfkill_ops.poll = cfg80211_rfkill_poll;
509 rfkill_resume_polling(drv->rfkill); 509 rfkill_resume_polling(rdev->rfkill);
510} 510}
511EXPORT_SYMBOL(wiphy_rfkill_start_polling); 511EXPORT_SYMBOL(wiphy_rfkill_start_polling);
512 512
513void wiphy_rfkill_stop_polling(struct wiphy *wiphy) 513void wiphy_rfkill_stop_polling(struct wiphy *wiphy)
514{ 514{
515 struct cfg80211_registered_device *drv = wiphy_to_dev(wiphy); 515 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
516 516
517 rfkill_pause_polling(drv->rfkill); 517 rfkill_pause_polling(rdev->rfkill);
518} 518}
519EXPORT_SYMBOL(wiphy_rfkill_stop_polling); 519EXPORT_SYMBOL(wiphy_rfkill_stop_polling);
520 520
521void wiphy_unregister(struct wiphy *wiphy) 521void wiphy_unregister(struct wiphy *wiphy)
522{ 522{
523 struct cfg80211_registered_device *drv = wiphy_to_dev(wiphy); 523 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
524 524
525 rfkill_unregister(drv->rfkill); 525 rfkill_unregister(rdev->rfkill);
526 526
527 /* protect the device list */ 527 /* protect the device list */
528 mutex_lock(&cfg80211_mutex); 528 mutex_lock(&cfg80211_mutex);
529 529
530 BUG_ON(!list_empty(&drv->netdev_list)); 530 BUG_ON(!list_empty(&rdev->netdev_list));
531 531
532 /* 532 /*
533 * Try to grab drv->mtx. If a command is still in progress, 533 * Try to grab rdev->mtx. If a command is still in progress,
534 * hopefully the driver will refuse it since it's tearing 534 * hopefully the driver will refuse it since it's tearing
535 * down the device already. We wait for this command to complete 535 * down the device already. We wait for this command to complete
536 * before unlinking the item from the list. 536 * before unlinking the item from the list.
@@ -539,38 +539,38 @@ void wiphy_unregister(struct wiphy *wiphy)
539 * get to lock contention here if userspace issues a command 539 * get to lock contention here if userspace issues a command
540 * that identified the hardware by wiphy index. 540 * that identified the hardware by wiphy index.
541 */ 541 */
542 mutex_lock(&drv->mtx); 542 mutex_lock(&rdev->mtx);
543 /* unlock again before freeing */ 543 /* unlock again before freeing */
544 mutex_unlock(&drv->mtx); 544 mutex_unlock(&rdev->mtx);
545 545
546 cancel_work_sync(&drv->conn_work); 546 cancel_work_sync(&rdev->conn_work);
547 cancel_work_sync(&drv->scan_done_wk); 547 cancel_work_sync(&rdev->scan_done_wk);
548 kfree(drv->scan_req); 548 kfree(rdev->scan_req);
549 flush_work(&drv->event_work); 549 flush_work(&rdev->event_work);
550 550
551 cfg80211_debugfs_drv_del(drv); 551 cfg80211_debugfs_rdev_del(rdev);
552 552
553 /* If this device got a regulatory hint tell core its 553 /* If this device got a regulatory hint tell core its
554 * free to listen now to a new shiny device regulatory hint */ 554 * free to listen now to a new shiny device regulatory hint */
555 reg_device_remove(wiphy); 555 reg_device_remove(wiphy);
556 556
557 list_del(&drv->list); 557 list_del(&rdev->list);
558 device_del(&drv->wiphy.dev); 558 device_del(&rdev->wiphy.dev);
559 debugfs_remove(drv->wiphy.debugfsdir); 559 debugfs_remove(rdev->wiphy.debugfsdir);
560 560
561 mutex_unlock(&cfg80211_mutex); 561 mutex_unlock(&cfg80211_mutex);
562} 562}
563EXPORT_SYMBOL(wiphy_unregister); 563EXPORT_SYMBOL(wiphy_unregister);
564 564
565void cfg80211_dev_free(struct cfg80211_registered_device *drv) 565void cfg80211_dev_free(struct cfg80211_registered_device *rdev)
566{ 566{
567 struct cfg80211_internal_bss *scan, *tmp; 567 struct cfg80211_internal_bss *scan, *tmp;
568 rfkill_destroy(drv->rfkill); 568 rfkill_destroy(rdev->rfkill);
569 mutex_destroy(&drv->mtx); 569 mutex_destroy(&rdev->mtx);
570 mutex_destroy(&drv->devlist_mtx); 570 mutex_destroy(&rdev->devlist_mtx);
571 list_for_each_entry_safe(scan, tmp, &drv->bss_list, list) 571 list_for_each_entry_safe(scan, tmp, &rdev->bss_list, list)
572 cfg80211_put_bss(&scan->pub); 572 cfg80211_put_bss(&scan->pub);
573 kfree(drv); 573 kfree(rdev);
574} 574}
575 575
576void wiphy_free(struct wiphy *wiphy) 576void wiphy_free(struct wiphy *wiphy)
@@ -581,10 +581,10 @@ EXPORT_SYMBOL(wiphy_free);
581 581
582void wiphy_rfkill_set_hw_state(struct wiphy *wiphy, bool blocked) 582void wiphy_rfkill_set_hw_state(struct wiphy *wiphy, bool blocked)
583{ 583{
584 struct cfg80211_registered_device *drv = wiphy_to_dev(wiphy); 584 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
585 585
586 if (rfkill_set_hw_state(drv->rfkill, blocked)) 586 if (rfkill_set_hw_state(rdev->rfkill, blocked))
587 schedule_work(&drv->rfkill_sync); 587 schedule_work(&rdev->rfkill_sync);
588} 588}
589EXPORT_SYMBOL(wiphy_rfkill_set_hw_state); 589EXPORT_SYMBOL(wiphy_rfkill_set_hw_state);
590 590
diff --git a/net/wireless/core.h b/net/wireless/core.h
index 5ccd642e183b..e46cd6eb61d7 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -97,13 +97,13 @@ bool wiphy_idx_valid(int wiphy_idx)
97} 97}
98 98
99extern struct mutex cfg80211_mutex; 99extern struct mutex cfg80211_mutex;
100extern struct list_head cfg80211_drv_list; 100extern struct list_head cfg80211_rdev_list;
101 101
102#define assert_cfg80211_lock() WARN_ON(!mutex_is_locked(&cfg80211_mutex)) 102#define assert_cfg80211_lock() WARN_ON(!mutex_is_locked(&cfg80211_mutex))
103 103
104/* 104/*
105 * You can use this to mark a wiphy_idx as not having an associated wiphy. 105 * You can use this to mark a wiphy_idx as not having an associated wiphy.
106 * It guarantees cfg80211_drv_by_wiphy_idx(wiphy_idx) will return NULL 106 * It guarantees cfg80211_rdev_by_wiphy_idx(wiphy_idx) will return NULL
107 */ 107 */
108#define WIPHY_IDX_STALE -1 108#define WIPHY_IDX_STALE -1
109 109
@@ -136,11 +136,11 @@ static inline void cfg80211_unhold_bss(struct cfg80211_internal_bss *bss)
136} 136}
137 137
138 138
139struct cfg80211_registered_device *cfg80211_drv_by_wiphy_idx(int wiphy_idx); 139struct cfg80211_registered_device *cfg80211_rdev_by_wiphy_idx(int wiphy_idx);
140int get_wiphy_idx(struct wiphy *wiphy); 140int get_wiphy_idx(struct wiphy *wiphy);
141 141
142struct cfg80211_registered_device * 142struct cfg80211_registered_device *
143__cfg80211_drv_from_info(struct genl_info *info); 143__cfg80211_rdev_from_info(struct genl_info *info);
144 144
145/* 145/*
146 * This function returns a pointer to the driver 146 * This function returns a pointer to the driver
@@ -153,7 +153,7 @@ __cfg80211_drv_from_info(struct genl_info *info);
153 * 153 *
154 * This is necessary because we need to lock the global 154 * This is necessary because we need to lock the global
155 * mutex to get an item off the list safely, and then 155 * mutex to get an item off the list safely, and then
156 * we lock the drv mutex so it doesn't go away under us. 156 * we lock the rdev mutex so it doesn't go away under us.
157 * 157 *
158 * We don't want to keep cfg80211_mutex locked 158 * We don't want to keep cfg80211_mutex locked
159 * for all the time in order to allow requests on 159 * for all the time in order to allow requests on
@@ -165,22 +165,22 @@ __cfg80211_drv_from_info(struct genl_info *info);
165extern struct cfg80211_registered_device * 165extern struct cfg80211_registered_device *
166cfg80211_get_dev_from_info(struct genl_info *info); 166cfg80211_get_dev_from_info(struct genl_info *info);
167 167
168/* requires cfg80211_drv_mutex to be held! */ 168/* requires cfg80211_rdev_mutex to be held! */
169struct wiphy *wiphy_idx_to_wiphy(int wiphy_idx); 169struct wiphy *wiphy_idx_to_wiphy(int wiphy_idx);
170 170
171/* identical to cfg80211_get_dev_from_info but only operate on ifindex */ 171/* identical to cfg80211_get_dev_from_info but only operate on ifindex */
172extern struct cfg80211_registered_device * 172extern struct cfg80211_registered_device *
173cfg80211_get_dev_from_ifindex(int ifindex); 173cfg80211_get_dev_from_ifindex(int ifindex);
174 174
175static inline void cfg80211_lock_rdev(struct cfg80211_registered_device *drv) 175static inline void cfg80211_lock_rdev(struct cfg80211_registered_device *rdev)
176{ 176{
177 mutex_lock(&drv->mtx); 177 mutex_lock(&rdev->mtx);
178} 178}
179 179
180static inline void cfg80211_unlock_rdev(struct cfg80211_registered_device *drv) 180static inline void cfg80211_unlock_rdev(struct cfg80211_registered_device *rdev)
181{ 181{
182 BUG_ON(IS_ERR(drv) || !drv); 182 BUG_ON(IS_ERR(rdev) || !rdev);
183 mutex_unlock(&drv->mtx); 183 mutex_unlock(&rdev->mtx);
184} 184}
185 185
186static inline void wdev_lock(struct wireless_dev *wdev) 186static inline void wdev_lock(struct wireless_dev *wdev)
@@ -240,9 +240,9 @@ struct cfg80211_event {
240 240
241 241
242/* free object */ 242/* free object */
243extern void cfg80211_dev_free(struct cfg80211_registered_device *drv); 243extern void cfg80211_dev_free(struct cfg80211_registered_device *rdev);
244 244
245extern int cfg80211_dev_rename(struct cfg80211_registered_device *drv, 245extern int cfg80211_dev_rename(struct cfg80211_registered_device *rdev,
246 char *newname); 246 char *newname);
247 247
248void ieee80211_set_bitrate_flags(struct wiphy *wiphy); 248void ieee80211_set_bitrate_flags(struct wiphy *wiphy);
diff --git a/net/wireless/debugfs.c b/net/wireless/debugfs.c
index 679ddfcec1ee..13d93d84f902 100644
--- a/net/wireless/debugfs.c
+++ b/net/wireless/debugfs.c
@@ -104,15 +104,15 @@ static const struct file_operations ht40allow_map_ops = {
104}; 104};
105 105
106#define DEBUGFS_ADD(name) \ 106#define DEBUGFS_ADD(name) \
107 drv->debugfs.name = debugfs_create_file(#name, S_IRUGO, phyd, \ 107 rdev->debugfs.name = debugfs_create_file(#name, S_IRUGO, phyd, \
108 &drv->wiphy, &name## _ops); 108 &rdev->wiphy, &name## _ops);
109#define DEBUGFS_DEL(name) \ 109#define DEBUGFS_DEL(name) \
110 debugfs_remove(drv->debugfs.name); \ 110 debugfs_remove(rdev->debugfs.name); \
111 drv->debugfs.name = NULL; 111 rdev->debugfs.name = NULL;
112 112
113void cfg80211_debugfs_drv_add(struct cfg80211_registered_device *drv) 113void cfg80211_debugfs_rdev_add(struct cfg80211_registered_device *rdev)
114{ 114{
115 struct dentry *phyd = drv->wiphy.debugfsdir; 115 struct dentry *phyd = rdev->wiphy.debugfsdir;
116 116
117 DEBUGFS_ADD(rts_threshold); 117 DEBUGFS_ADD(rts_threshold);
118 DEBUGFS_ADD(fragmentation_threshold); 118 DEBUGFS_ADD(fragmentation_threshold);
@@ -121,7 +121,7 @@ void cfg80211_debugfs_drv_add(struct cfg80211_registered_device *drv)
121 DEBUGFS_ADD(ht40allow_map); 121 DEBUGFS_ADD(ht40allow_map);
122} 122}
123 123
124void cfg80211_debugfs_drv_del(struct cfg80211_registered_device *drv) 124void cfg80211_debugfs_rdev_del(struct cfg80211_registered_device *rdev)
125{ 125{
126 DEBUGFS_DEL(rts_threshold); 126 DEBUGFS_DEL(rts_threshold);
127 DEBUGFS_DEL(fragmentation_threshold); 127 DEBUGFS_DEL(fragmentation_threshold);
diff --git a/net/wireless/debugfs.h b/net/wireless/debugfs.h
index c226983ae66b..6419b6d6ce3e 100644
--- a/net/wireless/debugfs.h
+++ b/net/wireless/debugfs.h
@@ -2,13 +2,13 @@
2#define __CFG80211_DEBUGFS_H 2#define __CFG80211_DEBUGFS_H
3 3
4#ifdef CONFIG_CFG80211_DEBUGFS 4#ifdef CONFIG_CFG80211_DEBUGFS
5void cfg80211_debugfs_drv_add(struct cfg80211_registered_device *drv); 5void cfg80211_debugfs_rdev_add(struct cfg80211_registered_device *rdev);
6void cfg80211_debugfs_drv_del(struct cfg80211_registered_device *drv); 6void cfg80211_debugfs_rdev_del(struct cfg80211_registered_device *rdev);
7#else 7#else
8static inline 8static inline
9void cfg80211_debugfs_drv_add(struct cfg80211_registered_device *drv) {} 9void cfg80211_debugfs_rdev_add(struct cfg80211_registered_device *rdev) {}
10static inline 10static inline
11void cfg80211_debugfs_drv_del(struct cfg80211_registered_device *drv) {} 11void cfg80211_debugfs_rdev_del(struct cfg80211_registered_device *rdev) {}
12#endif 12#endif
13 13
14#endif /* __CFG80211_DEBUGFS_H */ 14#endif /* __CFG80211_DEBUGFS_H */
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index cf4ac786b20a..9deb12f73c44 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -29,9 +29,9 @@ static struct genl_family nl80211_fam = {
29 .maxattr = NL80211_ATTR_MAX, 29 .maxattr = NL80211_ATTR_MAX,
30}; 30};
31 31
32/* internal helper: get drv and dev */ 32/* internal helper: get rdev and dev */
33static int get_drv_dev_by_info_ifindex(struct nlattr **attrs, 33static int get_rdev_dev_by_info_ifindex(struct nlattr **attrs,
34 struct cfg80211_registered_device **drv, 34 struct cfg80211_registered_device **rdev,
35 struct net_device **dev) 35 struct net_device **dev)
36{ 36{
37 int ifindex; 37 int ifindex;
@@ -44,10 +44,10 @@ static int get_drv_dev_by_info_ifindex(struct nlattr **attrs,
44 if (!*dev) 44 if (!*dev)
45 return -ENODEV; 45 return -ENODEV;
46 46
47 *drv = cfg80211_get_dev_from_ifindex(ifindex); 47 *rdev = cfg80211_get_dev_from_ifindex(ifindex);
48 if (IS_ERR(*drv)) { 48 if (IS_ERR(*rdev)) {
49 dev_put(*dev); 49 dev_put(*dev);
50 return PTR_ERR(*drv); 50 return PTR_ERR(*rdev);
51 } 51 }
52 52
53 return 0; 53 return 0;
@@ -378,7 +378,7 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb)
378 struct cfg80211_registered_device *dev; 378 struct cfg80211_registered_device *dev;
379 379
380 mutex_lock(&cfg80211_mutex); 380 mutex_lock(&cfg80211_mutex);
381 list_for_each_entry(dev, &cfg80211_drv_list, list) { 381 list_for_each_entry(dev, &cfg80211_rdev_list, list) {
382 if (++idx <= start) 382 if (++idx <= start)
383 continue; 383 continue;
384 if (nl80211_send_wiphy(skb, NETLINK_CB(cb->skb).pid, 384 if (nl80211_send_wiphy(skb, NETLINK_CB(cb->skb).pid,
@@ -460,7 +460,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
460 460
461 mutex_lock(&cfg80211_mutex); 461 mutex_lock(&cfg80211_mutex);
462 462
463 rdev = __cfg80211_drv_from_info(info); 463 rdev = __cfg80211_rdev_from_info(info);
464 if (IS_ERR(rdev)) { 464 if (IS_ERR(rdev)) {
465 mutex_unlock(&cfg80211_mutex); 465 mutex_unlock(&cfg80211_mutex);
466 result = PTR_ERR(rdev); 466 result = PTR_ERR(rdev);
@@ -683,7 +683,7 @@ static int nl80211_dump_interface(struct sk_buff *skb, struct netlink_callback *
683 struct wireless_dev *wdev; 683 struct wireless_dev *wdev;
684 684
685 mutex_lock(&cfg80211_mutex); 685 mutex_lock(&cfg80211_mutex);
686 list_for_each_entry(dev, &cfg80211_drv_list, list) { 686 list_for_each_entry(dev, &cfg80211_rdev_list, list) {
687 if (wp_idx < wp_start) { 687 if (wp_idx < wp_start) {
688 wp_idx++; 688 wp_idx++;
689 continue; 689 continue;
@@ -724,7 +724,7 @@ static int nl80211_get_interface(struct sk_buff *skb, struct genl_info *info)
724 struct net_device *netdev; 724 struct net_device *netdev;
725 int err; 725 int err;
726 726
727 err = get_drv_dev_by_info_ifindex(info->attrs, &dev, &netdev); 727 err = get_rdev_dev_by_info_ifindex(info->attrs, &dev, &netdev);
728 if (err) 728 if (err)
729 return err; 729 return err;
730 730
@@ -780,7 +780,7 @@ static int parse_monitor_flags(struct nlattr *nla, u32 *mntrflags)
780 780
781static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info) 781static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
782{ 782{
783 struct cfg80211_registered_device *drv; 783 struct cfg80211_registered_device *rdev;
784 struct vif_params params; 784 struct vif_params params;
785 int err; 785 int err;
786 enum nl80211_iftype otype, ntype; 786 enum nl80211_iftype otype, ntype;
@@ -792,7 +792,7 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
792 792
793 rtnl_lock(); 793 rtnl_lock();
794 794
795 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 795 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
796 if (err) 796 if (err)
797 goto unlock_rtnl; 797 goto unlock_rtnl;
798 798
@@ -808,8 +808,8 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
808 } 808 }
809 } 809 }
810 810
811 if (!drv->ops->change_virtual_intf || 811 if (!rdev->ops->change_virtual_intf ||
812 !(drv->wiphy.interface_modes & (1 << ntype))) { 812 !(rdev->wiphy.interface_modes & (1 << ntype))) {
813 err = -EOPNOTSUPP; 813 err = -EOPNOTSUPP;
814 goto unlock; 814 goto unlock;
815 } 815 }
@@ -839,7 +839,7 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
839 } 839 }
840 840
841 if (change) 841 if (change)
842 err = drv->ops->change_virtual_intf(&drv->wiphy, dev, 842 err = rdev->ops->change_virtual_intf(&rdev->wiphy, dev,
843 ntype, flags, &params); 843 ntype, flags, &params);
844 else 844 else
845 err = 0; 845 err = 0;
@@ -853,7 +853,7 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
853 853
854 unlock: 854 unlock:
855 dev_put(dev); 855 dev_put(dev);
856 cfg80211_unlock_rdev(drv); 856 cfg80211_unlock_rdev(rdev);
857 unlock_rtnl: 857 unlock_rtnl:
858 rtnl_unlock(); 858 rtnl_unlock();
859 return err; 859 return err;
@@ -861,7 +861,7 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
861 861
862static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info) 862static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
863{ 863{
864 struct cfg80211_registered_device *drv; 864 struct cfg80211_registered_device *rdev;
865 struct vif_params params; 865 struct vif_params params;
866 int err; 866 int err;
867 enum nl80211_iftype type = NL80211_IFTYPE_UNSPECIFIED; 867 enum nl80211_iftype type = NL80211_IFTYPE_UNSPECIFIED;
@@ -880,14 +880,14 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
880 880
881 rtnl_lock(); 881 rtnl_lock();
882 882
883 drv = cfg80211_get_dev_from_info(info); 883 rdev = cfg80211_get_dev_from_info(info);
884 if (IS_ERR(drv)) { 884 if (IS_ERR(rdev)) {
885 err = PTR_ERR(drv); 885 err = PTR_ERR(rdev);
886 goto unlock_rtnl; 886 goto unlock_rtnl;
887 } 887 }
888 888
889 if (!drv->ops->add_virtual_intf || 889 if (!rdev->ops->add_virtual_intf ||
890 !(drv->wiphy.interface_modes & (1 << type))) { 890 !(rdev->wiphy.interface_modes & (1 << type))) {
891 err = -EOPNOTSUPP; 891 err = -EOPNOTSUPP;
892 goto unlock; 892 goto unlock;
893 } 893 }
@@ -901,12 +901,12 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
901 err = parse_monitor_flags(type == NL80211_IFTYPE_MONITOR ? 901 err = parse_monitor_flags(type == NL80211_IFTYPE_MONITOR ?
902 info->attrs[NL80211_ATTR_MNTR_FLAGS] : NULL, 902 info->attrs[NL80211_ATTR_MNTR_FLAGS] : NULL,
903 &flags); 903 &flags);
904 err = drv->ops->add_virtual_intf(&drv->wiphy, 904 err = rdev->ops->add_virtual_intf(&rdev->wiphy,
905 nla_data(info->attrs[NL80211_ATTR_IFNAME]), 905 nla_data(info->attrs[NL80211_ATTR_IFNAME]),
906 type, err ? NULL : &flags, &params); 906 type, err ? NULL : &flags, &params);
907 907
908 unlock: 908 unlock:
909 cfg80211_unlock_rdev(drv); 909 cfg80211_unlock_rdev(rdev);
910 unlock_rtnl: 910 unlock_rtnl:
911 rtnl_unlock(); 911 rtnl_unlock();
912 return err; 912 return err;
@@ -914,27 +914,27 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
914 914
915static int nl80211_del_interface(struct sk_buff *skb, struct genl_info *info) 915static int nl80211_del_interface(struct sk_buff *skb, struct genl_info *info)
916{ 916{
917 struct cfg80211_registered_device *drv; 917 struct cfg80211_registered_device *rdev;
918 int ifindex, err; 918 int ifindex, err;
919 struct net_device *dev; 919 struct net_device *dev;
920 920
921 rtnl_lock(); 921 rtnl_lock();
922 922
923 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 923 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
924 if (err) 924 if (err)
925 goto unlock_rtnl; 925 goto unlock_rtnl;
926 ifindex = dev->ifindex; 926 ifindex = dev->ifindex;
927 dev_put(dev); 927 dev_put(dev);
928 928
929 if (!drv->ops->del_virtual_intf) { 929 if (!rdev->ops->del_virtual_intf) {
930 err = -EOPNOTSUPP; 930 err = -EOPNOTSUPP;
931 goto out; 931 goto out;
932 } 932 }
933 933
934 err = drv->ops->del_virtual_intf(&drv->wiphy, ifindex); 934 err = rdev->ops->del_virtual_intf(&rdev->wiphy, ifindex);
935 935
936 out: 936 out:
937 cfg80211_unlock_rdev(drv); 937 cfg80211_unlock_rdev(rdev);
938 unlock_rtnl: 938 unlock_rtnl:
939 rtnl_unlock(); 939 rtnl_unlock();
940 return err; 940 return err;
@@ -968,7 +968,7 @@ static void get_key_callback(void *c, struct key_params *params)
968 968
969static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info) 969static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
970{ 970{
971 struct cfg80211_registered_device *drv; 971 struct cfg80211_registered_device *rdev;
972 int err; 972 int err;
973 struct net_device *dev; 973 struct net_device *dev;
974 u8 key_idx = 0; 974 u8 key_idx = 0;
@@ -990,11 +990,11 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
990 990
991 rtnl_lock(); 991 rtnl_lock();
992 992
993 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 993 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
994 if (err) 994 if (err)
995 goto unlock_rtnl; 995 goto unlock_rtnl;
996 996
997 if (!drv->ops->get_key) { 997 if (!rdev->ops->get_key) {
998 err = -EOPNOTSUPP; 998 err = -EOPNOTSUPP;
999 goto out; 999 goto out;
1000 } 1000 }
@@ -1020,7 +1020,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
1020 if (mac_addr) 1020 if (mac_addr)
1021 NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr); 1021 NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, mac_addr);
1022 1022
1023 err = drv->ops->get_key(&drv->wiphy, dev, key_idx, mac_addr, 1023 err = rdev->ops->get_key(&rdev->wiphy, dev, key_idx, mac_addr,
1024 &cookie, get_key_callback); 1024 &cookie, get_key_callback);
1025 1025
1026 if (err) 1026 if (err)
@@ -1037,7 +1037,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
1037 err = -ENOBUFS; 1037 err = -ENOBUFS;
1038 nlmsg_free(msg); 1038 nlmsg_free(msg);
1039 out: 1039 out:
1040 cfg80211_unlock_rdev(drv); 1040 cfg80211_unlock_rdev(rdev);
1041 dev_put(dev); 1041 dev_put(dev);
1042 unlock_rtnl: 1042 unlock_rtnl:
1043 rtnl_unlock(); 1043 rtnl_unlock();
@@ -1047,7 +1047,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
1047 1047
1048static int nl80211_set_key(struct sk_buff *skb, struct genl_info *info) 1048static int nl80211_set_key(struct sk_buff *skb, struct genl_info *info)
1049{ 1049{
1050 struct cfg80211_registered_device *drv; 1050 struct cfg80211_registered_device *rdev;
1051 int err; 1051 int err;
1052 struct net_device *dev; 1052 struct net_device *dev;
1053 u8 key_idx; 1053 u8 key_idx;
@@ -1072,24 +1072,24 @@ static int nl80211_set_key(struct sk_buff *skb, struct genl_info *info)
1072 1072
1073 rtnl_lock(); 1073 rtnl_lock();
1074 1074
1075 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 1075 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
1076 if (err) 1076 if (err)
1077 goto unlock_rtnl; 1077 goto unlock_rtnl;
1078 1078
1079 if (info->attrs[NL80211_ATTR_KEY_DEFAULT]) 1079 if (info->attrs[NL80211_ATTR_KEY_DEFAULT])
1080 func = drv->ops->set_default_key; 1080 func = rdev->ops->set_default_key;
1081 else 1081 else
1082 func = drv->ops->set_default_mgmt_key; 1082 func = rdev->ops->set_default_mgmt_key;
1083 1083
1084 if (!func) { 1084 if (!func) {
1085 err = -EOPNOTSUPP; 1085 err = -EOPNOTSUPP;
1086 goto out; 1086 goto out;
1087 } 1087 }
1088 1088
1089 err = func(&drv->wiphy, dev, key_idx); 1089 err = func(&rdev->wiphy, dev, key_idx);
1090#ifdef CONFIG_WIRELESS_EXT 1090#ifdef CONFIG_WIRELESS_EXT
1091 if (!err) { 1091 if (!err) {
1092 if (func == drv->ops->set_default_key) 1092 if (func == rdev->ops->set_default_key)
1093 dev->ieee80211_ptr->wext.default_key = key_idx; 1093 dev->ieee80211_ptr->wext.default_key = key_idx;
1094 else 1094 else
1095 dev->ieee80211_ptr->wext.default_mgmt_key = key_idx; 1095 dev->ieee80211_ptr->wext.default_mgmt_key = key_idx;
@@ -1097,7 +1097,7 @@ static int nl80211_set_key(struct sk_buff *skb, struct genl_info *info)
1097#endif 1097#endif
1098 1098
1099 out: 1099 out:
1100 cfg80211_unlock_rdev(drv); 1100 cfg80211_unlock_rdev(rdev);
1101 dev_put(dev); 1101 dev_put(dev);
1102 1102
1103 unlock_rtnl: 1103 unlock_rtnl:
@@ -1108,7 +1108,7 @@ static int nl80211_set_key(struct sk_buff *skb, struct genl_info *info)
1108 1108
1109static int nl80211_new_key(struct sk_buff *skb, struct genl_info *info) 1109static int nl80211_new_key(struct sk_buff *skb, struct genl_info *info)
1110{ 1110{
1111 struct cfg80211_registered_device *drv; 1111 struct cfg80211_registered_device *rdev;
1112 int err, i; 1112 int err, i;
1113 struct net_device *dev; 1113 struct net_device *dev;
1114 struct key_params params; 1114 struct key_params params;
@@ -1143,27 +1143,27 @@ static int nl80211_new_key(struct sk_buff *skb, struct genl_info *info)
1143 1143
1144 rtnl_lock(); 1144 rtnl_lock();
1145 1145
1146 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 1146 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
1147 if (err) 1147 if (err)
1148 goto unlock_rtnl; 1148 goto unlock_rtnl;
1149 1149
1150 for (i = 0; i < drv->wiphy.n_cipher_suites; i++) 1150 for (i = 0; i < rdev->wiphy.n_cipher_suites; i++)
1151 if (params.cipher == drv->wiphy.cipher_suites[i]) 1151 if (params.cipher == rdev->wiphy.cipher_suites[i])
1152 break; 1152 break;
1153 if (i == drv->wiphy.n_cipher_suites) { 1153 if (i == rdev->wiphy.n_cipher_suites) {
1154 err = -EINVAL; 1154 err = -EINVAL;
1155 goto out; 1155 goto out;
1156 } 1156 }
1157 1157
1158 if (!drv->ops->add_key) { 1158 if (!rdev->ops->add_key) {
1159 err = -EOPNOTSUPP; 1159 err = -EOPNOTSUPP;
1160 goto out; 1160 goto out;
1161 } 1161 }
1162 1162
1163 err = drv->ops->add_key(&drv->wiphy, dev, key_idx, mac_addr, &params); 1163 err = rdev->ops->add_key(&rdev->wiphy, dev, key_idx, mac_addr, &params);
1164 1164
1165 out: 1165 out:
1166 cfg80211_unlock_rdev(drv); 1166 cfg80211_unlock_rdev(rdev);
1167 dev_put(dev); 1167 dev_put(dev);
1168 unlock_rtnl: 1168 unlock_rtnl:
1169 rtnl_unlock(); 1169 rtnl_unlock();
@@ -1173,7 +1173,7 @@ static int nl80211_new_key(struct sk_buff *skb, struct genl_info *info)
1173 1173
1174static int nl80211_del_key(struct sk_buff *skb, struct genl_info *info) 1174static int nl80211_del_key(struct sk_buff *skb, struct genl_info *info)
1175{ 1175{
1176 struct cfg80211_registered_device *drv; 1176 struct cfg80211_registered_device *rdev;
1177 int err; 1177 int err;
1178 struct net_device *dev; 1178 struct net_device *dev;
1179 u8 key_idx = 0; 1179 u8 key_idx = 0;
@@ -1190,16 +1190,16 @@ static int nl80211_del_key(struct sk_buff *skb, struct genl_info *info)
1190 1190
1191 rtnl_lock(); 1191 rtnl_lock();
1192 1192
1193 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 1193 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
1194 if (err) 1194 if (err)
1195 goto unlock_rtnl; 1195 goto unlock_rtnl;
1196 1196
1197 if (!drv->ops->del_key) { 1197 if (!rdev->ops->del_key) {
1198 err = -EOPNOTSUPP; 1198 err = -EOPNOTSUPP;
1199 goto out; 1199 goto out;
1200 } 1200 }
1201 1201
1202 err = drv->ops->del_key(&drv->wiphy, dev, key_idx, mac_addr); 1202 err = rdev->ops->del_key(&rdev->wiphy, dev, key_idx, mac_addr);
1203 1203
1204#ifdef CONFIG_WIRELESS_EXT 1204#ifdef CONFIG_WIRELESS_EXT
1205 if (!err) { 1205 if (!err) {
@@ -1211,7 +1211,7 @@ static int nl80211_del_key(struct sk_buff *skb, struct genl_info *info)
1211#endif 1211#endif
1212 1212
1213 out: 1213 out:
1214 cfg80211_unlock_rdev(drv); 1214 cfg80211_unlock_rdev(rdev);
1215 dev_put(dev); 1215 dev_put(dev);
1216 1216
1217 unlock_rtnl: 1217 unlock_rtnl:
@@ -1224,7 +1224,7 @@ static int nl80211_addset_beacon(struct sk_buff *skb, struct genl_info *info)
1224{ 1224{
1225 int (*call)(struct wiphy *wiphy, struct net_device *dev, 1225 int (*call)(struct wiphy *wiphy, struct net_device *dev,
1226 struct beacon_parameters *info); 1226 struct beacon_parameters *info);
1227 struct cfg80211_registered_device *drv; 1227 struct cfg80211_registered_device *rdev;
1228 int err; 1228 int err;
1229 struct net_device *dev; 1229 struct net_device *dev;
1230 struct beacon_parameters params; 1230 struct beacon_parameters params;
@@ -1235,7 +1235,7 @@ static int nl80211_addset_beacon(struct sk_buff *skb, struct genl_info *info)
1235 1235
1236 rtnl_lock(); 1236 rtnl_lock();
1237 1237
1238 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 1238 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
1239 if (err) 1239 if (err)
1240 goto unlock_rtnl; 1240 goto unlock_rtnl;
1241 1241
@@ -1254,10 +1254,10 @@ static int nl80211_addset_beacon(struct sk_buff *skb, struct genl_info *info)
1254 goto out; 1254 goto out;
1255 } 1255 }
1256 1256
1257 call = drv->ops->add_beacon; 1257 call = rdev->ops->add_beacon;
1258 break; 1258 break;
1259 case NL80211_CMD_SET_BEACON: 1259 case NL80211_CMD_SET_BEACON:
1260 call = drv->ops->set_beacon; 1260 call = rdev->ops->set_beacon;
1261 break; 1261 break;
1262 default: 1262 default:
1263 WARN_ON(1); 1263 WARN_ON(1);
@@ -1303,10 +1303,10 @@ static int nl80211_addset_beacon(struct sk_buff *skb, struct genl_info *info)
1303 goto out; 1303 goto out;
1304 } 1304 }
1305 1305
1306 err = call(&drv->wiphy, dev, &params); 1306 err = call(&rdev->wiphy, dev, &params);
1307 1307
1308 out: 1308 out:
1309 cfg80211_unlock_rdev(drv); 1309 cfg80211_unlock_rdev(rdev);
1310 dev_put(dev); 1310 dev_put(dev);
1311 unlock_rtnl: 1311 unlock_rtnl:
1312 rtnl_unlock(); 1312 rtnl_unlock();
@@ -1316,17 +1316,17 @@ static int nl80211_addset_beacon(struct sk_buff *skb, struct genl_info *info)
1316 1316
1317static int nl80211_del_beacon(struct sk_buff *skb, struct genl_info *info) 1317static int nl80211_del_beacon(struct sk_buff *skb, struct genl_info *info)
1318{ 1318{
1319 struct cfg80211_registered_device *drv; 1319 struct cfg80211_registered_device *rdev;
1320 int err; 1320 int err;
1321 struct net_device *dev; 1321 struct net_device *dev;
1322 1322
1323 rtnl_lock(); 1323 rtnl_lock();
1324 1324
1325 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 1325 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
1326 if (err) 1326 if (err)
1327 goto unlock_rtnl; 1327 goto unlock_rtnl;
1328 1328
1329 if (!drv->ops->del_beacon) { 1329 if (!rdev->ops->del_beacon) {
1330 err = -EOPNOTSUPP; 1330 err = -EOPNOTSUPP;
1331 goto out; 1331 goto out;
1332 } 1332 }
@@ -1335,10 +1335,10 @@ static int nl80211_del_beacon(struct sk_buff *skb, struct genl_info *info)
1335 err = -EOPNOTSUPP; 1335 err = -EOPNOTSUPP;
1336 goto out; 1336 goto out;
1337 } 1337 }
1338 err = drv->ops->del_beacon(&drv->wiphy, dev); 1338 err = rdev->ops->del_beacon(&rdev->wiphy, dev);
1339 1339
1340 out: 1340 out:
1341 cfg80211_unlock_rdev(drv); 1341 cfg80211_unlock_rdev(rdev);
1342 dev_put(dev); 1342 dev_put(dev);
1343 unlock_rtnl: 1343 unlock_rtnl:
1344 rtnl_unlock(); 1344 rtnl_unlock();
@@ -1581,7 +1581,7 @@ static int nl80211_dump_station(struct sk_buff *skb,
1581 1581
1582static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info) 1582static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info)
1583{ 1583{
1584 struct cfg80211_registered_device *drv; 1584 struct cfg80211_registered_device *rdev;
1585 int err; 1585 int err;
1586 struct net_device *dev; 1586 struct net_device *dev;
1587 struct station_info sinfo; 1587 struct station_info sinfo;
@@ -1597,16 +1597,16 @@ static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info)
1597 1597
1598 rtnl_lock(); 1598 rtnl_lock();
1599 1599
1600 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 1600 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
1601 if (err) 1601 if (err)
1602 goto out_rtnl; 1602 goto out_rtnl;
1603 1603
1604 if (!drv->ops->get_station) { 1604 if (!rdev->ops->get_station) {
1605 err = -EOPNOTSUPP; 1605 err = -EOPNOTSUPP;
1606 goto out; 1606 goto out;
1607 } 1607 }
1608 1608
1609 err = drv->ops->get_station(&drv->wiphy, dev, mac_addr, &sinfo); 1609 err = rdev->ops->get_station(&rdev->wiphy, dev, mac_addr, &sinfo);
1610 if (err) 1610 if (err)
1611 goto out; 1611 goto out;
1612 1612
@@ -1624,7 +1624,7 @@ static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info)
1624 out_free: 1624 out_free:
1625 nlmsg_free(msg); 1625 nlmsg_free(msg);
1626 out: 1626 out:
1627 cfg80211_unlock_rdev(drv); 1627 cfg80211_unlock_rdev(rdev);
1628 dev_put(dev); 1628 dev_put(dev);
1629 out_rtnl: 1629 out_rtnl:
1630 rtnl_unlock(); 1630 rtnl_unlock();
@@ -1655,7 +1655,7 @@ static int get_vlan(struct nlattr *vlanattr,
1655 1655
1656static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info) 1656static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
1657{ 1657{
1658 struct cfg80211_registered_device *drv; 1658 struct cfg80211_registered_device *rdev;
1659 int err; 1659 int err;
1660 struct net_device *dev; 1660 struct net_device *dev;
1661 struct station_parameters params; 1661 struct station_parameters params;
@@ -1697,11 +1697,11 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
1697 1697
1698 rtnl_lock(); 1698 rtnl_lock();
1699 1699
1700 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 1700 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
1701 if (err) 1701 if (err)
1702 goto out_rtnl; 1702 goto out_rtnl;
1703 1703
1704 err = get_vlan(info->attrs[NL80211_ATTR_STA_VLAN], drv, &params.vlan); 1704 err = get_vlan(info->attrs[NL80211_ATTR_STA_VLAN], rdev, &params.vlan);
1705 if (err) 1705 if (err)
1706 goto out; 1706 goto out;
1707 1707
@@ -1750,17 +1750,17 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
1750 if (err) 1750 if (err)
1751 goto out; 1751 goto out;
1752 1752
1753 if (!drv->ops->change_station) { 1753 if (!rdev->ops->change_station) {
1754 err = -EOPNOTSUPP; 1754 err = -EOPNOTSUPP;
1755 goto out; 1755 goto out;
1756 } 1756 }
1757 1757
1758 err = drv->ops->change_station(&drv->wiphy, dev, mac_addr, &params); 1758 err = rdev->ops->change_station(&rdev->wiphy, dev, mac_addr, &params);
1759 1759
1760 out: 1760 out:
1761 if (params.vlan) 1761 if (params.vlan)
1762 dev_put(params.vlan); 1762 dev_put(params.vlan);
1763 cfg80211_unlock_rdev(drv); 1763 cfg80211_unlock_rdev(rdev);
1764 dev_put(dev); 1764 dev_put(dev);
1765 out_rtnl: 1765 out_rtnl:
1766 rtnl_unlock(); 1766 rtnl_unlock();
@@ -1770,7 +1770,7 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
1770 1770
1771static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info) 1771static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
1772{ 1772{
1773 struct cfg80211_registered_device *drv; 1773 struct cfg80211_registered_device *rdev;
1774 int err; 1774 int err;
1775 struct net_device *dev; 1775 struct net_device *dev;
1776 struct station_parameters params; 1776 struct station_parameters params;
@@ -1810,11 +1810,11 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
1810 1810
1811 rtnl_lock(); 1811 rtnl_lock();
1812 1812
1813 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 1813 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
1814 if (err) 1814 if (err)
1815 goto out_rtnl; 1815 goto out_rtnl;
1816 1816
1817 err = get_vlan(info->attrs[NL80211_ATTR_STA_VLAN], drv, &params.vlan); 1817 err = get_vlan(info->attrs[NL80211_ATTR_STA_VLAN], rdev, &params.vlan);
1818 if (err) 1818 if (err)
1819 goto out; 1819 goto out;
1820 1820
@@ -1850,7 +1850,7 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
1850 if (err) 1850 if (err)
1851 goto out; 1851 goto out;
1852 1852
1853 if (!drv->ops->add_station) { 1853 if (!rdev->ops->add_station) {
1854 err = -EOPNOTSUPP; 1854 err = -EOPNOTSUPP;
1855 goto out; 1855 goto out;
1856 } 1856 }
@@ -1860,12 +1860,12 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
1860 goto out; 1860 goto out;
1861 } 1861 }
1862 1862
1863 err = drv->ops->add_station(&drv->wiphy, dev, mac_addr, &params); 1863 err = rdev->ops->add_station(&rdev->wiphy, dev, mac_addr, &params);
1864 1864
1865 out: 1865 out:
1866 if (params.vlan) 1866 if (params.vlan)
1867 dev_put(params.vlan); 1867 dev_put(params.vlan);
1868 cfg80211_unlock_rdev(drv); 1868 cfg80211_unlock_rdev(rdev);
1869 dev_put(dev); 1869 dev_put(dev);
1870 out_rtnl: 1870 out_rtnl:
1871 rtnl_unlock(); 1871 rtnl_unlock();
@@ -1875,7 +1875,7 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
1875 1875
1876static int nl80211_del_station(struct sk_buff *skb, struct genl_info *info) 1876static int nl80211_del_station(struct sk_buff *skb, struct genl_info *info)
1877{ 1877{
1878 struct cfg80211_registered_device *drv; 1878 struct cfg80211_registered_device *rdev;
1879 int err; 1879 int err;
1880 struct net_device *dev; 1880 struct net_device *dev;
1881 u8 *mac_addr = NULL; 1881 u8 *mac_addr = NULL;
@@ -1885,7 +1885,7 @@ static int nl80211_del_station(struct sk_buff *skb, struct genl_info *info)
1885 1885
1886 rtnl_lock(); 1886 rtnl_lock();
1887 1887
1888 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 1888 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
1889 if (err) 1889 if (err)
1890 goto out_rtnl; 1890 goto out_rtnl;
1891 1891
@@ -1896,15 +1896,15 @@ static int nl80211_del_station(struct sk_buff *skb, struct genl_info *info)
1896 goto out; 1896 goto out;
1897 } 1897 }
1898 1898
1899 if (!drv->ops->del_station) { 1899 if (!rdev->ops->del_station) {
1900 err = -EOPNOTSUPP; 1900 err = -EOPNOTSUPP;
1901 goto out; 1901 goto out;
1902 } 1902 }
1903 1903
1904 err = drv->ops->del_station(&drv->wiphy, dev, mac_addr); 1904 err = rdev->ops->del_station(&rdev->wiphy, dev, mac_addr);
1905 1905
1906 out: 1906 out:
1907 cfg80211_unlock_rdev(drv); 1907 cfg80211_unlock_rdev(rdev);
1908 dev_put(dev); 1908 dev_put(dev);
1909 out_rtnl: 1909 out_rtnl:
1910 rtnl_unlock(); 1910 rtnl_unlock();
@@ -2044,7 +2044,7 @@ static int nl80211_dump_mpath(struct sk_buff *skb,
2044 2044
2045static int nl80211_get_mpath(struct sk_buff *skb, struct genl_info *info) 2045static int nl80211_get_mpath(struct sk_buff *skb, struct genl_info *info)
2046{ 2046{
2047 struct cfg80211_registered_device *drv; 2047 struct cfg80211_registered_device *rdev;
2048 int err; 2048 int err;
2049 struct net_device *dev; 2049 struct net_device *dev;
2050 struct mpath_info pinfo; 2050 struct mpath_info pinfo;
@@ -2061,11 +2061,11 @@ static int nl80211_get_mpath(struct sk_buff *skb, struct genl_info *info)
2061 2061
2062 rtnl_lock(); 2062 rtnl_lock();
2063 2063
2064 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 2064 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
2065 if (err) 2065 if (err)
2066 goto out_rtnl; 2066 goto out_rtnl;
2067 2067
2068 if (!drv->ops->get_mpath) { 2068 if (!rdev->ops->get_mpath) {
2069 err = -EOPNOTSUPP; 2069 err = -EOPNOTSUPP;
2070 goto out; 2070 goto out;
2071 } 2071 }
@@ -2075,7 +2075,7 @@ static int nl80211_get_mpath(struct sk_buff *skb, struct genl_info *info)
2075 goto out; 2075 goto out;
2076 } 2076 }
2077 2077
2078 err = drv->ops->get_mpath(&drv->wiphy, dev, dst, next_hop, &pinfo); 2078 err = rdev->ops->get_mpath(&rdev->wiphy, dev, dst, next_hop, &pinfo);
2079 if (err) 2079 if (err)
2080 goto out; 2080 goto out;
2081 2081
@@ -2093,7 +2093,7 @@ static int nl80211_get_mpath(struct sk_buff *skb, struct genl_info *info)
2093 out_free: 2093 out_free:
2094 nlmsg_free(msg); 2094 nlmsg_free(msg);
2095 out: 2095 out:
2096 cfg80211_unlock_rdev(drv); 2096 cfg80211_unlock_rdev(rdev);
2097 dev_put(dev); 2097 dev_put(dev);
2098 out_rtnl: 2098 out_rtnl:
2099 rtnl_unlock(); 2099 rtnl_unlock();
@@ -2103,7 +2103,7 @@ static int nl80211_get_mpath(struct sk_buff *skb, struct genl_info *info)
2103 2103
2104static int nl80211_set_mpath(struct sk_buff *skb, struct genl_info *info) 2104static int nl80211_set_mpath(struct sk_buff *skb, struct genl_info *info)
2105{ 2105{
2106 struct cfg80211_registered_device *drv; 2106 struct cfg80211_registered_device *rdev;
2107 int err; 2107 int err;
2108 struct net_device *dev; 2108 struct net_device *dev;
2109 u8 *dst = NULL; 2109 u8 *dst = NULL;
@@ -2120,11 +2120,11 @@ static int nl80211_set_mpath(struct sk_buff *skb, struct genl_info *info)
2120 2120
2121 rtnl_lock(); 2121 rtnl_lock();
2122 2122
2123 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 2123 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
2124 if (err) 2124 if (err)
2125 goto out_rtnl; 2125 goto out_rtnl;
2126 2126
2127 if (!drv->ops->change_mpath) { 2127 if (!rdev->ops->change_mpath) {
2128 err = -EOPNOTSUPP; 2128 err = -EOPNOTSUPP;
2129 goto out; 2129 goto out;
2130 } 2130 }
@@ -2139,10 +2139,10 @@ static int nl80211_set_mpath(struct sk_buff *skb, struct genl_info *info)
2139 goto out; 2139 goto out;
2140 } 2140 }
2141 2141
2142 err = drv->ops->change_mpath(&drv->wiphy, dev, dst, next_hop); 2142 err = rdev->ops->change_mpath(&rdev->wiphy, dev, dst, next_hop);
2143 2143
2144 out: 2144 out:
2145 cfg80211_unlock_rdev(drv); 2145 cfg80211_unlock_rdev(rdev);
2146 dev_put(dev); 2146 dev_put(dev);
2147 out_rtnl: 2147 out_rtnl:
2148 rtnl_unlock(); 2148 rtnl_unlock();
@@ -2151,7 +2151,7 @@ static int nl80211_set_mpath(struct sk_buff *skb, struct genl_info *info)
2151} 2151}
2152static int nl80211_new_mpath(struct sk_buff *skb, struct genl_info *info) 2152static int nl80211_new_mpath(struct sk_buff *skb, struct genl_info *info)
2153{ 2153{
2154 struct cfg80211_registered_device *drv; 2154 struct cfg80211_registered_device *rdev;
2155 int err; 2155 int err;
2156 struct net_device *dev; 2156 struct net_device *dev;
2157 u8 *dst = NULL; 2157 u8 *dst = NULL;
@@ -2168,11 +2168,11 @@ static int nl80211_new_mpath(struct sk_buff *skb, struct genl_info *info)
2168 2168
2169 rtnl_lock(); 2169 rtnl_lock();
2170 2170
2171 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 2171 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
2172 if (err) 2172 if (err)
2173 goto out_rtnl; 2173 goto out_rtnl;
2174 2174
2175 if (!drv->ops->add_mpath) { 2175 if (!rdev->ops->add_mpath) {
2176 err = -EOPNOTSUPP; 2176 err = -EOPNOTSUPP;
2177 goto out; 2177 goto out;
2178 } 2178 }
@@ -2187,10 +2187,10 @@ static int nl80211_new_mpath(struct sk_buff *skb, struct genl_info *info)
2187 goto out; 2187 goto out;
2188 } 2188 }
2189 2189
2190 err = drv->ops->add_mpath(&drv->wiphy, dev, dst, next_hop); 2190 err = rdev->ops->add_mpath(&rdev->wiphy, dev, dst, next_hop);
2191 2191
2192 out: 2192 out:
2193 cfg80211_unlock_rdev(drv); 2193 cfg80211_unlock_rdev(rdev);
2194 dev_put(dev); 2194 dev_put(dev);
2195 out_rtnl: 2195 out_rtnl:
2196 rtnl_unlock(); 2196 rtnl_unlock();
@@ -2200,7 +2200,7 @@ static int nl80211_new_mpath(struct sk_buff *skb, struct genl_info *info)
2200 2200
2201static int nl80211_del_mpath(struct sk_buff *skb, struct genl_info *info) 2201static int nl80211_del_mpath(struct sk_buff *skb, struct genl_info *info)
2202{ 2202{
2203 struct cfg80211_registered_device *drv; 2203 struct cfg80211_registered_device *rdev;
2204 int err; 2204 int err;
2205 struct net_device *dev; 2205 struct net_device *dev;
2206 u8 *dst = NULL; 2206 u8 *dst = NULL;
@@ -2210,19 +2210,19 @@ static int nl80211_del_mpath(struct sk_buff *skb, struct genl_info *info)
2210 2210
2211 rtnl_lock(); 2211 rtnl_lock();
2212 2212
2213 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 2213 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
2214 if (err) 2214 if (err)
2215 goto out_rtnl; 2215 goto out_rtnl;
2216 2216
2217 if (!drv->ops->del_mpath) { 2217 if (!rdev->ops->del_mpath) {
2218 err = -EOPNOTSUPP; 2218 err = -EOPNOTSUPP;
2219 goto out; 2219 goto out;
2220 } 2220 }
2221 2221
2222 err = drv->ops->del_mpath(&drv->wiphy, dev, dst); 2222 err = rdev->ops->del_mpath(&rdev->wiphy, dev, dst);
2223 2223
2224 out: 2224 out:
2225 cfg80211_unlock_rdev(drv); 2225 cfg80211_unlock_rdev(rdev);
2226 dev_put(dev); 2226 dev_put(dev);
2227 out_rtnl: 2227 out_rtnl:
2228 rtnl_unlock(); 2228 rtnl_unlock();
@@ -2232,7 +2232,7 @@ static int nl80211_del_mpath(struct sk_buff *skb, struct genl_info *info)
2232 2232
2233static int nl80211_set_bss(struct sk_buff *skb, struct genl_info *info) 2233static int nl80211_set_bss(struct sk_buff *skb, struct genl_info *info)
2234{ 2234{
2235 struct cfg80211_registered_device *drv; 2235 struct cfg80211_registered_device *rdev;
2236 int err; 2236 int err;
2237 struct net_device *dev; 2237 struct net_device *dev;
2238 struct bss_parameters params; 2238 struct bss_parameters params;
@@ -2261,11 +2261,11 @@ static int nl80211_set_bss(struct sk_buff *skb, struct genl_info *info)
2261 2261
2262 rtnl_lock(); 2262 rtnl_lock();
2263 2263
2264 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 2264 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
2265 if (err) 2265 if (err)
2266 goto out_rtnl; 2266 goto out_rtnl;
2267 2267
2268 if (!drv->ops->change_bss) { 2268 if (!rdev->ops->change_bss) {
2269 err = -EOPNOTSUPP; 2269 err = -EOPNOTSUPP;
2270 goto out; 2270 goto out;
2271 } 2271 }
@@ -2275,10 +2275,10 @@ static int nl80211_set_bss(struct sk_buff *skb, struct genl_info *info)
2275 goto out; 2275 goto out;
2276 } 2276 }
2277 2277
2278 err = drv->ops->change_bss(&drv->wiphy, dev, &params); 2278 err = rdev->ops->change_bss(&rdev->wiphy, dev, &params);
2279 2279
2280 out: 2280 out:
2281 cfg80211_unlock_rdev(drv); 2281 cfg80211_unlock_rdev(rdev);
2282 dev_put(dev); 2282 dev_put(dev);
2283 out_rtnl: 2283 out_rtnl:
2284 rtnl_unlock(); 2284 rtnl_unlock();
@@ -2369,7 +2369,7 @@ static int nl80211_req_set_reg(struct sk_buff *skb, struct genl_info *info)
2369static int nl80211_get_mesh_params(struct sk_buff *skb, 2369static int nl80211_get_mesh_params(struct sk_buff *skb,
2370 struct genl_info *info) 2370 struct genl_info *info)
2371{ 2371{
2372 struct cfg80211_registered_device *drv; 2372 struct cfg80211_registered_device *rdev;
2373 struct mesh_config cur_params; 2373 struct mesh_config cur_params;
2374 int err; 2374 int err;
2375 struct net_device *dev; 2375 struct net_device *dev;
@@ -2380,17 +2380,17 @@ static int nl80211_get_mesh_params(struct sk_buff *skb,
2380 rtnl_lock(); 2380 rtnl_lock();
2381 2381
2382 /* Look up our device */ 2382 /* Look up our device */
2383 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 2383 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
2384 if (err) 2384 if (err)
2385 goto out_rtnl; 2385 goto out_rtnl;
2386 2386
2387 if (!drv->ops->get_mesh_params) { 2387 if (!rdev->ops->get_mesh_params) {
2388 err = -EOPNOTSUPP; 2388 err = -EOPNOTSUPP;
2389 goto out; 2389 goto out;
2390 } 2390 }
2391 2391
2392 /* Get the mesh params */ 2392 /* Get the mesh params */
2393 err = drv->ops->get_mesh_params(&drv->wiphy, dev, &cur_params); 2393 err = rdev->ops->get_mesh_params(&rdev->wiphy, dev, &cur_params);
2394 if (err) 2394 if (err)
2395 goto out; 2395 goto out;
2396 2396
@@ -2444,7 +2444,7 @@ static int nl80211_get_mesh_params(struct sk_buff *skb,
2444 err = -EMSGSIZE; 2444 err = -EMSGSIZE;
2445 out: 2445 out:
2446 /* Cleanup */ 2446 /* Cleanup */
2447 cfg80211_unlock_rdev(drv); 2447 cfg80211_unlock_rdev(rdev);
2448 dev_put(dev); 2448 dev_put(dev);
2449 out_rtnl: 2449 out_rtnl:
2450 rtnl_unlock(); 2450 rtnl_unlock();
@@ -2482,7 +2482,7 @@ static int nl80211_set_mesh_params(struct sk_buff *skb, struct genl_info *info)
2482{ 2482{
2483 int err; 2483 int err;
2484 u32 mask; 2484 u32 mask;
2485 struct cfg80211_registered_device *drv; 2485 struct cfg80211_registered_device *rdev;
2486 struct net_device *dev; 2486 struct net_device *dev;
2487 struct mesh_config cfg; 2487 struct mesh_config cfg;
2488 struct nlattr *tb[NL80211_MESHCONF_ATTR_MAX + 1]; 2488 struct nlattr *tb[NL80211_MESHCONF_ATTR_MAX + 1];
@@ -2497,11 +2497,11 @@ static int nl80211_set_mesh_params(struct sk_buff *skb, struct genl_info *info)
2497 2497
2498 rtnl_lock(); 2498 rtnl_lock();
2499 2499
2500 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 2500 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
2501 if (err) 2501 if (err)
2502 goto out_rtnl; 2502 goto out_rtnl;
2503 2503
2504 if (!drv->ops->set_mesh_params) { 2504 if (!rdev->ops->set_mesh_params) {
2505 err = -EOPNOTSUPP; 2505 err = -EOPNOTSUPP;
2506 goto out; 2506 goto out;
2507 } 2507 }
@@ -2546,11 +2546,11 @@ static int nl80211_set_mesh_params(struct sk_buff *skb, struct genl_info *info)
2546 nla_get_u16); 2546 nla_get_u16);
2547 2547
2548 /* Apply changes */ 2548 /* Apply changes */
2549 err = drv->ops->set_mesh_params(&drv->wiphy, dev, &cfg, mask); 2549 err = rdev->ops->set_mesh_params(&rdev->wiphy, dev, &cfg, mask);
2550 2550
2551 out: 2551 out:
2552 /* cleanup */ 2552 /* cleanup */
2553 cfg80211_unlock_rdev(drv); 2553 cfg80211_unlock_rdev(rdev);
2554 dev_put(dev); 2554 dev_put(dev);
2555 out_rtnl: 2555 out_rtnl:
2556 rtnl_unlock(); 2556 rtnl_unlock();
@@ -2737,7 +2737,7 @@ static int validate_scan_freqs(struct nlattr *freqs)
2737 2737
2738static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info) 2738static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
2739{ 2739{
2740 struct cfg80211_registered_device *drv; 2740 struct cfg80211_registered_device *rdev;
2741 struct net_device *dev; 2741 struct net_device *dev;
2742 struct cfg80211_scan_request *request; 2742 struct cfg80211_scan_request *request;
2743 struct cfg80211_ssid *ssid; 2743 struct cfg80211_ssid *ssid;
@@ -2753,13 +2753,13 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
2753 2753
2754 rtnl_lock(); 2754 rtnl_lock();
2755 2755
2756 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 2756 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
2757 if (err) 2757 if (err)
2758 goto out_rtnl; 2758 goto out_rtnl;
2759 2759
2760 wiphy = &drv->wiphy; 2760 wiphy = &rdev->wiphy;
2761 2761
2762 if (!drv->ops->scan) { 2762 if (!rdev->ops->scan) {
2763 err = -EOPNOTSUPP; 2763 err = -EOPNOTSUPP;
2764 goto out; 2764 goto out;
2765 } 2765 }
@@ -2769,7 +2769,7 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
2769 goto out; 2769 goto out;
2770 } 2770 }
2771 2771
2772 if (drv->scan_req) { 2772 if (rdev->scan_req) {
2773 err = -EBUSY; 2773 err = -EBUSY;
2774 goto out; 2774 goto out;
2775 } 2775 }
@@ -2876,21 +2876,21 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
2876 } 2876 }
2877 2877
2878 request->ifidx = dev->ifindex; 2878 request->ifidx = dev->ifindex;
2879 request->wiphy = &drv->wiphy; 2879 request->wiphy = &rdev->wiphy;
2880 2880
2881 drv->scan_req = request; 2881 rdev->scan_req = request;
2882 err = drv->ops->scan(&drv->wiphy, dev, request); 2882 err = rdev->ops->scan(&rdev->wiphy, dev, request);
2883 2883
2884 if (!err) 2884 if (!err)
2885 nl80211_send_scan_start(drv, dev); 2885 nl80211_send_scan_start(rdev, dev);
2886 2886
2887 out_free: 2887 out_free:
2888 if (err) { 2888 if (err) {
2889 drv->scan_req = NULL; 2889 rdev->scan_req = NULL;
2890 kfree(request); 2890 kfree(request);
2891 } 2891 }
2892 out: 2892 out:
2893 cfg80211_unlock_rdev(drv); 2893 cfg80211_unlock_rdev(rdev);
2894 dev_put(dev); 2894 dev_put(dev);
2895 out_rtnl: 2895 out_rtnl:
2896 rtnl_unlock(); 2896 rtnl_unlock();
@@ -3043,7 +3043,7 @@ static bool nl80211_valid_cipher_suite(u32 cipher)
3043 3043
3044static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info) 3044static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
3045{ 3045{
3046 struct cfg80211_registered_device *drv; 3046 struct cfg80211_registered_device *rdev;
3047 struct net_device *dev; 3047 struct net_device *dev;
3048 struct ieee80211_channel *chan; 3048 struct ieee80211_channel *chan;
3049 const u8 *bssid, *ssid, *ie = NULL; 3049 const u8 *bssid, *ssid, *ie = NULL;
@@ -3067,11 +3067,11 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
3067 3067
3068 rtnl_lock(); 3068 rtnl_lock();
3069 3069
3070 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 3070 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
3071 if (err) 3071 if (err)
3072 goto unlock_rtnl; 3072 goto unlock_rtnl;
3073 3073
3074 if (!drv->ops->auth) { 3074 if (!rdev->ops->auth) {
3075 err = -EOPNOTSUPP; 3075 err = -EOPNOTSUPP;
3076 goto out; 3076 goto out;
3077 } 3077 }
@@ -3087,7 +3087,7 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
3087 } 3087 }
3088 3088
3089 bssid = nla_data(info->attrs[NL80211_ATTR_MAC]); 3089 bssid = nla_data(info->attrs[NL80211_ATTR_MAC]);
3090 chan = ieee80211_get_channel(&drv->wiphy, 3090 chan = ieee80211_get_channel(&rdev->wiphy,
3091 nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ])); 3091 nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]));
3092 if (!chan || (chan->flags & IEEE80211_CHAN_DISABLED)) { 3092 if (!chan || (chan->flags & IEEE80211_CHAN_DISABLED)) {
3093 err = -EINVAL; 3093 err = -EINVAL;
@@ -3108,11 +3108,11 @@ static int nl80211_authenticate(struct sk_buff *skb, struct genl_info *info)
3108 goto out; 3108 goto out;
3109 } 3109 }
3110 3110
3111 err = cfg80211_mlme_auth(drv, dev, chan, auth_type, bssid, 3111 err = cfg80211_mlme_auth(rdev, dev, chan, auth_type, bssid,
3112 ssid, ssid_len, ie, ie_len); 3112 ssid, ssid_len, ie, ie_len);
3113 3113
3114out: 3114out:
3115 cfg80211_unlock_rdev(drv); 3115 cfg80211_unlock_rdev(rdev);
3116 dev_put(dev); 3116 dev_put(dev);
3117unlock_rtnl: 3117unlock_rtnl:
3118 rtnl_unlock(); 3118 rtnl_unlock();
@@ -3202,7 +3202,7 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
3202 3202
3203 rtnl_lock(); 3203 rtnl_lock();
3204 3204
3205 err = get_drv_dev_by_info_ifindex(info->attrs, &rdev, &dev); 3205 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
3206 if (err) 3206 if (err)
3207 goto unlock_rtnl; 3207 goto unlock_rtnl;
3208 3208
@@ -3268,7 +3268,7 @@ unlock_rtnl:
3268 3268
3269static int nl80211_deauthenticate(struct sk_buff *skb, struct genl_info *info) 3269static int nl80211_deauthenticate(struct sk_buff *skb, struct genl_info *info)
3270{ 3270{
3271 struct cfg80211_registered_device *drv; 3271 struct cfg80211_registered_device *rdev;
3272 struct net_device *dev; 3272 struct net_device *dev;
3273 const u8 *ie = NULL, *bssid; 3273 const u8 *ie = NULL, *bssid;
3274 int err, ie_len = 0; 3274 int err, ie_len = 0;
@@ -3285,11 +3285,11 @@ static int nl80211_deauthenticate(struct sk_buff *skb, struct genl_info *info)
3285 3285
3286 rtnl_lock(); 3286 rtnl_lock();
3287 3287
3288 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 3288 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
3289 if (err) 3289 if (err)
3290 goto unlock_rtnl; 3290 goto unlock_rtnl;
3291 3291
3292 if (!drv->ops->deauth) { 3292 if (!rdev->ops->deauth) {
3293 err = -EOPNOTSUPP; 3293 err = -EOPNOTSUPP;
3294 goto out; 3294 goto out;
3295 } 3295 }
@@ -3318,10 +3318,10 @@ static int nl80211_deauthenticate(struct sk_buff *skb, struct genl_info *info)
3318 ie_len = nla_len(info->attrs[NL80211_ATTR_IE]); 3318 ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
3319 } 3319 }
3320 3320
3321 err = cfg80211_mlme_deauth(drv, dev, bssid, ie, ie_len, reason_code); 3321 err = cfg80211_mlme_deauth(rdev, dev, bssid, ie, ie_len, reason_code);
3322 3322
3323out: 3323out:
3324 cfg80211_unlock_rdev(drv); 3324 cfg80211_unlock_rdev(rdev);
3325 dev_put(dev); 3325 dev_put(dev);
3326unlock_rtnl: 3326unlock_rtnl:
3327 rtnl_unlock(); 3327 rtnl_unlock();
@@ -3330,7 +3330,7 @@ unlock_rtnl:
3330 3330
3331static int nl80211_disassociate(struct sk_buff *skb, struct genl_info *info) 3331static int nl80211_disassociate(struct sk_buff *skb, struct genl_info *info)
3332{ 3332{
3333 struct cfg80211_registered_device *drv; 3333 struct cfg80211_registered_device *rdev;
3334 struct net_device *dev; 3334 struct net_device *dev;
3335 const u8 *ie = NULL, *bssid; 3335 const u8 *ie = NULL, *bssid;
3336 int err, ie_len = 0; 3336 int err, ie_len = 0;
@@ -3347,11 +3347,11 @@ static int nl80211_disassociate(struct sk_buff *skb, struct genl_info *info)
3347 3347
3348 rtnl_lock(); 3348 rtnl_lock();
3349 3349
3350 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 3350 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
3351 if (err) 3351 if (err)
3352 goto unlock_rtnl; 3352 goto unlock_rtnl;
3353 3353
3354 if (!drv->ops->disassoc) { 3354 if (!rdev->ops->disassoc) {
3355 err = -EOPNOTSUPP; 3355 err = -EOPNOTSUPP;
3356 goto out; 3356 goto out;
3357 } 3357 }
@@ -3380,10 +3380,10 @@ static int nl80211_disassociate(struct sk_buff *skb, struct genl_info *info)
3380 ie_len = nla_len(info->attrs[NL80211_ATTR_IE]); 3380 ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
3381 } 3381 }
3382 3382
3383 err = cfg80211_mlme_disassoc(drv, dev, bssid, ie, ie_len, reason_code); 3383 err = cfg80211_mlme_disassoc(rdev, dev, bssid, ie, ie_len, reason_code);
3384 3384
3385out: 3385out:
3386 cfg80211_unlock_rdev(drv); 3386 cfg80211_unlock_rdev(rdev);
3387 dev_put(dev); 3387 dev_put(dev);
3388unlock_rtnl: 3388unlock_rtnl:
3389 rtnl_unlock(); 3389 rtnl_unlock();
@@ -3392,7 +3392,7 @@ unlock_rtnl:
3392 3392
3393static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info) 3393static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
3394{ 3394{
3395 struct cfg80211_registered_device *drv; 3395 struct cfg80211_registered_device *rdev;
3396 struct net_device *dev; 3396 struct net_device *dev;
3397 struct cfg80211_ibss_params ibss; 3397 struct cfg80211_ibss_params ibss;
3398 struct wiphy *wiphy; 3398 struct wiphy *wiphy;
@@ -3419,11 +3419,11 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
3419 3419
3420 rtnl_lock(); 3420 rtnl_lock();
3421 3421
3422 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 3422 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
3423 if (err) 3423 if (err)
3424 goto unlock_rtnl; 3424 goto unlock_rtnl;
3425 3425
3426 if (!drv->ops->join_ibss) { 3426 if (!rdev->ops->join_ibss) {
3427 err = -EOPNOTSUPP; 3427 err = -EOPNOTSUPP;
3428 goto out; 3428 goto out;
3429 } 3429 }
@@ -3438,7 +3438,7 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
3438 goto out; 3438 goto out;
3439 } 3439 }
3440 3440
3441 wiphy = &drv->wiphy; 3441 wiphy = &rdev->wiphy;
3442 3442
3443 if (info->attrs[NL80211_ATTR_MAC]) 3443 if (info->attrs[NL80211_ATTR_MAC])
3444 ibss.bssid = nla_data(info->attrs[NL80211_ATTR_MAC]); 3444 ibss.bssid = nla_data(info->attrs[NL80211_ATTR_MAC]);
@@ -3461,10 +3461,10 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
3461 3461
3462 ibss.channel_fixed = !!info->attrs[NL80211_ATTR_FREQ_FIXED]; 3462 ibss.channel_fixed = !!info->attrs[NL80211_ATTR_FREQ_FIXED];
3463 3463
3464 err = cfg80211_join_ibss(drv, dev, &ibss); 3464 err = cfg80211_join_ibss(rdev, dev, &ibss);
3465 3465
3466out: 3466out:
3467 cfg80211_unlock_rdev(drv); 3467 cfg80211_unlock_rdev(rdev);
3468 dev_put(dev); 3468 dev_put(dev);
3469unlock_rtnl: 3469unlock_rtnl:
3470 rtnl_unlock(); 3470 rtnl_unlock();
@@ -3473,17 +3473,17 @@ unlock_rtnl:
3473 3473
3474static int nl80211_leave_ibss(struct sk_buff *skb, struct genl_info *info) 3474static int nl80211_leave_ibss(struct sk_buff *skb, struct genl_info *info)
3475{ 3475{
3476 struct cfg80211_registered_device *drv; 3476 struct cfg80211_registered_device *rdev;
3477 struct net_device *dev; 3477 struct net_device *dev;
3478 int err; 3478 int err;
3479 3479
3480 rtnl_lock(); 3480 rtnl_lock();
3481 3481
3482 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 3482 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
3483 if (err) 3483 if (err)
3484 goto unlock_rtnl; 3484 goto unlock_rtnl;
3485 3485
3486 if (!drv->ops->leave_ibss) { 3486 if (!rdev->ops->leave_ibss) {
3487 err = -EOPNOTSUPP; 3487 err = -EOPNOTSUPP;
3488 goto out; 3488 goto out;
3489 } 3489 }
@@ -3498,10 +3498,10 @@ static int nl80211_leave_ibss(struct sk_buff *skb, struct genl_info *info)
3498 goto out; 3498 goto out;
3499 } 3499 }
3500 3500
3501 err = cfg80211_leave_ibss(drv, dev, false); 3501 err = cfg80211_leave_ibss(rdev, dev, false);
3502 3502
3503out: 3503out:
3504 cfg80211_unlock_rdev(drv); 3504 cfg80211_unlock_rdev(rdev);
3505 dev_put(dev); 3505 dev_put(dev);
3506unlock_rtnl: 3506unlock_rtnl:
3507 rtnl_unlock(); 3507 rtnl_unlock();
@@ -3632,7 +3632,7 @@ EXPORT_SYMBOL(cfg80211_testmode_event);
3632 3632
3633static int nl80211_connect(struct sk_buff *skb, struct genl_info *info) 3633static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
3634{ 3634{
3635 struct cfg80211_registered_device *drv; 3635 struct cfg80211_registered_device *rdev;
3636 struct net_device *dev; 3636 struct net_device *dev;
3637 struct cfg80211_connect_params connect; 3637 struct cfg80211_connect_params connect;
3638 struct wiphy *wiphy; 3638 struct wiphy *wiphy;
@@ -3663,7 +3663,7 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
3663 return err; 3663 return err;
3664 rtnl_lock(); 3664 rtnl_lock();
3665 3665
3666 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 3666 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
3667 if (err) 3667 if (err)
3668 goto unlock_rtnl; 3668 goto unlock_rtnl;
3669 3669
@@ -3677,7 +3677,7 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
3677 goto out; 3677 goto out;
3678 } 3678 }
3679 3679
3680 wiphy = &drv->wiphy; 3680 wiphy = &rdev->wiphy;
3681 3681
3682 connect.bssid = NULL; 3682 connect.bssid = NULL;
3683 connect.channel = NULL; 3683 connect.channel = NULL;
@@ -3704,10 +3704,10 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
3704 } 3704 }
3705 } 3705 }
3706 3706
3707 err = cfg80211_connect(drv, dev, &connect); 3707 err = cfg80211_connect(rdev, dev, &connect);
3708 3708
3709out: 3709out:
3710 cfg80211_unlock_rdev(drv); 3710 cfg80211_unlock_rdev(rdev);
3711 dev_put(dev); 3711 dev_put(dev);
3712unlock_rtnl: 3712unlock_rtnl:
3713 rtnl_unlock(); 3713 rtnl_unlock();
@@ -3716,7 +3716,7 @@ unlock_rtnl:
3716 3716
3717static int nl80211_disconnect(struct sk_buff *skb, struct genl_info *info) 3717static int nl80211_disconnect(struct sk_buff *skb, struct genl_info *info)
3718{ 3718{
3719 struct cfg80211_registered_device *drv; 3719 struct cfg80211_registered_device *rdev;
3720 struct net_device *dev; 3720 struct net_device *dev;
3721 int err; 3721 int err;
3722 u16 reason; 3722 u16 reason;
@@ -3731,7 +3731,7 @@ static int nl80211_disconnect(struct sk_buff *skb, struct genl_info *info)
3731 3731
3732 rtnl_lock(); 3732 rtnl_lock();
3733 3733
3734 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 3734 err = get_rdev_dev_by_info_ifindex(info->attrs, &rdev, &dev);
3735 if (err) 3735 if (err)
3736 goto unlock_rtnl; 3736 goto unlock_rtnl;
3737 3737
@@ -3745,10 +3745,10 @@ static int nl80211_disconnect(struct sk_buff *skb, struct genl_info *info)
3745 goto out; 3745 goto out;
3746 } 3746 }
3747 3747
3748 err = cfg80211_disconnect(drv, dev, reason, true); 3748 err = cfg80211_disconnect(rdev, dev, reason, true);
3749 3749
3750out: 3750out:
3751 cfg80211_unlock_rdev(drv); 3751 cfg80211_unlock_rdev(rdev);
3752 dev_put(dev); 3752 dev_put(dev);
3753unlock_rtnl: 3753unlock_rtnl:
3754 rtnl_unlock(); 3754 rtnl_unlock();
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 5e14371cda70..2b4a6c66f5ae 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1061,10 +1061,10 @@ static bool ignore_reg_update(struct wiphy *wiphy,
1061 1061
1062static void update_all_wiphy_regulatory(enum nl80211_reg_initiator initiator) 1062static void update_all_wiphy_regulatory(enum nl80211_reg_initiator initiator)
1063{ 1063{
1064 struct cfg80211_registered_device *drv; 1064 struct cfg80211_registered_device *rdev;
1065 1065
1066 list_for_each_entry(drv, &cfg80211_drv_list, list) 1066 list_for_each_entry(rdev, &cfg80211_rdev_list, list)
1067 wiphy_update_regulatory(&drv->wiphy, initiator); 1067 wiphy_update_regulatory(&rdev->wiphy, initiator);
1068} 1068}
1069 1069
1070static void handle_reg_beacon(struct wiphy *wiphy, 1070static void handle_reg_beacon(struct wiphy *wiphy,
@@ -1614,7 +1614,7 @@ static void reg_process_pending_hints(void)
1614/* Processes beacon hints -- this has nothing to do with country IEs */ 1614/* Processes beacon hints -- this has nothing to do with country IEs */
1615static void reg_process_pending_beacon_hints(void) 1615static void reg_process_pending_beacon_hints(void)
1616{ 1616{
1617 struct cfg80211_registered_device *drv; 1617 struct cfg80211_registered_device *rdev;
1618 struct reg_beacon *pending_beacon, *tmp; 1618 struct reg_beacon *pending_beacon, *tmp;
1619 1619
1620 mutex_lock(&cfg80211_mutex); 1620 mutex_lock(&cfg80211_mutex);
@@ -1633,8 +1633,8 @@ static void reg_process_pending_beacon_hints(void)
1633 list_del_init(&pending_beacon->list); 1633 list_del_init(&pending_beacon->list);
1634 1634
1635 /* Applies the beacon hint to current wiphys */ 1635 /* Applies the beacon hint to current wiphys */
1636 list_for_each_entry(drv, &cfg80211_drv_list, list) 1636 list_for_each_entry(rdev, &cfg80211_rdev_list, list)
1637 wiphy_update_new_beacon(&drv->wiphy, pending_beacon); 1637 wiphy_update_new_beacon(&rdev->wiphy, pending_beacon);
1638 1638
1639 /* Remembers the beacon hint for new wiphys or reg changes */ 1639 /* Remembers the beacon hint for new wiphys or reg changes */
1640 list_add_tail(&pending_beacon->list, &reg_beacon_list); 1640 list_add_tail(&pending_beacon->list, &reg_beacon_list);
@@ -1814,23 +1814,23 @@ void regulatory_hint_11d(struct wiphy *wiphy,
1814 if (likely(last_request->initiator == 1814 if (likely(last_request->initiator ==
1815 NL80211_REGDOM_SET_BY_COUNTRY_IE && 1815 NL80211_REGDOM_SET_BY_COUNTRY_IE &&
1816 wiphy_idx_valid(last_request->wiphy_idx))) { 1816 wiphy_idx_valid(last_request->wiphy_idx))) {
1817 struct cfg80211_registered_device *drv_last_ie; 1817 struct cfg80211_registered_device *rdev_last_ie;
1818 1818
1819 drv_last_ie = 1819 rdev_last_ie =
1820 cfg80211_drv_by_wiphy_idx(last_request->wiphy_idx); 1820 cfg80211_rdev_by_wiphy_idx(last_request->wiphy_idx);
1821 1821
1822 /* 1822 /*
1823 * Lets keep this simple -- we trust the first AP 1823 * Lets keep this simple -- we trust the first AP
1824 * after we intersect with CRDA 1824 * after we intersect with CRDA
1825 */ 1825 */
1826 if (likely(&drv_last_ie->wiphy == wiphy)) { 1826 if (likely(&rdev_last_ie->wiphy == wiphy)) {
1827 /* 1827 /*
1828 * Ignore IEs coming in on this wiphy with 1828 * Ignore IEs coming in on this wiphy with
1829 * the same alpha2 and environment cap 1829 * the same alpha2 and environment cap
1830 */ 1830 */
1831 if (likely(alpha2_equal(drv_last_ie->country_ie_alpha2, 1831 if (likely(alpha2_equal(rdev_last_ie->country_ie_alpha2,
1832 alpha2) && 1832 alpha2) &&
1833 env == drv_last_ie->env)) { 1833 env == rdev_last_ie->env)) {
1834 goto out; 1834 goto out;
1835 } 1835 }
1836 /* 1836 /*
@@ -1846,9 +1846,9 @@ void regulatory_hint_11d(struct wiphy *wiphy,
1846 * Ignore IEs coming in on two separate wiphys with 1846 * Ignore IEs coming in on two separate wiphys with
1847 * the same alpha2 and environment cap 1847 * the same alpha2 and environment cap
1848 */ 1848 */
1849 if (likely(alpha2_equal(drv_last_ie->country_ie_alpha2, 1849 if (likely(alpha2_equal(rdev_last_ie->country_ie_alpha2,
1850 alpha2) && 1850 alpha2) &&
1851 env == drv_last_ie->env)) { 1851 env == rdev_last_ie->env)) {
1852 goto out; 1852 goto out;
1853 } 1853 }
1854 /* We could potentially intersect though */ 1854 /* We could potentially intersect though */
@@ -1995,14 +1995,14 @@ static void print_regdomain(const struct ieee80211_regdomain *rd)
1995 1995
1996 if (last_request->initiator == 1996 if (last_request->initiator ==
1997 NL80211_REGDOM_SET_BY_COUNTRY_IE) { 1997 NL80211_REGDOM_SET_BY_COUNTRY_IE) {
1998 struct cfg80211_registered_device *drv; 1998 struct cfg80211_registered_device *rdev;
1999 drv = cfg80211_drv_by_wiphy_idx( 1999 rdev = cfg80211_rdev_by_wiphy_idx(
2000 last_request->wiphy_idx); 2000 last_request->wiphy_idx);
2001 if (drv) { 2001 if (rdev) {
2002 printk(KERN_INFO "cfg80211: Current regulatory " 2002 printk(KERN_INFO "cfg80211: Current regulatory "
2003 "domain updated by AP to: %c%c\n", 2003 "domain updated by AP to: %c%c\n",
2004 drv->country_ie_alpha2[0], 2004 rdev->country_ie_alpha2[0],
2005 drv->country_ie_alpha2[1]); 2005 rdev->country_ie_alpha2[1]);
2006 } else 2006 } else
2007 printk(KERN_INFO "cfg80211: Current regulatory " 2007 printk(KERN_INFO "cfg80211: Current regulatory "
2008 "domain intersected: \n"); 2008 "domain intersected: \n");
@@ -2063,7 +2063,7 @@ static inline void reg_country_ie_process_debug(
2063static int __set_regdom(const struct ieee80211_regdomain *rd) 2063static int __set_regdom(const struct ieee80211_regdomain *rd)
2064{ 2064{
2065 const struct ieee80211_regdomain *intersected_rd = NULL; 2065 const struct ieee80211_regdomain *intersected_rd = NULL;
2066 struct cfg80211_registered_device *drv = NULL; 2066 struct cfg80211_registered_device *rdev = NULL;
2067 struct wiphy *request_wiphy; 2067 struct wiphy *request_wiphy;
2068 /* Some basic sanity checks first */ 2068 /* Some basic sanity checks first */
2069 2069
@@ -2202,11 +2202,11 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
2202 if (!intersected_rd) 2202 if (!intersected_rd)
2203 return -EINVAL; 2203 return -EINVAL;
2204 2204
2205 drv = wiphy_to_dev(request_wiphy); 2205 rdev = wiphy_to_dev(request_wiphy);
2206 2206
2207 drv->country_ie_alpha2[0] = rd->alpha2[0]; 2207 rdev->country_ie_alpha2[0] = rd->alpha2[0];
2208 drv->country_ie_alpha2[1] = rd->alpha2[1]; 2208 rdev->country_ie_alpha2[1] = rd->alpha2[1];
2209 drv->env = last_request->country_ie_env; 2209 rdev->env = last_request->country_ie_env;
2210 2210
2211 BUG_ON(intersected_rd == rd); 2211 BUG_ON(intersected_rd == rd);
2212 2212
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 472e2412c781..df9173f73604 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -33,15 +33,15 @@ struct cfg80211_conn {
33 33
34static int cfg80211_conn_scan(struct wireless_dev *wdev) 34static int cfg80211_conn_scan(struct wireless_dev *wdev)
35{ 35{
36 struct cfg80211_registered_device *drv = wiphy_to_dev(wdev->wiphy); 36 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
37 struct cfg80211_scan_request *request; 37 struct cfg80211_scan_request *request;
38 int n_channels, err; 38 int n_channels, err;
39 39
40 ASSERT_RTNL(); 40 ASSERT_RTNL();
41 ASSERT_RDEV_LOCK(drv); 41 ASSERT_RDEV_LOCK(rdev);
42 ASSERT_WDEV_LOCK(wdev); 42 ASSERT_WDEV_LOCK(wdev);
43 43
44 if (drv->scan_req) 44 if (rdev->scan_req)
45 return -EBUSY; 45 return -EBUSY;
46 46
47 if (wdev->conn->params.channel) { 47 if (wdev->conn->params.channel) {
@@ -87,16 +87,16 @@ static int cfg80211_conn_scan(struct wireless_dev *wdev)
87 request->ssids[0].ssid_len = wdev->conn->params.ssid_len; 87 request->ssids[0].ssid_len = wdev->conn->params.ssid_len;
88 88
89 request->ifidx = wdev->netdev->ifindex; 89 request->ifidx = wdev->netdev->ifindex;
90 request->wiphy = &drv->wiphy; 90 request->wiphy = &rdev->wiphy;
91 91
92 drv->scan_req = request; 92 rdev->scan_req = request;
93 93
94 err = drv->ops->scan(wdev->wiphy, wdev->netdev, request); 94 err = rdev->ops->scan(wdev->wiphy, wdev->netdev, request);
95 if (!err) { 95 if (!err) {
96 wdev->conn->state = CFG80211_CONN_SCANNING; 96 wdev->conn->state = CFG80211_CONN_SCANNING;
97 nl80211_send_scan_start(drv, wdev->netdev); 97 nl80211_send_scan_start(rdev, wdev->netdev);
98 } else { 98 } else {
99 drv->scan_req = NULL; 99 rdev->scan_req = NULL;
100 kfree(request); 100 kfree(request);
101 } 101 }
102 return err; 102 return err;
@@ -104,7 +104,7 @@ static int cfg80211_conn_scan(struct wireless_dev *wdev)
104 104
105static int cfg80211_conn_do_work(struct wireless_dev *wdev) 105static int cfg80211_conn_do_work(struct wireless_dev *wdev)
106{ 106{
107 struct cfg80211_registered_device *drv = wiphy_to_dev(wdev->wiphy); 107 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
108 struct cfg80211_connect_params *params; 108 struct cfg80211_connect_params *params;
109 int err; 109 int err;
110 110
@@ -119,15 +119,15 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev)
119 case CFG80211_CONN_SCAN_AGAIN: 119 case CFG80211_CONN_SCAN_AGAIN:
120 return cfg80211_conn_scan(wdev); 120 return cfg80211_conn_scan(wdev);
121 case CFG80211_CONN_AUTHENTICATE_NEXT: 121 case CFG80211_CONN_AUTHENTICATE_NEXT:
122 BUG_ON(!drv->ops->auth); 122 BUG_ON(!rdev->ops->auth);
123 wdev->conn->state = CFG80211_CONN_AUTHENTICATING; 123 wdev->conn->state = CFG80211_CONN_AUTHENTICATING;
124 return __cfg80211_mlme_auth(drv, wdev->netdev, 124 return __cfg80211_mlme_auth(rdev, wdev->netdev,
125 params->channel, params->auth_type, 125 params->channel, params->auth_type,
126 params->bssid, 126 params->bssid,
127 params->ssid, params->ssid_len, 127 params->ssid, params->ssid_len,
128 NULL, 0); 128 NULL, 0);
129 case CFG80211_CONN_ASSOCIATE_NEXT: 129 case CFG80211_CONN_ASSOCIATE_NEXT:
130 BUG_ON(!drv->ops->assoc); 130 BUG_ON(!rdev->ops->assoc);
131 wdev->conn->state = CFG80211_CONN_ASSOCIATING; 131 wdev->conn->state = CFG80211_CONN_ASSOCIATING;
132 /* 132 /*
133 * We could, later, implement roaming here and then actually 133 * We could, later, implement roaming here and then actually
@@ -135,14 +135,14 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev)
135 * that some APs don't like that -- so we'd need to retry 135 * that some APs don't like that -- so we'd need to retry
136 * the association. 136 * the association.
137 */ 137 */
138 err = __cfg80211_mlme_assoc(drv, wdev->netdev, 138 err = __cfg80211_mlme_assoc(rdev, wdev->netdev,
139 params->channel, params->bssid, 139 params->channel, params->bssid,
140 NULL, 140 NULL,
141 params->ssid, params->ssid_len, 141 params->ssid, params->ssid_len,
142 params->ie, params->ie_len, 142 params->ie, params->ie_len,
143 false, &params->crypto); 143 false, &params->crypto);
144 if (err) 144 if (err)
145 __cfg80211_mlme_deauth(drv, wdev->netdev, params->bssid, 145 __cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid,
146 NULL, 0, 146 NULL, 0,
147 WLAN_REASON_DEAUTH_LEAVING); 147 WLAN_REASON_DEAUTH_LEAVING);
148 return err; 148 return err;
@@ -153,15 +153,15 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev)
153 153
154void cfg80211_conn_work(struct work_struct *work) 154void cfg80211_conn_work(struct work_struct *work)
155{ 155{
156 struct cfg80211_registered_device *drv = 156 struct cfg80211_registered_device *rdev =
157 container_of(work, struct cfg80211_registered_device, conn_work); 157 container_of(work, struct cfg80211_registered_device, conn_work);
158 struct wireless_dev *wdev; 158 struct wireless_dev *wdev;
159 159
160 rtnl_lock(); 160 rtnl_lock();
161 cfg80211_lock_rdev(drv); 161 cfg80211_lock_rdev(rdev);
162 mutex_lock(&drv->devlist_mtx); 162 mutex_lock(&rdev->devlist_mtx);
163 163
164 list_for_each_entry(wdev, &drv->netdev_list, list) { 164 list_for_each_entry(wdev, &rdev->netdev_list, list) {
165 wdev_lock(wdev); 165 wdev_lock(wdev);
166 if (!netif_running(wdev->netdev)) { 166 if (!netif_running(wdev->netdev)) {
167 wdev_unlock(wdev); 167 wdev_unlock(wdev);
@@ -181,14 +181,14 @@ void cfg80211_conn_work(struct work_struct *work)
181 wdev_unlock(wdev); 181 wdev_unlock(wdev);
182 } 182 }
183 183
184 mutex_unlock(&drv->devlist_mtx); 184 mutex_unlock(&rdev->devlist_mtx);
185 cfg80211_unlock_rdev(drv); 185 cfg80211_unlock_rdev(rdev);
186 rtnl_unlock(); 186 rtnl_unlock();
187} 187}
188 188
189static bool cfg80211_get_conn_bss(struct wireless_dev *wdev) 189static bool cfg80211_get_conn_bss(struct wireless_dev *wdev)
190{ 190{
191 struct cfg80211_registered_device *drv = wiphy_to_dev(wdev->wiphy); 191 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
192 struct cfg80211_bss *bss; 192 struct cfg80211_bss *bss;
193 u16 capa = WLAN_CAPABILITY_ESS; 193 u16 capa = WLAN_CAPABILITY_ESS;
194 194
@@ -209,7 +209,7 @@ static bool cfg80211_get_conn_bss(struct wireless_dev *wdev)
209 wdev->conn->params.bssid = wdev->conn->bssid; 209 wdev->conn->params.bssid = wdev->conn->bssid;
210 wdev->conn->params.channel = bss->channel; 210 wdev->conn->params.channel = bss->channel;
211 wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT; 211 wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT;
212 schedule_work(&drv->conn_work); 212 schedule_work(&rdev->conn_work);
213 213
214 cfg80211_put_bss(bss); 214 cfg80211_put_bss(bss);
215 return true; 215 return true;
@@ -218,7 +218,7 @@ static bool cfg80211_get_conn_bss(struct wireless_dev *wdev)
218static void __cfg80211_sme_scan_done(struct net_device *dev) 218static void __cfg80211_sme_scan_done(struct net_device *dev)
219{ 219{
220 struct wireless_dev *wdev = dev->ieee80211_ptr; 220 struct wireless_dev *wdev = dev->ieee80211_ptr;
221 struct cfg80211_registered_device *drv = wiphy_to_dev(wdev->wiphy); 221 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
222 222
223 ASSERT_WDEV_LOCK(wdev); 223 ASSERT_WDEV_LOCK(wdev);
224 224
@@ -235,7 +235,7 @@ static void __cfg80211_sme_scan_done(struct net_device *dev)
235 if (!cfg80211_get_conn_bss(wdev)) { 235 if (!cfg80211_get_conn_bss(wdev)) {
236 /* not found */ 236 /* not found */
237 if (wdev->conn->state == CFG80211_CONN_SCAN_AGAIN) 237 if (wdev->conn->state == CFG80211_CONN_SCAN_AGAIN)
238 schedule_work(&drv->conn_work); 238 schedule_work(&rdev->conn_work);
239 else 239 else
240 __cfg80211_connect_result( 240 __cfg80211_connect_result(
241 wdev->netdev, 241 wdev->netdev,