diff options
author | Arik Nemtsov <arik@wizery.com> | 2011-11-10 04:28:56 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-11 12:32:51 -0500 |
commit | 00f740e1a3b7abb51980371ee8fa113df22ae0b8 (patch) | |
tree | ef32c13175ba8bd2aed63d5fb31ad393829ce90d | |
parent | 87bbbe22f84b91d0bcd3a7fc638e4f5e8224cc4e (diff) |
nl80211: Pass probe response data to drivers
Pass probe-response data from usermode via beacon parameters.
Signed-off-by: Guy Eilam <guy@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | include/linux/nl80211.h | 6 | ||||
-rw-r--r-- | include/net/cfg80211.h | 4 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 9 |
3 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index be92333cf8fe..f9261c253735 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -1166,6 +1166,10 @@ enum nl80211_commands { | |||
1166 | * This attribute holds a bitmap of the supported protocols for | 1166 | * This attribute holds a bitmap of the supported protocols for |
1167 | * offloading (see &enum nl80211_probe_resp_offload_support_attr). | 1167 | * offloading (see &enum nl80211_probe_resp_offload_support_attr). |
1168 | * | 1168 | * |
1169 | * @NL80211_ATTR_PROBE_RESP: Probe Response template data. Contains the entire | ||
1170 | * probe-response frame. The DA field in the 802.11 header is zero-ed out, | ||
1171 | * to be filled by the FW. | ||
1172 | * | ||
1169 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 1173 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
1170 | * @__NL80211_ATTR_AFTER_LAST: internal use | 1174 | * @__NL80211_ATTR_AFTER_LAST: internal use |
1171 | */ | 1175 | */ |
@@ -1402,6 +1406,8 @@ enum nl80211_attrs { | |||
1402 | 1406 | ||
1403 | NL80211_ATTR_PROBE_RESP_OFFLOAD, | 1407 | NL80211_ATTR_PROBE_RESP_OFFLOAD, |
1404 | 1408 | ||
1409 | NL80211_ATTR_PROBE_RESP, | ||
1410 | |||
1405 | /* add attributes here, update the policy in nl80211.c */ | 1411 | /* add attributes here, update the policy in nl80211.c */ |
1406 | 1412 | ||
1407 | __NL80211_ATTR_AFTER_LAST, | 1413 | __NL80211_ATTR_AFTER_LAST, |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 093f538f65d6..8d7ba0961d3e 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -391,6 +391,8 @@ struct cfg80211_crypto_settings { | |||
391 | * @assocresp_ies: extra information element(s) to add into (Re)Association | 391 | * @assocresp_ies: extra information element(s) to add into (Re)Association |
392 | * Response frames or %NULL | 392 | * Response frames or %NULL |
393 | * @assocresp_ies_len: length of assocresp_ies in octets | 393 | * @assocresp_ies_len: length of assocresp_ies in octets |
394 | * @probe_resp_len: length of probe response template (@probe_resp) | ||
395 | * @probe_resp: probe response template (AP mode only) | ||
394 | */ | 396 | */ |
395 | struct beacon_parameters { | 397 | struct beacon_parameters { |
396 | u8 *head, *tail; | 398 | u8 *head, *tail; |
@@ -408,6 +410,8 @@ struct beacon_parameters { | |||
408 | size_t proberesp_ies_len; | 410 | size_t proberesp_ies_len; |
409 | const u8 *assocresp_ies; | 411 | const u8 *assocresp_ies; |
410 | size_t assocresp_ies_len; | 412 | size_t assocresp_ies_len; |
413 | int probe_resp_len; | ||
414 | u8 *probe_resp; | ||
411 | }; | 415 | }; |
412 | 416 | ||
413 | /** | 417 | /** |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index f395a06c114a..6bc7c4b32fa5 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -197,6 +197,8 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = { | |||
197 | [NL80211_ATTR_TDLS_SUPPORT] = { .type = NLA_FLAG }, | 197 | [NL80211_ATTR_TDLS_SUPPORT] = { .type = NLA_FLAG }, |
198 | [NL80211_ATTR_TDLS_EXTERNAL_SETUP] = { .type = NLA_FLAG }, | 198 | [NL80211_ATTR_TDLS_EXTERNAL_SETUP] = { .type = NLA_FLAG }, |
199 | [NL80211_ATTR_DONT_WAIT_FOR_ACK] = { .type = NLA_FLAG }, | 199 | [NL80211_ATTR_DONT_WAIT_FOR_ACK] = { .type = NLA_FLAG }, |
200 | [NL80211_ATTR_PROBE_RESP] = { .type = NLA_BINARY, | ||
201 | .len = IEEE80211_MAX_DATA_LEN }, | ||
200 | }; | 202 | }; |
201 | 203 | ||
202 | /* policy for the key attributes */ | 204 | /* policy for the key attributes */ |
@@ -2171,6 +2173,13 @@ static int nl80211_addset_beacon(struct sk_buff *skb, struct genl_info *info) | |||
2171 | nla_len(info->attrs[NL80211_ATTR_IE_ASSOC_RESP]); | 2173 | nla_len(info->attrs[NL80211_ATTR_IE_ASSOC_RESP]); |
2172 | } | 2174 | } |
2173 | 2175 | ||
2176 | if (info->attrs[NL80211_ATTR_PROBE_RESP]) { | ||
2177 | params.probe_resp = | ||
2178 | nla_data(info->attrs[NL80211_ATTR_PROBE_RESP]); | ||
2179 | params.probe_resp_len = | ||
2180 | nla_len(info->attrs[NL80211_ATTR_PROBE_RESP]); | ||
2181 | } | ||
2182 | |||
2174 | err = call(&rdev->wiphy, dev, ¶ms); | 2183 | err = call(&rdev->wiphy, dev, ¶ms); |
2175 | if (!err && params.interval) | 2184 | if (!err && params.interval) |
2176 | wdev->beacon_interval = params.interval; | 2185 | wdev->beacon_interval = params.interval; |