diff mbox series

[24/30] patches: Revert usage of small_ops

Message ID 20201201220415.30582-25-hauke@hauke-m.de (mailing list archive)
State New, archived
Headers show
Series backports: Update to match kernel 5.10-rc6 | expand

Commit Message

Hauke Mehrtens Dec. 1, 2020, 10:04 p.m. UTC
This reverts upstream Linux kernel commit 66a9b9287d2 ("genetlink: move
to smaller ops wherever possible") for older kernel versions.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0100-revert-small_ops/mac80211.patch  | 25 +++++++++++++++++
 .../mac80211_hwsim.patch                      | 28 +++++++++++++++++++
 2 files changed, 53 insertions(+)
 create mode 100644 patches/0100-revert-small_ops/mac80211.patch
 create mode 100644 patches/0100-revert-small_ops/mac80211_hwsim.patch
diff mbox series

Patch

diff --git a/patches/0100-revert-small_ops/mac80211.patch b/patches/0100-revert-small_ops/mac80211.patch
new file mode 100644
index 00000000..37c2fcff
--- /dev/null
+++ b/patches/0100-revert-small_ops/mac80211.patch
@@ -0,0 +1,25 @@ 
+--- a/net/wireless/nl80211.c
++++ b/net/wireless/nl80211.c
+@@ -14690,9 +14690,11 @@ static const struct genl_ops nl80211_ops
+ 		.internal_flags = NL80211_FLAG_NEED_WIPHY |
+ 				  NL80211_FLAG_NEED_RTNL,
+ 	},
++#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,
+@@ -15554,8 +15556,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
+ 	.mcgrps = nl80211_mcgrps,
+ 	.n_mcgrps = ARRAY_SIZE(nl80211_mcgrps),
+ 	.parallel_ops = true,
diff --git a/patches/0100-revert-small_ops/mac80211_hwsim.patch b/patches/0100-revert-small_ops/mac80211_hwsim.patch
new file mode 100644
index 00000000..1a764336
--- /dev/null
+++ b/patches/0100-revert-small_ops/mac80211_hwsim.patch
@@ -0,0 +1,28 @@ 
+--- a/drivers/net/wireless/mac80211_hwsim.c
++++ b/drivers/net/wireless/mac80211_hwsim.c
+@@ -3964,7 +3964,11 @@ done:
+ }
+ 
+ /* Generic Netlink operations array */
++#if LINUX_VERSION_IS_GEQ(5,10,0)
+ static const struct genl_small_ops hwsim_ops[] = {
++#else
++static const struct genl_ops hwsim_ops[] = {
++#endif
+ 	{
+ 		.cmd = HWSIM_CMD_REGISTER,
+ 		.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+@@ -4008,8 +4012,13 @@ static struct genl_family hwsim_genl_fam
+ 	.policy = hwsim_genl_policy,
+ 	.netnsok = true,
+ 	.module = THIS_MODULE,
++#if LINUX_VERSION_IS_GEQ(5,10,0)
+ 	.small_ops = hwsim_ops,
+ 	.n_small_ops = ARRAY_SIZE(hwsim_ops),
++#else
++	.ops = hwsim_ops,
++	.n_ops = ARRAY_SIZE(hwsim_ops),
++#endif
+ 	.mcgrps = hwsim_mcgrps,
+ 	.n_mcgrps = ARRAY_SIZE(hwsim_mcgrps),
+ };