2 *************************************************************************
4 * 5F., No.36, Taiyuan St., Jhubei City,
8 * (c) Copyright 2002-2007, Ralink Technology, Inc.
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
15 * This program is distributed in the hope that it will be useful, *
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18 * GNU General Public License for more details. *
20 * You should have received a copy of the GNU General Public License *
21 * along with this program; if not, write to the *
22 * Free Software Foundation, Inc., *
23 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
25 *************************************************************************
31 Ralink Wireless Driver timer related data structures and delcarations
35 -------- ---------- ----------------------------------------------
36 Name Date Modification logs
37 Shiang Tu Aug-28-2008 init version
41 #ifndef __RTMP_TIMER_H__
42 #define __RTMP_TIMER_H__
46 #define DECLARE_TIMER_FUNCTION(_func) \
47 void rtmp_timer_##_func(unsigned long data)
49 #define GET_TIMER_FUNCTION(_func) \
52 /* ----------------- Timer Related MARCO ---------------*/
53 /* In some os or chipset, we have a lot of timer functions and will read/write register, */
54 /* it's not allowed in Linux USB sub-system to do it ( because of sleep issue when */
55 /* submit to ctrl pipe). So we need a wrapper function to take care it. */
57 #ifdef RTMP_TIMER_TASK_SUPPORT
58 typedef void(*RTMP_TIMER_TASK_HANDLE
) (void *SystemSpecific1
,
59 void *FunctionContext
,
60 void *SystemSpecific2
,
61 void *SystemSpecific3
);
62 #endif /* RTMP_TIMER_TASK_SUPPORT // */
64 struct rt_ralink_timer
{
65 struct timer_list TimerObj
; /* Ndis Timer object */
66 BOOLEAN Valid
; /* Set to True when call RTMPInitTimer */
67 BOOLEAN State
; /* True if timer cancelled */
68 BOOLEAN PeriodicType
; /* True if timer is periodic timer */
69 BOOLEAN Repeat
; /* True if periodic timer */
70 unsigned long TimerValue
; /* Timer value in milliseconds */
71 unsigned long cookie
; /* os specific object */
72 #ifdef RTMP_TIMER_TASK_SUPPORT
73 RTMP_TIMER_TASK_HANDLE handle
;
75 #endif /* RTMP_TIMER_TASK_SUPPORT // */
78 #ifdef RTMP_TIMER_TASK_SUPPORT
79 struct rt_rtmp_timer_task_entry
{
80 struct rt_ralink_timer
*pRaTimer
;
81 struct rt_rtmp_timer_task_entry
*pNext
;
84 #define TIMER_QUEUE_SIZE_MAX 128
85 struct rt_rtmp_timer_task_queue
{
87 unsigned char *pTimerQPoll
;
88 struct rt_rtmp_timer_task_entry
*pQPollFreeList
;
89 struct rt_rtmp_timer_task_entry
*pQHead
;
90 struct rt_rtmp_timer_task_entry
*pQTail
;
93 #define BUILD_TIMER_FUNCTION(_func) \
94 void rtmp_timer_##_func(unsigned long data) \
96 struct rt_ralink_timer *_pTimer = (struct rt_ralink_timer *)data; \
97 struct rt_rtmp_timer_task_entry *_pQNode; \
98 struct rt_rtmp_adapter *_pAd; \
100 _pTimer->handle = _func; \
101 _pAd = (struct rt_rtmp_adapter *)_pTimer->pAd; \
102 _pQNode = RtmpTimerQInsert(_pAd, _pTimer); \
103 if ((_pQNode == NULL) && (_pAd->TimerQ.status & RTMP_TASK_CAN_DO_INSERT)) \
104 RTMP_OS_Add_Timer(&_pTimer->TimerObj, OS_HZ); \
107 #define BUILD_TIMER_FUNCTION(_func) \
108 void rtmp_timer_##_func(unsigned long data) \
110 struct rt_ralink_timer *pTimer = (struct rt_ralink_timer *)data; \
112 _func(NULL, (void *)pTimer->cookie, NULL, pTimer); \
113 if (pTimer->Repeat) \
114 RTMP_OS_Add_Timer(&pTimer->TimerObj, pTimer->TimerValue); \
116 #endif /* RTMP_TIMER_TASK_SUPPORT // */
118 DECLARE_TIMER_FUNCTION(MlmePeriodicExec
);
119 DECLARE_TIMER_FUNCTION(MlmeRssiReportExec
);
120 DECLARE_TIMER_FUNCTION(AsicRxAntEvalTimeout
);
121 DECLARE_TIMER_FUNCTION(APSDPeriodicExec
);
122 DECLARE_TIMER_FUNCTION(AsicRfTuningExec
);
124 DECLARE_TIMER_FUNCTION(BeaconUpdateExec
);
125 #endif /* RTMP_MAC_USB // */
127 DECLARE_TIMER_FUNCTION(BeaconTimeout
);
128 DECLARE_TIMER_FUNCTION(ScanTimeout
);
129 DECLARE_TIMER_FUNCTION(AuthTimeout
);
130 DECLARE_TIMER_FUNCTION(AssocTimeout
);
131 DECLARE_TIMER_FUNCTION(ReassocTimeout
);
132 DECLARE_TIMER_FUNCTION(DisassocTimeout
);
133 DECLARE_TIMER_FUNCTION(LinkDownExec
);
134 DECLARE_TIMER_FUNCTION(StaQuickResponeForRateUpExec
);
135 DECLARE_TIMER_FUNCTION(WpaDisassocApAndBlockAssoc
);
136 DECLARE_TIMER_FUNCTION(PsPollWakeExec
);
137 DECLARE_TIMER_FUNCTION(RadioOnExec
);
140 DECLARE_TIMER_FUNCTION(RtmpUsbStaAsicForceWakeupTimeout
);
141 #endif /* RTMP_MAC_USB // */
143 #if defined(AP_LED) || defined(STA_LED)
144 DECLARE_TIMER_FUNCTION(LedCtrlMain
);
147 #endif /* __RTMP_TIMER_H__ // */