Commit 2a783c13 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

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: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 89832402
...@@ -526,52 +526,53 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb, ...@@ -526,52 +526,53 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
void *ndev) void *ndev)
{ {
struct net_device *dev = ndev; struct net_device *dev = ndev;
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev; struct cfg80211_registered_device *rdev;
if (!dev->ieee80211_ptr) if (!wdev)
return NOTIFY_DONE; return NOTIFY_DONE;
rdev = wiphy_to_dev(dev->ieee80211_ptr->wiphy); rdev = wiphy_to_dev(wdev->wiphy);
WARN_ON(dev->ieee80211_ptr->iftype == NL80211_IFTYPE_UNSPECIFIED); WARN_ON(wdev->iftype == NL80211_IFTYPE_UNSPECIFIED);
switch (state) { switch (state) {
case NETDEV_REGISTER: case NETDEV_REGISTER:
mutex_lock(&rdev->devlist_mtx); mutex_lock(&rdev->devlist_mtx);
list_add(&dev->ieee80211_ptr->list, &rdev->netdev_list); list_add(&wdev->list, &rdev->netdev_list);
if (sysfs_create_link(&dev->dev.kobj, &rdev->wiphy.dev.kobj, if (sysfs_create_link(&dev->dev.kobj, &rdev->wiphy.dev.kobj,
"phy80211")) { "phy80211")) {
printk(KERN_ERR "wireless: failed to add phy80211 " printk(KERN_ERR "wireless: failed to add phy80211 "
"symlink to netdev!\n"); "symlink to netdev!\n");
} }
dev->ieee80211_ptr->netdev = dev; wdev->netdev = dev;
#ifdef CONFIG_WIRELESS_EXT #ifdef CONFIG_WIRELESS_EXT
dev->ieee80211_ptr->wext.default_key = -1; wdev->wext.default_key = -1;
dev->ieee80211_ptr->wext.default_mgmt_key = -1; wdev->wext.default_mgmt_key = -1;
#endif #endif
mutex_unlock(&rdev->devlist_mtx); mutex_unlock(&rdev->devlist_mtx);
break; break;
case NETDEV_GOING_DOWN: case NETDEV_GOING_DOWN:
if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_ADHOC) if (wdev->iftype != NL80211_IFTYPE_ADHOC)
break; break;
if (!dev->ieee80211_ptr->ssid_len) if (!wdev->ssid_len)
break; break;
cfg80211_leave_ibss(rdev, dev, true); cfg80211_leave_ibss(rdev, dev, true);
break; break;
case NETDEV_UP: case NETDEV_UP:
#ifdef CONFIG_WIRELESS_EXT #ifdef CONFIG_WIRELESS_EXT
if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_ADHOC) if (wdev->iftype != NL80211_IFTYPE_ADHOC)
break; break;
if (!dev->ieee80211_ptr->wext.ibss.ssid_len) if (!wdev->wext.ibss.ssid_len)
break;
cfg80211_join_ibss(rdev, dev, &dev->ieee80211_ptr->wext.ibss);
break; break;
cfg80211_join_ibss(rdev, dev, &wdev->wext.ibss);
#endif #endif
break;
case NETDEV_UNREGISTER: case NETDEV_UNREGISTER:
mutex_lock(&rdev->devlist_mtx); mutex_lock(&rdev->devlist_mtx);
if (!list_empty(&dev->ieee80211_ptr->list)) { if (!list_empty(&wdev->list)) {
sysfs_remove_link(&dev->dev.kobj, "phy80211"); sysfs_remove_link(&dev->dev.kobj, "phy80211");
list_del_init(&dev->ieee80211_ptr->list); list_del_init(&wdev->list);
} }
mutex_unlock(&rdev->devlist_mtx); mutex_unlock(&rdev->devlist_mtx);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment