diff options
author | Kalle Valo <kalle.valo@nokia.com> | 2010-01-05 13:16:44 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-01-12 13:51:25 -0500 |
commit | 7c12ce8b854df346388ea56d684784e3484012cf (patch) | |
tree | 28dd1f0e0b2e4388cdc5bf5cd68eb37844cda7f4 /net/mac80211 | |
parent | 05e54ea6cce400ac34528d705179b45244f61074 (diff) |
mac80211: use Probe Request template when sending a direct scan
As mac80211 now has a separate function for creating Probe Request templates,
better to use it when sending direct Probe Requests to an AP. Only the
bssid needs to be updated in the template before sending it.
Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/util.c | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index bc73904d561c..72a98e844718 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -1000,37 +1000,29 @@ void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, | |||
1000 | struct ieee80211_local *local = sdata->local; | 1000 | struct ieee80211_local *local = sdata->local; |
1001 | struct sk_buff *skb; | 1001 | struct sk_buff *skb; |
1002 | struct ieee80211_mgmt *mgmt; | 1002 | struct ieee80211_mgmt *mgmt; |
1003 | u8 *pos; | 1003 | size_t buf_len; |
1004 | 1004 | u8 *buf; | |
1005 | skb = dev_alloc_skb(local->hw.extra_tx_headroom + sizeof(*mgmt) + 200 + | 1005 | |
1006 | ie_len); | 1006 | /* FIXME: come up with a proper value */ |
1007 | if (!skb) { | 1007 | buf = kmalloc(200 + ie_len, GFP_KERNEL); |
1008 | printk(KERN_DEBUG "%s: failed to allocate buffer for probe " | 1008 | if (!buf) { |
1009 | "request\n", sdata->name); | 1009 | printk(KERN_DEBUG "%s: failed to allocate temporary IE " |
1010 | "buffer\n", sdata->name); | ||
1010 | return; | 1011 | return; |
1011 | } | 1012 | } |
1012 | skb_reserve(skb, local->hw.extra_tx_headroom); | ||
1013 | 1013 | ||
1014 | mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24); | 1014 | buf_len = ieee80211_build_preq_ies(local, buf, ie, ie_len, |
1015 | memset(mgmt, 0, 24); | 1015 | local->hw.conf.channel->band); |
1016 | mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | | 1016 | |
1017 | IEEE80211_STYPE_PROBE_REQ); | 1017 | skb = ieee80211_probereq_get(&local->hw, &sdata->vif, |
1018 | memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); | 1018 | ssid, ssid_len, |
1019 | buf, buf_len); | ||
1020 | |||
1019 | if (dst) { | 1021 | if (dst) { |
1022 | mgmt = (struct ieee80211_mgmt *) skb->data; | ||
1020 | memcpy(mgmt->da, dst, ETH_ALEN); | 1023 | memcpy(mgmt->da, dst, ETH_ALEN); |
1021 | memcpy(mgmt->bssid, dst, ETH_ALEN); | 1024 | memcpy(mgmt->bssid, dst, ETH_ALEN); |
1022 | } else { | ||
1023 | memset(mgmt->da, 0xff, ETH_ALEN); | ||
1024 | memset(mgmt->bssid, 0xff, ETH_ALEN); | ||
1025 | } | 1025 | } |
1026 | pos = skb_put(skb, 2 + ssid_len); | ||
1027 | *pos++ = WLAN_EID_SSID; | ||
1028 | *pos++ = ssid_len; | ||
1029 | memcpy(pos, ssid, ssid_len); | ||
1030 | pos += ssid_len; | ||
1031 | |||
1032 | skb_put(skb, ieee80211_build_preq_ies(local, pos, ie, ie_len, | ||
1033 | local->hw.conf.channel->band)); | ||
1034 | 1026 | ||
1035 | IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; | 1027 | IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; |
1036 | ieee80211_tx_skb(sdata, skb); | 1028 | ieee80211_tx_skb(sdata, skb); |