aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/wext-compat.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-07-12 13:45:08 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-07-13 10:16:11 -0400
commit5b7ccaf3fc7446e42b83a77fd7aa7ad92850acdd (patch)
treee87b3f28cdfe513de4f3527fabaaacca63eedc24 /net/wireless/wext-compat.c
parent075e08477d51709ae1998a05c35aadf59ef823b9 (diff)
cfg80211/mac80211: re-add get_channel operation
This essentially reverts commit 2e165b818456 but introduces the get_channel operation with a new wireless_dev argument so that you can retrieve the channel per interface. This is necessary as even though we can track all interface channels (except monitor) we can't track the channel type used. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/wext-compat.c')
-rw-r--r--net/wireless/wext-compat.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
index 7df42f541873..494379eb464f 100644
--- a/net/wireless/wext-compat.c
+++ b/net/wireless/wext-compat.c
@@ -827,6 +827,8 @@ static int cfg80211_wext_giwfreq(struct net_device *dev,
827{ 827{
828 struct wireless_dev *wdev = dev->ieee80211_ptr; 828 struct wireless_dev *wdev = dev->ieee80211_ptr;
829 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); 829 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
830 struct ieee80211_channel *chan;
831 enum nl80211_channel_type channel_type;
830 832
831 switch (wdev->iftype) { 833 switch (wdev->iftype) {
832 case NL80211_IFTYPE_STATION: 834 case NL80211_IFTYPE_STATION:
@@ -834,10 +836,13 @@ static int cfg80211_wext_giwfreq(struct net_device *dev,
834 case NL80211_IFTYPE_ADHOC: 836 case NL80211_IFTYPE_ADHOC:
835 return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra); 837 return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra);
836 case NL80211_IFTYPE_MONITOR: 838 case NL80211_IFTYPE_MONITOR:
837 if (!rdev->monitor_channel) 839 if (!rdev->ops->get_channel)
838 return -EINVAL; 840 return -EINVAL;
839 841
840 freq->m = rdev->monitor_channel->center_freq; 842 chan = rdev->ops->get_channel(wdev->wiphy, wdev, &channel_type);
843 if (!chan)
844 return -EINVAL;
845 freq->m = chan->center_freq;
841 freq->e = 6; 846 freq->e = 6;
842 return 0; 847 return 0;
843 default: 848 default: