diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-05-08 15:34:22 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-05-24 18:02:13 -0400 |
commit | 9f419f3851041e0c8170629f0639813dbfc79d5e (patch) | |
tree | 881b599ab8ee0c0924d7152bf4e330aa36213609 /net/wireless/scan.c | |
parent | dde7dc759b777f385fc5df2af691c82eb455c7f3 (diff) |
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 'net/wireless/scan.c')
-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) | |||
1040 | EXPORT_SYMBOL(cfg80211_unlink_bss); | 1040 | EXPORT_SYMBOL(cfg80211_unlink_bss); |
1041 | 1041 | ||
1042 | #ifdef CONFIG_CFG80211_WEXT | 1042 | #ifdef CONFIG_CFG80211_WEXT |
1043 | static struct cfg80211_registered_device * | ||
1044 | cfg80211_get_dev_from_ifindex(struct net *net, int ifindex) | ||
1045 | { | ||
1046 | struct cfg80211_registered_device *rdev = ERR_PTR(-ENODEV); | ||
1047 | struct net_device *dev; | ||
1048 | |||
1049 | mutex_lock(&cfg80211_mutex); | ||
1050 | dev = dev_get_by_index(net, ifindex); | ||
1051 | if (!dev) | ||
1052 | goto out; | ||
1053 | if (dev->ieee80211_ptr) { | ||
1054 | rdev = wiphy_to_dev(dev->ieee80211_ptr->wiphy); | ||
1055 | mutex_lock(&rdev->mtx); | ||
1056 | } else | ||
1057 | rdev = ERR_PTR(-ENODEV); | ||
1058 | dev_put(dev); | ||
1059 | out: | ||
1060 | mutex_unlock(&cfg80211_mutex); | ||
1061 | return rdev; | ||
1062 | } | ||
1063 | |||
1043 | int cfg80211_wext_siwscan(struct net_device *dev, | 1064 | int cfg80211_wext_siwscan(struct net_device *dev, |
1044 | struct iw_request_info *info, | 1065 | struct iw_request_info *info, |
1045 | union iwreq_data *wrqu, char *extra) | 1066 | union iwreq_data *wrqu, char *extra) |