aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/wext-compat.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-07-27 06:01:50 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-29 15:46:14 -0400
commit0e82ffe3b90bcad72cfe80e4379946b8fb0691ca (patch)
treec6b73524d4db86ddcaa866d7ea81a9600b610413 /net/wireless/wext-compat.c
parenta7bc376c858e0e724b8cb2db09b6874562d377ca (diff)
cfg80211: combine iwfreq implementations
Until now we implemented iwfreq for managed mode, we needed to keep the implementations separate, but now that we have all versions implemented we can combine them and export just one handler. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/wext-compat.c')
-rw-r--r--net/wireless/wext-compat.c54
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
19int cfg80211_wext_giwname(struct net_device *dev, 20int 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}
303EXPORT_SYMBOL_GPL(cfg80211_wext_freq);
304 304
305int cfg80211_wext_siwrts(struct net_device *dev, 305int 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}
760EXPORT_SYMBOL_GPL(cfg80211_wext_giwencode); 760EXPORT_SYMBOL_GPL(cfg80211_wext_giwencode);
761 761
762int 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}
790EXPORT_SYMBOL_GPL(cfg80211_wext_siwfreq);
791
792int 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}
812EXPORT_SYMBOL_GPL(cfg80211_wext_giwfreq);
813
762int cfg80211_wext_siwtxpower(struct net_device *dev, 814int 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)