cfg80211: accept no-op interface mode changes

When somebody tries to set the interface mode to the existing
mode, don't ask the driver but silently accept the setting.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Johannes Berg
2009-03-21 17:07:59 +01:00
committed by John W. Linville
parent 86f04680df
commit ac7f9cfa2c
2 changed files with 30 additions and 9 deletions

View File

@@ -66,6 +66,7 @@ int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info,
struct cfg80211_registered_device *rdev;
struct vif_params vifparams;
enum nl80211_iftype type;
int ret;
if (!wdev)
return -EOPNOTSUPP;
@@ -96,10 +97,16 @@ int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info,
return -EINVAL;
}
if (type == wdev->iftype)
return 0;
memset(&vifparams, 0, sizeof(vifparams));
return rdev->ops->change_virtual_intf(wdev->wiphy, dev->ifindex, type,
NULL, &vifparams);
ret = rdev->ops->change_virtual_intf(wdev->wiphy, dev->ifindex, type,
NULL, &vifparams);
WARN_ON(!ret && wdev->iftype != type);
return ret;
}
EXPORT_SYMBOL(cfg80211_wext_siwmode);