diff options
Diffstat (limited to 'net/wireless/wext-compat.c')
-rw-r--r-- | net/wireless/wext-compat.c | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index c7351a98e660..fc2e7768967d 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/etherdevice.h> | 14 | #include <linux/etherdevice.h> |
15 | #include <net/iw_handler.h> | 15 | #include <net/iw_handler.h> |
16 | #include <net/cfg80211.h> | 16 | #include <net/cfg80211.h> |
17 | #include "wext-compat.h" | ||
17 | #include "core.h" | 18 | #include "core.h" |
18 | 19 | ||
19 | int cfg80211_wext_giwname(struct net_device *dev, | 20 | int cfg80211_wext_giwname(struct net_device *dev, |
@@ -300,7 +301,6 @@ struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy, | |||
300 | return ERR_PTR(-EINVAL); | 301 | return ERR_PTR(-EINVAL); |
301 | return chan; | 302 | return chan; |
302 | } | 303 | } |
303 | EXPORT_SYMBOL_GPL(cfg80211_wext_freq); | ||
304 | 304 | ||
305 | int cfg80211_wext_siwrts(struct net_device *dev, | 305 | int cfg80211_wext_siwrts(struct net_device *dev, |
306 | struct iw_request_info *info, | 306 | struct iw_request_info *info, |
@@ -759,6 +759,58 @@ int cfg80211_wext_giwencode(struct net_device *dev, | |||
759 | } | 759 | } |
760 | EXPORT_SYMBOL_GPL(cfg80211_wext_giwencode); | 760 | EXPORT_SYMBOL_GPL(cfg80211_wext_giwencode); |
761 | 761 | ||
762 | int cfg80211_wext_siwfreq(struct net_device *dev, | ||
763 | struct iw_request_info *info, | ||
764 | struct iw_freq *freq, char *extra) | ||
765 | { | ||
766 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
767 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | ||
768 | struct ieee80211_channel *chan; | ||
769 | int err; | ||
770 | |||
771 | switch (wdev->iftype) { | ||
772 | case NL80211_IFTYPE_STATION: | ||
773 | return cfg80211_mgd_wext_siwfreq(dev, info, freq, extra); | ||
774 | case NL80211_IFTYPE_ADHOC: | ||
775 | return cfg80211_ibss_wext_siwfreq(dev, info, freq, extra); | ||
776 | default: | ||
777 | chan = cfg80211_wext_freq(wdev->wiphy, freq); | ||
778 | if (!chan) | ||
779 | return -EINVAL; | ||
780 | if (IS_ERR(chan)) | ||
781 | return PTR_ERR(chan); | ||
782 | err = rdev->ops->set_channel(wdev->wiphy, chan, | ||
783 | NL80211_CHAN_NO_HT); | ||
784 | if (err) | ||
785 | return err; | ||
786 | rdev->channel = chan; | ||
787 | return 0; | ||
788 | } | ||
789 | } | ||
790 | EXPORT_SYMBOL_GPL(cfg80211_wext_siwfreq); | ||
791 | |||
792 | int cfg80211_wext_giwfreq(struct net_device *dev, | ||
793 | struct iw_request_info *info, | ||
794 | struct iw_freq *freq, char *extra) | ||
795 | { | ||
796 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
797 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | ||
798 | |||
799 | switch (wdev->iftype) { | ||
800 | case NL80211_IFTYPE_STATION: | ||
801 | return cfg80211_mgd_wext_giwfreq(dev, info, freq, extra); | ||
802 | case NL80211_IFTYPE_ADHOC: | ||
803 | return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra); | ||
804 | default: | ||
805 | if (!rdev->channel) | ||
806 | return -EINVAL; | ||
807 | freq->m = rdev->channel->center_freq; | ||
808 | freq->e = 6; | ||
809 | return 0; | ||
810 | } | ||
811 | } | ||
812 | EXPORT_SYMBOL_GPL(cfg80211_wext_giwfreq); | ||
813 | |||
762 | int cfg80211_wext_siwtxpower(struct net_device *dev, | 814 | int cfg80211_wext_siwtxpower(struct net_device *dev, |
763 | struct iw_request_info *info, | 815 | struct iw_request_info *info, |
764 | union iwreq_data *data, char *extra) | 816 | union iwreq_data *data, char *extra) |