Skip to content

Commit 85a237f

Browse files
jmberg-intellinvjw
authored andcommitted
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>
1 parent 34850ab commit 85a237f

5 files changed

Lines changed: 15 additions & 15 deletions

File tree

‎net/mac80211/ieee80211_i.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,14 +1377,14 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
13771377
enum ieee80211_band band, u32 rate_mask,
13781378
u8 channel);
13791379
struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1380-
u8 *dst,
1380+
u8 *dst, u32 ratemask,
13811381
const u8 *ssid, size_t ssid_len,
13821382
const u8 *ie, size_t ie_len,
13831383
bool directed);
13841384
void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
13851385
const u8 *ssid, size_t ssid_len,
13861386
const u8 *ie, size_t ie_len,
1387-
bool directed);
1387+
u32 ratemask, bool directed);
13881388

13891389
void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
13901390
const size_t supp_rates_len,

‎net/mac80211/mlme.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ static void ieee80211_mgd_probe_ap_send(struct ieee80211_sub_if_data *sdata)
12201220
} else {
12211221
ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID);
12221222
ieee80211_send_probe_req(sdata, dst, ssid + 2, ssid[1], NULL, 0,
1223-
true);
1223+
(u32) -1, true);
12241224
}
12251225

12261226
ifmgd->probe_send_count++;
@@ -1305,7 +1305,8 @@ struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw,
13051305

13061306
ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID);
13071307
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);
13091310

13101311
return skb;
13111312
}

‎net/mac80211/scan.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
228228
static bool ieee80211_prep_hw_scan(struct ieee80211_local *local)
229229
{
230230
struct cfg80211_scan_request *req = local->scan_req;
231-
struct ieee80211_sub_if_data *sdata = local->scan_sdata;
232231
enum ieee80211_band band;
233232
int i, ielen, n_chans;
234233

@@ -253,7 +252,7 @@ static bool ieee80211_prep_hw_scan(struct ieee80211_local *local)
253252

254253
ielen = ieee80211_build_preq_ies(local, (u8 *)local->hw_scan_req->ie,
255254
req->ie, req->ie_len, band,
256-
sdata->rc_rateidx_mask[band], 0);
255+
req->rates[band], 0);
257256
local->hw_scan_req->ie_len = ielen;
258257

259258
return true;
@@ -653,14 +652,15 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local,
653652
{
654653
int i;
655654
struct ieee80211_sub_if_data *sdata = local->scan_sdata;
655+
enum ieee80211_band band = local->hw.conf.channel->band;
656656

657657
for (i = 0; i < local->scan_req->n_ssids; i++)
658658
ieee80211_send_probe_req(
659659
sdata, NULL,
660660
local->scan_req->ssids[i].ssid,
661661
local->scan_req->ssids[i].ssid_len,
662662
local->scan_req->ie, local->scan_req->ie_len,
663-
false);
663+
local->scan_req->rates[band], false);
664664

665665
/*
666666
* After sending probe requests, wait for probe responses

‎net/mac80211/util.c‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
10171017
}
10181018

10191019
struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1020-
u8 *dst,
1020+
u8 *dst, u32 ratemask,
10211021
const u8 *ssid, size_t ssid_len,
10221022
const u8 *ie, size_t ie_len,
10231023
bool directed)
@@ -1050,9 +1050,7 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
10501050

10511051
buf_len = ieee80211_build_preq_ies(local, buf, ie, ie_len,
10521052
local->hw.conf.channel->band,
1053-
sdata->rc_rateidx_mask
1054-
[local->hw.conf.channel->band],
1055-
chan);
1053+
ratemask, chan);
10561054

10571055
skb = ieee80211_probereq_get(&local->hw, &sdata->vif,
10581056
ssid, ssid_len,
@@ -1073,12 +1071,12 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
10731071
void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
10741072
const u8 *ssid, size_t ssid_len,
10751073
const u8 *ie, size_t ie_len,
1076-
bool directed)
1074+
u32 ratemask, bool directed)
10771075
{
10781076
struct sk_buff *skb;
10791077

1080-
skb = ieee80211_build_probe_req(sdata, dst, ssid, ssid_len, ie, ie_len,
1081-
directed);
1078+
skb = ieee80211_build_probe_req(sdata, dst, ratemask, ssid, ssid_len,
1079+
ie, ie_len, directed);
10821080
if (skb)
10831081
ieee80211_tx_skb(sdata, skb);
10841082
}

‎net/mac80211/work.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,8 @@ ieee80211_direct_probe(struct ieee80211_work *wk)
450450
* will not answer to direct packet in unassociated state.
451451
*/
452452
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);
454455

455456
wk->timeout = jiffies + IEEE80211_AUTH_TIMEOUT;
456457
run_again(local, wk->timeout);

0 commit comments

Comments
 (0)