Revert "cpmodem_shim: Update driver to new timer interface"
This reverts commit 2e2e7b34b23b441f408d5fa77733b14c849fcba1.
Need to move the master branch back to v4.4.100 now that the changes on
on the feature/kernel-5.4-upgrade branch
Change-Id: Ica1fe50ea3e4d993d81816cf5f83de119b003de1
diff --git a/cpmodem_shim/cpmodem_shim_main.c b/cpmodem_shim/cpmodem_shim_main.c
index e5bb813..0ad3061 100755
--- a/cpmodem_shim/cpmodem_shim_main.c
+++ b/cpmodem_shim/cpmodem_shim_main.c
@@ -790,9 +790,9 @@
CP_LKM_STUCK_DEINIT
};
static void cp_lkm_usb_stuck_check(struct cp_lkm_usb_base_dev* cpbdev, int action);
-static void cp_lkm_usb_pause_stuck_timer(struct timer_list *timer);
+static void cp_lkm_usb_pause_stuck_timer(unsigned long param);
-static void cp_lkm_usb_delay_timer (struct timer_list *timer);
+static void cp_lkm_usb_delay_timer (unsigned long param);
static void cp_lkm_usb_kevent (struct work_struct *work);
static int cp_lkm_usb_open(struct cp_lkm_common_ctx *ctx);
static int cp_lkm_usb_close(struct cp_lkm_common_ctx *ctx);
@@ -1651,7 +1651,10 @@
cpbdev->processing_state = USB_PROCESS_STATE_IDLE;
cpbdev->other_state = USB_PROCESS_STATE_IDLE;
INIT_WORK(&cpbdev->kevent, cp_lkm_usb_kevent);
- timer_setup(&cpbdev->rx_delay, cp_lkm_usb_delay_timer, 0);
+
+ cpbdev->rx_delay.function = cp_lkm_usb_delay_timer; //TODO: this needs to handle the cpdev or cpbdev??
+ cpbdev->rx_delay.data = (unsigned long) cpbdev; //????? should this be cpdev??
+ init_timer (&cpbdev->rx_delay);
cpbdev->data_process_tasklet.func = cp_lkm_usb_process_data_done_tasklet; //TODO: modify to take cpbdev
cpbdev->data_process_tasklet.data = (unsigned long) cpbdev;
@@ -2501,12 +2504,11 @@
//
// The whole purpose of this function is to pump the system if it is otherwise idle. If
// it isn't idle, we can count on those processes to call cp_lkm_schedule_rx_restock when done.
-static void cp_lkm_usb_delay_timer (struct timer_list *timer)
+static void cp_lkm_usb_delay_timer (unsigned long param)
{
unsigned long flags;
- struct cp_lkm_usb_base_dev* cpbdev = from_timer(cpbdev,timer,rx_delay);
-
+ struct cp_lkm_usb_base_dev* cpbdev = (struct cp_lkm_usb_base_dev *)param;
spin_lock_irqsave(&cpbdev->processing_state_lock, flags);
if(cpbdev->processing_state == USB_PROCESS_STATE_IDLE){
cp_lkm_schedule_rx_restock(cpbdev,NULL);
@@ -2542,7 +2544,9 @@
//g_stuck_chk++;
switch(action) {
case CP_LKM_STUCK_INIT:
- timer_setup(&cpbdev->usb_pause_stuck_timer, cp_lkm_usb_pause_stuck_timer, 0);
+ cpbdev->usb_pause_stuck_timer.function = cp_lkm_usb_pause_stuck_timer;
+ cpbdev->usb_pause_stuck_timer.data = (unsigned long)cpbdev;
+ init_timer(&cpbdev->usb_pause_stuck_timer);
break;
case CP_LKM_STUCK_START:
mod_timer(&cpbdev->usb_pause_stuck_timer, jiffies + msecs_to_jiffies(3000));
@@ -2560,9 +2564,9 @@
// If we detect that it is stuck (if the tx has been paused for more than 3 seconds) then we cancel the
// struck urb and this gets things going again. The cancelled urb results in a dropped packet which is undesirable,
// but preferrable to being stuck.
-static void cp_lkm_usb_pause_stuck_timer (struct timer_list *timer)
+static void cp_lkm_usb_pause_stuck_timer (unsigned long param)
{
- struct cp_lkm_usb_base_dev* cpbdev = from_timer(cpbdev,timer,usb_pause_stuck_timer);
+ struct cp_lkm_usb_base_dev* cpbdev = (struct cp_lkm_usb_base_dev *)param;
struct skb_data *entry;
struct sk_buff *skb;
struct urb *urb = NULL;
@@ -2777,7 +2781,6 @@
work_done++;
tx_work_done++;
//fall through on purpose
- fallthrough;
case in_data_cleanup:
if(entry->urb) {
//cp_lkm_usb_urb_cnt(-1);
@@ -4507,7 +4510,7 @@
};
-static void cp_lkm_pm_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats)
+static struct rtnl_link_stats64 *cp_lkm_pm_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats)
{
struct cp_lkm_pm_net *pm_net;
int i;
@@ -4544,6 +4547,7 @@
stats->rx_over_errors += rx_over_errors;
}
+ return stats;
}
static int cp_lkm_pm_net_open(struct net_device *dev)