upload tizen1.0 source
[kernel/linux-2.6.36.git] / drivers / net / wireless / bcm4330 / src / include / typedefs.h
1 /*
2  * Copyright (C) 1999-2011, Broadcom Corporation
3  * 
4  *         Unless you and Broadcom execute a separate written software license
5  * agreement governing use of this software, this software is licensed to you
6  * under the terms of the GNU General Public License version 2 (the "GPL"),
7  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
8  * following added to such license:
9  * 
10  *      As a special exception, the copyright holders of this software give you
11  * permission to link this software with independent modules, and to copy and
12  * distribute the resulting executable under terms of your choice, provided that
13  * you also meet, for each linked independent module, the terms and conditions of
14  * the license of that module.  An independent module is a module which is not
15  * derived from this software.  The special exception does not apply to any
16  * modifications of the software.
17  * 
18  *      Notwithstanding the above, under no circumstances may you combine this
19  * software in any way with any other Broadcom software provided under a license
20  * other than the GPL, without Broadcom's express prior written consent.
21  * $Id: typedefs.h,v 1.103.2.1 2010-05-11 18:19:28 $
22  */
23
24 #ifndef _TYPEDEFS_H_
25 #define _TYPEDEFS_H_
26
27 #ifdef SITE_TYPEDEFS
28
29 /*
30  * Define SITE_TYPEDEFS in the compile to include a site-specific
31  * typedef file "site_typedefs.h".
32  *
33  * If SITE_TYPEDEFS is not defined, then the code section below makes
34  * inferences about the compile environment based on defined symbols and
35  * possibly compiler pragmas.
36  *
37  * Following these two sections is the Default Typedefs section.
38  * This section is only processed if USE_TYPEDEF_DEFAULTS is
39  * defined. This section has a default set of typedefs and a few
40  * preprocessor symbols (TRUE, FALSE, NULL, ...).
41  */
42
43 #include "site_typedefs.h"
44
45 #else
46
47 /*
48  * Infer the compile environment based on preprocessor symbols and pragmas.
49  * Override type definitions as needed, and include configuration-dependent
50  * header files to define types.
51  */
52
53 #ifdef __cplusplus
54
55 #define TYPEDEF_BOOL
56 #ifndef FALSE
57 #define FALSE   false
58 #endif
59 #ifndef TRUE
60 #define TRUE    true
61 #endif
62
63 #else   /* ! __cplusplus */
64
65
66 #endif  /* ! __cplusplus */
67
68 #if defined(__x86_64__)
69 #define TYPEDEF_UINTPTR
70 typedef unsigned long long int uintptr;
71 #endif
72
73
74
75
76
77 #if defined(_NEED_SIZE_T_)
78 typedef long unsigned int size_t;
79 #endif
80
81
82
83
84
85 #if defined(__sparc__)
86 #define TYPEDEF_ULONG
87 #endif
88
89
90 /*
91  * If this is either a Linux hybrid build or the per-port code of a hybrid build
92  * then use the Linux header files to get some of the typedefs.  Otherwise, define
93  * them entirely in this file.  We can't always define the types because we get
94  * a duplicate typedef error; there is no way to "undefine" a typedef.
95  * We know when it's per-port code because each file defines LINUX_PORT at the top.
96  */
97 #if !defined(LINUX_HYBRID) || defined(LINUX_PORT)
98 #define TYPEDEF_UINT
99 #ifndef TARGETENV_android
100 #define TYPEDEF_USHORT
101 #define TYPEDEF_ULONG
102 #endif /* TARGETENV_android */
103 #ifdef __KERNEL__
104 #include <linux/version.h>
105 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19))
106 #define TYPEDEF_BOOL
107 #endif  /* >= 2.6.19 */
108 #endif  /* __KERNEL__ */
109 #endif  /* !defined(LINUX_HYBRID) || defined(LINUX_PORT) */
110
111
112
113
114 /* Do not support the (u)int64 types with strict ansi for GNU C */
115 #if defined(__GNUC__) && defined(__STRICT_ANSI__)
116 #define TYPEDEF_INT64
117 #define TYPEDEF_UINT64
118 #endif
119
120 /* ICL accepts unsigned 64 bit type only, and complains in ANSI mode
121  * for signed or unsigned
122  */
123 #if defined(__ICL)
124
125 #define TYPEDEF_INT64
126
127 #if defined(__STDC__)
128 #define TYPEDEF_UINT64
129 #endif
130
131 #endif /* __ICL */
132
133 #if !defined(__DJGPP__)
134
135 /* pick up ushort & uint from standard types.h */
136 #if defined(__KERNEL__)
137
138 /* See note above */
139 #if !defined(LINUX_HYBRID) || defined(LINUX_PORT)
140 #include <linux/types.h>        /* sys/types.h and linux/types.h are oil and water */
141 #endif /* !defined(LINUX_HYBRID) || defined(LINUX_PORT) */
142
143 #else
144
145
146 #include <sys/types.h>
147
148 #endif /* linux && __KERNEL__ */
149
150 #endif 
151
152
153
154 /* use the default typedefs in the next section of this file */
155 #define USE_TYPEDEF_DEFAULTS
156
157 #endif /* SITE_TYPEDEFS */
158
159
160 /*
161  * Default Typedefs
162  */
163
164 #ifdef USE_TYPEDEF_DEFAULTS
165 #undef USE_TYPEDEF_DEFAULTS
166
167 #ifndef TYPEDEF_BOOL
168 typedef /* @abstract@ */ unsigned char  bool;
169 #endif
170
171 /* define uchar, ushort, uint, ulong */
172
173 #ifndef TYPEDEF_UCHAR
174 typedef unsigned char   uchar;
175 #endif
176
177 #ifndef TYPEDEF_USHORT
178 typedef unsigned short  ushort;
179 #endif
180
181 #ifndef TYPEDEF_UINT
182 typedef unsigned int    uint;
183 #endif
184
185 #ifndef TYPEDEF_ULONG
186 typedef unsigned long   ulong;
187 #endif
188
189 /* define [u]int8/16/32/64, uintptr */
190
191 #ifndef TYPEDEF_UINT8
192 typedef unsigned char   uint8;
193 #endif
194
195 #ifndef TYPEDEF_UINT16
196 typedef unsigned short  uint16;
197 #endif
198
199 #ifndef TYPEDEF_UINT32
200 typedef unsigned int    uint32;
201 #endif
202
203 #ifndef TYPEDEF_UINT64
204 typedef unsigned long long uint64;
205 #endif
206
207 #ifndef TYPEDEF_UINTPTR
208 typedef unsigned int    uintptr;
209 #endif
210
211 #ifndef TYPEDEF_INT8
212 typedef signed char     int8;
213 #endif
214
215 #ifndef TYPEDEF_INT16
216 typedef signed short    int16;
217 #endif
218
219 #ifndef TYPEDEF_INT32
220 typedef signed int      int32;
221 #endif
222
223 #ifndef TYPEDEF_INT64
224 typedef signed long long int64;
225 #endif
226
227 /* define float32/64, float_t */
228
229 #ifndef TYPEDEF_FLOAT32
230 typedef float           float32;
231 #endif
232
233 #ifndef TYPEDEF_FLOAT64
234 typedef double          float64;
235 #endif
236
237 /*
238  * abstracted floating point type allows for compile time selection of
239  * single or double precision arithmetic.  Compiling with -DFLOAT32
240  * selects single precision; the default is double precision.
241  */
242
243 #ifndef TYPEDEF_FLOAT_T
244
245 #if defined(FLOAT32)
246 typedef float32 float_t;
247 #else /* default to double precision floating point */
248 typedef float64 float_t;
249 #endif
250
251 #endif /* TYPEDEF_FLOAT_T */
252
253 /* define macro values */
254
255 #ifndef FALSE
256 #define FALSE   0
257 #endif
258
259 #ifndef TRUE
260 #define TRUE    1  /* TRUE */
261 #endif
262
263 #ifndef NULL
264 #define NULL    0
265 #endif
266
267 #ifndef OFF
268 #define OFF     0
269 #endif
270
271 #ifndef ON
272 #define ON      1  /* ON = 1 */
273 #endif
274
275 #define AUTO    (-1) /* Auto = -1 */
276
277 /* define PTRSZ, INLINE */
278
279 #ifndef PTRSZ
280 #define PTRSZ   sizeof(char*)
281 #endif
282
283
284 /* Detect compiler type. */
285 #if defined(__GNUC__)
286         #define BWL_COMPILER_GNU
287 #elif defined(__CC_ARM) && __CC_ARM
288         #define BWL_COMPILER_ARMCC
289 #else
290         #error "Unknown compiler!"
291 #endif 
292
293
294 #ifndef INLINE
295         #if defined(BWL_COMPILER_MICROSOFT)
296                 #define INLINE __inline
297         #elif defined(BWL_COMPILER_GNU)
298                 #define INLINE __inline__
299         #elif defined(BWL_COMPILER_ARMCC)
300                 #define INLINE  __inline
301         #else
302                 #define INLINE
303         #endif /* _MSC_VER */
304 #endif /* INLINE */
305
306 #undef TYPEDEF_BOOL
307 #undef TYPEDEF_UCHAR
308 #undef TYPEDEF_USHORT
309 #undef TYPEDEF_UINT
310 #undef TYPEDEF_ULONG
311 #undef TYPEDEF_UINT8
312 #undef TYPEDEF_UINT16
313 #undef TYPEDEF_UINT32
314 #undef TYPEDEF_UINT64
315 #undef TYPEDEF_UINTPTR
316 #undef TYPEDEF_INT8
317 #undef TYPEDEF_INT16
318 #undef TYPEDEF_INT32
319 #undef TYPEDEF_INT64
320 #undef TYPEDEF_FLOAT32
321 #undef TYPEDEF_FLOAT64
322 #undef TYPEDEF_FLOAT_T
323
324 #endif /* USE_TYPEDEF_DEFAULTS */
325
326 /* Suppress unused parameter warning */
327 #define UNUSED_PARAMETER(x) (void)(x)
328
329 /*
330  * Including the bcmdefs.h here, to make sure everyone including typedefs.h
331  * gets this automatically
332 */
333 #include <bcmdefs.h>
334 #endif /* _TYPEDEFS_H_ */