summarylogtreecommitdiffstats
path: root/0002-kernel-5.6-proc_dir_entry-proc_ops.patch
blob: 0ac56c97f979c9de84e978d1004ec9e421b1a79f (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
--- nslink.c.orig	2020-05-21 00:58:54.304970216 -0400
+++ nslink.c	2020-05-21 01:04:05.147271869 -0400
@@ -5031,17 +5031,26 @@ static int queue_proc_show(struct seq_fi
 }
 static int queue_proc_open(struct inode *inode, struct file *file)
 {
         return single_open(file, queue_proc_show, NULL);
 }
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
+static const struct proc_ops queue_proc_fops = {
+        .proc_open = queue_proc_open,
+        .proc_read = seq_read,
+        .proc_lseek = seq_lseek,
+        .proc_release = seq_release,
+};
+#else
 static const struct file_operations queue_proc_fops = {
         .open = queue_proc_open,
         .read = seq_read,
         .llseek = seq_lseek,
         .release = seq_release,
 };
 #endif
+#endif
 
 
 #if NSLINK_DEBUG_TRACE_HDLC
 
 static char *stopString[] = {
@@ -5089,17 +5098,26 @@ static int ack_proc_show(struct seq_file
 }
 static int ack_proc_open(struct inode *inode, struct file *file)
 {
         return single_open(file, ack_proc_show, NULL);
 }
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
+static const struct proc_ops ack_proc_fops = {
+        .proc_open = ack_proc_open,
+        .proc_read = seq_read,
+        .proc_lseek = seq_lseek,
+        .proc_release = seq_release,
+};
+#else
 static const struct file_operations ack_proc_fops = {
         .open = ack_proc_open,
         .read = seq_read,
         .llseek = seq_lseek,
         .release = seq_release,
 };
 #endif
+#endif
 
 #define NumElements(a)  (sizeof (a)/(sizeof (a)[0]))
 
 // Implements the /proc/driver/nslink/port method.
 static int port_proc_show(struct seq_file *m, void *v)
@@ -5162,16 +5180,25 @@ static int port_proc_show(struct seq_fil
 }
 static int port_proc_open(struct inode *inode, struct file *file)
 {
         return single_open(file, port_proc_show, NULL);
 }
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
+static const struct proc_ops port_proc_fops = {
+        .proc_open = port_proc_open,
+        .proc_read = seq_read,
+        .proc_lseek = seq_lseek,
+        .proc_release = seq_release,
+};
+#else
 static const struct file_operations port_proc_fops = {
         .open = port_proc_open,
         .read = seq_read,
         .llseek = seq_lseek,
         .release = seq_release,
 };
+#endif
 
 
 // Implements the /proc/driver/nslink/hdlc method.
 static int hdlc_proc_show(struct seq_file *m, void *v)
 {
@@ -5203,16 +5230,25 @@ static int hdlc_proc_show(struct seq_fil
 }
 static int hdlc_proc_open(struct inode *inode, struct file *file)
 {
         return single_open(file, hdlc_proc_show, NULL);
 }
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
+static const struct proc_ops hdlc_proc_fops = {
+        .proc_open = hdlc_proc_open,
+        .proc_read = seq_read,
+        .proc_lseek = seq_lseek,
+        .proc_release = seq_release,
+};
+#else
 static const struct file_operations hdlc_proc_fops = {
         .open = hdlc_proc_open,
         .read = seq_read,
         .llseek = seq_lseek,
         .release = seq_release,
 };
+#endif
 
 
 // Implements the /proc/driver/nslink/hdlc-queue method.
 static int hdlc_queue_proc_show(struct seq_file *m, void *v)
 {
@@ -5258,16 +5294,25 @@ static int hdlc_queue_proc_show(struct s
 }
 static int hdlc_queue_proc_open(struct inode *inode, struct file *file)
 {
         return single_open(file, hdlc_queue_proc_show, NULL);
 }
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
+static const struct proc_ops hdlc_queue_proc_fops = {
+        .proc_open = hdlc_queue_proc_open,
+        .proc_read = seq_read,
+        .proc_lseek = seq_lseek,
+        .proc_release = seq_release,
+};
+#else
 static const struct file_operations hdlc_queue_proc_fops = {
         .open = hdlc_queue_proc_open,
         .read = seq_read,
         .llseek = seq_lseek,
         .release = seq_release,
 };
+#endif
 
 
 const char *inet_addr_string(struct sockaddr_storage *ss)
 {
         static char buf[256];
@@ -5324,16 +5369,25 @@ static int status_proc_show(struct seq_f
 }
 static int status_proc_open(struct inode *inode, struct file *file)
 {
         return single_open(file, status_proc_show, NULL);
 }
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
+static const struct proc_ops status_proc_fops = {
+        .proc_open = status_proc_open,
+        .proc_read = seq_read,
+        .proc_lseek = seq_lseek,
+        .proc_release = seq_release,
+};
+#else
 static const struct file_operations status_proc_fops = {
         .open = status_proc_open,
         .read = seq_read,
         .llseek = seq_lseek,
         .release = seq_release,
 };
+#endif
 
 /********************************************************************************/
 /*                                                                              */
 /*        MODULE INIT/CLEANUP FUNCTIONS                                         */
 /*                                                                              */