Skip to content

Commit

Permalink
Fixed compil for Linux >= 4.15
Browse files Browse the repository at this point in the history
  • Loading branch information
Viish committed Mar 7, 2018
1 parent 3d334db commit 0ecd3f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/os/rt_linux.h
Expand Up @@ -539,8 +539,11 @@ typedef struct tasklet_struct *POS_NET_TASK_STRUCT;
typedef struct timer_list OS_NDIS_MINIPORT_TIMER;
typedef struct timer_list OS_TIMER;

#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
typedef void (*TIMER_FUNCTION)(unsigned long);

#else
typedef void (*TIMER_FUNCTION)(struct timer_list *unused);
#endif

#define OS_WAIT(_time) \
{ \
Expand Down
4 changes: 4 additions & 0 deletions os/linux/rt_linux.c
Expand Up @@ -114,9 +114,13 @@ static inline VOID __RTMP_OS_Init_Timer(
IN PVOID data)
{
if (!timer_pending(pTimer)) {
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0)
init_timer(pTimer);
pTimer->data = (unsigned long)data;
pTimer->function = function;
#else
timer_setup(pTimer, function, 0);
#endif
}
}

Expand Down

0 comments on commit 0ecd3f8

Please sign in to comment.