Revert "wifi: cfg80211: Increase akm_suites array size in"

This reverts commit 525fb1b48f.

Reason for revert: Breaks WiFi, likely needs additional changes to be
backported for it to work properly.

Change-Id: Ifc537c0dc80d759a9ab12671c7ff053ad6c31759
This commit is contained in:
Michael Bestas 2026-05-05 20:00:10 +03:00
commit 1df27edaaf
No known key found for this signature in database
GPG key ID: CC95044519BE6669
5 changed files with 6 additions and 45 deletions

View file

@ -222,7 +222,6 @@ int qtnf_cmd_send_start_ap(struct qtnf_vif *vif,
struct qlink_auth_encr *aen;
int ret;
int i;
int n;
if (!qtnf_cmd_start_ap_can_fit(vif, s))
return -E2BIG;
@ -254,9 +253,8 @@ int qtnf_cmd_send_start_ap(struct qtnf_vif *vif,
for (i = 0; i < QLINK_MAX_NR_CIPHER_SUITES; i++)
aen->ciphers_pairwise[i] =
cpu_to_le32(s->crypto.ciphers_pairwise[i]);
n = min(QLINK_MAX_NR_AKM_SUITES, s->crypto.n_akm_suites);
aen->n_akm_suites = cpu_to_le32(n);
for (i = 0; i < n; i++)
aen->n_akm_suites = cpu_to_le32(s->crypto.n_akm_suites);
for (i = 0; i < QLINK_MAX_NR_AKM_SUITES; i++)
aen->akm_suites[i] = cpu_to_le32(s->crypto.akm_suites[i]);
aen->control_port = s->crypto.control_port;
aen->control_port_no_encrypt = s->crypto.control_port_no_encrypt;
@ -2202,7 +2200,6 @@ int qtnf_cmd_send_connect(struct qtnf_vif *vif,
struct qlink_auth_encr *aen;
int ret;
int i;
int n;
u32 connect_flags = 0;
cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid,
@ -2259,10 +2256,9 @@ int qtnf_cmd_send_connect(struct qtnf_vif *vif,
aen->ciphers_pairwise[i] =
cpu_to_le32(sme->crypto.ciphers_pairwise[i]);
n = min(QLINK_MAX_NR_AKM_SUITES, sme->crypto.n_akm_suites);
aen->n_akm_suites = cpu_to_le32(n);
aen->n_akm_suites = cpu_to_le32(sme->crypto.n_akm_suites);
for (i = 0; i < n; i++)
for (i = 0; i < QLINK_MAX_NR_AKM_SUITES; i++)
aen->akm_suites[i] = cpu_to_le32(sme->crypto.akm_suites[i]);
aen->control_port = sme->crypto.control_port;

View file

@ -903,7 +903,6 @@ struct survey_info {
};
#define CFG80211_MAX_WEP_KEYS 4
#define CFG80211_MAX_NUM_AKM_SUITES 10
/**
* struct cfg80211_crypto_settings - Crypto settings
@ -938,7 +937,7 @@ struct cfg80211_crypto_settings {
int n_ciphers_pairwise;
u32 ciphers_pairwise[NL80211_MAX_NR_CIPHER_SUITES];
int n_akm_suites;
u32 akm_suites[CFG80211_MAX_NUM_AKM_SUITES];
u32 akm_suites[NL80211_MAX_NR_AKM_SUITES];
bool control_port;
__be16 control_port_ethertype;
bool control_port_no_encrypt;
@ -4683,13 +4682,6 @@ struct wiphy_iftype_akm_suites {
* supported by the driver for each vif
* @tid_config_support.peer: bitmap of attributes (configurations)
* supported by the driver for each peer
* @max_num_akm_suites: maximum number of AKM suites allowed for
* configuration through %NL80211_CMD_CONNECT, %NL80211_CMD_ASSOCIATE and
* %NL80211_CMD_START_AP. Set to NL80211_MAX_NR_AKM_SUITES if not set by
* driver. If set by driver minimum allowed value is
* NL80211_MAX_NR_AKM_SUITES in order to avoid compatibility issues with
* legacy userspace and maximum allowed value is
* CFG80211_MAX_NUM_AKM_SUITES.
*/
struct wiphy {
/* assign these fields before you register the wiphy */
@ -4841,8 +4833,6 @@ struct wiphy {
u64 peer, vif;
} tid_config_support;
u16 max_num_akm_suites;
char priv[0] __aligned(NETDEV_ALIGN);
};

View file

@ -2465,13 +2465,6 @@ enum nl80211_commands {
* @NL80211_ATTR_HE_6GHZ_CAPABILITY: HE 6 GHz Band Capability element (from
* association request when used with NL80211_CMD_NEW_STATION).
*
* @NL80211_ATTR_MAX_NUM_AKM_SUITES: U16 attribute. Indicates maximum number of
* AKM suites allowed for %NL80211_CMD_CONNECT, %NL80211_CMD_ASSOCIATE and
* %NL80211_CMD_START_AP in %NL80211_CMD_GET_WIPHY response. If this
* attribute is not present userspace shall consider maximum number of AKM
* suites allowed as %NL80211_MAX_NR_AKM_SUITES which is the legacy maximum
* number prior to the introduction of this attribute.
*
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@ -2949,8 +2942,6 @@ enum nl80211_attrs {
NL80211_ATTR_HE_6GHZ_CAPABILITY,
NL80211_ATTR_MAX_NUM_AKM_SUITES = 316,
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
@ -3003,11 +2994,6 @@ enum nl80211_attrs {
#define NL80211_HE_MIN_CAPABILITY_LEN 16
#define NL80211_HE_MAX_CAPABILITY_LEN 54
#define NL80211_MAX_NR_CIPHER_SUITES 5
/*
* NL80211_MAX_NR_AKM_SUITES is obsolete when %NL80211_ATTR_MAX_NUM_AKM_SUITES
* present in %NL80211_CMD_GET_WIPHY response.
*/
#define NL80211_MAX_NR_AKM_SUITES 2
#define NL80211_MIN_REMAIN_ON_CHANNEL_TIME 10

View file

@ -894,12 +894,6 @@ int wiphy_register(struct wiphy *wiphy)
return -EINVAL;
#endif
if (!wiphy->max_num_akm_suites)
wiphy->max_num_akm_suites = NL80211_MAX_NR_AKM_SUITES;
else if (wiphy->max_num_akm_suites < NL80211_MAX_NR_AKM_SUITES ||
wiphy->max_num_akm_suites > CFG80211_MAX_NUM_AKM_SUITES)
return -EINVAL;
/* check and set up bitrates */
ieee80211_set_bitrate_flags(wiphy);

View file

@ -656,7 +656,6 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
.type = NLA_EXACT_LEN,
.len = sizeof(struct ieee80211_he_6ghz_capa),
},
[NL80211_ATTR_MAX_NUM_AKM_SUITES] = { .type = NLA_REJECT },
};
/* policy for the key attributes */
@ -2575,10 +2574,6 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
if (nl80211_put_tid_config_support(rdev, msg))
goto nla_put_failure;
if (nla_put_u16(msg, NL80211_ATTR_MAX_NUM_AKM_SUITES,
rdev->wiphy.max_num_akm_suites))
goto nla_put_failure;
/* done */
state->split_start = 0;
break;
@ -9385,7 +9380,7 @@ static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev,
if (len % sizeof(u32))
return -EINVAL;
if (settings->n_akm_suites > rdev->wiphy.max_num_akm_suites)
if (settings->n_akm_suites > NL80211_MAX_NR_AKM_SUITES)
return -EINVAL;
memcpy(settings->akm_suites, data, len);