diff options
author | Johannes Berg <johannes.berg@intel.com> | 2011-11-09 04:30:21 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-11 12:32:50 -0500 |
commit | e999882a052a2959571989b2db2b51893d23c0bb (patch) | |
tree | cbdb8c0ab84e372a0a9466720a058a9a0745349d /net/wireless/wext-compat.c | |
parent | 07ef03ee8b280a536b38ccfe512b9556996f0492 (diff) |
mac80211/cfg80211: report monitor channel in wireless extensions
Just add API to get the channel & report it. Trivial really.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/wext-compat.c')
-rw-r--r-- | net/wireless/wext-compat.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 62f121d1d9cb..db38c8302b54 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c | |||
@@ -818,12 +818,24 @@ static int cfg80211_wext_giwfreq(struct net_device *dev, | |||
818 | struct iw_freq *freq, char *extra) | 818 | struct iw_freq *freq, char *extra) |
819 | { | 819 | { |
820 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 820 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
821 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | ||
822 | struct ieee80211_channel *chan; | ||
821 | 823 | ||
822 | switch (wdev->iftype) { | 824 | switch (wdev->iftype) { |
823 | case NL80211_IFTYPE_STATION: | 825 | case NL80211_IFTYPE_STATION: |
824 | return cfg80211_mgd_wext_giwfreq(dev, info, freq, extra); | 826 | return cfg80211_mgd_wext_giwfreq(dev, info, freq, extra); |
825 | case NL80211_IFTYPE_ADHOC: | 827 | case NL80211_IFTYPE_ADHOC: |
826 | return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra); | 828 | return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra); |
829 | case NL80211_IFTYPE_MONITOR: | ||
830 | if (!rdev->ops->get_channel) | ||
831 | return -EINVAL; | ||
832 | |||
833 | chan = rdev->ops->get_channel(wdev->wiphy); | ||
834 | if (!chan) | ||
835 | return -EINVAL; | ||
836 | freq->m = chan->center_freq; | ||
837 | freq->e = 6; | ||
838 | return 0; | ||
827 | default: | 839 | default: |
828 | if (!wdev->channel) | 840 | if (!wdev->channel) |
829 | return -EINVAL; | 841 | return -EINVAL; |