1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 ******************************************************************************/
20 #ifndef __ODM_TYPES_H__
21 #define __ODM_TYPES_H__
24 // Define Different SW team support
26 #define ODM_AP 0x01 //BIT0
27 #define ODM_ADSL 0x02 //BIT1
28 #define ODM_CE 0x04 //BIT2
29 #define ODM_WIN 0x08 //BIT3
31 #define DM_ODM_SUPPORT_TYPE ODM_CE
33 // Deifne HW endian support
34 #define ODM_ENDIAN_BIG 0
35 #define ODM_ENDIAN_LITTLE 1
37 #if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
38 #define GET_PDM_ODM(__pAdapter) ((PDM_ODM_T)(&((GET_HAL_DATA(__pAdapter))->DM_OutSrc)))
39 #elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
40 #define GET_PDM_ODM(__pAdapter) ((PDM_ODM_T)(&((GET_HAL_DATA(__pAdapter))->odmpriv)))
43 #if (DM_ODM_SUPPORT_TYPE != ODM_WIN)
44 #define RT_PCI_INTERFACE 1
45 #define RT_USB_INTERFACE 2
46 #define RT_SDIO_INTERFACE 3
49 typedef enum _HAL_STATUS{
54 RT_STATUS_INVALID_CONTEXT,
55 RT_STATUS_INVALID_PARAMETER,
56 RT_STATUS_NOT_SUPPORT,
57 RT_STATUS_OS_API_FAILED,*/
58 }HAL_STATUS,*PHAL_STATUS;
60 #if( DM_ODM_SUPPORT_TYPE == ODM_AP)
63 #if(DM_ODM_SUPPORT_TYPE != ODM_WIN)
65 #define VISTA_USB_RX_REVISE 0
68 // Declare for ODM spin lock defintion temporarily fro compile pass.
70 typedef enum _RT_SPINLOCK_TYPE{
78 RT_CHNLOP_SPINLOCK = 9,
79 RT_RF_OPERATE_SPINLOCK = 10,
80 RT_INITIAL_SPINLOCK = 11,
81 RT_RF_STATE_SPINLOCK = 12, // For RF state. Added by Bruce, 2007-10-30.
82 #if VISTA_USB_RX_REVISE
83 RT_USBRX_CONTEXT_SPINLOCK = 13,
84 RT_USBRX_POSTPROC_SPINLOCK = 14, // protect data of Adapter->IndicateW/ IndicateR
86 //Shall we define Ndis 6.2 SpinLock Here ?
90 RT_H2C_SPINLOCK = 20, // For H2C cmd. Added by tynli. 2009.11.09.
92 RT_BTData_SPINLOCK=25,
94 RT_WAPI_OPTION_SPINLOCK=26,
95 RT_WAPI_RX_SPINLOCK=27,
97 // add for 92D CCK control issue
98 RT_CCK_PAGEA_SPINLOCK = 28,
99 RT_BUFFER_SPINLOCK = 29,
100 RT_CHANNEL_AND_BANDWIDTH_SPINLOCK = 30,
101 RT_GEN_TEMP_BUF_SPINLOCK = 31,
102 RT_AWB_SPINLOCK = 32,
103 RT_FW_PS_SPINLOCK = 33,
104 RT_HW_TIMER_SPIN_LOCK = 34,
105 RT_MPT_WI_SPINLOCK = 35,
106 RT_P2P_SPIN_LOCK = 36, // Protect P2P context
107 RT_DBG_SPIN_LOCK = 37,
108 RT_IQK_SPINLOCK = 38,
109 RT_PENDED_OID_SPINLOCK = 39,
110 RT_CHNLLIST_SPINLOCK = 40,
111 RT_INDIC_SPINLOCK = 41, //protect indication
112 RT_RFD_SPINLOCK = 42,
113 RT_SYNC_IO_CNT_SPINLOCK = 43,
120 #if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
121 #define STA_INFO_T RT_WLAN_STA
122 #define PSTA_INFO_T PRT_WLAN_STA
124 #define CONFIG_HW_ANTENNA_DIVERSITY
125 #define CONFIG_SW_ANTENNA_DIVERSITY
126 /*#define CONFIG_PATH_DIVERSITY*/
127 /*#define CONFIG_RA_DYNAMIC_RTY_LIMIT*/
128 #define CONFIG_ANT_DETECTION
129 #define CONFIG_RA_DBG_CMD
131 #elif (DM_ODM_SUPPORT_TYPE == ODM_AP)
133 // To let ADSL/AP project compile ok; it should be removed after all conflict are solved. Added by Annie, 2011-10-07.
134 #define ADSL_AP_BUILD_WORKAROUND
135 #define AP_BUILD_WORKAROUND
137 //2 [ Configure RA Debug H2C CMD ]
138 #define CONFIG_RA_DBG_CMD
140 /*#define CONFIG_PATH_DIVERSITY*/
141 /*#define CONFIG_RA_DYNAMIC_RTY_LIMIT*/
143 //2 [ Configure Antenna Diversity ]
144 #if defined(CONFIG_RTL_8881A_ANT_SWITCH) || defined(CONFIG_SLOT_0_ANT_SWITCH) || defined(CONFIG_SLOT_1_ANT_SWITCH)
145 #define CONFIG_HW_ANTENNA_DIVERSITY
146 #define ODM_EVM_ENHANCE_ANTDIV
149 #if(!defined(CONFIG_NO_2G_DIVERSITY) && !defined(CONFIG_2G5G_CG_TRX_DIVERSITY_8881A) && !defined(CONFIG_2G_CGCS_RX_DIVERSITY) && !defined(CONFIG_2G_CG_TRX_DIVERSITY) && !defined(CONFIG_2G_CG_SMART_ANT_DIVERSITY))
150 #define CONFIG_NO_2G_DIVERSITY
153 #ifdef CONFIG_NO_5G_DIVERSITY_8881A
154 #define CONFIG_NO_5G_DIVERSITY
155 #elif defined(CONFIG_5G_CGCS_RX_DIVERSITY_8881A)
156 #define CONFIG_5G_CGCS_RX_DIVERSITY
157 #elif defined(CONFIG_5G_CG_TRX_DIVERSITY_8881A)
158 #define CONFIG_5G_CG_TRX_DIVERSITY
159 #elif defined(CONFIG_2G5G_CG_TRX_DIVERSITY_8881A)
160 #define CONFIG_2G5G_CG_TRX_DIVERSITY
162 #if(!defined(CONFIG_NO_5G_DIVERSITY) && !defined(CONFIG_5G_CGCS_RX_DIVERSITY) && !defined(CONFIG_5G_CG_TRX_DIVERSITY) && !defined(CONFIG_2G5G_CG_TRX_DIVERSITY) && !defined(CONFIG_5G_CG_SMART_ANT_DIVERSITY))
163 #define CONFIG_NO_5G_DIVERSITY
166 #if ( defined(CONFIG_NO_2G_DIVERSITY) && defined(CONFIG_NO_5G_DIVERSITY) )
167 #define CONFIG_NOT_SUPPORT_ANTDIV
168 #elif( !defined(CONFIG_NO_2G_DIVERSITY) && defined(CONFIG_NO_5G_DIVERSITY) )
169 #define CONFIG_2G_SUPPORT_ANTDIV
170 #elif( defined(CONFIG_NO_2G_DIVERSITY) && !defined(CONFIG_NO_5G_DIVERSITY) )
171 #define CONFIG_5G_SUPPORT_ANTDIV
172 #elif( (!defined(CONFIG_NO_2G_DIVERSITY) && !defined(CONFIG_NO_5G_DIVERSITY)) || defined(CONFIG_2G5G_CG_TRX_DIVERSITY) )
173 #define CONFIG_2G5G_SUPPORT_ANTDIV
177 #ifdef AP_BUILD_WORKAROUND
178 #include "../typedef.h"
180 typedef void VOID,*PVOID;
181 typedef unsigned char BOOLEAN,*PBOOLEAN;
182 typedef unsigned char u1Byte,*pu1Byte;
183 typedef unsigned short u2Byte,*pu2Byte;
184 typedef unsigned int u4Byte,*pu4Byte;
185 typedef unsigned long long u8Byte,*pu8Byte;
187 /* In ARM platform, system would use the type -- "char" as "unsigned char"
188 * And we only use s1Byte/ps1Byte as INT8 now, so changes the type of s1Byte.*/
189 typedef signed char s1Byte,*ps1Byte;
191 typedef char s1Byte,*ps1Byte;
193 typedef short s2Byte,*ps2Byte;
194 typedef long s4Byte,*ps4Byte;
195 typedef long long s8Byte,*ps8Byte;
198 typedef struct rtl8192cd_priv *prtl8192cd_priv;
199 typedef struct stat_info STA_INFO_T,*PSTA_INFO_T;
200 typedef struct timer_list RT_TIMER, *PRT_TIMER;
201 typedef void * RT_TIMER_CALL_BACK;
203 #ifdef CONFIG_PCI_HCI
204 #define DEV_BUS_TYPE RT_PCI_INTERFACE
210 #elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
211 #include <drv_types.h>
213 /*#define CONFIG_RA_DBG_CMD*/
214 /*#define CONFIG_ANT_DETECTION*/
215 /*#define CONFIG_PATH_DIVERSITY*/
216 /*#define CONFIG_RA_DYNAMIC_RTY_LIMIT*/
219 typedef u8 u1Byte, *pu1Byte;
220 typedef u16 u2Byte,*pu2Byte;
221 typedef u32 u4Byte,*pu4Byte;
222 typedef u64 u8Byte,*pu8Byte;
223 typedef s8 s1Byte,*ps1Byte;
224 typedef s16 s2Byte,*ps2Byte;
225 typedef s32 s4Byte,*ps4Byte;
226 typedef s64 s8Byte,*ps8Byte;
253 #ifdef CONFIG_USB_HCI
254 #define DEV_BUS_TYPE RT_USB_INTERFACE
255 #elif defined(CONFIG_PCI_HCI)
256 #define DEV_BUS_TYPE RT_PCI_INTERFACE
257 #elif defined(CONFIG_SDIO_HCI)
258 #define DEV_BUS_TYPE RT_SDIO_INTERFACE
259 #elif defined(CONFIG_GSPI_HCI)
260 #define DEV_BUS_TYPE RT_SDIO_INTERFACE
264 #if defined(CONFIG_LITTLE_ENDIAN)
265 #define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE
266 #elif defined (CONFIG_BIG_ENDIAN)
267 #define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG
270 typedef struct timer_list RT_TIMER, *PRT_TIMER;
271 typedef void * RT_TIMER_CALL_BACK;
272 #define STA_INFO_T struct sta_info
273 #define PSTA_INFO_T struct sta_info *
281 #define SET_TX_DESC_ANTSEL_A_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+8, 24, 1, __Value)
282 #define SET_TX_DESC_ANTSEL_B_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+8, 25, 1, __Value)
283 #define SET_TX_DESC_ANTSEL_C_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+28, 29, 1, __Value)
285 //define useless flag to avoid compile warning
286 #define USE_WORKITEM 0
287 #define FOR_BRAZIL_PRETEST 0
288 /*#define BT_30_SUPPORT 0*/
289 #define FPGA_TWO_MAC_VERIFICATION 0
290 #define RTL8881A_SUPPORT 0
293 #define READ_NEXT_PAIR(v1, v2, i) do { if (i+2 >= ArrayLen) break; i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
297 #endif // __ODM_TYPES_H__