]> git.proxmox.com Git - pve-kernel.git/blob - patches/intel/e1000e/e1000e_4.15-new-timer.patch
renenable out-of-tree intel ethernet driver (e1000e, igb, ixgbe)
[pve-kernel.git] / patches / intel / e1000e / e1000e_4.15-new-timer.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 Date: Tue, 5 Jun 2018 11:16:29 +0200
4 Subject: [PATCH] port to new internal kernel timer API
5
6 Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 ---
8 diff --git a/src/netdev.c b/src/netdev.c
9 --- a/src/netdev.c
10 +++ b/src/netdev.c
11 @@ -5389,9 +5389,10 @@
12 * Need to wait a few seconds after link up to get diagnostic information from
13 * the phy
14 **/
15 -static void e1000_update_phy_info(unsigned long data)
16 +static void e1000_update_phy_info(struct timer_list *t)
17 {
18 - struct e1000_adapter *adapter = (struct e1000_adapter *)data;
19 + struct e1000_adapter *adapter;
20 + adapter = from_timer(adapter, t, phy_info_timer);
21
22 if (test_bit(__E1000_DOWN, &adapter->state))
23 return;
24 @@ -5774,9 +5775,10 @@
25 * e1000_watchdog - Timer Call-back
26 * @data: pointer to adapter cast into an unsigned long
27 **/
28 -static void e1000_watchdog(unsigned long data)
29 +static void e1000_watchdog(struct timer_list *t)
30 {
31 - struct e1000_adapter *adapter = (struct e1000_adapter *)data;
32 + struct e1000_adapter *adapter;
33 + adapter = from_timer(adapter, t, watchdog_timer);
34
35 /* Do the rest outside of interrupt context */
36 schedule_work(&adapter->watchdog_task);
37 @@ -8348,13 +8348,9 @@
38 goto err_eeprom;
39 }
40
41 - init_timer(&adapter->watchdog_timer);
42 - adapter->watchdog_timer.function = e1000_watchdog;
43 - adapter->watchdog_timer.data = (unsigned long)adapter;
44 -
45 - init_timer(&adapter->phy_info_timer);
46 - adapter->phy_info_timer.function = e1000_update_phy_info;
47 - adapter->phy_info_timer.data = (unsigned long)adapter;
48 + timer_setup(&adapter->watchdog_timer, e1000_watchdog, 0);
49 +
50 + timer_setup(&adapter->phy_info_timer, e1000_update_phy_info, 0);
51
52 INIT_WORK(&adapter->reset_task, e1000_reset_task);
53 INIT_WORK(&adapter->watchdog_task, e1000_watchdog_task);