aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/lantiq/ltq-vectoring/patches/001-fix-compile.patch
blob: c97ec4d94b3f7741eefef035b8a03735ccf3df89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
--- a/src/vectoring/Makefile
+++ b/src/vectoring/Makefile
@@ -1,5 +1,5 @@
-obj-$(CONFIG_PTM_VECTORING)	+= ifxmips_vectoring.o
-obj-y += ifxmips_vectoring_stub.o
-ifeq ($(CONFIG_DSL_MEI_CPE_DRV),)
-obj-$(CONFIG_PTM_VECTORING)	+= ifxmips_vectoring_test.o
-endif
+obj-m += ltq_vectoring.o
+ltq_vectoring-objs = ifxmips_vectoring.o ifxmips_vectoring_stub.o
+
+obj-m += ltq_vectoring_test.o
+ltq_vectoring_test-objs = ifxmips_vectoring_test.o
--- a/src/vectoring/ifxmips_vectoring.c
+++ b/src/vectoring/ifxmips_vectoring.c
@@ -30,9 +30,11 @@
 /*
  *  Common Head File
  */
+#include <linux/version.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/etherdevice.h>
+#include <linux/proc_fs.h>
 
 /*
  *  Chip Specific Head File
@@ -239,7 +241,7 @@ static int netdev_event_handler(struct n
         && event != NETDEV_UNREGISTER )
         return NOTIFY_DONE;
 
-    netif = (struct net_device *)netdev;
+    netif = netdev_notifier_info_to_dev(netdev);
     if ( strcmp(netif->name, "ptm0") != 0 )
         return NOTIFY_DONE;
 
@@ -356,6 +358,7 @@ static int proc_write_dbg(struct file *f
     return count;
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
 static struct file_operations g_proc_file_vectoring_dbg_seq_fops = {
     .owner      = THIS_MODULE,
     .open       = proc_read_dbg_seq_open,
@@ -364,6 +367,15 @@ static struct file_operations g_proc_fil
     .llseek     = seq_lseek,
     .release    = single_release,
 };
+#else
+static struct proc_ops g_proc_file_vectoring_dbg_seq_fops = {
+    .proc_open    = proc_read_dbg_seq_open,
+    .proc_read    = seq_read,
+    .proc_write   = proc_write_dbg,
+    .proc_lseek   = seq_lseek,
+    .proc_release = single_release,
+};
+#endif
 
 static int proc_read_dbg_seq_open(struct inode *inode, struct file *file)
 {
--- a/src/vectoring/ifxmips_vectoring_test.c
+++ b/src/vectoring/ifxmips_vectoring_test.c
@@ -1,6 +1,8 @@
+#include <linux/version.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/proc_fs.h>
+#include <linux/seq_file.h>
 
 #include "ifxmips_vectoring_stub.h"
 
@@ -82,6 +84,7 @@ static int proc_write_vectoring(struct f
     return count;
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
 static struct file_operations g_proc_file_vectoring_seq_fops = {
     .owner      = THIS_MODULE,
     .open       = proc_read_vectoring_seq_open,
@@ -90,6 +93,15 @@ static struct file_operations g_proc_fil
     .llseek     = seq_lseek,
     .release    = single_release,
 };
+#else
+static struct proc_ops g_proc_file_vectoring_seq_fops = {
+    .proc_open    = proc_read_vectoring_seq_open,
+    .proc_read    = seq_read,
+    .proc_write   = proc_write_vectoring,
+    .proc_lseek   = seq_lseek,
+    .proc_release = single_release,
+};
+#endif
 
 static int proc_read_vectoring_seq_open(struct inode *inode, struct file *file)
 {