diff options
-rw-r--r-- | include/linux/nl80211.h | 16 | ||||
-rw-r--r-- | include/net/cfg80211.h | 14 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 28 |
3 files changed, 56 insertions, 2 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 580fcdceed2c..89dec16b4697 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -166,7 +166,8 @@ | |||
166 | * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE, | 166 | * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE, |
167 | * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, | 167 | * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, |
168 | * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, | 168 | * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, |
169 | * %NL80211_ATTR_AUTH_TYPE. | 169 | * %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_IE, %NL80211_ATTR_IE_PROBE_RESP, |
170 | * %NL80211_ATTR_IE_ASSOC_RESP. | ||
170 | * @NL80211_CMD_NEW_BEACON: add a new beacon to an access point interface, | 171 | * @NL80211_CMD_NEW_BEACON: add a new beacon to an access point interface, |
171 | * parameters are like for %NL80211_CMD_SET_BEACON. | 172 | * parameters are like for %NL80211_CMD_SET_BEACON. |
172 | * @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it | 173 | * @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it |
@@ -1031,6 +1032,16 @@ enum nl80211_commands { | |||
1031 | * and Probe Response (when response to wildcard Probe Request); see | 1032 | * and Probe Response (when response to wildcard Probe Request); see |
1032 | * &enum nl80211_hidden_ssid, represented as a u32 | 1033 | * &enum nl80211_hidden_ssid, represented as a u32 |
1033 | * | 1034 | * |
1035 | * @NL80211_ATTR_IE_PROBE_RESP: Information element(s) for Probe Response frame. | ||
1036 | * This is used with %NL80211_CMD_NEW_BEACON and %NL80211_CMD_SET_BEACON to | ||
1037 | * provide extra IEs (e.g., WPS/P2P IE) into Probe Response frames when the | ||
1038 | * driver (or firmware) replies to Probe Request frames. | ||
1039 | * @NL80211_ATTR_IE_ASSOC_RESP: Information element(s) for (Re)Association | ||
1040 | * Response frames. This is used with %NL80211_CMD_NEW_BEACON and | ||
1041 | * %NL80211_CMD_SET_BEACON to provide extra IEs (e.g., WPS/P2P IE) into | ||
1042 | * (Re)Association Response frames when the driver (or firmware) replies to | ||
1043 | * (Re)Association Request frames. | ||
1044 | * | ||
1034 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 1045 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
1035 | * @__NL80211_ATTR_AFTER_LAST: internal use | 1046 | * @__NL80211_ATTR_AFTER_LAST: internal use |
1036 | */ | 1047 | */ |
@@ -1238,6 +1249,9 @@ enum nl80211_attrs { | |||
1238 | 1249 | ||
1239 | NL80211_ATTR_HIDDEN_SSID, | 1250 | NL80211_ATTR_HIDDEN_SSID, |
1240 | 1251 | ||
1252 | NL80211_ATTR_IE_PROBE_RESP, | ||
1253 | NL80211_ATTR_IE_ASSOC_RESP, | ||
1254 | |||
1241 | /* add attributes here, update the policy in nl80211.c */ | 1255 | /* add attributes here, update the policy in nl80211.c */ |
1242 | 1256 | ||
1243 | __NL80211_ATTR_AFTER_LAST, | 1257 | __NL80211_ATTR_AFTER_LAST, |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 6fcd0bf4dc62..d86a15d87e58 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -383,6 +383,14 @@ struct cfg80211_crypto_settings { | |||
383 | * @crypto: crypto settings | 383 | * @crypto: crypto settings |
384 | * @privacy: the BSS uses privacy | 384 | * @privacy: the BSS uses privacy |
385 | * @auth_type: Authentication type (algorithm) | 385 | * @auth_type: Authentication type (algorithm) |
386 | * @beacon_ies: extra information element(s) to add into Beacon frames or %NULL | ||
387 | * @beacon_ies_len: length of beacon_ies in octets | ||
388 | * @proberesp_ies: extra information element(s) to add into Probe Response | ||
389 | * frames or %NULL | ||
390 | * @proberesp_ies_len: length of proberesp_ies in octets | ||
391 | * @assocresp_ies: extra information element(s) to add into (Re)Association | ||
392 | * Response frames or %NULL | ||
393 | * @assocresp_ies_len: length of assocresp_ies in octets | ||
386 | */ | 394 | */ |
387 | struct beacon_parameters { | 395 | struct beacon_parameters { |
388 | u8 *head, *tail; | 396 | u8 *head, *tail; |
@@ -394,6 +402,12 @@ struct beacon_parameters { | |||
394 | struct cfg80211_crypto_settings crypto; | 402 | struct cfg80211_crypto_settings crypto; |
395 | bool privacy; | 403 | bool privacy; |
396 | enum nl80211_auth_type auth_type; | 404 | enum nl80211_auth_type auth_type; |
405 | const u8 *beacon_ies; | ||
406 | size_t beacon_ies_len; | ||
407 | const u8 *proberesp_ies; | ||
408 | size_t proberesp_ies_len; | ||
409 | const u8 *assocresp_ies; | ||
410 | size_t assocresp_ies_len; | ||
397 | }; | 411 | }; |
398 | 412 | ||
399 | /** | 413 | /** |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 6e57a3afb609..2aa6a2189842 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -185,6 +185,10 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = { | |||
185 | [NL80211_ATTR_REKEY_DATA] = { .type = NLA_NESTED }, | 185 | [NL80211_ATTR_REKEY_DATA] = { .type = NLA_NESTED }, |
186 | [NL80211_ATTR_SCAN_SUPP_RATES] = { .type = NLA_NESTED }, | 186 | [NL80211_ATTR_SCAN_SUPP_RATES] = { .type = NLA_NESTED }, |
187 | [NL80211_ATTR_HIDDEN_SSID] = { .type = NLA_U32 }, | 187 | [NL80211_ATTR_HIDDEN_SSID] = { .type = NLA_U32 }, |
188 | [NL80211_ATTR_IE_PROBE_RESP] = { .type = NLA_BINARY, | ||
189 | .len = IEEE80211_MAX_DATA_LEN }, | ||
190 | [NL80211_ATTR_IE_ASSOC_RESP] = { .type = NLA_BINARY, | ||
191 | .len = IEEE80211_MAX_DATA_LEN }, | ||
188 | }; | 192 | }; |
189 | 193 | ||
190 | /* policy for the key attributes */ | 194 | /* policy for the key attributes */ |
@@ -1991,7 +1995,10 @@ static int nl80211_addset_beacon(struct sk_buff *skb, struct genl_info *info) | |||
1991 | struct beacon_parameters params; | 1995 | struct beacon_parameters params; |
1992 | int haveinfo = 0, err; | 1996 | int haveinfo = 0, err; |
1993 | 1997 | ||
1994 | if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_BEACON_TAIL])) | 1998 | if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_BEACON_TAIL]) || |
1999 | !is_valid_ie_attr(info->attrs[NL80211_ATTR_IE]) || | ||
2000 | !is_valid_ie_attr(info->attrs[NL80211_ATTR_IE_PROBE_RESP]) || | ||
2001 | !is_valid_ie_attr(info->attrs[NL80211_ATTR_IE_ASSOC_RESP])) | ||
1995 | return -EINVAL; | 2002 | return -EINVAL; |
1996 | 2003 | ||
1997 | if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP && | 2004 | if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP && |
@@ -2090,6 +2097,25 @@ static int nl80211_addset_beacon(struct sk_buff *skb, struct genl_info *info) | |||
2090 | if (!haveinfo) | 2097 | if (!haveinfo) |
2091 | return -EINVAL; | 2098 | return -EINVAL; |
2092 | 2099 | ||
2100 | if (info->attrs[NL80211_ATTR_IE]) { | ||
2101 | params.beacon_ies = nla_data(info->attrs[NL80211_ATTR_IE]); | ||
2102 | params.beacon_ies_len = nla_len(info->attrs[NL80211_ATTR_IE]); | ||
2103 | } | ||
2104 | |||
2105 | if (info->attrs[NL80211_ATTR_IE_PROBE_RESP]) { | ||
2106 | params.proberesp_ies = | ||
2107 | nla_data(info->attrs[NL80211_ATTR_IE_PROBE_RESP]); | ||
2108 | params.proberesp_ies_len = | ||
2109 | nla_len(info->attrs[NL80211_ATTR_IE_PROBE_RESP]); | ||
2110 | } | ||
2111 | |||
2112 | if (info->attrs[NL80211_ATTR_IE_ASSOC_RESP]) { | ||
2113 | params.assocresp_ies = | ||
2114 | nla_data(info->attrs[NL80211_ATTR_IE_ASSOC_RESP]); | ||
2115 | params.assocresp_ies_len = | ||
2116 | nla_len(info->attrs[NL80211_ATTR_IE_ASSOC_RESP]); | ||
2117 | } | ||
2118 | |||
2093 | err = call(&rdev->wiphy, dev, ¶ms); | 2119 | err = call(&rdev->wiphy, dev, ¶ms); |
2094 | if (!err && params.interval) | 2120 | if (!err && params.interval) |
2095 | wdev->beacon_interval = params.interval; | 2121 | wdev->beacon_interval = params.interval; |