diff options
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 6897436b1d3f..3c24eb97e9d7 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c | |||
@@ -819,12 +819,24 @@ static int cfg80211_wext_giwfreq(struct net_device *dev, | |||
819 | struct iw_freq *freq, char *extra) | 819 | struct iw_freq *freq, char *extra) |
820 | { | 820 | { |
821 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 821 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
822 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | ||
823 | struct ieee80211_channel *chan; | ||
822 | 824 | ||
823 | switch (wdev->iftype) { | 825 | switch (wdev->iftype) { |
824 | case NL80211_IFTYPE_STATION: | 826 | case NL80211_IFTYPE_STATION: |
825 | return cfg80211_mgd_wext_giwfreq(dev, info, freq, extra); | 827 | return cfg80211_mgd_wext_giwfreq(dev, info, freq, extra); |
826 | case NL80211_IFTYPE_ADHOC: | 828 | case NL80211_IFTYPE_ADHOC: |
827 | return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra); | 829 | return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra); |
830 | case NL80211_IFTYPE_MONITOR: | ||
831 | if (!rdev->ops->get_channel) | ||
832 | return -EINVAL; | ||
833 | |||
834 | chan = rdev->ops->get_channel(wdev->wiphy); | ||
835 | if (!chan) | ||
836 | return -EINVAL; | ||
837 | freq->m = chan->center_freq; | ||
838 | freq->e = 6; | ||
839 | return 0; | ||
828 | default: | 840 | default: |
829 | if (!wdev->channel) | 841 | if (!wdev->channel) |
830 | return -EINVAL; | 842 | return -EINVAL; |