ANDROID: nl80211: bring delta changes from final upstream MLO commits
This commit brings in delta changes merged in final upstream commits of backport commits merged with b/233387627. Update netlink attributes order to be in sync with final changes. Since the changes are upstream replace corresponding reserved attributes with actual attributes. Also, add missing changes from upstream commits. Fixes: -af34adaa6a
("BACKPORT: FROMLIST: cfg80211: Increase akm_suites array size in cfg80211_crypto_settings") -d975927513
("BACKPORT: FROMGIT: wifi: cfg80211: do some rework towards MLO link APIs") -3f048cd911
("BACKPORT: FROMGIT: wifi: nl80211: support MLO in auth/assoc") -6abf3c5ef2
("BACKPORT: FROMLIST: cfg80211: Indicate MLO connection info in connect and roam callbacks") Corresponding upstream commits: - ecad3b0b99bf ("wifi: cfg80211: Increase akm_suites array size in cfg80211_crypto_settings") - 7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link APIs") - d648c23024bd ("wifi: nl80211: support MLO in auth/assoc") - efbabc116500 ("cfg80211: Indicate MLO connection info in connect and roam callbacks") Bug: 238103864 Change-Id: I160f11a150cd275105fb7261b4facb468aa04325 Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
This commit is contained in:
parent
885990cd85
commit
4238cf1087
|
@ -1498,8 +1498,9 @@ enum nl80211_commands {
|
|||
|
||||
NL80211_CMD_ASSOC_COMEBACK,
|
||||
|
||||
NL80211_CMD_RESERVED_DO_NOT_USE_1 = 148,
|
||||
NL80211_CMD_RESERVED_DO_NOT_USE_2 = 149,
|
||||
NL80211_CMD_ADD_LINK,
|
||||
NL80211_CMD_REMOVE_LINK,
|
||||
|
||||
NL80211_CMD_RESERVED_DO_NOT_USE_3 = 150,
|
||||
NL80211_CMD_RESERVED_DO_NOT_USE_4 = 151,
|
||||
NL80211_CMD_RESERVED_DO_NOT_USE_5 = 152,
|
||||
|
@ -1516,17 +1517,6 @@ enum nl80211_commands {
|
|||
NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
|
||||
};
|
||||
|
||||
/*
|
||||
* These are temporary definitions that will become permanent when the UAPI
|
||||
* change is accepted upstream. This will not be used in production until the
|
||||
* UAPI change lands upstream
|
||||
*/
|
||||
|
||||
/* Link: https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git/commit/?h=mld&id=a353a99fb75e5c1c3b15050e9efaab1997350862 */
|
||||
#define NL80211_CMD_ADD_LINK NL80211_CMD_RESERVED_DO_NOT_USE_1
|
||||
#define NL80211_CMD_REMOVE_LINK NL80211_CMD_RESERVED_DO_NOT_USE_2
|
||||
|
||||
|
||||
/*
|
||||
* Allow user space programs to use #ifdef on new commands by defining them
|
||||
* here
|
||||
|
@ -3234,11 +3224,14 @@ enum nl80211_attrs {
|
|||
|
||||
NL80211_ATTR_DISABLE_EHT,
|
||||
|
||||
NL80211_ATTR_RESERVED_DO_NOT_USE_1 = 312,
|
||||
NL80211_ATTR_RESERVED_DO_NOT_USE_2 = 313,
|
||||
NL80211_ATTR_RESERVED_DO_NOT_USE_3 = 314,
|
||||
NL80211_ATTR_RESERVED_DO_NOT_USE_4 = 315,
|
||||
NL80211_ATTR_RESERVED_DO_NOT_USE_5 = 316,
|
||||
NL80211_ATTR_MLO_LINKS,
|
||||
NL80211_ATTR_MLO_LINK_ID,
|
||||
NL80211_ATTR_MLD_ADDR,
|
||||
|
||||
NL80211_ATTR_MLO_SUPPORT,
|
||||
|
||||
NL80211_ATTR_MAX_NUM_AKM_SUITES,
|
||||
|
||||
NL80211_ATTR_RESERVED_DO_NOT_USE_6 = 317,
|
||||
NL80211_ATTR_RESERVED_DO_NOT_USE_7 = 318,
|
||||
NL80211_ATTR_RESERVED_DO_NOT_USE_8 = 319,
|
||||
|
@ -3267,25 +3260,6 @@ enum nl80211_attrs {
|
|||
NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
|
||||
};
|
||||
|
||||
/*
|
||||
* These are temporary definitions that will become permanent when the UAPI
|
||||
* change is accepted upstream. This will not be used in production until the
|
||||
* UAPI change lands upstream
|
||||
*/
|
||||
|
||||
/* Link: https://lore.kernel.org/linux-wireless/1653312358-12321-1-git-send-email-quic_vjakkam@quicinc.com/ */
|
||||
#define NL80211_ATTR_MAX_NUM_AKM_SUITES NL80211_ATTR_RESERVED_DO_NOT_USE_1
|
||||
|
||||
/* Link: https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git/commit/?h=mld&id=a353a99fb75e5c1c3b15050e9efaab1997350862 */
|
||||
#define NL80211_ATTR_MLO_LINKS NL80211_ATTR_RESERVED_DO_NOT_USE_2
|
||||
#define NL80211_ATTR_MLO_LINK_ID NL80211_ATTR_RESERVED_DO_NOT_USE_3
|
||||
|
||||
/* Link: https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git/commit/?h=mld&id=e35626979423cadc21bd4a68d4aa14eaeccbbd59 */
|
||||
#define NL80211_ATTR_MLD_ADDR NL80211_ATTR_RESERVED_DO_NOT_USE_4
|
||||
|
||||
/* Link: https://lore.kernel.org/linux-wireless/1654679797-7740-1-git-send-email-quic_vjakkam@quicinc.com/ */
|
||||
#define NL80211_ATTR_MLO_SUPPORT NL80211_ATTR_RESERVED_DO_NOT_USE_5
|
||||
|
||||
/* source-level API compatibility */
|
||||
#define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION
|
||||
#define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG
|
||||
|
|
|
@ -792,16 +792,13 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
|
|||
NL80211_EHT_MIN_CAPABILITY_LEN,
|
||||
NL80211_EHT_MAX_CAPABILITY_LEN),
|
||||
[NL80211_ATTR_DISABLE_EHT] = { .type = NLA_FLAG },
|
||||
[NL80211_ATTR_MAX_NUM_AKM_SUITES] =
|
||||
NLA_POLICY_RANGE(NLA_U16,
|
||||
NL80211_MAX_NR_AKM_SUITES,
|
||||
CFG80211_MAX_NUM_AKM_SUITES),
|
||||
[NL80211_ATTR_MLO_LINKS] =
|
||||
NLA_POLICY_NESTED_ARRAY(nl80211_policy),
|
||||
[NL80211_ATTR_MLO_LINK_ID] =
|
||||
NLA_POLICY_RANGE(NLA_U8, 0, IEEE80211_MLD_MAX_NUM_LINKS),
|
||||
[NL80211_ATTR_MLD_ADDR] = NLA_POLICY_EXACT_LEN(ETH_ALEN),
|
||||
[NL80211_ATTR_MLO_SUPPORT] = { .type = NLA_FLAG },
|
||||
[NL80211_ATTR_MAX_NUM_AKM_SUITES] = { .type = NLA_REJECT },
|
||||
};
|
||||
|
||||
/* policy for the key attributes */
|
||||
|
@ -15570,6 +15567,7 @@ static int nl80211_add_link(struct sk_buff *skb, struct genl_info *info)
|
|||
!is_valid_ether_addr(nla_data(info->attrs[NL80211_ATTR_MAC])))
|
||||
return -EINVAL;
|
||||
|
||||
wdev_lock(wdev);
|
||||
wdev->valid_links |= BIT(link_id);
|
||||
ether_addr_copy(wdev->links[link_id].addr,
|
||||
nla_data(info->attrs[NL80211_ATTR_MAC]));
|
||||
|
@ -15579,6 +15577,7 @@ static int nl80211_add_link(struct sk_buff *skb, struct genl_info *info)
|
|||
wdev->valid_links &= ~BIT(link_id);
|
||||
eth_zero_addr(wdev->links[link_id].addr);
|
||||
}
|
||||
wdev_unlock(wdev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -15603,11 +15602,13 @@ static int nl80211_remove_link(struct sk_buff *skb, struct genl_info *info)
|
|||
|
||||
/* FIXME: stop the link operations first */
|
||||
|
||||
wdev_lock(wdev);
|
||||
wdev->valid_links &= ~BIT(link_id);
|
||||
|
||||
rdev_del_intf_link(rdev, wdev, link_id);
|
||||
|
||||
eth_zero_addr(wdev->links[link_id].addr);
|
||||
wdev_unlock(wdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -15779,11 +15780,11 @@ static int nl80211_pre_doit(const struct genl_ops *ops, struct sk_buff *skb,
|
|||
}
|
||||
|
||||
if (internal_flags & NL80211_FLAG_MLO_UNSUPPORTED) {
|
||||
if (info->attrs[NL80211_ATTR_MLO_LINK_ID])
|
||||
return -EINVAL;
|
||||
|
||||
if (wdev->valid_links)
|
||||
return -EINVAL;
|
||||
if (info->attrs[NL80211_ATTR_MLO_LINK_ID] ||
|
||||
(wdev && wdev->valid_links)) {
|
||||
err = -EINVAL;
|
||||
goto out_unlock;
|
||||
}
|
||||
}
|
||||
|
||||
if (rdev && !(internal_flags & NL80211_FLAG_NO_WIPHY_MTX)) {
|
||||
|
@ -16770,7 +16771,7 @@ static struct genl_family nl80211_fam __ro_after_init = {
|
|||
.name = NL80211_GENL_NAME, /* have users key off the name instead */
|
||||
.hdrsize = 0, /* no private header */
|
||||
.version = 1, /* no particular meaning now */
|
||||
.maxattr = NL80211_ATTR_MLO_SUPPORT,
|
||||
.maxattr = NL80211_ATTR_MAX_NUM_AKM_SUITES,
|
||||
.policy = nl80211_policy,
|
||||
.netnsok = true,
|
||||
.pre_doit = nl80211_pre_doit,
|
||||
|
|
Loading…
Reference in New Issue