wireless: Support disabling HE mode
Subsystems (2)
PATCH 1/1 wireless: Support disabling HE mode
From: Ben Greear <[email protected]>
Allow user to disable HE mode, similar to how VHT and HT can be disabled. Useful for testing.
Signed-off-by Ben Greear <[email protected]>
--- include/net/cfg80211.h | 2 ++ include/uapi/linux/nl80211.h | 2 ++ net/mac80211/mlme.c | 3 +++ net/wireless/nl80211.c | 7 +++++++ 4 files changed, 14 insertions(+)
include/net/cfg80211.h +2 -0
@@ -2581,12 +2581,14 @@ struct cfg80211_auth_request {* authentication capability. Drivers can offload authentication to * userspace if this flag is set. Only applicable for cfg80211_connect() * request (connect callback). +* @ASSOC_REQ_DISABLE_HE: Disable HE */ enum cfg80211_assoc_req_flags {ASSOC_REQ_DISABLE_HT =BIT (0 ),ASSOC_REQ_DISABLE_VHT =BIT (1 ),ASSOC_REQ_USE_RRM =BIT (2 ),CONNECT_REQ_EXTERNAL_AUTH_SUPPORT =BIT (3 ), +ASSOC_REQ_DISABLE_HE =BIT (4 ), };/**
include/uapi/linux/nl80211.h +2 -0
@@ -3045,6 +3045,8 @@ enum nl80211_attrs {NL80211_ATTR_SAR_SPEC , +NL80211_ATTR_DISABLE_HE , +/* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST,
net/mac80211/mlme.c +3 -0
@@ -5796,6 +5796,9 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,if (req->flags &ASSOC_REQ_DISABLE_VHT ) ifmgd->flags |=IEEE80211_STA_DISABLE_VHT ; +if (req->flags &ASSOC_REQ_DISABLE_HE ) + ifmgd->flags |=IEEE80211_STA_DISABLE_HE ; + err =ieee80211_prep_connection (sdata, req->bss, true, override);if (err) goto err_clear;
net/wireless/nl80211.c +7 -0
@@ -732,6 +732,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { NL80211_SAE_PWE_BOTH), [NL80211_ATTR_RECONNECT_REQUESTED] = { .type = NLA_REJECT }, [NL80211_ATTR_SAR_SPEC] = NLA_POLICY_NESTED(sar_policy), + [NL80211_ATTR_DISABLE_HE] = { .type = NLA_FLAG }, };/* policy for the key attributes */
@@ -10121,6 +10122,9 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)if (nla_get_flag (info->attrs[NL80211_ATTR_DISABLE_VHT ])) req.flags |=ASSOC_REQ_DISABLE_VHT ; +if (nla_get_flag (info->attrs[NL80211_ATTR_DISABLE_HE ])) + req.flags |=ASSOC_REQ_DISABLE_HE ; +if (info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK ]) memcpy(&req.vht_capa_mask, nla_data(info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK]),
@@ -10930,6 +10934,9 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)if (nla_get_flag (info->attrs[NL80211_ATTR_DISABLE_VHT ])) connect.flags |=ASSOC_REQ_DISABLE_VHT ; +if (nla_get_flag (info->attrs[NL80211_ATTR_DISABLE_HE ])) + connect.flags |=ASSOC_REQ_DISABLE_HE ; +if (info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK ]) memcpy(&connect.vht_capa_mask, nla_data(info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK]),
Signature · 1 line
2.20.1