Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158870
b: refs/heads/master
c: 2a783c1
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Jul 10, 2009
1 parent 39fdb27 commit 4b3cec9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 898324025fc12132d3ed98f8baf4fb3fa45327e0
refs/heads/master: 2a783c136b4f280d9863170bd6703d25bdb4746c
31 changes: 16 additions & 15 deletions trunk/net/wireless/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,52 +526,53 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
void *ndev)
{
struct net_device *dev = ndev;
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev;

if (!dev->ieee80211_ptr)
if (!wdev)
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) {
case NETDEV_REGISTER:
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,
"phy80211")) {
printk(KERN_ERR "wireless: failed to add phy80211 "
"symlink to netdev!\n");
}
dev->ieee80211_ptr->netdev = dev;
wdev->netdev = dev;
#ifdef CONFIG_WIRELESS_EXT
dev->ieee80211_ptr->wext.default_key = -1;
dev->ieee80211_ptr->wext.default_mgmt_key = -1;
wdev->wext.default_key = -1;
wdev->wext.default_mgmt_key = -1;
#endif
mutex_unlock(&rdev->devlist_mtx);
break;
case NETDEV_GOING_DOWN:
if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_ADHOC)
if (wdev->iftype != NL80211_IFTYPE_ADHOC)
break;
if (!dev->ieee80211_ptr->ssid_len)
if (!wdev->ssid_len)
break;
cfg80211_leave_ibss(rdev, dev, true);
break;
case NETDEV_UP:
#ifdef CONFIG_WIRELESS_EXT
if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_ADHOC)
if (wdev->iftype != NL80211_IFTYPE_ADHOC)
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;
cfg80211_join_ibss(rdev, dev, &wdev->wext.ibss);
#endif
break;
case NETDEV_UNREGISTER:
mutex_lock(&rdev->devlist_mtx);
if (!list_empty(&dev->ieee80211_ptr->list)) {
if (!list_empty(&wdev->list)) {
sysfs_remove_link(&dev->dev.kobj, "phy80211");
list_del_init(&dev->ieee80211_ptr->list);
list_del_init(&wdev->list);
}
mutex_unlock(&rdev->devlist_mtx);
break;
Expand Down

0 comments on commit 4b3cec9

Please sign in to comment.