aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index bfd19d76667a..aba025d748e9 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -895,7 +895,8 @@ void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
895 895
896int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer, 896int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
897 const u8 *ie, size_t ie_len, 897 const u8 *ie, size_t ie_len,
898 enum ieee80211_band band, u32 rate_mask) 898 enum ieee80211_band band, u32 rate_mask,
899 u8 channel)
899{ 900{
900 struct ieee80211_supported_band *sband; 901 struct ieee80211_supported_band *sband;
901 u8 *pos; 902 u8 *pos;
@@ -947,6 +948,12 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
947 pos += ext_rates_len; 948 pos += ext_rates_len;
948 } 949 }
949 950
951 if (channel && sband->band == IEEE80211_BAND_2GHZ) {
952 *pos++ = WLAN_EID_DS_PARAMS;
953 *pos++ = 1;
954 *pos++ = channel;
955 }
956
950 /* insert custom IEs that go before HT */ 957 /* insert custom IEs that go before HT */
951 if (ie && ie_len) { 958 if (ie && ie_len) {
952 static const u8 before_ht[] = { 959 static const u8 before_ht[] = {
@@ -1013,6 +1020,7 @@ void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
1013 struct ieee80211_mgmt *mgmt; 1020 struct ieee80211_mgmt *mgmt;
1014 size_t buf_len; 1021 size_t buf_len;
1015 u8 *buf; 1022 u8 *buf;
1023 u8 chan;
1016 1024
1017 /* FIXME: come up with a proper value */ 1025 /* FIXME: come up with a proper value */
1018 buf = kmalloc(200 + ie_len, GFP_KERNEL); 1026 buf = kmalloc(200 + ie_len, GFP_KERNEL);
@@ -1022,10 +1030,14 @@ void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
1022 return; 1030 return;
1023 } 1031 }
1024 1032
1033 chan = ieee80211_frequency_to_channel(
1034 local->hw.conf.channel->center_freq);
1035
1025 buf_len = ieee80211_build_preq_ies(local, buf, ie, ie_len, 1036 buf_len = ieee80211_build_preq_ies(local, buf, ie, ie_len,
1026 local->hw.conf.channel->band, 1037 local->hw.conf.channel->band,
1027 sdata->rc_rateidx_mask 1038 sdata->rc_rateidx_mask
1028 [local->hw.conf.channel->band]); 1039 [local->hw.conf.channel->band],
1040 chan);
1029 1041
1030 skb = ieee80211_probereq_get(&local->hw, &sdata->vif, 1042 skb = ieee80211_probereq_get(&local->hw, &sdata->vif,
1031 ssid, ssid_len, 1043 ssid, ssid_len,