summarylogtreecommitdiffstats
path: root/0003-kernel-5.6--proc_dir_entry-proc_ops.patch
blob: e9b11a4b5ad4c941020787c8ec0da5a87e203c8d (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
diff -pNaru5 driver/2.6.27.orig/dgnc_proc.c driver/2.6.27/dgnc_proc.c
--- driver/2.6.27.orig/dgnc_proc.c	2017-10-21 10:39:21.000000000 -0400
+++ driver/2.6.27/dgnc_proc.c	2020-05-22 05:56:03.148214713 -0400
@@ -69,18 +69,28 @@ static int dgnc_proc_chk_perm(struct ino
 #else
 static int dgnc_proc_chk_perm(struct inode *, int);
 #endif
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
+static const struct proc_ops dgnc_proc_file_ops =
+{
+	.proc_read =		dgnc_gen_proc_read,	/* read		*/
+	.proc_write =	dgnc_gen_proc_write,	/* write	*/
+	.proc_open =		dgnc_gen_proc_open,	/* open		*/
+	.proc_release =	dgnc_gen_proc_close,	/* release	*/
+};
+#else
 static const struct file_operations dgnc_proc_file_ops =
 {
 	.owner =	THIS_MODULE,
 	.read =		dgnc_gen_proc_read,	/* read		*/
 	.write =	dgnc_gen_proc_write,	/* write	*/
 	.open =		dgnc_gen_proc_open,	/* open		*/
 	.release =	dgnc_gen_proc_close,	/* release	*/
 };
+#endif
 
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
 static struct inode_operations dgnc_proc_inode_ops =
 {
diff -pNaru5 driver/2.6.27.orig/dgnc_tty.c driver/2.6.27/dgnc_tty.c
--- driver/2.6.27.orig/dgnc_tty.c	2020-05-22 05:54:38.907639099 -0400
+++ driver/2.6.27/dgnc_tty.c	2020-05-22 05:54:48.157702308 -0400
@@ -519,13 +519,22 @@ void dgnc_tty_uninit(struct board_t *brd
 }
 
 
 #define TMPBUFLEN (1024)
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
+struct DGNC_timeval {
+  __kernel_old_time_t	tv_sec;		/* seconds */
+  __kernel_suseconds_t	tv_usec;	/* microseconds */
+};
+#else
+#define DGNC_timeval timeval
+#endif
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0)
 /* Temporary until reimplemented with 64 bit functions */
-static inline void do_gettimeofday(struct timeval *tv)
+static inline void do_gettimeofday(struct DGNC_timeval *tv)
 {
   struct timespec64 now;
 
   ktime_get_real_ts64(&now);
   tv->tv_sec = now.tv_sec;
@@ -537,11 +546,11 @@ static inline void do_gettimeofday(struc
  * dgnc_sniff - Dump data out to the "sniff" buffer if the
  * proc sniff file is opened...
  */
 void dgnc_sniff_nowait_nolock(struct channel_t *ch, uchar *text, uchar *buf, int len)
 {
-	struct timeval tv;
+	struct DGNC_timeval tv;
 	int n;
 	int r;
 	int nbuf;
 	int i;
 	int tmpbuflen;