Initial cut of the open ath9k htc firmware.
[open-ath9k-htc-firmware.git] / target_firmware / magpie_fw_dev / target / adf / adf_os_types_pvt.h
1 #ifndef __ADF_OS_TYPES_PVT_H
2 #define __ADF_OS_TYPES_PVT_H
3
4 #include <stddef.h>
5 #include <osapi.h>
6 //#include "cmnos_api.h"
7 //#include "Magpie_api.h"
8 #include <vbuf_api.h>
9
10 #define __ADF_OS_MAX_SCATTER    1
11 #define __adf_os_packed         __attribute__((__packed__))
12 #define __ADF_OS_NAME_SIZE      10
13
14 /*
15  * Private definitions of general data types
16  */
17 /**
18  * Endian-ness
19  */
20 #undef ADF_LITTLE_ENDIAN_MACHINE
21 #undef ADF_BIG_ENDIAN_MACHINE
22
23 //#if (_BYTE_ORDER == _LITTLE_ENDIAN)
24 #ifdef LITTLE_ENDIAN
25 #define ADF_LITTLE_ENDIAN_MACHINE
26 //#elif (_BYTE_ORDER == _BIG_ENDIAN)
27 #elif BIG_ENDIAN
28 #define ADF_BIG_ENDIAN_MACHINE
29 #endif
30
31 /**
32  * CACHE-SYNC (DMA)
33  */
34 #define __ADF_SYNC_PREREAD         0 
35 #define __ADF_SYNC_POSTREAD                1
36 #define __ADF_SYNC_PREWRITE                2
37 #define __ADF_SYNC_POSTWRITE       3
38
39 #define __ADF_OS_DMA_TO_DEVICE     0
40 #define __ADF_OS_DMA_FROM_DEVICE   1 
41       
42
43 struct __adf_softc;
44
45
46 enum __adf_net_wireless_evcode{
47     __ADF_IEEE80211_ASSOC = 100,
48     __ADF_IEEE80211_REASSOC = 101,
49     __ADF_IEEE80211_DISASSOC = 102,
50     __ADF_IEEE80211_JOIN = 103,
51     __ADF_IEEE80211_LEAVE = 104,
52     __ADF_IEEE80211_SCAN = 105,
53     __ADF_IEEE80211_REPLAY = 106,
54     __ADF_IEEE80211_MICHAEL = 107,
55     __ADF_IEEE80211_REJOIN = 108, 
56     __ADF_CUSTOM_PUSH_BUTTON = 109,
57 };
58
59 /* generic data types */
60 struct __adf_device  {
61 int dummy;    
62 }; 
63
64 typedef struct __adf_device *__adf_os_device_t;
65
66
67 struct __adf_dma_map {
68     VBUF *buf;
69     
70     A_UINT32 *ds_addr;
71     A_UINT16 ds_len;
72 }; 
73
74 typedef struct __adf_dma_map *__adf_os_dma_map_t;
75
76 typedef A_UINT32      __adf_os_dma_addr_t;
77 typedef A_UINT32      __adf_os_dma_size_t;
78
79 typedef unsigned int            __adf_os_size_t;
80 typedef int             __adf_os_off_t;
81
82 #define __adf_os_iomem_t
83
84 #if 0
85 typedef int           __a_uint8_t;    
86 typedef int            __a_int8_t;     
87 typedef int          __a_uint16_t;   
88 typedef int           __a_int16_t;    
89 typedef int          __a_uint32_t;   
90 typedef int           __a_int32_t;    
91 typedef int          __a_uint64_t;   
92 typedef int           __a_int64_t; 
93 #else
94 typedef A_UINT8           __a_uint8_t;
95 typedef A_INT8            __a_int8_t;     
96 typedef A_UINT16          __a_uint16_t;   
97 typedef A_INT16          __a_int16_t;    
98 typedef A_UINT32          __a_uint32_t;   
99 typedef A_INT32          __a_int32_t;    
100 typedef A_UINT64          __a_uint64_t;   
101 typedef A_INT64           __a_int64_t;    
102
103 typedef A_UINT32            u_int32_t;
104 typedef A_UINT16            u_int16_t;
105 typedef A_UINT8             u_int8_t;
106 typedef unsigned int        u_int;
107 typedef unsigned long        u_long;
108 //typedef __adf_os_size_t        size_t;
109
110 typedef A_UINT64            u_int64_t;
111
112 #endif
113
114 //extern void my_printf(struct ath_hal *ah, const char* fmt, ...);
115
116 //#define __adf_os_print        my_printf
117 #define __adf_os_print          A_PRINTF
118
119 #if 1  
120 #if defined(__XCC__)
121 #include "stdarg.h"
122 #define __va_list __gnuc_va_list
123 #endif
124 #endif
125
126 /* For compiling WLAN drivers */
127 #define IFNAMSIZ                                10
128 #define ENXIO                                           -1
129 #define ENOMEM                                          -1
130 #define EIO                                             -1
131 #define caddr_t                                         int
132 #define ENODEV                                          -1
133 #define EOPNOTSUPP                                      -1
134 #define KASSERT(exp, msg)
135
136 #if 0
137 #ifndef __packed
138 #define __packed    __attribute__((__packed__))
139 #endif
140
141 #ifndef roundup
142 #define roundup(x, y)   ((((x)+((y)-1))/(y))*(y))  /* to any y */
143 #endif
144 #endif
145
146 #endif