Commit 2a783c136b4f280d9863170bd6703d25bdb4746c
Committed by
John W. Linville
1 parent
898324025f
Exists in
master
and in
40 other branches
cfg80211: move break statement to correct place
Move a break statement to the correct place _after_ the #endif, otherwise w/o WIRELESS_EXT things break badly. Also, while touching this code, do a cleanup and assign dev->ieee80211_ptr to a new variable. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Showing 1 changed file with 16 additions and 15 deletions Side-by-side Diff
net/wireless/core.c
... | ... | @@ -526,52 +526,53 @@ |
526 | 526 | void *ndev) |
527 | 527 | { |
528 | 528 | struct net_device *dev = ndev; |
529 | + struct wireless_dev *wdev = dev->ieee80211_ptr; | |
529 | 530 | struct cfg80211_registered_device *rdev; |
530 | 531 | |
531 | - if (!dev->ieee80211_ptr) | |
532 | + if (!wdev) | |
532 | 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 | 539 | switch (state) { |
539 | 540 | case NETDEV_REGISTER: |
540 | 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 | 543 | if (sysfs_create_link(&dev->dev.kobj, &rdev->wiphy.dev.kobj, |
543 | 544 | "phy80211")) { |
544 | 545 | printk(KERN_ERR "wireless: failed to add phy80211 " |
545 | 546 | "symlink to netdev!\n"); |
546 | 547 | } |
547 | - dev->ieee80211_ptr->netdev = dev; | |
548 | + wdev->netdev = dev; | |
548 | 549 | #ifdef CONFIG_WIRELESS_EXT |
549 | - dev->ieee80211_ptr->wext.default_key = -1; | |
550 | - dev->ieee80211_ptr->wext.default_mgmt_key = -1; | |
550 | + wdev->wext.default_key = -1; | |
551 | + wdev->wext.default_mgmt_key = -1; | |
551 | 552 | #endif |
552 | 553 | mutex_unlock(&rdev->devlist_mtx); |
553 | 554 | break; |
554 | 555 | case NETDEV_GOING_DOWN: |
555 | - if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_ADHOC) | |
556 | + if (wdev->iftype != NL80211_IFTYPE_ADHOC) | |
556 | 557 | break; |
557 | - if (!dev->ieee80211_ptr->ssid_len) | |
558 | + if (!wdev->ssid_len) | |
558 | 559 | break; |
559 | 560 | cfg80211_leave_ibss(rdev, dev, true); |
560 | 561 | break; |
561 | 562 | case NETDEV_UP: |
562 | 563 | #ifdef CONFIG_WIRELESS_EXT |
563 | - if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_ADHOC) | |
564 | + if (wdev->iftype != NL80211_IFTYPE_ADHOC) | |
564 | 565 | break; |
565 | - if (!dev->ieee80211_ptr->wext.ibss.ssid_len) | |
566 | + if (!wdev->wext.ibss.ssid_len) | |
566 | 567 | break; |
567 | - cfg80211_join_ibss(rdev, dev, &dev->ieee80211_ptr->wext.ibss); | |
568 | - break; | |
568 | + cfg80211_join_ibss(rdev, dev, &wdev->wext.ibss); | |
569 | 569 | #endif |
570 | + break; | |
570 | 571 | case NETDEV_UNREGISTER: |
571 | 572 | mutex_lock(&rdev->devlist_mtx); |
572 | - if (!list_empty(&dev->ieee80211_ptr->list)) { | |
573 | + if (!list_empty(&wdev->list)) { | |
573 | 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 | 577 | mutex_unlock(&rdev->devlist_mtx); |
577 | 578 | break; |