aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2011-08-10 16:53:31 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-12 13:45:03 -0400
commit32e9de846be885444358b67267f837088c05e0c2 (patch)
tree181a4b23ab44337fdb72e7e0f5f1c0874154f21f /net
parent0879fa44b54101c9955123582018cb511047a2b6 (diff)
nl80211/cfg80211: Allow SSID to be specified in new beacon command
This makes it easier for drivers that generate Beacon and Probe Response frames internally (in firmware most likely) in AP mode. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/wireless/nl80211.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 080fd470fdec..fbb63d3ddc78 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -178,6 +178,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
178 [NL80211_ATTR_SCHED_SCAN_INTERVAL] = { .type = NLA_U32 }, 178 [NL80211_ATTR_SCHED_SCAN_INTERVAL] = { .type = NLA_U32 },
179 [NL80211_ATTR_REKEY_DATA] = { .type = NLA_NESTED }, 179 [NL80211_ATTR_REKEY_DATA] = { .type = NLA_NESTED },
180 [NL80211_ATTR_SCAN_SUPP_RATES] = { .type = NLA_NESTED }, 180 [NL80211_ATTR_SCAN_SUPP_RATES] = { .type = NLA_NESTED },
181 [NL80211_ATTR_HIDDEN_SSID] = { .type = NLA_U32 },
181}; 182};
182 183
183/* policy for the key attributes */ 184/* policy for the key attributes */
@@ -2010,6 +2011,34 @@ static int nl80211_addset_beacon(struct sk_buff *skb, struct genl_info *info)
2010 if (err) 2011 if (err)
2011 return err; 2012 return err;
2012 2013
2014 /*
2015 * In theory, some of these attributes could be required for
2016 * NEW_BEACON, but since they were not used when the command was
2017 * originally added, keep them optional for old user space
2018 * programs to work with drivers that do not need the additional
2019 * information.
2020 */
2021 if (info->attrs[NL80211_ATTR_SSID]) {
2022 params.ssid = nla_data(info->attrs[NL80211_ATTR_SSID]);
2023 params.ssid_len =
2024 nla_len(info->attrs[NL80211_ATTR_SSID]);
2025 if (params.ssid_len == 0 ||
2026 params.ssid_len > IEEE80211_MAX_SSID_LEN)
2027 return -EINVAL;
2028 }
2029
2030 if (info->attrs[NL80211_ATTR_HIDDEN_SSID]) {
2031 params.hidden_ssid = nla_get_u32(
2032 info->attrs[NL80211_ATTR_HIDDEN_SSID]);
2033 if (params.hidden_ssid !=
2034 NL80211_HIDDEN_SSID_NOT_IN_USE &&
2035 params.hidden_ssid !=
2036 NL80211_HIDDEN_SSID_ZERO_LEN &&
2037 params.hidden_ssid !=
2038 NL80211_HIDDEN_SSID_ZERO_CONTENTS)
2039 return -EINVAL;
2040 }
2041
2013 call = rdev->ops->add_beacon; 2042 call = rdev->ops->add_beacon;
2014 break; 2043 break;
2015 case NL80211_CMD_SET_BEACON: 2044 case NL80211_CMD_SET_BEACON: