1 diff -urNp -x '*.orig' lin_tape-3.0.52.org/lin_tape_ioctl_tape.c lin_tape-3.0.52/lin_tape_ioctl_tape.c
2 --- lin_tape-3.0.52.org/lin_tape_ioctl_tape.c 2021-02-24 22:06:04.675258765 +0100
3 +++ lin_tape-3.0.52/lin_tape_ioctl_tape.c 2021-02-24 22:06:04.715258642 +0100
5 #include <linux/delay.h>
6 #include <linux/ktime.h>
9 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
10 +struct lin_tape_timeval {
11 + __kernel_long_t tv_sec;
12 + __kernel_suseconds_t tv_usec;
15 +#define lin_tape_timeval timeval
18 /*****************************************************************************
21 @@ -2795,7 +2805,7 @@ EXIT_LABEL:
23 ssize_t tape_set_tod(struct tape_descriptor** drvp)
25 - struct timeval* tv = NULL;
26 + struct lin_tape_timeval* tv = NULL;
27 struct tod_control* buffer = NULL;
28 struct tape_descriptor *drv = *drvp;
29 int now = 0, rc = STATUS_SUCCESS;
30 @@ -2811,20 +2821,20 @@ ssize_t tape_set_tod(struct tape_descrip
34 - tv = kmalloc(sizeof(struct timeval), GFP_KERNEL);
35 + tv = kmalloc(sizeof(struct lin_tape_timeval), GFP_KERNEL);
41 memset(buffer, '\0', sizeof(struct tod_control));
42 - memset(tv, '\0', sizeof(struct timeval));
43 + memset(tv, '\0', sizeof(struct lin_tape_timeval));
45 rc = tape_modesense_page(&drv, TODControlPageNumber, (unchar*)buffer,
46 sizeof(struct tod_control), True, True);
47 if(rc != STATUS_SUCCESS) goto EXIT_LABEL;
49 - memset(tv, '\0', sizeof(struct timeval));
50 + memset(tv, '\0', sizeof(struct lin_tape_timeval));
51 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
54 @@ -8940,7 +8950,7 @@ EXIT_LABEL:
56 int erp_tod(struct tape_descriptor* drv, union cdb* tmp_cdb, char* sense_data)
58 - struct timeval* tv = NULL;
59 + struct lin_tape_timeval* tv = NULL;
60 struct tod_control* tod_buf = NULL;
61 int now = 0, rc = -EIO;
63 @@ -8950,7 +8960,7 @@ int erp_tod(struct tape_descriptor* drv,
67 - tv = kmalloc(sizeof(struct timeval), GFP_KERNEL);
68 + tv = kmalloc(sizeof(struct lin_tape_timeval), GFP_KERNEL);
72 @@ -8961,7 +8971,7 @@ int erp_tod(struct tape_descriptor* drv,
73 if(rc != STATUS_SUCCESS) goto EXIT_LABEL;
75 /* get time info to set TOD */
76 - memset(tv, '\0', sizeof(struct timeval));
77 + memset(tv, '\0', sizeof(struct lin_tape_timeval));
78 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
81 diff -urNp -x '*.orig' lin_tape-3.0.52.org/lin_tape_scsi_config.h lin_tape-3.0.52/lin_tape_scsi_config.h
82 --- lin_tape-3.0.52.org/lin_tape_scsi_config.h 2021-02-24 22:06:04.671925441 +0100
83 +++ lin_tape-3.0.52/lin_tape_scsi_config.h 2021-02-24 22:06:04.715258642 +0100
84 @@ -220,6 +220,7 @@ static int tape_open_proc(struct inode *
86 return single_open(file, tape_read_proc, NULL);
88 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
89 static struct file_operations tape_proc_ops = {
91 .open = tape_open_proc,
92 @@ -227,6 +228,14 @@ static struct file_operations tape_proc_
94 .release = single_release,
97 +static struct proc_ops tape_proc_ops = {
98 + .proc_open = tape_open_proc,
99 + .proc_read = seq_read,
100 + .proc_lseek = seq_lseek,
101 + .proc_release = single_release,
107 @@ -252,6 +261,7 @@ static int changer_open_proc(struct inod
109 return single_open(file, changer_read_proc, NULL);
111 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
112 static struct file_operations changer_proc_ops = {
113 .owner = THIS_MODULE,
114 .open = changer_open_proc,
115 @@ -259,6 +269,14 @@ static struct file_operations changer_pr
117 .release = single_release,
120 +static struct proc_ops changer_proc_ops = {
121 + .proc_open = changer_open_proc,
122 + .proc_read = seq_read,
123 + .proc_lseek = seq_lseek,
124 + .proc_release = single_release,
129 static int status_read_proc
130 @@ -270,6 +288,7 @@ static int status_open_proc(struct inode
132 return single_open(file, status_read_proc, NULL);
134 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
135 static struct file_operations status_proc_ops = {
136 .owner = THIS_MODULE,
137 .open = status_open_proc,
138 @@ -277,6 +296,14 @@ static struct file_operations status_pro
140 .release = single_release,
143 +static struct proc_ops status_proc_ops = {
144 + .proc_open = status_open_proc,
145 + .proc_read = seq_read,
146 + .proc_lseek = seq_lseek,
147 + .proc_release = single_release,
152 int rdstatus_pc_initial