diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-05-08 21:34:22 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-05-25 00:02:13 +0200 |
commit | 9f419f3851041e0c8170629f0639813dbfc79d5e (patch) | |
tree | 881b599ab8ee0c0924d7152bf4e330aa36213609 /net/wireless/scan.c | |
parent | Merge remote-tracking branch 'mac80211/master' into mac80211-next (diff) | |
download | linux-9f419f3851041e0c8170629f0639813dbfc79d5e.tar.xz linux-9f419f3851041e0c8170629f0639813dbfc79d5e.zip |
cfg80211: move cfg80211_get_dev_from_ifindex under wext
The function is only used and needed by the wext code
for scanning, so move it there.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to '')
-rw-r--r-- | net/wireless/scan.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c index fd99ea495b7e..2ce44a712f13 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -1040,6 +1040,27 @@ void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *pub) EXPORT_SYMBOL(cfg80211_unlink_bss); #ifdef CONFIG_CFG80211_WEXT +static struct cfg80211_registered_device * +cfg80211_get_dev_from_ifindex(struct net *net, int ifindex) +{ + struct cfg80211_registered_device *rdev = ERR_PTR(-ENODEV); + struct net_device *dev; + + mutex_lock(&cfg80211_mutex); + dev = dev_get_by_index(net, ifindex); + if (!dev) + goto out; + if (dev->ieee80211_ptr) { + rdev = wiphy_to_dev(dev->ieee80211_ptr->wiphy); + mutex_lock(&rdev->mtx); + } else + rdev = ERR_PTR(-ENODEV); + dev_put(dev); + out: + mutex_unlock(&cfg80211_mutex); + return rdev; +} + int cfg80211_wext_siwscan(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) |