summaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-06-09 21:04:43 +0200
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 14:57:38 -0400
commite36d56b64808aec54b68b4e9976180c1da0933b2 (patch)
tree93f0e696d077b58d1064f3321d52b4611addf104 /net/wireless
parente5a8a896f5180f2950695d2d0b79db348d200ca4 (diff)
downloadop-kernel-dev-e36d56b64808aec54b68b4e9976180c1da0933b2.zip
op-kernel-dev-e36d56b64808aec54b68b4e9976180c1da0933b2.tar.gz
cfg80211: pass netdev to change_virtual_intf
If there was a reason I'm passing the ifidx I cannot remember it any more and don't see one now, so let's just pass the pointer itself. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/nl80211.c12
-rw-r--r--net/wireless/wext-compat.c2
2 files changed, 6 insertions, 8 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 43bdb13..f91e5d4 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -767,7 +767,7 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
{
struct cfg80211_registered_device *drv;
struct vif_params params;
- int err, ifindex;
+ int err;
enum nl80211_iftype otype, ntype;
struct net_device *dev;
u32 _flags, *flags = NULL;
@@ -781,9 +781,7 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
if (err)
goto unlock_rtnl;
- ifindex = dev->ifindex;
otype = ntype = dev->ieee80211_ptr->iftype;
- dev_put(dev);
if (info->attrs[NL80211_ATTR_IFTYPE]) {
ntype = nla_get_u32(info->attrs[NL80211_ATTR_IFTYPE]);
@@ -826,20 +824,20 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
}
if (change)
- err = drv->ops->change_virtual_intf(&drv->wiphy, ifindex,
+ err = drv->ops->change_virtual_intf(&drv->wiphy, dev,
ntype, flags, &params);
else
err = 0;
- dev = __dev_get_by_index(&init_net, ifindex);
- WARN_ON(!dev || (!err && dev->ieee80211_ptr->iftype != ntype));
+ WARN_ON(!err && dev->ieee80211_ptr->iftype != ntype);
- if (dev && !err && (ntype != otype)) {
+ if (!err && (ntype != otype)) {
if (otype == NL80211_IFTYPE_ADHOC)
cfg80211_clear_ibss(dev, false);
}
unlock:
+ dev_put(dev);
cfg80211_put_dev(drv);
unlock_rtnl:
rtnl_unlock();
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
index d030c53..9e56f35 100644
--- a/net/wireless/wext-compat.c
+++ b/net/wireless/wext-compat.c
@@ -103,7 +103,7 @@ int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info,
memset(&vifparams, 0, sizeof(vifparams));
- ret = rdev->ops->change_virtual_intf(wdev->wiphy, dev->ifindex, type,
+ ret = rdev->ops->change_virtual_intf(wdev->wiphy, dev, type,
NULL, &vifparams);
WARN_ON(!ret && wdev->iftype != type);
OpenPOWER on IntegriCloud