]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - drivers/staging/wilc1000/wilc_timer.c
staging: wilc1000: remove tstrWILC_TimerAttrs typedef
[karo-tx-linux.git] / drivers / staging / wilc1000 / wilc_timer.c
1
2 #include "wilc_timer.h"
3
4 WILC_ErrNo WILC_TimerCreate(struct timer_list *pHandle,
5         tpfWILC_TimerFunction pfCallback)
6 {
7         WILC_ErrNo s32RetStatus = WILC_SUCCESS;
8         setup_timer(pHandle, (void(*)(unsigned long))pfCallback, 0);
9
10         return s32RetStatus;
11 }
12
13 WILC_ErrNo WILC_TimerDestroy(struct timer_list *pHandle)
14 {
15         WILC_ErrNo s32RetStatus = WILC_FAIL;
16         if (pHandle != NULL) {
17                 s32RetStatus = del_timer_sync(pHandle);
18                 pHandle = NULL;
19         }
20
21         return s32RetStatus;
22 }
23
24
25 WILC_ErrNo WILC_TimerStart(struct timer_list *pHandle, u32 u32Timeout,
26         void *pvArg)
27 {
28         WILC_ErrNo s32RetStatus = WILC_FAIL;
29         if (pHandle != NULL) {
30                 pHandle->data = (unsigned long)pvArg;
31                 s32RetStatus = mod_timer(pHandle, (jiffies + msecs_to_jiffies(u32Timeout)));
32         }
33         return s32RetStatus;
34 }
35
36 WILC_ErrNo WILC_TimerStop(struct timer_list *pHandle)
37 {
38         WILC_ErrNo s32RetStatus = WILC_FAIL;
39         if (pHandle != NULL)
40                 s32RetStatus = del_timer(pHandle);
41
42         return s32RetStatus;
43 }