Commit 47301a74 authored by Veerendranath Jakkam's avatar Veerendranath Jakkam Committed by Johannes Berg

nl80211: Add support to set AP settings flags with single attribute

In previous method each AP settings flag is represented by a top-level
flag attribute and conversion to enum cfg80211_ap_settings_flags had to
be done before sending them to driver. This commit is to make it easier
to define new AP settings flags and sending them to driver.

This commit also deprecate sending of
%NL80211_ATTR_EXTERNAL_AUTH_SUPPORT in %NL80211_CMD_START_AP. But to
maintain backwards compatibility checks for
%NL80211_ATTR_EXTERNAL_AUTH_SUPPORT in %NL80211_CMD_START_AP when
%NL80211_ATTR_AP_SETTINGS_FLAGS not present in %NL80211_CMD_START_AP.
Signed-off-by: default avatarVeerendranath Jakkam <vjakkam@codeaurora.org>
Link: https://lore.kernel.org/r/1637911519-21306-1-git-send-email-vjakkam@codeaurora.orgSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 636ccdae
...@@ -1187,17 +1187,6 @@ struct cfg80211_unsol_bcast_probe_resp { ...@@ -1187,17 +1187,6 @@ struct cfg80211_unsol_bcast_probe_resp {
const u8 *tmpl; const u8 *tmpl;
}; };
/**
* enum cfg80211_ap_settings_flags - AP settings flags
*
* Used by cfg80211_ap_settings
*
* @AP_SETTINGS_EXTERNAL_AUTH_SUPPORT: AP supports external authentication
*/
enum cfg80211_ap_settings_flags {
AP_SETTINGS_EXTERNAL_AUTH_SUPPORT = BIT(0),
};
/** /**
* struct cfg80211_ap_settings - AP configuration * struct cfg80211_ap_settings - AP configuration
* *
......
...@@ -2477,7 +2477,9 @@ enum nl80211_commands { ...@@ -2477,7 +2477,9 @@ enum nl80211_commands {
* space supports external authentication. This attribute shall be used * space supports external authentication. This attribute shall be used
* with %NL80211_CMD_CONNECT and %NL80211_CMD_START_AP request. The driver * with %NL80211_CMD_CONNECT and %NL80211_CMD_START_AP request. The driver
* may offload authentication processing to user space if this capability * may offload authentication processing to user space if this capability
* is indicated in the respective requests from the user space. * is indicated in the respective requests from the user space. (This flag
* attribute deprecated for %NL80211_CMD_START_AP, use
* %NL80211_ATTR_AP_SETTINGS_FLAGS)
* *
* @NL80211_ATTR_NSS: Station's New/updated RX_NSS value notified using this * @NL80211_ATTR_NSS: Station's New/updated RX_NSS value notified using this
* u8 attribute. This is used with %NL80211_CMD_STA_OPMODE_CHANGED. * u8 attribute. This is used with %NL80211_CMD_STA_OPMODE_CHANGED.
...@@ -2653,6 +2655,10 @@ enum nl80211_commands { ...@@ -2653,6 +2655,10 @@ enum nl80211_commands {
* switching on a different channel during CAC detection on the selected * switching on a different channel during CAC detection on the selected
* radar channel. * radar channel.
* *
* @NL80211_ATTR_AP_SETTINGS_FLAGS: u32 attribute contains ap settings flags,
* enumerated in &enum nl80211_ap_settings_flags. This attribute shall be
* used with %NL80211_CMD_START_AP request.
*
* @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined * @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use * @__NL80211_ATTR_AFTER_LAST: internal use
...@@ -3161,6 +3167,8 @@ enum nl80211_attrs { ...@@ -3161,6 +3167,8 @@ enum nl80211_attrs {
NL80211_ATTR_RADAR_BACKGROUND, NL80211_ATTR_RADAR_BACKGROUND,
NL80211_ATTR_AP_SETTINGS_FLAGS,
/* add attributes here, update the policy in nl80211.c */ /* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST, __NL80211_ATTR_AFTER_LAST,
...@@ -7481,4 +7489,14 @@ enum nl80211_mbssid_config_attributes { ...@@ -7481,4 +7489,14 @@ enum nl80211_mbssid_config_attributes {
NL80211_MBSSID_CONFIG_ATTR_MAX = __NL80211_MBSSID_CONFIG_ATTR_LAST - 1, NL80211_MBSSID_CONFIG_ATTR_MAX = __NL80211_MBSSID_CONFIG_ATTR_LAST - 1,
}; };
/**
* enum nl80211_ap_settings_flags - AP settings flags
*
* @NL80211_AP_SETTINGS_EXTERNAL_AUTH_SUPPORT: AP supports external
* authentication.
*/
enum nl80211_ap_settings_flags {
NL80211_AP_SETTINGS_EXTERNAL_AUTH_SUPPORT = 1 << 0,
};
#endif /* __LINUX_NL80211_H */ #endif /* __LINUX_NL80211_H */
...@@ -777,6 +777,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { ...@@ -777,6 +777,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
NLA_POLICY_NESTED(nl80211_mbssid_config_policy), NLA_POLICY_NESTED(nl80211_mbssid_config_policy),
[NL80211_ATTR_MBSSID_ELEMS] = { .type = NLA_NESTED }, [NL80211_ATTR_MBSSID_ELEMS] = { .type = NLA_NESTED },
[NL80211_ATTR_RADAR_BACKGROUND] = { .type = NLA_FLAG }, [NL80211_ATTR_RADAR_BACKGROUND] = { .type = NLA_FLAG },
[NL80211_ATTR_AP_SETTINGS_FLAGS] = { .type = NLA_U32 },
}; };
/* policy for the key attributes */ /* policy for the key attributes */
...@@ -5714,8 +5715,11 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) ...@@ -5714,8 +5715,11 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
nl80211_calculate_ap_params(params); nl80211_calculate_ap_params(params);
if (info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT]) if (info->attrs[NL80211_ATTR_AP_SETTINGS_FLAGS])
params->flags |= AP_SETTINGS_EXTERNAL_AUTH_SUPPORT; params->flags = nla_get_u32(
info->attrs[NL80211_ATTR_AP_SETTINGS_FLAGS]);
else if (info->attrs[NL80211_ATTR_EXTERNAL_AUTH_SUPPORT])
params->flags |= NL80211_AP_SETTINGS_EXTERNAL_AUTH_SUPPORT;
wdev_lock(wdev); wdev_lock(wdev);
err = rdev_start_ap(rdev, dev, params); err = rdev_start_ap(rdev, dev, params);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment