aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-07-18 12:08:36 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-07-19 16:50:00 -0400
commit85a237fe308405ee38eb9c6733571c49902ec229 (patch)
tree8e8fdbd588a749b7eb7da24d65684a2ca6161c6b /net/mac80211
parent34850ab25d74ab4eead62c3b4a9e8036a25cc669 (diff)
mac80211: implement scan supported rates
Scanning currently uses the TX rate mask to restrict the rate set, which is bogus. Make it use the new set of rates from userspace. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/ieee80211_i.h4
-rw-r--r--net/mac80211/mlme.c5
-rw-r--r--net/mac80211/scan.c6
-rw-r--r--net/mac80211/util.c12
-rw-r--r--net/mac80211/work.c3
5 files changed, 15 insertions, 15 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 1b845bb49c41..eb9d4826f775 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1377,14 +1377,14 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
1377 enum ieee80211_band band, u32 rate_mask, 1377 enum ieee80211_band band, u32 rate_mask,
1378 u8 channel); 1378 u8 channel);
1379struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata, 1379struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1380 u8 *dst, 1380 u8 *dst, u32 ratemask,
1381 const u8 *ssid, size_t ssid_len, 1381 const u8 *ssid, size_t ssid_len,
1382 const u8 *ie, size_t ie_len, 1382 const u8 *ie, size_t ie_len,
1383 bool directed); 1383 bool directed);
1384void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, 1384void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
1385 const u8 *ssid, size_t ssid_len, 1385 const u8 *ssid, size_t ssid_len,
1386 const u8 *ie, size_t ie_len, 1386 const u8 *ie, size_t ie_len,
1387 bool directed); 1387 u32 ratemask, bool directed);
1388 1388
1389void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, 1389void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
1390 const size_t supp_rates_len, 1390 const size_t supp_rates_len,
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 71e20a7af307..fee706d39fc2 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1220,7 +1220,7 @@ static void ieee80211_mgd_probe_ap_send(struct ieee80211_sub_if_data *sdata)
1220 } else { 1220 } else {
1221 ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID); 1221 ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID);
1222 ieee80211_send_probe_req(sdata, dst, ssid + 2, ssid[1], NULL, 0, 1222 ieee80211_send_probe_req(sdata, dst, ssid + 2, ssid[1], NULL, 0,
1223 true); 1223 (u32) -1, true);
1224 } 1224 }
1225 1225
1226 ifmgd->probe_send_count++; 1226 ifmgd->probe_send_count++;
@@ -1305,7 +1305,8 @@ struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw,
1305 1305
1306 ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID); 1306 ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID);
1307 skb = ieee80211_build_probe_req(sdata, ifmgd->associated->bssid, 1307 skb = ieee80211_build_probe_req(sdata, ifmgd->associated->bssid,
1308 ssid + 2, ssid[1], NULL, 0, true); 1308 (u32) -1, ssid + 2, ssid[1],
1309 NULL, 0, true);
1309 1310
1310 return skb; 1311 return skb;
1311} 1312}
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 08a45ac3d6f8..6f09eca01112 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -228,7 +228,6 @@ ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
228static bool ieee80211_prep_hw_scan(struct ieee80211_local *local) 228static bool ieee80211_prep_hw_scan(struct ieee80211_local *local)
229{ 229{
230 struct cfg80211_scan_request *req = local->scan_req; 230 struct cfg80211_scan_request *req = local->scan_req;
231 struct ieee80211_sub_if_data *sdata = local->scan_sdata;
232 enum ieee80211_band band; 231 enum ieee80211_band band;
233 int i, ielen, n_chans; 232 int i, ielen, n_chans;
234 233
@@ -253,7 +252,7 @@ static bool ieee80211_prep_hw_scan(struct ieee80211_local *local)
253 252
254 ielen = ieee80211_build_preq_ies(local, (u8 *)local->hw_scan_req->ie, 253 ielen = ieee80211_build_preq_ies(local, (u8 *)local->hw_scan_req->ie,
255 req->ie, req->ie_len, band, 254 req->ie, req->ie_len, band,
256 sdata->rc_rateidx_mask[band], 0); 255 req->rates[band], 0);
257 local->hw_scan_req->ie_len = ielen; 256 local->hw_scan_req->ie_len = ielen;
258 257
259 return true; 258 return true;
@@ -653,6 +652,7 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local,
653{ 652{
654 int i; 653 int i;
655 struct ieee80211_sub_if_data *sdata = local->scan_sdata; 654 struct ieee80211_sub_if_data *sdata = local->scan_sdata;
655 enum ieee80211_band band = local->hw.conf.channel->band;
656 656
657 for (i = 0; i < local->scan_req->n_ssids; i++) 657 for (i = 0; i < local->scan_req->n_ssids; i++)
658 ieee80211_send_probe_req( 658 ieee80211_send_probe_req(
@@ -660,7 +660,7 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local,
660 local->scan_req->ssids[i].ssid, 660 local->scan_req->ssids[i].ssid,
661 local->scan_req->ssids[i].ssid_len, 661 local->scan_req->ssids[i].ssid_len,
662 local->scan_req->ie, local->scan_req->ie_len, 662 local->scan_req->ie, local->scan_req->ie_len,
663 false); 663 local->scan_req->rates[band], false);
664 664
665 /* 665 /*
666 * After sending probe requests, wait for probe responses 666 * After sending probe requests, wait for probe responses
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index ca440bce3de8..ddeb1b998383 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1017,7 +1017,7 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
1017} 1017}
1018 1018
1019struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata, 1019struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1020 u8 *dst, 1020 u8 *dst, u32 ratemask,
1021 const u8 *ssid, size_t ssid_len, 1021 const u8 *ssid, size_t ssid_len,
1022 const u8 *ie, size_t ie_len, 1022 const u8 *ie, size_t ie_len,
1023 bool directed) 1023 bool directed)
@@ -1050,9 +1050,7 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1050 1050
1051 buf_len = ieee80211_build_preq_ies(local, buf, ie, ie_len, 1051 buf_len = ieee80211_build_preq_ies(local, buf, ie, ie_len,
1052 local->hw.conf.channel->band, 1052 local->hw.conf.channel->band,
1053 sdata->rc_rateidx_mask 1053 ratemask, chan);
1054 [local->hw.conf.channel->band],
1055 chan);
1056 1054
1057 skb = ieee80211_probereq_get(&local->hw, &sdata->vif, 1055 skb = ieee80211_probereq_get(&local->hw, &sdata->vif,
1058 ssid, ssid_len, 1056 ssid, ssid_len,
@@ -1073,12 +1071,12 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1073void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, 1071void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
1074 const u8 *ssid, size_t ssid_len, 1072 const u8 *ssid, size_t ssid_len,
1075 const u8 *ie, size_t ie_len, 1073 const u8 *ie, size_t ie_len,
1076 bool directed) 1074 u32 ratemask, bool directed)
1077{ 1075{
1078 struct sk_buff *skb; 1076 struct sk_buff *skb;
1079 1077
1080 skb = ieee80211_build_probe_req(sdata, dst, ssid, ssid_len, ie, ie_len, 1078 skb = ieee80211_build_probe_req(sdata, dst, ratemask, ssid, ssid_len,
1081 directed); 1079 ie, ie_len, directed);
1082 if (skb) 1080 if (skb)
1083 ieee80211_tx_skb(sdata, skb); 1081 ieee80211_tx_skb(sdata, skb);
1084} 1082}
diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index edf8583280c9..f0c74a1a9a02 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -450,7 +450,8 @@ ieee80211_direct_probe(struct ieee80211_work *wk)
450 * will not answer to direct packet in unassociated state. 450 * will not answer to direct packet in unassociated state.
451 */ 451 */
452 ieee80211_send_probe_req(sdata, NULL, wk->probe_auth.ssid, 452 ieee80211_send_probe_req(sdata, NULL, wk->probe_auth.ssid,
453 wk->probe_auth.ssid_len, NULL, 0, true); 453 wk->probe_auth.ssid_len, NULL, 0,
454 (u32) -1, true);
454 455
455 wk->timeout = jiffies + IEEE80211_AUTH_TIMEOUT; 456 wk->timeout = jiffies + IEEE80211_AUTH_TIMEOUT;
456 run_again(local, wk->timeout); 457 run_again(local, wk->timeout);