aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/wext-compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/wext-compat.c')
-rw-r--r--net/wireless/wext-compat.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
index c12029b1def0..429dd06a4ecc 100644
--- a/net/wireless/wext-compat.c
+++ b/net/wireless/wext-compat.c
@@ -70,18 +70,8 @@ int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info,
70 enum nl80211_iftype type; 70 enum nl80211_iftype type;
71 int ret; 71 int ret;
72 72
73 if (!wdev)
74 return -EOPNOTSUPP;
75
76 rdev = wiphy_to_dev(wdev->wiphy); 73 rdev = wiphy_to_dev(wdev->wiphy);
77 74
78 if (!rdev->ops->change_virtual_intf)
79 return -EOPNOTSUPP;
80
81 /* don't support changing VLANs, you just re-create them */
82 if (wdev->iftype == NL80211_IFTYPE_AP_VLAN)
83 return -EOPNOTSUPP;
84
85 switch (*mode) { 75 switch (*mode) {
86 case IW_MODE_INFRA: 76 case IW_MODE_INFRA:
87 type = NL80211_IFTYPE_STATION; 77 type = NL80211_IFTYPE_STATION;
@@ -104,9 +94,9 @@ int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info,
104 94
105 memset(&vifparams, 0, sizeof(vifparams)); 95 memset(&vifparams, 0, sizeof(vifparams));
106 96
107 ret = rdev->ops->change_virtual_intf(wdev->wiphy, dev, type, 97 cfg80211_lock_rdev(rdev);
108 NULL, &vifparams); 98 ret = cfg80211_change_iface(rdev, dev, type, NULL, &vifparams);
109 WARN_ON(!ret && wdev->iftype != type); 99 cfg80211_unlock_rdev(rdev);
110 100
111 return ret; 101 return ret;
112} 102}