Skip to content

Commit b6db0f8

Browse files
greearbjmberg-intel
authored andcommitted
cfg80211/mac80211: Support disabling HE mode
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]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 549fdd3 commit b6db0f8

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

include/net/cfg80211.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2583,12 +2583,14 @@ struct cfg80211_auth_request {
25832583
* authentication capability. Drivers can offload authentication to
25842584
* userspace if this flag is set. Only applicable for cfg80211_connect()
25852585
* request (connect callback).
2586+
* @ASSOC_REQ_DISABLE_HE: Disable HE
25862587
*/
25872588
enum cfg80211_assoc_req_flags {
25882589
ASSOC_REQ_DISABLE_HT = BIT(0),
25892590
ASSOC_REQ_DISABLE_VHT = BIT(1),
25902591
ASSOC_REQ_USE_RRM = BIT(2),
25912592
CONNECT_REQ_EXTERNAL_AUTH_SUPPORT = BIT(3),
2593+
ASSOC_REQ_DISABLE_HE = BIT(4),
25922594
};
25932595

25942596
/**

include/uapi/linux/nl80211.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3045,6 +3045,8 @@ enum nl80211_attrs {
30453045

30463046
NL80211_ATTR_SAR_SPEC,
30473047

3048+
NL80211_ATTR_DISABLE_HE,
3049+
30483050
/* add attributes here, update the policy in nl80211.c */
30493051

30503052
__NL80211_ATTR_AFTER_LAST,

net/mac80211/mlme.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5754,6 +5754,9 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
57545754
if (req->flags & ASSOC_REQ_DISABLE_VHT)
57555755
ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
57565756

5757+
if (req->flags & ASSOC_REQ_DISABLE_HE)
5758+
ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
5759+
57575760
err = ieee80211_prep_connection(sdata, req->bss, true, override);
57585761
if (err)
57595762
goto err_clear;

net/wireless/nl80211.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
752752
NL80211_SAE_PWE_BOTH),
753753
[NL80211_ATTR_RECONNECT_REQUESTED] = { .type = NLA_REJECT },
754754
[NL80211_ATTR_SAR_SPEC] = NLA_POLICY_NESTED(sar_policy),
755+
[NL80211_ATTR_DISABLE_HE] = { .type = NLA_FLAG },
755756
};
756757

757758
/* policy for the key attributes */
@@ -10019,6 +10020,9 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
1001910020
if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_VHT]))
1002010021
req.flags |= ASSOC_REQ_DISABLE_VHT;
1002110022

10023+
if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_HE]))
10024+
req.flags |= ASSOC_REQ_DISABLE_HE;
10025+
1002210026
if (info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK])
1002310027
memcpy(&req.vht_capa_mask,
1002410028
nla_data(info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK]),
@@ -10802,6 +10806,9 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
1080210806
if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_VHT]))
1080310807
connect.flags |= ASSOC_REQ_DISABLE_VHT;
1080410808

10809+
if (nla_get_flag(info->attrs[NL80211_ATTR_DISABLE_HE]))
10810+
connect.flags |= ASSOC_REQ_DISABLE_HE;
10811+
1080510812
if (info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK])
1080610813
memcpy(&connect.vht_capa_mask,
1080710814
nla_data(info->attrs[NL80211_ATTR_VHT_CAPABILITY_MASK]),

0 commit comments

Comments
 (0)