aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-11-11 01:50:18 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-11-16 16:37:08 -0500
commita619a4c0e1fd4e8c360c63d0df3fa0a401107d69 (patch)
treec9eb89d30834140f252c77bdf578528b11716678 /net/mac80211/util.c
parent4e8c14e9587c38f4cce8049c766935629fdb8d46 (diff)
mac80211: Add function to get probe request template for current AP
Chipsets with hardware based connection monitoring need to autonomically send directed probe-request frames to the AP (in the event of beacon loss, for example.) For the hardware to be able to do this, it requires a template for the frame to transmit to the AP, filled in with the BSSID and SSID of the AP, but also the supported rate IE's. This patch adds a function to mac80211, which allows the hardware driver to fetch this template after association, so it can be configured to the hardware. Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index e486286ebf1a..68d0518254dd 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1011,9 +1011,10 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
1011 return pos - buffer; 1011 return pos - buffer;
1012} 1012}
1013 1013
1014void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, 1014struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1015 const u8 *ssid, size_t ssid_len, 1015 u8 *dst,
1016 const u8 *ie, size_t ie_len) 1016 const u8 *ssid, size_t ssid_len,
1017 const u8 *ie, size_t ie_len)
1017{ 1018{
1018 struct ieee80211_local *local = sdata->local; 1019 struct ieee80211_local *local = sdata->local;
1019 struct sk_buff *skb; 1020 struct sk_buff *skb;
@@ -1027,7 +1028,7 @@ void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
1027 if (!buf) { 1028 if (!buf) {
1028 printk(KERN_DEBUG "%s: failed to allocate temporary IE " 1029 printk(KERN_DEBUG "%s: failed to allocate temporary IE "
1029 "buffer\n", sdata->name); 1030 "buffer\n", sdata->name);
1030 return; 1031 return NULL;
1031 } 1032 }
1032 1033
1033 chan = ieee80211_frequency_to_channel( 1034 chan = ieee80211_frequency_to_channel(
@@ -1050,8 +1051,20 @@ void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
1050 } 1051 }
1051 1052
1052 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; 1053 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
1053 ieee80211_tx_skb(sdata, skb);
1054 kfree(buf); 1054 kfree(buf);
1055
1056 return skb;
1057}
1058
1059void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
1060 const u8 *ssid, size_t ssid_len,
1061 const u8 *ie, size_t ie_len)
1062{
1063 struct sk_buff *skb;
1064
1065 skb = ieee80211_build_probe_req(sdata, dst, ssid, ssid_len, ie, ie_len);
1066 if (skb)
1067 ieee80211_tx_skb(sdata, skb);
1055} 1068}
1056 1069
1057u32 ieee80211_sta_get_rates(struct ieee80211_local *local, 1070u32 ieee80211_sta_get_rates(struct ieee80211_local *local,