OLD | NEW |
1 /* | 1 //------------------------------------------------------------------------------ |
2 * This file contains the definitions of the basic atheros data types. | 2 // This file contains the definitions of the basic atheros data types. |
3 * It is used to map the data types in atheros files to a platform specific | 3 // It is used to map the data types in atheros files to a platform specific |
4 * type. | 4 // type. |
5 * | 5 // Copyright (c) 2004-2010 Atheros Communications Inc. |
6 * Copyright 2003-2005 Atheros Communications, Inc., All Rights Reserved. | 6 // All rights reserved. |
7 * | |
8 * | |
9 // This program is free software; you can redistribute it and/or modify | |
10 // it under the terms of the GNU General Public License version 2 as | |
11 // published by the Free Software Foundation; | |
12 // | 7 // |
13 // Software distributed under the License is distributed on an "AS | 8 // |
14 // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or | 9 // |
15 // implied. See the License for the specific language governing | 10 // Permission to use, copy, modify, and/or distribute this software for any |
16 // rights and limitations under the License. | 11 // purpose with or without fee is hereby granted, provided that the above |
| 12 // copyright notice and this permission notice appear in all copies. |
| 13 // |
| 14 // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 15 // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 16 // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 17 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 18 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 19 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 20 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
17 // | 21 // |
18 // | 22 // |
19 * | 23 // |
20 */ | 24 // Author(s): ="Atheros" |
| 25 //------------------------------------------------------------------------------ |
21 | 26 |
22 #ifndef _OSAPI_LINUX_H_ | 27 #ifndef _OSAPI_LINUX_H_ |
23 #define _OSAPI_LINUX_H_ | 28 #define _OSAPI_LINUX_H_ |
24 | 29 |
25 #ifdef __KERNEL__ | 30 #ifdef __KERNEL__ |
26 | 31 |
27 #include <linux/version.h> | 32 #include <linux/version.h> |
28 #include <linux/types.h> | 33 #include <linux/types.h> |
29 #include <linux/kernel.h> | 34 #include <linux/kernel.h> |
30 #include <linux/string.h> | 35 #include <linux/string.h> |
31 #include <linux/skbuff.h> | 36 #include <linux/skbuff.h> |
32 #include <linux/netdevice.h> | 37 #include <linux/netdevice.h> |
33 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) | |
34 #include <linux/jiffies.h> | 38 #include <linux/jiffies.h> |
35 #endif | |
36 #include <linux/timer.h> | 39 #include <linux/timer.h> |
37 #include <linux/delay.h> | 40 #include <linux/delay.h> |
38 #include <linux/wait.h> | 41 #include <linux/wait.h> |
39 #ifdef KERNEL_2_4 | 42 #include <linux/semaphore.h> |
40 #include <asm/arch/irq.h> | |
41 #include <asm/irq.h> | |
42 #endif | |
43 | |
44 #include <linux/cache.h> | 43 #include <linux/cache.h> |
45 | 44 |
46 #ifdef __GNUC__ | 45 #ifdef __GNUC__ |
47 #define __ATTRIB_PACK __attribute__ ((packed)) | 46 #define __ATTRIB_PACK __attribute__ ((packed)) |
48 #define __ATTRIB_PRINTF __attribute__ ((format (printf, 1, 2))) | 47 #define __ATTRIB_PRINTF __attribute__ ((format (printf, 1, 2))) |
49 #define __ATTRIB_NORETURN __attribute__ ((noreturn)) | 48 #define __ATTRIB_NORETURN __attribute__ ((noreturn)) |
50 #ifndef INLINE | 49 #ifndef INLINE |
51 #define INLINE __inline__ | 50 #define INLINE __inline__ |
52 #endif | 51 #endif |
53 #else /* Not GCC */ | 52 #else /* Not GCC */ |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 | 333 |
335 /* In linux, WLAN Rx and Tx run in different contexts, so no need to check | 334 /* In linux, WLAN Rx and Tx run in different contexts, so no need to check |
336 * for any commands/data queued for WLAN */ | 335 * for any commands/data queued for WLAN */ |
337 #define A_CHECK_DRV_TX() | 336 #define A_CHECK_DRV_TX() |
338 | 337 |
339 #define A_GET_CACHE_LINE_BYTES() L1_CACHE_BYTES | 338 #define A_GET_CACHE_LINE_BYTES() L1_CACHE_BYTES |
340 | 339 |
341 #define A_CACHE_LINE_PAD 128 | 340 #define A_CACHE_LINE_PAD 128 |
342 | 341 |
343 static inline void *A_ALIGN_TO_CACHE_LINE(void *ptr) { | 342 static inline void *A_ALIGN_TO_CACHE_LINE(void *ptr) { |
344 return (void *)L1_CACHE_ALIGN((A_UINT32)ptr); | 343 return (void *)L1_CACHE_ALIGN((unsigned long)ptr); |
345 } | 344 } |
346 | 345 |
347 #else /* __KERNEL__ */ | 346 #else /* __KERNEL__ */ |
348 | 347 |
349 #ifdef __GNUC__ | 348 #ifdef __GNUC__ |
350 #define __ATTRIB_PACK __attribute__ ((packed)) | 349 #define __ATTRIB_PACK __attribute__ ((packed)) |
351 #define __ATTRIB_PRINTF __attribute__ ((format (printf, 1, 2))) | 350 #define __ATTRIB_PRINTF __attribute__ ((format (printf, 1, 2))) |
352 #define __ATTRIB_NORETURN __attribute__ ((noreturn)) | 351 #define __ATTRIB_NORETURN __attribute__ ((noreturn)) |
353 #ifndef INLINE | 352 #ifndef INLINE |
354 #define INLINE __inline__ | 353 #define INLINE __inline__ |
(...skipping 24 matching lines...) Expand all Loading... |
379 fprintf(stderr, args); fprintf(stderr, ": %d\n", errno); \ | 378 fprintf(stderr, args); fprintf(stderr, ": %d\n", errno); \ |
380 exit(_s); } while (0) | 379 exit(_s); } while (0) |
381 #endif | 380 #endif |
382 #else | 381 #else |
383 #include <err.h> | 382 #include <err.h> |
384 #endif | 383 #endif |
385 | 384 |
386 #endif /* __KERNEL__ */ | 385 #endif /* __KERNEL__ */ |
387 | 386 |
388 #endif /* _OSAPI_LINUX_H_ */ | 387 #endif /* _OSAPI_LINUX_H_ */ |
OLD | NEW |