aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/mac80211.h15
-rw-r--r--net/mac80211/ieee80211_i.h4
-rw-r--r--net/mac80211/mlme.c24
-rw-r--r--net/mac80211/util.c23
4 files changed, 61 insertions, 5 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index a7323eca08d1..af7e84199e62 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2509,6 +2509,21 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw,
2509 struct ieee80211_sta *pubsta, bool block); 2509 struct ieee80211_sta *pubsta, bool block);
2510 2510
2511/** 2511/**
2512 * ieee80211_ap_probereq_get - retrieve a Probe Request template
2513 * @hw: pointer obtained from ieee80211_alloc_hw().
2514 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
2515 *
2516 * Creates a Probe Request template which can, for example, be uploaded to
2517 * hardware. The template is filled with bssid, ssid and supported rate
2518 * information. This function must only be called from within the
2519 * .bss_info_changed callback function and only in managed mode. The function
2520 * is only useful when the interface is associated, otherwise it will return
2521 * NULL.
2522 */
2523struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw,
2524 struct ieee80211_vif *vif);
2525
2526/**
2512 * ieee80211_beacon_loss - inform hardware does not receive beacons 2527 * ieee80211_beacon_loss - inform hardware does not receive beacons
2513 * 2528 *
2514 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 2529 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index b80c38689927..59a1d38212fd 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1287,6 +1287,10 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
1287 const u8 *ie, size_t ie_len, 1287 const u8 *ie, size_t ie_len,
1288 enum ieee80211_band band, u32 rate_mask, 1288 enum ieee80211_band band, u32 rate_mask,
1289 u8 channel); 1289 u8 channel);
1290struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1291 u8 *dst,
1292 const u8 *ssid, size_t ssid_len,
1293 const u8 *ie, size_t ie_len);
1290void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, 1294void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
1291 const u8 *ssid, size_t ssid_len, 1295 const u8 *ssid, size_t ssid_len,
1292 const u8 *ie, size_t ie_len); 1296 const u8 *ie, size_t ie_len);
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index a3a9421555af..dfc4a316ac1c 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1108,6 +1108,30 @@ static void ieee80211_mgd_probe_ap(struct ieee80211_sub_if_data *sdata,
1108 mutex_unlock(&ifmgd->mtx); 1108 mutex_unlock(&ifmgd->mtx);
1109} 1109}
1110 1110
1111struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw,
1112 struct ieee80211_vif *vif)
1113{
1114 struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
1115 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
1116 struct sk_buff *skb;
1117 const u8 *ssid;
1118
1119 if (WARN_ON(sdata->vif.type != NL80211_IFTYPE_STATION))
1120 return NULL;
1121
1122 ASSERT_MGD_MTX(ifmgd);
1123
1124 if (!ifmgd->associated)
1125 return NULL;
1126
1127 ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID);
1128 skb = ieee80211_build_probe_req(sdata, ifmgd->associated->bssid,
1129 ssid + 2, ssid[1], NULL, 0);
1130
1131 return skb;
1132}
1133EXPORT_SYMBOL(ieee80211_ap_probereq_get);
1134
1111static void __ieee80211_connection_loss(struct ieee80211_sub_if_data *sdata) 1135static void __ieee80211_connection_loss(struct ieee80211_sub_if_data *sdata)
1112{ 1136{
1113 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 1137 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
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,