aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/wireless/core.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index a98670ca98b8..d41b7412b212 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -526,52 +526,53 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
526 void *ndev) 526 void *ndev)
527{ 527{
528 struct net_device *dev = ndev; 528 struct net_device *dev = ndev;
529 struct wireless_dev *wdev = dev->ieee80211_ptr;
529 struct cfg80211_registered_device *rdev; 530 struct cfg80211_registered_device *rdev;
530 531
531 if (!dev->ieee80211_ptr) 532 if (!wdev)
532 return NOTIFY_DONE; 533 return NOTIFY_DONE;
533 534
534 rdev = wiphy_to_dev(dev->ieee80211_ptr->wiphy); 535 rdev = wiphy_to_dev(wdev->wiphy);
535 536
536 WARN_ON(dev->ieee80211_ptr->iftype == NL80211_IFTYPE_UNSPECIFIED); 537 WARN_ON(wdev->iftype == NL80211_IFTYPE_UNSPECIFIED);
537 538
538 switch (state) { 539 switch (state) {
539 case NETDEV_REGISTER: 540 case NETDEV_REGISTER:
540 mutex_lock(&rdev->devlist_mtx); 541 mutex_lock(&rdev->devlist_mtx);
541 list_add(&dev->ieee80211_ptr->list, &rdev->netdev_list); 542 list_add(&wdev->list, &rdev->netdev_list);
542 if (sysfs_create_link(&dev->dev.kobj, &rdev->wiphy.dev.kobj, 543 if (sysfs_create_link(&dev->dev.kobj, &rdev->wiphy.dev.kobj,
543 "phy80211")) { 544 "phy80211")) {
544 printk(KERN_ERR "wireless: failed to add phy80211 " 545 printk(KERN_ERR "wireless: failed to add phy80211 "
545 "symlink to netdev!\n"); 546 "symlink to netdev!\n");
546 } 547 }
547 dev->ieee80211_ptr->netdev = dev; 548 wdev->netdev = dev;
548#ifdef CONFIG_WIRELESS_EXT 549#ifdef CONFIG_WIRELESS_EXT
549 dev->ieee80211_ptr->wext.default_key = -1; 550 wdev->wext.default_key = -1;
550 dev->ieee80211_ptr->wext.default_mgmt_key = -1; 551 wdev->wext.default_mgmt_key = -1;
551#endif 552#endif
552 mutex_unlock(&rdev->devlist_mtx); 553 mutex_unlock(&rdev->devlist_mtx);
553 break; 554 break;
554 case NETDEV_GOING_DOWN: 555 case NETDEV_GOING_DOWN:
555 if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_ADHOC) 556 if (wdev->iftype != NL80211_IFTYPE_ADHOC)
556 break; 557 break;
557 if (!dev->ieee80211_ptr->ssid_len) 558 if (!wdev->ssid_len)
558 break; 559 break;
559 cfg80211_leave_ibss(rdev, dev, true); 560 cfg80211_leave_ibss(rdev, dev, true);
560 break; 561 break;
561 case NETDEV_UP: 562 case NETDEV_UP:
562#ifdef CONFIG_WIRELESS_EXT 563#ifdef CONFIG_WIRELESS_EXT
563 if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_ADHOC) 564 if (wdev->iftype != NL80211_IFTYPE_ADHOC)
564 break; 565 break;
565 if (!dev->ieee80211_ptr->wext.ibss.ssid_len) 566 if (!wdev->wext.ibss.ssid_len)
566 break; 567 break;
567 cfg80211_join_ibss(rdev, dev, &dev->ieee80211_ptr->wext.ibss); 568 cfg80211_join_ibss(rdev, dev, &wdev->wext.ibss);
568 break;
569#endif 569#endif
570 break;
570 case NETDEV_UNREGISTER: 571 case NETDEV_UNREGISTER:
571 mutex_lock(&rdev->devlist_mtx); 572 mutex_lock(&rdev->devlist_mtx);
572 if (!list_empty(&dev->ieee80211_ptr->list)) { 573 if (!list_empty(&wdev->list)) {
573 sysfs_remove_link(&dev->dev.kobj, "phy80211"); 574 sysfs_remove_link(&dev->dev.kobj, "phy80211");
574 list_del_init(&dev->ieee80211_ptr->list); 575 list_del_init(&wdev->list);
575 } 576 }
576 mutex_unlock(&rdev->devlist_mtx); 577 mutex_unlock(&rdev->devlist_mtx);
577 break; 578 break;