aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2019-10-28 16:59:49 +0100
committerRafał Miłecki <rafal@milecki.pl>2019-10-28 17:01:00 +0100
commitb49f2113cc750c093d3b55f228f820d8bfe029a9 (patch)
tree7fe1d2a080e4b837fc15e4f2fa9ef4b105adc598 /target/linux/generic/files
parentd22c1755fcb45a7509629c3f769a2da204d6b0b0 (diff)
downloadupstream-b49f2113cc750c093d3b55f228f820d8bfe029a9.tar.gz
upstream-b49f2113cc750c093d3b55f228f820d8bfe029a9.tar.bz2
upstream-b49f2113cc750c093d3b55f228f820d8bfe029a9.zip
kernel: fix swconfig compilation with kernels 5.2+
This is related to the upstream kernel change 3b0f31f2b8c9 ("genetlink: make policy common to family"). Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target/linux/generic/files')
-rw-r--r--target/linux/generic/files/drivers/net/phy/swconfig.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/swconfig.c b/target/linux/generic/files/drivers/net/phy/swconfig.c
index e8a684742c..20d6c693da 100644
--- a/target/linux/generic/files/drivers/net/phy/swconfig.c
+++ b/target/linux/generic/files/drivers/net/phy/swconfig.c
@@ -1001,55 +1001,75 @@ static struct genl_ops swconfig_ops[] = {
{
.cmd = SWITCH_CMD_LIST_GLOBAL,
.doit = swconfig_list_attrs,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
.policy = switch_policy,
+#endif
},
{
.cmd = SWITCH_CMD_LIST_VLAN,
.doit = swconfig_list_attrs,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
.policy = switch_policy,
+#endif
},
{
.cmd = SWITCH_CMD_LIST_PORT,
.doit = swconfig_list_attrs,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
.policy = switch_policy,
+#endif
},
{
.cmd = SWITCH_CMD_GET_GLOBAL,
.doit = swconfig_get_attr,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
.policy = switch_policy,
+#endif
},
{
.cmd = SWITCH_CMD_GET_VLAN,
.doit = swconfig_get_attr,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
.policy = switch_policy,
+#endif
},
{
.cmd = SWITCH_CMD_GET_PORT,
.doit = swconfig_get_attr,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
.policy = switch_policy,
+#endif
},
{
.cmd = SWITCH_CMD_SET_GLOBAL,
.flags = GENL_ADMIN_PERM,
.doit = swconfig_set_attr,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
.policy = switch_policy,
+#endif
},
{
.cmd = SWITCH_CMD_SET_VLAN,
.flags = GENL_ADMIN_PERM,
.doit = swconfig_set_attr,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
.policy = switch_policy,
+#endif
},
{
.cmd = SWITCH_CMD_SET_PORT,
.flags = GENL_ADMIN_PERM,
.doit = swconfig_set_attr,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
.policy = switch_policy,
+#endif
},
{
.cmd = SWITCH_CMD_GET_SWITCH,
.dumpit = swconfig_dump_switches,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
.policy = switch_policy,
+#endif
.done = swconfig_done,
}
};
@@ -1062,6 +1082,9 @@ static struct genl_family switch_fam = {
.hdrsize = 0,
.version = 1,
.maxattr = SWITCH_ATTR_MAX,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0)
+ .policy = switch_policy,
+#endif
.module = THIS_MODULE,
.ops = swconfig_ops,
.n_ops = ARRAY_SIZE(swconfig_ops),