Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215107
b: refs/heads/master
c: 43b1995
h: refs/heads/master
i:
  215105: 2d480b4
  215103: 6622945
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Oct 7, 2010
1 parent e158eaf commit 9e4225a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 34 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: 7b99a7c2dab7efe7c265b66fedbf3444958ebfe3
refs/heads/master: 43b19952de54b0fccfcdc5968891ebe550367fe8
45 changes: 12 additions & 33 deletions trunk/net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -876,48 +876,25 @@ static int nl80211_set_channel(struct sk_buff *skb, struct genl_info *info)

static int nl80211_set_wds_peer(struct sk_buff *skb, struct genl_info *info)
{
struct cfg80211_registered_device *rdev;
struct wireless_dev *wdev;
struct net_device *dev;
struct cfg80211_registered_device *rdev = info->user_ptr[0];
struct net_device *dev = info->user_ptr[1];
struct wireless_dev *wdev = dev->ieee80211_ptr;
u8 *bssid;
int err;

if (!info->attrs[NL80211_ATTR_MAC])
return -EINVAL;

rtnl_lock();

err = get_rdev_dev_by_info_ifindex(info, &rdev, &dev);
if (err)
goto unlock_rtnl;

wdev = dev->ieee80211_ptr;

if (netif_running(dev)) {
err = -EBUSY;
goto out;
}
if (netif_running(dev))
return -EBUSY;

if (!rdev->ops->set_wds_peer) {
err = -EOPNOTSUPP;
goto out;
}
if (!rdev->ops->set_wds_peer)
return -EOPNOTSUPP;

if (wdev->iftype != NL80211_IFTYPE_WDS) {
err = -EOPNOTSUPP;
goto out;
}
if (wdev->iftype != NL80211_IFTYPE_WDS)
return -EOPNOTSUPP;

bssid = nla_data(info->attrs[NL80211_ATTR_MAC]);
err = rdev->ops->set_wds_peer(wdev->wiphy, dev, bssid);

out:
cfg80211_unlock_rdev(rdev);
dev_put(dev);
unlock_rtnl:
rtnl_unlock();

return err;
return rdev->ops->set_wds_peer(wdev->wiphy, dev, bssid);
}


Expand Down Expand Up @@ -4860,6 +4837,8 @@ static struct genl_ops nl80211_ops[] = {
.doit = nl80211_set_wds_peer,
.policy = nl80211_policy,
.flags = GENL_ADMIN_PERM,
.internal_flags = NL80211_FLAG_NEED_NETDEV |
NL80211_FLAG_NEED_RTNL,
},
};

Expand Down

0 comments on commit 9e4225a

Please sign in to comment.