@@ -1,6 +1,8 @@
+diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
+index 569234bc2be6..c713f47c2302 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
-@@ -413,10 +413,15 @@ static const struct nla_policy
+@@ -422,10 +422,15 @@ static const struct nla_policy
nl80211_fils_discovery_policy[NL80211_FILS_DISCOVERY_ATTR_MAX + 1] = {
[NL80211_FILS_DISCOVERY_ATTR_INT_MIN] = NLA_POLICY_MAX(NLA_U32, 10000),
[NL80211_FILS_DISCOVERY_ATTR_INT_MAX] = NLA_POLICY_MAX(NLA_U32, 10000),
@@ -16,7 +18,27 @@
};
static const struct nla_policy
-@@ -511,7 +516,11 @@ static const struct nla_policy nl80211_p
+@@ -463,10 +468,19 @@ nl80211_sta_wme_policy[NL80211_STA_WME_MAX + 1] = {
+ [NL80211_STA_WME_MAX_SP] = { .type = NLA_U8 },
+ };
+
++#if LINUX_VERSION_IS_GEQ(5,10,0)
++#if LINUX_VERSION_IS_GEQ(6,7,0)
+ static const struct netlink_range_validation nl80211_punct_bitmap_range = {
+ .min = 0,
+ .max = 0xffff,
+ };
++#else
++static struct netlink_range_validation nl80211_punct_bitmap_range = {
++ .min = 0,
++ .max = 0xffff,
++};
++#endif
++#endif
+
+ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
+ [0] = { .strict_start_type = NL80211_ATTR_HE_OBSS_PD },
+@@ -541,7 +555,11 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
[NL80211_ATTR_MPATH_NEXT_HOP] = NLA_POLICY_ETH_ADDR_COMPAT,
/* allow 3 for NUL-termination, we used to declare this NLA_STRING */
@@ -28,7 +50,7 @@
[NL80211_ATTR_REG_RULES] = { .type = NLA_NESTED },
[NL80211_ATTR_BSS_CTS_PROT] = { .type = NLA_U8 },
-@@ -657,16 +666,26 @@ static const struct nla_policy nl80211_p
+@@ -687,16 +705,26 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
* The value of the Length field of the Supported Operating
* Classes element is between 2 and 253.
*/
@@ -55,19 +77,17 @@
[NL80211_ATTR_MAC_HINT] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN),
[NL80211_ATTR_WIPHY_FREQ_HINT] = { .type = NLA_U32 },
[NL80211_ATTR_TDLS_PEER_CAPABILITY] = { .type = NLA_U32 },
-@@ -721,10 +740,15 @@ static const struct nla_policy nl80211_p
- [NL80211_ATTR_TXQ_LIMIT] = { .type = NLA_U32 },
- [NL80211_ATTR_TXQ_MEMORY_LIMIT] = { .type = NLA_U32 },
- [NL80211_ATTR_TXQ_QUANTUM] = { .type = NLA_U32 },
+@@ -811,8 +839,13 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
+ [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 },
+#if LINUX_VERSION_IS_GEQ(5,10,0)
- [NL80211_ATTR_HE_CAPABILITY] =
- NLA_POLICY_RANGE(NLA_BINARY,
- NL80211_HE_MIN_CAPABILITY_LEN,
- NL80211_HE_MAX_CAPABILITY_LEN),
+ [NL80211_ATTR_PUNCT_BITMAP] =
+ NLA_POLICY_FULL_RANGE(NLA_U32, &nl80211_punct_bitmap_range),
+#else
-+ [NL80211_ATTR_HE_CAPABILITY] = { .type = NLA_BINARY,
-+ .len = NL80211_HE_MAX_CAPABILITY_LEN },
++ [NL80211_ATTR_PUNCT_BITMAP] =
++ NLA_POLICY_RANGE(NLA_U32, 0, 0xffff),
+#endif
- [NL80211_ATTR_FTM_RESPONDER] =
- NLA_POLICY_NESTED(nl80211_ftm_responder_policy),
- [NL80211_ATTR_TIMEOUT] = NLA_POLICY_MIN(NLA_U32, 1),
+
+ [NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS] = { .type = NLA_U16 },
+ [NL80211_ATTR_HW_TIMESTAMP_ENABLED] = { .type = NLA_FLAG },
@@ -1,8 +1,10 @@
+diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
+index 33a82ecab9d5..b0c05fbf3560 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
-@@ -15188,9 +15188,11 @@ static const struct genl_ops nl80211_ops
+@@ -16403,9 +16403,11 @@ static const struct genl_ops nl80211_ops[] = {
/* can be retrieved by unprivileged users */
- .internal_flags = NL80211_FLAG_NEED_WIPHY,
+ .internal_flags = IFLAGS(NL80211_FLAG_NEED_WIPHY),
},
+#if LINUX_VERSION_IS_GEQ(5,10,0)
};
@@ -12,13 +14,16 @@
{
.cmd = NL80211_CMD_SET_WIPHY,
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
-@@ -15980,8 +15982,10 @@ static struct genl_family nl80211_fam __
+@@ -17243,9 +17245,13 @@ static struct genl_family nl80211_fam __ro_after_init = {
.module = THIS_MODULE,
.ops = nl80211_ops,
.n_ops = ARRAY_SIZE(nl80211_ops),
+#if LINUX_VERSION_IS_GEQ(5,10,0)
.small_ops = nl80211_small_ops,
.n_small_ops = ARRAY_SIZE(nl80211_small_ops),
++#endif
++#if LINUX_VERSION_IS_GEQ(6,1,0)
+ .resv_start_op = NL80211_CMD_REMOVE_LINK_STA + 1,
+#endif
.mcgrps = nl80211_mcgrps,
.n_mcgrps = ARRAY_SIZE(nl80211_mcgrps),
@@ -67,7 +67,7 @@
struct x509_certificate *signer; /* Certificate that signed this one */
--- a/include/crypto/backport-public_key.h
+++ b/include/crypto/backport-public_key.h
-@@ -52,34 +52,6 @@ extern void public_key_signature_free(st
+@@ -56,25 +56,6 @@ extern void public_key_signature_free(struct public_key_signature *sig);
extern struct asymmetric_key_subtype public_key_subtype;
@@ -90,15 +90,20 @@
- const union key_payload *payload,
- struct key *trusted);
-
--extern int query_asymmetric_key(const struct kernel_pkey_params *,
-- struct kernel_pkey_query *);
--
+ #if IS_REACHABLE(CONFIG_ASYMMETRIC_KEY_TYPE)
+ extern int restrict_link_by_ca(struct key *dest_keyring,
+ const struct key_type *type,
+@@ -93,12 +74,6 @@ static inline int restrict_link_by_ca(struct key *dest_keyring,
+ extern int query_asymmetric_key(const struct kernel_pkey_params *,
+ struct kernel_pkey_query *);
+
-extern int encrypt_blob(struct kernel_pkey_params *, const void *, void *);
-extern int decrypt_blob(struct kernel_pkey_params *, const void *, void *);
-extern int create_signature(struct kernel_pkey_params *, const void *, void *);
-extern int verify_signature(const struct key *,
- const struct public_key_signature *);
-
+ #if IS_REACHABLE(CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE)
int public_key_verify_signature(const struct public_key *pkey,
const struct public_key_signature *sig);
-
+