aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/cfg80211.h4
-rw-r--r--net/mac80211/ieee80211_i.h3
-rw-r--r--net/mac80211/mlme.c8
-rw-r--r--net/mac80211/scan.c3
-rw-r--r--net/mac80211/util.c7
-rw-r--r--net/wireless/nl80211.c21
6 files changed, 38 insertions, 8 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index c0d1f5b708c5..33f43b0d08fb 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -525,6 +525,8 @@ struct cfg80211_ssid {
525 * @n_ssids: number of SSIDs 525 * @n_ssids: number of SSIDs
526 * @channels: channels to scan on. 526 * @channels: channels to scan on.
527 * @n_channels: number of channels for each band 527 * @n_channels: number of channels for each band
528 * @ie: optional information element(s) to add into Probe Request or %NULL
529 * @ie_len: length of ie in octets
528 * @wiphy: the wiphy this was for 530 * @wiphy: the wiphy this was for
529 * @ifidx: the interface index 531 * @ifidx: the interface index
530 */ 532 */
@@ -533,6 +535,8 @@ struct cfg80211_scan_request {
533 int n_ssids; 535 int n_ssids;
534 struct ieee80211_channel **channels; 536 struct ieee80211_channel **channels;
535 u32 n_channels; 537 u32 n_channels;
538 u8 *ie;
539 size_t ie_len;
536 540
537 /* internal */ 541 /* internal */
538 struct wiphy *wiphy; 542 struct wiphy *wiphy;
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 27d56414019d..d06c75720ced 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1093,7 +1093,8 @@ void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
1093 u8 *extra, size_t extra_len, 1093 u8 *extra, size_t extra_len,
1094 const u8 *bssid, int encrypt); 1094 const u8 *bssid, int encrypt);
1095void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, 1095void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
1096 u8 *ssid, size_t ssid_len); 1096 u8 *ssid, size_t ssid_len,
1097 u8 *ie, size_t ie_len);
1097 1098
1098void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, 1099void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
1099 const size_t supp_rates_len, 1100 const size_t supp_rates_len,
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index ec5a0900cba0..5a4977936f6f 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -716,7 +716,7 @@ static void ieee80211_direct_probe(struct ieee80211_sub_if_data *sdata)
716 * will not answer to direct packet in unassociated state. 716 * will not answer to direct packet in unassociated state.
717 */ 717 */
718 ieee80211_send_probe_req(sdata, NULL, 718 ieee80211_send_probe_req(sdata, NULL,
719 ifmgd->ssid, ifmgd->ssid_len); 719 ifmgd->ssid, ifmgd->ssid_len, NULL, 0);
720 720
721 mod_timer(&ifmgd->timer, jiffies + IEEE80211_AUTH_TIMEOUT); 721 mod_timer(&ifmgd->timer, jiffies + IEEE80211_AUTH_TIMEOUT);
722} 722}
@@ -946,7 +946,8 @@ static void ieee80211_associated(struct ieee80211_sub_if_data *sdata)
946 } else 946 } else
947 ieee80211_send_probe_req(sdata, ifmgd->bssid, 947 ieee80211_send_probe_req(sdata, ifmgd->bssid,
948 ifmgd->ssid, 948 ifmgd->ssid,
949 ifmgd->ssid_len); 949 ifmgd->ssid_len,
950 NULL, 0);
950 ifmgd->flags ^= IEEE80211_STA_PROBEREQ_POLL; 951 ifmgd->flags ^= IEEE80211_STA_PROBEREQ_POLL;
951 } else { 952 } else {
952 ifmgd->flags &= ~IEEE80211_STA_PROBEREQ_POLL; 953 ifmgd->flags &= ~IEEE80211_STA_PROBEREQ_POLL;
@@ -955,7 +956,8 @@ static void ieee80211_associated(struct ieee80211_sub_if_data *sdata)
955 ifmgd->last_probe = jiffies; 956 ifmgd->last_probe = jiffies;
956 ieee80211_send_probe_req(sdata, ifmgd->bssid, 957 ieee80211_send_probe_req(sdata, ifmgd->bssid,
957 ifmgd->ssid, 958 ifmgd->ssid,
958 ifmgd->ssid_len); 959 ifmgd->ssid_len,
960 NULL, 0);
959 } 961 }
960 } 962 }
961 } 963 }
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 08a1fc27ca10..c063f8204263 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -338,7 +338,8 @@ void ieee80211_scan_work(struct work_struct *work)
338 ieee80211_send_probe_req( 338 ieee80211_send_probe_req(
339 sdata, NULL, 339 sdata, NULL,
340 local->scan_req->ssids[i].ssid, 340 local->scan_req->ssids[i].ssid,
341 local->scan_req->ssids[i].ssid_len); 341 local->scan_req->ssids[i].ssid_len,
342 local->scan_req->ie, local->scan_req->ie_len);
342 next_delay = IEEE80211_CHANNEL_TIME; 343 next_delay = IEEE80211_CHANNEL_TIME;
343 break; 344 break;
344 } 345 }
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index dee17e5cbb89..e0431a1d218b 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -884,7 +884,8 @@ void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
884} 884}
885 885
886void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, 886void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
887 u8 *ssid, size_t ssid_len) 887 u8 *ssid, size_t ssid_len,
888 u8 *ie, size_t ie_len)
888{ 889{
889 struct ieee80211_local *local = sdata->local; 890 struct ieee80211_local *local = sdata->local;
890 struct ieee80211_supported_band *sband; 891 struct ieee80211_supported_band *sband;
@@ -903,7 +904,7 @@ void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
903 } 904 }
904 905
905 skb = dev_alloc_skb(local->hw.extra_tx_headroom + sizeof(*mgmt) + 200 + 906 skb = dev_alloc_skb(local->hw.extra_tx_headroom + sizeof(*mgmt) + 200 +
906 extra_preq_ie_len); 907 ie_len + extra_preq_ie_len);
907 if (!skb) { 908 if (!skb) {
908 printk(KERN_DEBUG "%s: failed to allocate buffer for probe " 909 printk(KERN_DEBUG "%s: failed to allocate buffer for probe "
909 "request\n", sdata->dev->name); 910 "request\n", sdata->dev->name);
@@ -950,6 +951,8 @@ void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
950 *pos = rate->bitrate / 5; 951 *pos = rate->bitrate / 5;
951 } 952 }
952 953
954 if (ie)
955 memcpy(skb_put(skb, ie_len), ie, ie_len);
953 if (extra_preq_ie) 956 if (extra_preq_ie)
954 memcpy(skb_put(skb, extra_preq_ie_len), extra_preq_ie, 957 memcpy(skb_put(skb, extra_preq_ie_len), extra_preq_ie,
955 extra_preq_ie_len); 958 extra_preq_ie_len);
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 298a4de59948..67b18b3a93a0 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2286,6 +2286,7 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
2286 struct wiphy *wiphy; 2286 struct wiphy *wiphy;
2287 int err, tmp, n_ssids = 0, n_channels = 0, i; 2287 int err, tmp, n_ssids = 0, n_channels = 0, i;
2288 enum ieee80211_band band; 2288 enum ieee80211_band band;
2289 size_t ie_len;
2289 2290
2290 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev); 2291 err = get_drv_dev_by_info_ifindex(info->attrs, &drv, &dev);
2291 if (err) 2292 if (err)
@@ -2327,9 +2328,15 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
2327 goto out_unlock; 2328 goto out_unlock;
2328 } 2329 }
2329 2330
2331 if (info->attrs[NL80211_ATTR_IE])
2332 ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
2333 else
2334 ie_len = 0;
2335
2330 request = kzalloc(sizeof(*request) 2336 request = kzalloc(sizeof(*request)
2331 + sizeof(*ssid) * n_ssids 2337 + sizeof(*ssid) * n_ssids
2332 + sizeof(channel) * n_channels, GFP_KERNEL); 2338 + sizeof(channel) * n_channels
2339 + ie_len, GFP_KERNEL);
2333 if (!request) { 2340 if (!request) {
2334 err = -ENOMEM; 2341 err = -ENOMEM;
2335 goto out_unlock; 2342 goto out_unlock;
@@ -2340,6 +2347,12 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
2340 if (n_ssids) 2347 if (n_ssids)
2341 request->ssids = (void *)(request->channels + n_channels); 2348 request->ssids = (void *)(request->channels + n_channels);
2342 request->n_ssids = n_ssids; 2349 request->n_ssids = n_ssids;
2350 if (ie_len) {
2351 if (request->ssids)
2352 request->ie = (void *)(request->ssids + n_ssids);
2353 else
2354 request->ie = (void *)(request->channels + n_channels);
2355 }
2343 2356
2344 if (info->attrs[NL80211_ATTR_SCAN_FREQUENCIES]) { 2357 if (info->attrs[NL80211_ATTR_SCAN_FREQUENCIES]) {
2345 /* user specified, bail out if channel not found */ 2358 /* user specified, bail out if channel not found */
@@ -2380,6 +2393,12 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
2380 } 2393 }
2381 } 2394 }
2382 2395
2396 if (info->attrs[NL80211_ATTR_IE]) {
2397 request->ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
2398 memcpy(request->ie, nla_data(info->attrs[NL80211_ATTR_IE]),
2399 request->ie_len);
2400 }
2401
2383 request->ifidx = dev->ifindex; 2402 request->ifidx = dev->ifindex;
2384 request->wiphy = &drv->wiphy; 2403 request->wiphy = &drv->wiphy;
2385 2404