summaryrefslogtreecommitdiff
path: root/net/mac80211
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-02-16 19:39:13 +0200
committerJohn W. Linville <linville@tuxdriver.com>2009-02-27 14:52:38 -0500
commit70692ad2923a379e0a10f9ec2ad93fbbe084cc46 (patch)
treef67488c396ea6e61f71e0199eea189ea939a698b /net/mac80211
parent83befbde839b1deb0cd752a834ffd9fde8571ae2 (diff)
nl80211: Optional IEs into scan request
This extends the NL80211_CMD_TRIGGER_SCAN command to allow applications to specify a set of information element(s) to be added into Probe Request frames with NL80211_ATTR_IE. This provides support for the MLME-SCAN.request primitive parameter VendorSpecificInfo and can be used, e.g., to implement WPS scanning. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-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
4 files changed, 14 insertions, 7 deletions
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,
u8 *extra, size_t extra_len,
const u8 *bssid, int encrypt);
void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
- u8 *ssid, size_t ssid_len);
+ u8 *ssid, size_t ssid_len,
+ u8 *ie, size_t ie_len);
void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
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)
* will not answer to direct packet in unassociated state.
*/
ieee80211_send_probe_req(sdata, NULL,
- ifmgd->ssid, ifmgd->ssid_len);
+ ifmgd->ssid, ifmgd->ssid_len, NULL, 0);
mod_timer(&ifmgd->timer, jiffies + IEEE80211_AUTH_TIMEOUT);
}
@@ -946,7 +946,8 @@ static void ieee80211_associated(struct ieee80211_sub_if_data *sdata)
} else
ieee80211_send_probe_req(sdata, ifmgd->bssid,
ifmgd->ssid,
- ifmgd->ssid_len);
+ ifmgd->ssid_len,
+ NULL, 0);
ifmgd->flags ^= IEEE80211_STA_PROBEREQ_POLL;
} else {
ifmgd->flags &= ~IEEE80211_STA_PROBEREQ_POLL;
@@ -955,7 +956,8 @@ static void ieee80211_associated(struct ieee80211_sub_if_data *sdata)
ifmgd->last_probe = jiffies;
ieee80211_send_probe_req(sdata, ifmgd->bssid,
ifmgd->ssid,
- ifmgd->ssid_len);
+ ifmgd->ssid_len,
+ NULL, 0);
}
}
}
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)
ieee80211_send_probe_req(
sdata, NULL,
local->scan_req->ssids[i].ssid,
- local->scan_req->ssids[i].ssid_len);
+ local->scan_req->ssids[i].ssid_len,
+ local->scan_req->ie, local->scan_req->ie_len);
next_delay = IEEE80211_CHANNEL_TIME;
break;
}
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,
}
void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
- u8 *ssid, size_t ssid_len)
+ u8 *ssid, size_t ssid_len,
+ u8 *ie, size_t ie_len)
{
struct ieee80211_local *local = sdata->local;
struct ieee80211_supported_band *sband;
@@ -903,7 +904,7 @@ void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
}
skb = dev_alloc_skb(local->hw.extra_tx_headroom + sizeof(*mgmt) + 200 +
- extra_preq_ie_len);
+ ie_len + extra_preq_ie_len);
if (!skb) {
printk(KERN_DEBUG "%s: failed to allocate buffer for probe "
"request\n", sdata->dev->name);
@@ -950,6 +951,8 @@ void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
*pos = rate->bitrate / 5;
}
+ if (ie)
+ memcpy(skb_put(skb, ie_len), ie, ie_len);
if (extra_preq_ie)
memcpy(skb_put(skb, extra_preq_ie_len), extra_preq_ie,
extra_preq_ie_len);