mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
92 lines
3.5 KiB
Diff
92 lines
3.5 KiB
Diff
--- a/net/wireless/nl80211.c
|
|
+++ b/net/wireless/nl80211.c
|
|
@@ -421,8 +421,13 @@ 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),
|
|
+#if LINUX_VERSION_IS_GEQ(5,10,0)
|
|
[NL80211_FILS_DISCOVERY_ATTR_TMPL] =
|
|
NLA_POLICY_BINARY_RANGE(NL80211_FILS_DISCOVERY_TMPL_MIN_LEN, IEEE80211_MAX_DATA_LEN),
|
|
+#else
|
|
+ [NL80211_FILS_DISCOVERY_ATTR_TMPL] = { .type = NLA_BINARY,
|
|
+ .len = IEEE80211_MAX_DATA_LEN },
|
|
+#endif
|
|
};
|
|
|
|
static const struct nla_policy
|
|
@@ -533,7 +538,11 @@ static const struct nla_policy nl80211_p
|
|
[NL80211_ATTR_MPATH_NEXT_HOP] = NLA_POLICY_ETH_ADDR_COMPAT,
|
|
|
|
/* allow 3 for NUL-termination, we used to declare this NLA_STRING */
|
|
+#if LINUX_VERSION_IS_GEQ(5,10,0)
|
|
[NL80211_ATTR_REG_ALPHA2] = NLA_POLICY_BINARY_RANGE(2, 3),
|
|
+#else
|
|
+ [NL80211_ATTR_REG_ALPHA2] = { .type = NLA_STRING, .len = 2 },
|
|
+#endif
|
|
[NL80211_ATTR_REG_RULES] = { .type = NLA_NESTED },
|
|
|
|
[NL80211_ATTR_BSS_CTS_PROT] = { .type = NLA_U8 },
|
|
@@ -679,14 +688,24 @@ static const struct nla_policy nl80211_p
|
|
* The value of the Length field of the Supported Operating
|
|
* Classes element is between 2 and 253.
|
|
*/
|
|
+#if LINUX_VERSION_IS_GEQ(5,10,0)
|
|
[NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES] =
|
|
NLA_POLICY_BINARY_RANGE(2, 253),
|
|
+#else
|
|
+ [NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES] =
|
|
+ { .type = NLA_BINARY },
|
|
+#endif
|
|
[NL80211_ATTR_HANDLE_DFS] = { .type = NLA_FLAG },
|
|
[NL80211_ATTR_OPMODE_NOTIF] = { .type = NLA_U8 },
|
|
[NL80211_ATTR_VENDOR_ID] = { .type = NLA_U32 },
|
|
[NL80211_ATTR_VENDOR_SUBCMD] = { .type = NLA_U32 },
|
|
[NL80211_ATTR_VENDOR_DATA] = { .type = NLA_BINARY },
|
|
+#if LINUX_VERSION_IS_GEQ(5,10,0)
|
|
[NL80211_ATTR_QOS_MAP] = NLA_POLICY_BINARY_RANGE(IEEE80211_QOS_MAP_LEN_MIN, IEEE80211_QOS_MAP_LEN_MAX),
|
|
+#else
|
|
+ [NL80211_ATTR_QOS_MAP] = { .type = NLA_BINARY,
|
|
+ .len = IEEE80211_QOS_MAP_LEN_MAX },
|
|
+#endif
|
|
[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 },
|
|
@@ -741,9 +760,14 @@ 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 },
|
|
+#if LINUX_VERSION_IS_GEQ(5,10,0)
|
|
[NL80211_ATTR_HE_CAPABILITY] =
|
|
NLA_POLICY_VALIDATE_FN(NLA_BINARY, validate_he_capa,
|
|
NL80211_HE_MAX_CAPABILITY_LEN),
|
|
+#else
|
|
+ [NL80211_ATTR_HE_CAPABILITY] = { .type = NLA_BINARY,
|
|
+ .len = NL80211_HE_MAX_CAPABILITY_LEN },
|
|
+#endif
|
|
[NL80211_ATTR_FTM_RESPONDER] =
|
|
NLA_POLICY_NESTED(nl80211_ftm_responder_policy),
|
|
[NL80211_ATTR_TIMEOUT] = NLA_POLICY_MIN(NLA_U32, 1),
|
|
@@ -16392,9 +16416,11 @@ static const struct genl_ops nl80211_ops
|
|
/* can be retrieved by unprivileged users */
|
|
.internal_flags = IFLAGS(NL80211_FLAG_NEED_WIPHY),
|
|
},
|
|
+#if LINUX_VERSION_IS_GEQ(5,10,0)
|
|
};
|
|
|
|
static const struct genl_small_ops nl80211_small_ops[] = {
|
|
+#endif
|
|
{
|
|
.cmd = NL80211_CMD_SET_WIPHY,
|
|
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
|
@@ -17231,8 +17257,10 @@ static struct genl_family nl80211_fam __
|
|
.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
|