2 * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer,
10 * without modification.
11 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
12 * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
13 * redistribution must be conditioned upon including a substantially
14 * similar Disclaimer requirement for further binary redistribution.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
20 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
21 * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
22 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27 * THE POSSIBILITY OF SUCH DAMAGES.
31 #ifndef _ATH_AH_OSDEP_H_
32 #define _ATH_AH_OSDEP_H_
34 * Atheros Hardware Access Layer (HAL) OS Dependent Definitions.
36 #include <sys/param.h>
39 * Bus i/o type definitions.
41 typedef void *HAL_SOFTC;
42 typedef int HAL_BUS_TAG;
43 typedef void *HAL_BUS_HANDLE;
45 #define OS_DELAY(_n) DELAY(_n)
46 #define OS_INLINE __inline
47 #define OS_MEMZERO(_a, _size) bzero((_a), (_size))
48 #define OS_MEMCPY(_dst, _src, _size) bcopy((_src), (_dst), (_size))
49 #define OS_MACEQU(_a, _b) \
50 (bcmp((_a), (_b), IEEE80211_ADDR_LEN) == 0)
53 extern u_int32_t OS_GETUPTIME(struct ath_hal *);
54 extern void OS_REG_WRITE(struct ath_hal *, u_int32_t, u_int32_t);
55 extern u_int32_t OS_REG_READ(struct ath_hal *, u_int32_t);
56 extern void OS_MARK(struct ath_hal *, u_int id, u_int32_t value);
57 #define OS_GETUPTIME(_ah) 0
58 #define OS_REG_WRITE(_ah, _reg, _val)
59 #define OS_REG_READ(_ah, _reg) 0
60 #define OS_MARK(_ah, _id, _v)
61 #define __packed __attribute__((__packed__))
64 * Linux/BSD gcc compatibility shims.
67 #define __printflike(_a,_b) \
68 __attribute__ ((__format__ (__printf__, _a, _b)))
72 #define __va_list va_list
74 #define OS_INLINE __inline
75 #endif /* _ATH_AH_OSDEP_H_ */