cfg80211: support disabling EHT mode

Allow userspace to disable EHT mode during association.

Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
Link: https://lore.kernel.org/r/20220323224636.20211-1-quic_alokad@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Muna Sinada 2022-03-23 15:46:35 -07:00 committed by Johannes Berg
parent b041b7b9de
commit 36f8423597
3 changed files with 11 additions and 0 deletions

View File

@ -2735,6 +2735,7 @@ struct cfg80211_auth_request {
* userspace if this flag is set. Only applicable for cfg80211_connect() * userspace if this flag is set. Only applicable for cfg80211_connect()
* request (connect callback). * request (connect callback).
* @ASSOC_REQ_DISABLE_HE: Disable HE * @ASSOC_REQ_DISABLE_HE: Disable HE
* @ASSOC_REQ_DISABLE_EHT: Disable EHT
*/ */
enum cfg80211_assoc_req_flags { enum cfg80211_assoc_req_flags {
ASSOC_REQ_DISABLE_HT = BIT(0), ASSOC_REQ_DISABLE_HT = BIT(0),
@ -2742,6 +2743,7 @@ enum cfg80211_assoc_req_flags {
ASSOC_REQ_USE_RRM = BIT(2), ASSOC_REQ_USE_RRM = BIT(2),
CONNECT_REQ_EXTERNAL_AUTH_SUPPORT = BIT(3), CONNECT_REQ_EXTERNAL_AUTH_SUPPORT = BIT(3),
ASSOC_REQ_DISABLE_HE = BIT(4), ASSOC_REQ_DISABLE_HE = BIT(4),
ASSOC_REQ_DISABLE_EHT = BIT(5),
}; };
/** /**

View File

@ -3175,6 +3175,8 @@ enum nl80211_attrs {
NL80211_ATTR_EHT_CAPABILITY, NL80211_ATTR_EHT_CAPABILITY,
NL80211_ATTR_DISABLE_EHT,
/* 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,

View File

@ -791,6 +791,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
NLA_POLICY_RANGE(NLA_BINARY, NLA_POLICY_RANGE(NLA_BINARY,
NL80211_EHT_MIN_CAPABILITY_LEN, NL80211_EHT_MIN_CAPABILITY_LEN,
NL80211_EHT_MAX_CAPABILITY_LEN), NL80211_EHT_MAX_CAPABILITY_LEN),
[NL80211_ATTR_DISABLE_EHT] = { .type = NLA_FLAG },
}; };
/* policy for the key attributes */ /* policy for the key attributes */
@ -10378,6 +10379,9 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_HE])) if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_HE]))
req.flags |= ASSOC_REQ_DISABLE_HE; req.flags |= ASSOC_REQ_DISABLE_HE;
if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_EHT]))
req.flags |= ASSOC_REQ_DISABLE_EHT;
if (info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK]) if (info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK])
memcpy(&req.vht_capa_mask, memcpy(&req.vht_capa_mask,
nla_data(info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK]), nla_data(info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK]),
@ -11166,6 +11170,9 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_HE])) if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_HE]))
connect.flags |= ASSOC_REQ_DISABLE_HE; connect.flags |= ASSOC_REQ_DISABLE_HE;
if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_EHT]))
connect.flags |= ASSOC_REQ_DISABLE_EHT;
if (info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK]) if (info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK])
memcpy(&connect.vht_capa_mask, memcpy(&connect.vht_capa_mask,
nla_data(info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK]), nla_data(info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK]),