aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Stewart <pstew@chromium.org>2011-06-23 13:00:11 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-06-27 15:09:41 -0400
commita806c558e01747b499201d2667818f03d79ef1e3 (patch)
treed639da034366d3390f8b99a96cc30bec11abf446
parentce2dd3c2d54494195e8820b2432eb47ca61ebdd7 (diff)
mac80211: Drop DS Channel PARAM in directed probe
Do not send DS Channel parameter for directed probe requests in order to maximize the chance that we get a response. Some badly-behaved APs don't respond when this parameter is included. Signed-off-by: Paul Stewart <pstew@chromium.org> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--net/mac80211/ieee80211_i.h6
-rw-r--r--net/mac80211/mlme.c5
-rw-r--r--net/mac80211/scan.c3
-rw-r--r--net/mac80211/util.c21
-rw-r--r--net/mac80211/work.c2
5 files changed, 26 insertions, 11 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 090b0ec1e056..25c15cc63319 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1350,10 +1350,12 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
1350struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata, 1350struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1351 u8 *dst, 1351 u8 *dst,
1352 const u8 *ssid, size_t ssid_len, 1352 const u8 *ssid, size_t ssid_len,
1353 const u8 *ie, size_t ie_len); 1353 const u8 *ie, size_t ie_len,
1354 bool directed);
1354void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, 1355void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
1355 const u8 *ssid, size_t ssid_len, 1356 const u8 *ssid, size_t ssid_len,
1356 const u8 *ie, size_t ie_len); 1357 const u8 *ie, size_t ie_len,
1358 bool directed);
1357 1359
1358void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, 1360void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
1359 const size_t supp_rates_len, 1361 const size_t supp_rates_len,
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index faca5033f061..0f6052faeb45 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1204,7 +1204,8 @@ static void ieee80211_mgd_probe_ap_send(struct ieee80211_sub_if_data *sdata)
1204 ieee80211_send_nullfunc(sdata->local, sdata, 0); 1204 ieee80211_send_nullfunc(sdata->local, sdata, 0);
1205 } else { 1205 } else {
1206 ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID); 1206 ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID);
1207 ieee80211_send_probe_req(sdata, dst, ssid + 2, ssid[1], NULL, 0); 1207 ieee80211_send_probe_req(sdata, dst, ssid + 2, ssid[1], NULL, 0,
1208 true);
1208 } 1209 }
1209 1210
1210 ifmgd->probe_send_count++; 1211 ifmgd->probe_send_count++;
@@ -1289,7 +1290,7 @@ struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw,
1289 1290
1290 ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID); 1291 ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID);
1291 skb = ieee80211_build_probe_req(sdata, ifmgd->associated->bssid, 1292 skb = ieee80211_build_probe_req(sdata, ifmgd->associated->bssid,
1292 ssid + 2, ssid[1], NULL, 0); 1293 ssid + 2, ssid[1], NULL, 0, true);
1293 1294
1294 return skb; 1295 return skb;
1295} 1296}
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 6403722da603..e5a6ea4a94ea 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -659,7 +659,8 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local,
659 sdata, NULL, 659 sdata, NULL,
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 664
664 /* 665 /*
665 * 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 05e3fb889d77..652e5695225a 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1018,7 +1018,8 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
1018struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata, 1018struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1019 u8 *dst, 1019 u8 *dst,
1020 const u8 *ssid, size_t ssid_len, 1020 const u8 *ssid, size_t ssid_len,
1021 const u8 *ie, size_t ie_len) 1021 const u8 *ie, size_t ie_len,
1022 bool directed)
1022{ 1023{
1023 struct ieee80211_local *local = sdata->local; 1024 struct ieee80211_local *local = sdata->local;
1024 struct sk_buff *skb; 1025 struct sk_buff *skb;
@@ -1035,8 +1036,16 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1035 return NULL; 1036 return NULL;
1036 } 1037 }
1037 1038
1038 chan = ieee80211_frequency_to_channel( 1039 /*
1039 local->hw.conf.channel->center_freq); 1040 * Do not send DS Channel parameter for directed probe requests
1041 * in order to maximize the chance that we get a response. Some
1042 * badly-behaved APs don't respond when this parameter is included.
1043 */
1044 if (directed)
1045 chan = 0;
1046 else
1047 chan = ieee80211_frequency_to_channel(
1048 local->hw.conf.channel->center_freq);
1040 1049
1041 buf_len = ieee80211_build_preq_ies(local, buf, ie, ie_len, 1050 buf_len = ieee80211_build_preq_ies(local, buf, ie, ie_len,
1042 local->hw.conf.channel->band, 1051 local->hw.conf.channel->band,
@@ -1062,11 +1071,13 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1062 1071
1063void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, 1072void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
1064 const u8 *ssid, size_t ssid_len, 1073 const u8 *ssid, size_t ssid_len,
1065 const u8 *ie, size_t ie_len) 1074 const u8 *ie, size_t ie_len,
1075 bool directed)
1066{ 1076{
1067 struct sk_buff *skb; 1077 struct sk_buff *skb;
1068 1078
1069 skb = ieee80211_build_probe_req(sdata, dst, ssid, ssid_len, ie, ie_len); 1079 skb = ieee80211_build_probe_req(sdata, dst, ssid, ssid_len, ie, ie_len,
1080 directed);
1070 if (skb) 1081 if (skb)
1071 ieee80211_tx_skb(sdata, skb); 1082 ieee80211_tx_skb(sdata, skb);
1072} 1083}
diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index d2e7f0e86677..edf8583280c9 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -450,7 +450,7 @@ 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); 453 wk->probe_auth.ssid_len, NULL, 0, true);
454 454
455 wk->timeout = jiffies + IEEE80211_AUTH_TIMEOUT; 455 wk->timeout = jiffies + IEEE80211_AUTH_TIMEOUT;
456 run_again(local, wk->timeout); 456 run_again(local, wk->timeout);