]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/wireless/wext-compat.c
Merge tag 'spi-for-linus' of git://git.secretlab.ca/git/linux-2.6
[karo-tx-linux.git] / net / wireless / wext-compat.c
index 6488d2dbc1d783bb34f3009fe8a8b81b05c1b5f9..d997d0f0c54a683fb0aee287d44fc79d4b15230d 100644 (file)
@@ -176,7 +176,7 @@ int cfg80211_wext_giwrange(struct net_device *dev,
        case CFG80211_SIGNAL_TYPE_NONE:
                break;
        case CFG80211_SIGNAL_TYPE_MBM:
-               range->max_qual.level = -110;
+               range->max_qual.level = (u8)-110;
                range->max_qual.qual = 70;
                range->avg_qual.qual = 35;
                range->max_qual.updated |= IW_QUAL_DBM;
@@ -784,6 +784,9 @@ static int cfg80211_wext_siwfreq(struct net_device *dev,
 {
        struct wireless_dev *wdev = dev->ieee80211_ptr;
        struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
+       struct cfg80211_chan_def chandef = {
+               .width = NL80211_CHAN_WIDTH_20_NOHT,
+       };
        int freq, err;
 
        switch (wdev->iftype) {
@@ -797,8 +800,12 @@ static int cfg80211_wext_siwfreq(struct net_device *dev,
                        return freq;
                if (freq == 0)
                        return -EINVAL;
+               chandef.center_freq1 = freq;
+               chandef.chan = ieee80211_get_channel(&rdev->wiphy, freq);
+               if (!chandef.chan)
+                       return -EINVAL;
                mutex_lock(&rdev->devlist_mtx);
-               err = cfg80211_set_monitor_channel(rdev, freq, NL80211_CHAN_NO_HT);
+               err = cfg80211_set_monitor_channel(rdev, &chandef);
                mutex_unlock(&rdev->devlist_mtx);
                return err;
        case NL80211_IFTYPE_MESH_POINT:
@@ -807,9 +814,12 @@ static int cfg80211_wext_siwfreq(struct net_device *dev,
                        return freq;
                if (freq == 0)
                        return -EINVAL;
+               chandef.center_freq1 = freq;
+               chandef.chan = ieee80211_get_channel(&rdev->wiphy, freq);
+               if (!chandef.chan)
+                       return -EINVAL;
                mutex_lock(&rdev->devlist_mtx);
-               err = cfg80211_set_mesh_freq(rdev, wdev, freq,
-                                            NL80211_CHAN_NO_HT);
+               err = cfg80211_set_mesh_channel(rdev, wdev, &chandef);
                mutex_unlock(&rdev->devlist_mtx);
                return err;
        default:
@@ -823,8 +833,8 @@ static int cfg80211_wext_giwfreq(struct net_device *dev,
 {
        struct wireless_dev *wdev = dev->ieee80211_ptr;
        struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
-       struct ieee80211_channel *chan;
-       enum nl80211_channel_type channel_type;
+       struct cfg80211_chan_def chandef;
+       int ret;
 
        switch (wdev->iftype) {
        case NL80211_IFTYPE_STATION:
@@ -835,10 +845,10 @@ static int cfg80211_wext_giwfreq(struct net_device *dev,
                if (!rdev->ops->get_channel)
                        return -EINVAL;
 
-               chan = rdev_get_channel(rdev, wdev, &channel_type);
-               if (!chan)
-                       return -EINVAL;
-               freq->m = chan->center_freq;
+               ret = rdev_get_channel(rdev, wdev, &chandef);
+               if (ret)
+                       return ret;
+               freq->m = chandef.chan->center_freq;
                freq->e = 6;
                return 0;
        default:
@@ -895,7 +905,7 @@ static int cfg80211_wext_siwtxpower(struct net_device *dev,
                return 0;
        }
 
-       return rdev_set_tx_power(rdev, type, DBM_TO_MBM(dbm));
+       return rdev_set_tx_power(rdev, wdev, type, DBM_TO_MBM(dbm));
 }
 
 static int cfg80211_wext_giwtxpower(struct net_device *dev,
@@ -914,7 +924,7 @@ static int cfg80211_wext_giwtxpower(struct net_device *dev,
        if (!rdev->ops->get_tx_power)
                return -EOPNOTSUPP;
 
-       err = rdev_get_tx_power(rdev, &val);
+       err = rdev_get_tx_power(rdev, wdev, &val);
        if (err)
                return err;