1 /******************************************************************************
\r
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
\r
5 * This program is free software; you can redistribute it and/or modify it
\r
6 * under the terms of version 2 of the GNU General Public License as
\r
7 * published by the Free Software Foundation.
\r
9 * This program is distributed in the hope that it will be useful, but WITHOUT
\r
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
\r
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
\r
14 * You should have received a copy of the GNU General Public License along with
\r
15 * this program; if not, write to the Free Software Foundation, Inc.,
\r
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
\r
19 ******************************************************************************/
\r
20 #ifndef __ODM_TYPES_H__
\r
21 #define __ODM_TYPES_H__
\r
24 /*Define Different SW team support*/
\r
25 #define ODM_AP 0x01 /*BIT0*/
\r
26 #define ODM_CE 0x04 /*BIT2*/
\r
27 #define ODM_WIN 0x08 /*BIT3*/
\r
28 #define ODM_ADSL 0x10 /*BIT4*/
\r
29 #define ODM_IOT 0x20 /*BIT5*/
\r
31 /*Deifne HW endian support*/
\r
32 #define ODM_ENDIAN_BIG 0
\r
33 #define ODM_ENDIAN_LITTLE 1
\r
35 #if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
\r
36 #define GET_PDM_ODM(__pAdapter) ((PDM_ODM_T)(&((GET_HAL_DATA(__pAdapter))->DM_OutSrc)))
\r
37 #elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
\r
38 #define GET_PDM_ODM(__pAdapter) ((PDM_ODM_T)(&((GET_HAL_DATA(__pAdapter))->odmpriv)))
\r
41 #if (DM_ODM_SUPPORT_TYPE != ODM_WIN)
\r
42 #define RT_PCI_INTERFACE 1
\r
43 #define RT_USB_INTERFACE 2
\r
44 #define RT_SDIO_INTERFACE 3
\r
47 typedef enum _HAL_STATUS{
\r
50 /*RT_STATUS_PENDING,
\r
52 RT_STATUS_INVALID_CONTEXT,
\r
53 RT_STATUS_INVALID_PARAMETER,
\r
54 RT_STATUS_NOT_SUPPORT,
\r
55 RT_STATUS_OS_API_FAILED,*/
\r
56 }HAL_STATUS,*PHAL_STATUS;
\r
58 #if( DM_ODM_SUPPORT_TYPE == ODM_AP)
\r
61 #if(DM_ODM_SUPPORT_TYPE != ODM_WIN)
\r
63 #define VISTA_USB_RX_REVISE 0
\r
66 // Declare for ODM spin lock defintion temporarily fro compile pass.
\r
68 typedef enum _RT_SPINLOCK_TYPE{
\r
72 RT_CAM_SPINLOCK = 4,
\r
73 RT_SCAN_SPINLOCK = 5,
\r
74 RT_LOG_SPINLOCK = 7,
\r
76 RT_CHNLOP_SPINLOCK = 9,
\r
77 RT_RF_OPERATE_SPINLOCK = 10,
\r
78 RT_INITIAL_SPINLOCK = 11,
\r
79 RT_RF_STATE_SPINLOCK = 12, // For RF state. Added by Bruce, 2007-10-30.
\r
80 #if VISTA_USB_RX_REVISE
\r
81 RT_USBRX_CONTEXT_SPINLOCK = 13,
\r
82 RT_USBRX_POSTPROC_SPINLOCK = 14, // protect data of Adapter->IndicateW/ IndicateR
\r
84 //Shall we define Ndis 6.2 SpinLock Here ?
\r
85 RT_PORT_SPINLOCK=16,
\r
86 RT_VNIC_SPINLOCK=17,
\r
87 RT_HVL_SPINLOCK=18,
\r
88 RT_H2C_SPINLOCK = 20, // For H2C cmd. Added by tynli. 2009.11.09.
\r
90 RT_BTData_SPINLOCK=25,
\r
92 RT_WAPI_OPTION_SPINLOCK=26,
\r
93 RT_WAPI_RX_SPINLOCK=27,
\r
95 // add for 92D CCK control issue
\r
96 RT_CCK_PAGEA_SPINLOCK = 28,
\r
97 RT_BUFFER_SPINLOCK = 29,
\r
98 RT_CHANNEL_AND_BANDWIDTH_SPINLOCK = 30,
\r
99 RT_GEN_TEMP_BUF_SPINLOCK = 31,
\r
100 RT_AWB_SPINLOCK = 32,
\r
101 RT_FW_PS_SPINLOCK = 33,
\r
102 RT_HW_TIMER_SPIN_LOCK = 34,
\r
103 RT_MPT_WI_SPINLOCK = 35,
\r
104 RT_P2P_SPIN_LOCK = 36, // Protect P2P context
\r
105 RT_DBG_SPIN_LOCK = 37,
\r
106 RT_IQK_SPINLOCK = 38,
\r
107 RT_PENDED_OID_SPINLOCK = 39,
\r
108 RT_CHNLLIST_SPINLOCK = 40,
\r
109 RT_INDIC_SPINLOCK = 41, //protect indication
\r
110 RT_RFD_SPINLOCK = 42,
\r
111 RT_SYNC_IO_CNT_SPINLOCK = 43,
\r
118 #if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
\r
119 #define STA_INFO_T RT_WLAN_STA
\r
120 #define PSTA_INFO_T PRT_WLAN_STA
\r
121 #define __func__ __FUNCTION__
\r
122 #define PHYDM_TESTCHIP_SUPPORT TESTCHIP_SUPPORT
\r
123 #define bMaskH3Bytes 0xffffff00
\r
127 #elif (DM_ODM_SUPPORT_TYPE == ODM_AP)
\r
129 // To let ADSL/AP project compile ok; it should be removed after all conflict are solved. Added by Annie, 2011-10-07.
\r
130 #define ADSL_AP_BUILD_WORKAROUND
\r
131 #define AP_BUILD_WORKAROUND
\r
133 #ifdef AP_BUILD_WORKAROUND
\r
134 #include "../typedef.h"
\r
136 typedef void VOID,*PVOID;
\r
137 typedef unsigned char BOOLEAN,*PBOOLEAN;
\r
138 typedef unsigned char u1Byte,*pu1Byte;
\r
139 typedef unsigned short u2Byte,*pu2Byte;
\r
140 typedef unsigned int u4Byte,*pu4Byte;
\r
141 typedef unsigned long long u8Byte,*pu8Byte;
\r
143 /* In ARM platform, system would use the type -- "char" as "unsigned char"
\r
144 * And we only use s1Byte/ps1Byte as INT8 now, so changes the type of s1Byte.*/
\r
145 typedef signed char s1Byte,*ps1Byte;
\r
147 typedef char s1Byte,*ps1Byte;
\r
149 typedef short s2Byte,*ps2Byte;
\r
150 typedef long s4Byte,*ps4Byte;
\r
151 typedef long long s8Byte,*ps8Byte;
\r
154 typedef struct rtl8192cd_priv *prtl8192cd_priv;
\r
155 typedef struct stat_info STA_INFO_T,*PSTA_INFO_T;
\r
156 typedef struct timer_list RT_TIMER, *PRT_TIMER;
\r
157 typedef void * RT_TIMER_CALL_BACK;
\r
159 #ifdef CONFIG_PCI_HCI
\r
160 #define DEV_BUS_TYPE RT_PCI_INTERFACE
\r
166 #if (defined(TESTCHIP_SUPPORT))
\r
167 #define PHYDM_TESTCHIP_SUPPORT 1
\r
169 #define PHYDM_TESTCHIP_SUPPORT 0
\r
172 #elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
\r
173 #include <drv_types.h>
\r
175 typedef u8 u1Byte, *pu1Byte;
\r
176 typedef u16 u2Byte,*pu2Byte;
\r
177 typedef u32 u4Byte,*pu4Byte;
\r
178 typedef u64 u8Byte,*pu8Byte;
\r
179 typedef s8 s1Byte,*ps1Byte;
\r
180 typedef s16 s2Byte,*ps2Byte;
\r
181 typedef s32 s4Byte,*ps4Byte;
\r
182 typedef s64 s8Byte,*ps8Byte;
\r
185 #define pu1Byte u8*
\r
188 #define pu2Byte u16*
\r
191 #define pu4Byte u32*
\r
194 #define pu8Byte u64*
\r
197 #define ps1Byte s8*
\r
200 #define ps2Byte s16*
\r
203 #define ps4Byte s32*
\r
206 #define ps8Byte s64*
\r
209 #ifdef CONFIG_USB_HCI
\r
210 #define DEV_BUS_TYPE RT_USB_INTERFACE
\r
211 #elif defined(CONFIG_PCI_HCI)
\r
212 #define DEV_BUS_TYPE RT_PCI_INTERFACE
\r
213 #elif defined(CONFIG_SDIO_HCI)
\r
214 #define DEV_BUS_TYPE RT_SDIO_INTERFACE
\r
215 #elif defined(CONFIG_GSPI_HCI)
\r
216 #define DEV_BUS_TYPE RT_SDIO_INTERFACE
\r
220 #if defined(CONFIG_LITTLE_ENDIAN)
\r
221 #define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE
\r
222 #elif defined (CONFIG_BIG_ENDIAN)
\r
223 #define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG
\r
226 typedef struct timer_list RT_TIMER, *PRT_TIMER;
\r
227 typedef void * RT_TIMER_CALL_BACK;
\r
228 #define STA_INFO_T struct sta_info
\r
229 #define PSTA_INFO_T struct sta_info *
\r
233 #define TRUE _TRUE
\r
234 #define FALSE _FALSE
\r
237 #define SET_TX_DESC_ANTSEL_A_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+8, 24, 1, __Value)
\r
238 #define SET_TX_DESC_ANTSEL_B_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+8, 25, 1, __Value)
\r
239 #define SET_TX_DESC_ANTSEL_C_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+28, 29, 1, __Value)
\r
241 //define useless flag to avoid compile warning
\r
242 #define USE_WORKITEM 0
\r
243 #define FOR_BRAZIL_PRETEST 0
\r
244 #define FPGA_TWO_MAC_VERIFICATION 0
\r
245 #define RTL8881A_SUPPORT 0
\r
247 #if (defined(TESTCHIP_SUPPORT))
\r
248 #define PHYDM_TESTCHIP_SUPPORT 1
\r
250 #define PHYDM_TESTCHIP_SUPPORT 0
\r
254 #define READ_NEXT_PAIR(v1, v2, i) do { if (i+2 >= ArrayLen) break; i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
\r
255 #define COND_ELSE 2
\r
256 #define COND_ENDIF 3
\r
258 #include "phydm_features.h"
\r
260 #endif // __ODM_TYPES_H__
\r