forked from rchovan/npreal2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
npreal2.c.rej
30 lines (28 loc) · 1.13 KB
/
npreal2.c.rej
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
--- npreal2.c.orig 2020-05-21 00:42:40.690229660 -0400
+++ npreal2.c 2020-05-21 00:40:48.857014581 -0400
@@ -672,17 +676,26 @@ npreal_init(void)
put_tty_driver(DRV_VAR);
return -1;
}
/* Initialize the net node structure */
- memset(&npreal_net_fops,0,sizeof(struct file_operations));
+ memset(&npreal_net_fops,0,sizeof(npreal_net_fops));
+#if LINUX_VERSION_CODE >= VERSION_CODE(5,6,0)
+ npreal_net_fops.proc_read = npreal_net_read;
+ npreal_net_fops.proc_write = npreal_net_write;
+ npreal_net_fops.proc_ioctl = npreal_net_ioctl;
+ npreal_net_fops.proc_open = npreal_net_open;
+ npreal_net_fops.proc_release = npreal_net_close;
+ npreal_net_fops.proc_poll = npreal_net_select;
+#else
npreal_net_fops.read = npreal_net_read;
npreal_net_fops.write = npreal_net_write;
npreal_net_fops.unlocked_ioctl = npreal_net_ioctl;
npreal_net_fops.open = npreal_net_open;
npreal_net_fops.release = npreal_net_close;
npreal_net_fops.poll = npreal_net_select;
+#endif
if (npreal_init_tty() != 0)
{
tty_unregister_driver(DRV_VAR);
DBGPRINT(MX_DEBUG_ERROR, "Couldn't install MOXA Async/NPort server family Real TTY driver !\n");