diff options
author | Jouni Malinen <jouni@qca.qualcomm.com> | 2011-08-10 16:54:35 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-12 13:45:04 -0400 |
commit | 5fb628e9105eef6796789b1ae93289e1566ccdf0 (patch) | |
tree | 3d1e9eef06be596bdd0ab936b8527202afac42e7 /net/wireless | |
parent | 32e9de846be885444358b67267f837088c05e0c2 (diff) |
nl80211/cfg80211: Add crypto settings into NEW_BEACON
This removes need from drivers to parse the beacon tail/head data
to figure out what crypto settings are to be used in AP mode in case
the Beacon and Probe Response frames are fully constructed in the
driver/firmware.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/nl80211.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index fbb63d3ddc78..6e57a3afb609 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -23,6 +23,12 @@ | |||
23 | #include "nl80211.h" | 23 | #include "nl80211.h" |
24 | #include "reg.h" | 24 | #include "reg.h" |
25 | 25 | ||
26 | static bool nl80211_valid_auth_type(enum nl80211_auth_type auth_type); | ||
27 | static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev, | ||
28 | struct genl_info *info, | ||
29 | struct cfg80211_crypto_settings *settings, | ||
30 | int cipher_limit); | ||
31 | |||
26 | static int nl80211_pre_doit(struct genl_ops *ops, struct sk_buff *skb, | 32 | static int nl80211_pre_doit(struct genl_ops *ops, struct sk_buff *skb, |
27 | struct genl_info *info); | 33 | struct genl_info *info); |
28 | static void nl80211_post_doit(struct genl_ops *ops, struct sk_buff *skb, | 34 | static void nl80211_post_doit(struct genl_ops *ops, struct sk_buff *skb, |
@@ -2039,6 +2045,21 @@ static int nl80211_addset_beacon(struct sk_buff *skb, struct genl_info *info) | |||
2039 | return -EINVAL; | 2045 | return -EINVAL; |
2040 | } | 2046 | } |
2041 | 2047 | ||
2048 | params.privacy = !!info->attrs[NL80211_ATTR_PRIVACY]; | ||
2049 | |||
2050 | if (info->attrs[NL80211_ATTR_AUTH_TYPE]) { | ||
2051 | params.auth_type = nla_get_u32( | ||
2052 | info->attrs[NL80211_ATTR_AUTH_TYPE]); | ||
2053 | if (!nl80211_valid_auth_type(params.auth_type)) | ||
2054 | return -EINVAL; | ||
2055 | } else | ||
2056 | params.auth_type = NL80211_AUTHTYPE_AUTOMATIC; | ||
2057 | |||
2058 | err = nl80211_crypto_settings(rdev, info, ¶ms.crypto, | ||
2059 | NL80211_MAX_NR_CIPHER_SUITES); | ||
2060 | if (err) | ||
2061 | return err; | ||
2062 | |||
2042 | call = rdev->ops->add_beacon; | 2063 | call = rdev->ops->add_beacon; |
2043 | break; | 2064 | break; |
2044 | case NL80211_CMD_SET_BEACON: | 2065 | case NL80211_CMD_SET_BEACON: |