2 * Copyright (c) 2013 Qualcomm Atheros, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted (subject to the limitations in the
7 * disclaimer below) provided that the following conditions are met:
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the
17 * * Neither the name of Qualcomm Atheros nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
22 * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
23 * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
24 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
30 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
32 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
33 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 #ifndef __ADF_OS_TYPES_PVT_H
36 #define __ADF_OS_TYPES_PVT_H
40 //#include "cmnos_api.h"
41 //#include "Magpie_api.h"
44 #define __ADF_OS_MAX_SCATTER 1
45 #define __adf_os_packed __attribute__((__packed__))
46 #define __ADF_OS_NAME_SIZE 10
49 * Private definitions of general data types
54 #undef ADF_LITTLE_ENDIAN_MACHINE
55 #undef ADF_BIG_ENDIAN_MACHINE
57 //#if (_BYTE_ORDER == _LITTLE_ENDIAN)
59 #define ADF_LITTLE_ENDIAN_MACHINE
60 //#elif (_BYTE_ORDER == _BIG_ENDIAN)
62 #define ADF_BIG_ENDIAN_MACHINE
68 #define __ADF_SYNC_PREREAD 0
69 #define __ADF_SYNC_POSTREAD 1
70 #define __ADF_SYNC_PREWRITE 2
71 #define __ADF_SYNC_POSTWRITE 3
73 #define __ADF_OS_DMA_TO_DEVICE 0
74 #define __ADF_OS_DMA_FROM_DEVICE 1
80 enum __adf_net_wireless_evcode{
81 __ADF_IEEE80211_ASSOC = 100,
82 __ADF_IEEE80211_REASSOC = 101,
83 __ADF_IEEE80211_DISASSOC = 102,
84 __ADF_IEEE80211_JOIN = 103,
85 __ADF_IEEE80211_LEAVE = 104,
86 __ADF_IEEE80211_SCAN = 105,
87 __ADF_IEEE80211_REPLAY = 106,
88 __ADF_IEEE80211_MICHAEL = 107,
89 __ADF_IEEE80211_REJOIN = 108,
90 __ADF_CUSTOM_PUSH_BUTTON = 109,
93 /* generic data types */
98 typedef struct __adf_device *__adf_os_device_t;
101 struct __adf_dma_map {
108 typedef struct __adf_dma_map *__adf_os_dma_map_t;
110 typedef A_UINT32 __adf_os_dma_addr_t;
111 typedef A_UINT32 __adf_os_dma_size_t;
113 typedef unsigned int __adf_os_size_t;
114 typedef int __adf_os_off_t;
116 #define __adf_os_iomem_t
119 typedef int __a_uint8_t;
120 typedef int __a_int8_t;
121 typedef int __a_uint16_t;
122 typedef int __a_int16_t;
123 typedef int __a_uint32_t;
124 typedef int __a_int32_t;
125 typedef int __a_uint64_t;
126 typedef int __a_int64_t;
128 typedef A_UINT8 __a_uint8_t;
129 typedef A_INT8 __a_int8_t;
130 typedef A_UINT16 __a_uint16_t;
131 typedef A_INT16 __a_int16_t;
132 typedef A_UINT32 __a_uint32_t;
133 typedef A_INT32 __a_int32_t;
134 typedef A_UINT64 __a_uint64_t;
135 typedef A_INT64 __a_int64_t;
137 typedef A_UINT32 u_int32_t;
138 typedef A_UINT16 u_int16_t;
139 typedef A_UINT8 u_int8_t;
140 typedef unsigned int u_int;
141 typedef unsigned long u_long;
142 //typedef __adf_os_size_t size_t;
144 typedef A_UINT64 u_int64_t;
148 //extern void my_printf(struct ath_hal *ah, const char* fmt, ...);
150 //#define __adf_os_print my_printf
151 #define __adf_os_print A_PRINTF
156 #define __va_list __gnuc_va_list
160 /* For compiling WLAN drivers */
167 #define EOPNOTSUPP -1
168 #define KASSERT(exp, msg)
172 #define __packed __attribute__((__packed__))
176 #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */