rtl8188eu: Fix some build problems

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2018-03-14 10:45:07 -05:00
parent 2d546792fc
commit add1bba8bc
3 changed files with 25 additions and 5 deletions

View file

@ -309,9 +309,19 @@ exit:
return; return;
} }
static void pwr_state_check_handler(void *FunctionContext) #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
void pwr_state_check_handler(RTW_TIMER_HDL_ARGS)
#else
void pwr_state_check_handler(struct timer_list *t)
#endif
{ {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
struct adapter *padapter = (struct adapter *)FunctionContext; struct adapter *padapter = (struct adapter *)FunctionContext;
#else
struct dvobj_priv *dvobj = from_timer(dvobj, t, pwrctl_priv.pwr_state_check_timer);
struct adapter *padapter = dvobj->
#endif
rtw_ps_cmd(padapter); rtw_ps_cmd(padapter);
} }
@ -693,7 +703,11 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter)
pwrctrlpriv->btcoex_rfon = false; pwrctrlpriv->btcoex_rfon = false;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
_init_timer(&(pwrctrlpriv->pwr_state_check_timer), padapter->pnetdev, pwr_state_check_handler, (u8 *)padapter); _init_timer(&(pwrctrlpriv->pwr_state_check_timer), padapter->pnetdev, pwr_state_check_handler, (u8 *)padapter);
#else
timer_setup(&pwrctrlpriv->pwr_state_check_timer, pwr_state_check_handler, 0);
#endif
} }
void rtw_free_pwrctrl_priv(struct adapter *adapter) void rtw_free_pwrctrl_priv(struct adapter *adapter)

View file

@ -20,6 +20,10 @@
#ifndef __OSDEP_SERVICE_H_ #ifndef __OSDEP_SERVICE_H_
#define __OSDEP_SERVICE_H_ #define __OSDEP_SERVICE_H_
#include <linux/version.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
#include <linux/sched/signal.h>
#endif
#include <drv_conf.h> #include <drv_conf.h>
#include <basic_types.h> #include <basic_types.h>
@ -202,12 +206,14 @@ __inline static void rtw_list_delete(struct list_head *plist)
list_del_init(plist); list_del_init(plist);
} }
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
__inline static void _init_timer(struct timer_list *ptimer,struct net_device * nic_hdl,void *pfunc,void* cntx) __inline static void _init_timer(struct timer_list *ptimer,struct net_device * nic_hdl,void *pfunc,void* cntx)
{ {
ptimer->function = pfunc; ptimer->function = pfunc;
ptimer->data = (unsigned long)cntx; ptimer->data = (unsigned long)cntx;
init_timer(ptimer); init_timer(ptimer);
} }
#endif
__inline static void _set_timer(struct timer_list *ptimer,u32 delay_time) __inline static void _set_timer(struct timer_list *ptimer,u32 delay_time)
{ {