OSDN Git Service

cfg80211: set the rates mask in connection probes over specified freq
authorKarl Beldan <karl.beldan@rivierawaves.com>
Tue, 7 Oct 2014 09:42:18 +0000 (11:42 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 10 Oct 2014 15:11:13 +0000 (17:11 +0200)
ATM, specifying the frequency when connecting sends a void 'supported
rates' EID.

Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
[fix memory leak in error path]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/sme.c

index dc1668f..0ab3711 100644 (file)
@@ -80,9 +80,18 @@ static int cfg80211_conn_scan(struct wireless_dev *wdev)
        if (!request)
                return -ENOMEM;
 
-       if (wdev->conn->params.channel)
+       if (wdev->conn->params.channel) {
+               enum ieee80211_band band = wdev->conn->params.channel->band;
+               struct ieee80211_supported_band *sband =
+                       wdev->wiphy->bands[band];
+
+               if (!sband) {
+                       kfree(request);
+                       return -EINVAL;
+               }
                request->channels[0] = wdev->conn->params.channel;
-       else {
+               request->rates[band] = (1 << sband->n_bitrates) - 1;
+       } else {
                int i = 0, j;
                enum ieee80211_band band;
                struct ieee80211_supported_band *bands;