rtl8188eu: Updates for timer changes in kernel 4.15

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2017-12-05 16:03:03 -06:00
parent e472b5d684
commit 1f08a062ad
13 changed files with 196 additions and 7 deletions

View file

@ -26,9 +26,17 @@
/* Callback function of LED BlinkTimer, */
/* it just schedules to corresponding BlinkWorkItem/led_blink_hdl */
/* */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
void BlinkTimerCallback(struct timer_list *t)
#else
void BlinkTimerCallback(void *data)
#endif
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
struct LED_871x *pLed = from_timer(pLed, t, BlinkTimer);
#else
struct LED_871x *pLed = (struct LED_871x *)data;
#endif
struct adapter *padapter = pLed->padapter;
if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped))
@ -78,8 +86,11 @@ void InitLed871x(struct adapter *padapter, struct LED_871x *pLed, enum LED_PIN_8
ResetLedStatus(pLed);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
timer_setup(&pLed->BlinkTimer, BlinkTimerCallback, 0);
#else
_init_timer(&(pLed->BlinkTimer), padapter->pnetdev, BlinkTimerCallback, pLed);
#endif
_init_workitem(&(pLed->BlinkWorkItem), BlinkWorkItemCallback, pLed);
}