diff options
Diffstat (limited to 'net/wireless/wext-compat.c')
-rw-r--r-- | net/wireless/wext-compat.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 9ab51838849e..75848c6cb22a 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c | |||
@@ -781,16 +781,22 @@ int cfg80211_wext_siwfreq(struct net_device *dev, | |||
781 | return cfg80211_mgd_wext_siwfreq(dev, info, wextfreq, extra); | 781 | return cfg80211_mgd_wext_siwfreq(dev, info, wextfreq, extra); |
782 | case NL80211_IFTYPE_ADHOC: | 782 | case NL80211_IFTYPE_ADHOC: |
783 | return cfg80211_ibss_wext_siwfreq(dev, info, wextfreq, extra); | 783 | return cfg80211_ibss_wext_siwfreq(dev, info, wextfreq, extra); |
784 | default: | 784 | case NL80211_IFTYPE_MONITOR: |
785 | case NL80211_IFTYPE_WDS: | ||
786 | case NL80211_IFTYPE_MESH_POINT: | ||
785 | freq = cfg80211_wext_freq(wdev->wiphy, wextfreq); | 787 | freq = cfg80211_wext_freq(wdev->wiphy, wextfreq); |
786 | if (freq < 0) | 788 | if (freq < 0) |
787 | return freq; | 789 | return freq; |
788 | if (freq == 0) | 790 | if (freq == 0) |
789 | return -EINVAL; | 791 | return -EINVAL; |
792 | wdev_lock(wdev); | ||
790 | mutex_lock(&rdev->devlist_mtx); | 793 | mutex_lock(&rdev->devlist_mtx); |
791 | err = rdev_set_freq(rdev, NULL, freq, NL80211_CHAN_NO_HT); | 794 | err = cfg80211_set_freq(rdev, wdev, freq, NL80211_CHAN_NO_HT); |
792 | mutex_unlock(&rdev->devlist_mtx); | 795 | mutex_unlock(&rdev->devlist_mtx); |
796 | wdev_unlock(wdev); | ||
793 | return err; | 797 | return err; |
798 | default: | ||
799 | return -EOPNOTSUPP; | ||
794 | } | 800 | } |
795 | } | 801 | } |
796 | EXPORT_SYMBOL_GPL(cfg80211_wext_siwfreq); | 802 | EXPORT_SYMBOL_GPL(cfg80211_wext_siwfreq); |
@@ -800,7 +806,6 @@ int cfg80211_wext_giwfreq(struct net_device *dev, | |||
800 | struct iw_freq *freq, char *extra) | 806 | struct iw_freq *freq, char *extra) |
801 | { | 807 | { |
802 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 808 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
803 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | ||
804 | 809 | ||
805 | switch (wdev->iftype) { | 810 | switch (wdev->iftype) { |
806 | case NL80211_IFTYPE_STATION: | 811 | case NL80211_IFTYPE_STATION: |
@@ -808,9 +813,9 @@ int cfg80211_wext_giwfreq(struct net_device *dev, | |||
808 | case NL80211_IFTYPE_ADHOC: | 813 | case NL80211_IFTYPE_ADHOC: |
809 | return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra); | 814 | return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra); |
810 | default: | 815 | default: |
811 | if (!rdev->channel) | 816 | if (!wdev->channel) |
812 | return -EINVAL; | 817 | return -EINVAL; |
813 | freq->m = rdev->channel->center_freq; | 818 | freq->m = wdev->channel->center_freq; |
814 | freq->e = 6; | 819 | freq->e = 6; |
815 | return 0; | 820 | return 0; |
816 | } | 821 | } |