Initial cut of the open ath9k htc firmware.
[open-ath9k-htc-firmware.git] / target_firmware / magpie_fw_dev / target / adf / adf_os_time_pvt.h
1 #ifndef _ADF_OS_TIME_PVT_H
2 #define _ADF_OS_TIME_PVT_H
3
4 #include <cmnos_api.h>
5 #include "Magpie_api.h"
6
7 /**
8  * @brief this code is modified version of tvtohz(9) which
9  *        returns signed int which we don't require, hence we
10  *        got rid of the type casting thing
11  * 
12  * @return unsigned long
13  */
14 static inline unsigned long
15 __adf_os_ticks(void)
16 {
17     return MSEC_TO_TICK(A_MILLISECONDS());
18 }
19 static inline a_uint32_t
20 __adf_os_ticks_to_msecs(unsigned long ticks)
21 {
22         return TICK_TO_MSEC(ticks);
23 }
24 static inline unsigned long
25 __adf_os_msecs_to_ticks(a_uint32_t msecs)
26 {
27         return MSEC_TO_TICK(msecs);
28 }
29 static inline unsigned long
30 __adf_os_getuptime(void)
31 {
32     return MSEC_TO_TICK(A_MILLISECONDS());;      
33 }
34
35 static inline void
36 __adf_os_udelay(int usecs)
37 {
38     A_DELAY_USECS(usecs);
39 }
40
41 static inline void
42 __adf_os_mdelay(int msecs)
43 {
44     A_DELAY_USECS(msecs*1000);
45 }
46
47 #endif