Commit 85a237fe authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

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: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 34850ab2
...@@ -1377,14 +1377,14 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer, ...@@ -1377,14 +1377,14 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
enum ieee80211_band band, u32 rate_mask, enum ieee80211_band band, u32 rate_mask,
u8 channel); u8 channel);
struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata, struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
u8 *dst, u8 *dst, u32 ratemask,
const u8 *ssid, size_t ssid_len, const u8 *ssid, size_t ssid_len,
const u8 *ie, size_t ie_len, const u8 *ie, size_t ie_len,
bool directed); bool directed);
void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
const u8 *ssid, size_t ssid_len, const u8 *ssid, size_t ssid_len,
const u8 *ie, size_t ie_len, const u8 *ie, size_t ie_len,
bool directed); u32 ratemask, bool directed);
void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
const size_t supp_rates_len, const size_t supp_rates_len,
......
...@@ -1220,7 +1220,7 @@ static void ieee80211_mgd_probe_ap_send(struct ieee80211_sub_if_data *sdata) ...@@ -1220,7 +1220,7 @@ static void ieee80211_mgd_probe_ap_send(struct ieee80211_sub_if_data *sdata)
} else { } else {
ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID); ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID);
ieee80211_send_probe_req(sdata, dst, ssid + 2, ssid[1], NULL, 0, ieee80211_send_probe_req(sdata, dst, ssid + 2, ssid[1], NULL, 0,
true); (u32) -1, true);
} }
ifmgd->probe_send_count++; ifmgd->probe_send_count++;
...@@ -1305,7 +1305,8 @@ struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw, ...@@ -1305,7 +1305,8 @@ struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw,
ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID); ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID);
skb = ieee80211_build_probe_req(sdata, ifmgd->associated->bssid, skb = ieee80211_build_probe_req(sdata, ifmgd->associated->bssid,
ssid + 2, ssid[1], NULL, 0, true); (u32) -1, ssid + 2, ssid[1],
NULL, 0, true);
return skb; return skb;
} }
......
...@@ -228,7 +228,6 @@ ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) ...@@ -228,7 +228,6 @@ ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
static bool ieee80211_prep_hw_scan(struct ieee80211_local *local) static bool ieee80211_prep_hw_scan(struct ieee80211_local *local)
{ {
struct cfg80211_scan_request *req = local->scan_req; struct cfg80211_scan_request *req = local->scan_req;
struct ieee80211_sub_if_data *sdata = local->scan_sdata;
enum ieee80211_band band; enum ieee80211_band band;
int i, ielen, n_chans; int i, ielen, n_chans;
...@@ -253,7 +252,7 @@ static bool ieee80211_prep_hw_scan(struct ieee80211_local *local) ...@@ -253,7 +252,7 @@ static bool ieee80211_prep_hw_scan(struct ieee80211_local *local)
ielen = ieee80211_build_preq_ies(local, (u8 *)local->hw_scan_req->ie, ielen = ieee80211_build_preq_ies(local, (u8 *)local->hw_scan_req->ie,
req->ie, req->ie_len, band, req->ie, req->ie_len, band,
sdata->rc_rateidx_mask[band], 0); req->rates[band], 0);
local->hw_scan_req->ie_len = ielen; local->hw_scan_req->ie_len = ielen;
return true; return true;
...@@ -653,6 +652,7 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local, ...@@ -653,6 +652,7 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local,
{ {
int i; int i;
struct ieee80211_sub_if_data *sdata = local->scan_sdata; struct ieee80211_sub_if_data *sdata = local->scan_sdata;
enum ieee80211_band band = local->hw.conf.channel->band;
for (i = 0; i < local->scan_req->n_ssids; i++) for (i = 0; i < local->scan_req->n_ssids; i++)
ieee80211_send_probe_req( ieee80211_send_probe_req(
...@@ -660,7 +660,7 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local, ...@@ -660,7 +660,7 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local,
local->scan_req->ssids[i].ssid, local->scan_req->ssids[i].ssid,
local->scan_req->ssids[i].ssid_len, local->scan_req->ssids[i].ssid_len,
local->scan_req->ie, local->scan_req->ie_len, local->scan_req->ie, local->scan_req->ie_len,
false); local->scan_req->rates[band], false);
/* /*
* After sending probe requests, wait for probe responses * After sending probe requests, wait for probe responses
......
...@@ -1017,7 +1017,7 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer, ...@@ -1017,7 +1017,7 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
} }
struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata, struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
u8 *dst, u8 *dst, u32 ratemask,
const u8 *ssid, size_t ssid_len, const u8 *ssid, size_t ssid_len,
const u8 *ie, size_t ie_len, const u8 *ie, size_t ie_len,
bool directed) bool directed)
...@@ -1050,9 +1050,7 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata, ...@@ -1050,9 +1050,7 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
buf_len = ieee80211_build_preq_ies(local, buf, ie, ie_len, buf_len = ieee80211_build_preq_ies(local, buf, ie, ie_len,
local->hw.conf.channel->band, local->hw.conf.channel->band,
sdata->rc_rateidx_mask ratemask, chan);
[local->hw.conf.channel->band],
chan);
skb = ieee80211_probereq_get(&local->hw, &sdata->vif, skb = ieee80211_probereq_get(&local->hw, &sdata->vif,
ssid, ssid_len, ssid, ssid_len,
...@@ -1073,12 +1071,12 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata, ...@@ -1073,12 +1071,12 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
const u8 *ssid, size_t ssid_len, const u8 *ssid, size_t ssid_len,
const u8 *ie, size_t ie_len, const u8 *ie, size_t ie_len,
bool directed) u32 ratemask, bool directed)
{ {
struct sk_buff *skb; struct sk_buff *skb;
skb = ieee80211_build_probe_req(sdata, dst, ssid, ssid_len, ie, ie_len, skb = ieee80211_build_probe_req(sdata, dst, ratemask, ssid, ssid_len,
directed); ie, ie_len, directed);
if (skb) if (skb)
ieee80211_tx_skb(sdata, skb); ieee80211_tx_skb(sdata, skb);
} }
......
...@@ -450,7 +450,8 @@ ieee80211_direct_probe(struct ieee80211_work *wk) ...@@ -450,7 +450,8 @@ ieee80211_direct_probe(struct ieee80211_work *wk)
* will not answer to direct packet in unassociated state. * will not answer to direct packet in unassociated state.
*/ */
ieee80211_send_probe_req(sdata, NULL, wk->probe_auth.ssid, ieee80211_send_probe_req(sdata, NULL, wk->probe_auth.ssid,
wk->probe_auth.ssid_len, NULL, 0, true); wk->probe_auth.ssid_len, NULL, 0,
(u32) -1, true);
wk->timeout = jiffies + IEEE80211_AUTH_TIMEOUT; wk->timeout = jiffies + IEEE80211_AUTH_TIMEOUT;
run_again(local, wk->timeout); run_again(local, wk->timeout);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment