summarylogtreecommitdiffstats
path: root/0001-Kernel-4-15-timers.patch
blob: 67f8b39178ed50fc5aaca30e6d2172d371c1abe0 (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
diff -pNaru5 dgnc-1.3.orig-0001/driver/2.6.27/dgnc_driver.c dgnc-1.3/driver/2.6.27/dgnc_driver.c
--- dgnc-1.3.orig-0001/driver/2.6.27/dgnc_driver.c	2017-10-21 10:39:21.000000000 -0400
+++ dgnc-1.3/driver/2.6.27/dgnc_driver.c	2018-06-17 15:58:18.724092247 -0400
@@ -77,11 +77,15 @@ PARM_INT(trcbuf_size,	0x100000,	0644, 	"
 static int		dgnc_start(void);
 static int		dgnc_finalize_board_init(struct board_t *brd);
 static void		dgnc_init_globals(void);
 static int		dgnc_found_board(struct pci_dev *pdev, int id);
 static void		dgnc_cleanup_board(struct board_t *brd);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
 static void		dgnc_poll_handler(ulong dummy);
+#else
+static void		dgnc_poll_handler(struct timer_list *dummy);
+#endif
 static int		dgnc_init_pci(void);
 static int		dgnc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
 static void		dgnc_remove_one(struct pci_dev *dev);
 static int		dgnc_probe1(struct pci_dev *pdev, int card_type);
 static void		dgnc_do_remap(struct board_t *brd);
@@ -330,13 +334,17 @@ static int dgnc_start(void)
 			return(rc);
 		}
 
 		/* Start the poller */
 		DGNC_LOCK(dgnc_poll_lock, flags);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
 		init_timer(&dgnc_poll_timer);
 		dgnc_poll_timer.function = dgnc_poll_handler;
 		dgnc_poll_timer.data = 0;
+#else
+		timer_setup(&dgnc_poll_timer,dgnc_poll_handler,0);
+#endif
 		dgnc_poll_time = jiffies + dgnc_jiffies_from_ms(dgnc_poll_tick);
 		dgnc_poll_timer.expires = dgnc_poll_time;
 		DGNC_UNLOCK(dgnc_poll_lock, flags);
 
 		add_timer(&dgnc_poll_timer);
@@ -862,11 +870,15 @@ static void dgnc_do_remap(struct board_t
 *    waiter needs to be woken up, and (b) whether the poller needs to
 *    be rescheduled.
 *
 ******************************************************************************/
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
 static void dgnc_poll_handler(ulong dummy)
+#else
+static void dgnc_poll_handler(struct timer_list *dummy)
+#endif
 {
         struct board_t *brd;
         unsigned long lock_flags;
 	int i;
 	unsigned long new_time;
@@ -912,13 +924,17 @@ schedule_poller:
 
 	if ((ulong) new_time >= 2 * dgnc_poll_tick) {
 		dgnc_poll_time = jiffies +  dgnc_jiffies_from_ms(dgnc_poll_tick);
 	}
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
 	init_timer(&dgnc_poll_timer);
 	dgnc_poll_timer.function = dgnc_poll_handler;
 	dgnc_poll_timer.data = 0;
+#else
+	timer_setup(&dgnc_poll_timer,dgnc_poll_handler,0);
+#endif
 	dgnc_poll_timer.expires = dgnc_poll_time;
 	DGNC_UNLOCK(dgnc_poll_lock, lock_flags);
 
 	if (!dgnc_poll_stop)
 		add_timer(&dgnc_poll_timer);
@@ -941,11 +957,15 @@ static void dgnc_init_globals(void)
 
 	for (i = 0; i < MAXBOARDS; i++) {
 		dgnc_Board[i] = NULL;
 	}
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
 	init_timer(&dgnc_poll_timer);
+#else
+	timer_setup(&dgnc_poll_timer,NULL,0);
+#endif
 }
 
 
 /************************************************************************
  *