add rk3288 pinctrl dts code
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rtl8723bs / hal / OUTSRC / odm_types.h
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
4  *                                        
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.
8  *
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
12  * more details.
13  *
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
17  *
18  *
19  ******************************************************************************/
20 #ifndef __ODM_TYPES_H__
21 #define __ODM_TYPES_H__
22
23 //
24 // Define Different SW team support
25 //
26 #define ODM_AP                  0x01    //BIT0 
27 #define ODM_ADSL                0x02    //BIT1
28 #define ODM_CE                  0x04    //BIT2
29 #define ODM_WIN                 0x08    //BIT3
30
31 #define DM_ODM_SUPPORT_TYPE                     ODM_CE
32
33 // Deifne HW endian support
34 #define ODM_ENDIAN_BIG  0
35 #define ODM_ENDIAN_LITTLE       1
36
37 #if (DM_ODM_SUPPORT_TYPE != ODM_WIN)
38 #define         RT_PCI_INTERFACE                                1
39 #define         RT_USB_INTERFACE                                2
40 #define         RT_SDIO_INTERFACE                               3
41 #endif
42
43 typedef enum _HAL_STATUS{
44         HAL_STATUS_SUCCESS,
45         HAL_STATUS_FAILURE,
46         /*RT_STATUS_PENDING,
47         RT_STATUS_RESOURCE,
48         RT_STATUS_INVALID_CONTEXT,
49         RT_STATUS_INVALID_PARAMETER,
50         RT_STATUS_NOT_SUPPORT,
51         RT_STATUS_OS_API_FAILED,*/
52 }HAL_STATUS,*PHAL_STATUS;
53
54
55 #if( (DM_ODM_SUPPORT_TYPE == ODM_AP) ||(DM_ODM_SUPPORT_TYPE == ODM_ADSL) || (DM_ODM_SUPPORT_TYPE == ODM_CE))
56
57 #define         VISTA_USB_RX_REVISE                     0
58
59 //
60 // Declare for ODM spin lock defintion temporarily fro compile pass.
61 //
62 typedef enum _RT_SPINLOCK_TYPE{
63         RT_TX_SPINLOCK = 1,
64         RT_RX_SPINLOCK = 2,
65         RT_RM_SPINLOCK = 3,
66         RT_CAM_SPINLOCK = 4,
67         RT_SCAN_SPINLOCK = 5,
68         RT_LOG_SPINLOCK = 7, 
69         RT_BW_SPINLOCK = 8,
70         RT_CHNLOP_SPINLOCK = 9,
71         RT_RF_OPERATE_SPINLOCK = 10,
72         RT_INITIAL_SPINLOCK = 11,
73         RT_RF_STATE_SPINLOCK = 12, // For RF state. Added by Bruce, 2007-10-30.
74 #if VISTA_USB_RX_REVISE
75         RT_USBRX_CONTEXT_SPINLOCK = 13,
76         RT_USBRX_POSTPROC_SPINLOCK = 14, // protect data of Adapter->IndicateW/ IndicateR
77 #endif
78         //Shall we define Ndis 6.2 SpinLock Here ?
79         RT_PORT_SPINLOCK=16,
80         RT_H2C_SPINLOCK = 20, // For H2C cmd. Added by tynli. 2009.11.09.
81
82         RT_BTData_SPINLOCK=25,
83
84         RT_WAPI_OPTION_SPINLOCK=26,
85         RT_WAPI_RX_SPINLOCK=27,
86
87       // add for 92D CCK control issue  
88         RT_CCK_PAGEA_SPINLOCK = 28,
89         RT_BUFFER_SPINLOCK = 29,
90         RT_CHANNEL_AND_BANDWIDTH_SPINLOCK = 30,
91         RT_GEN_TEMP_BUF_SPINLOCK = 31,
92         RT_AWB_SPINLOCK = 32,
93         RT_FW_PS_SPINLOCK = 33,
94         RT_HW_TIMER_SPIN_LOCK = 34,
95         RT_MPT_WI_SPINLOCK = 35,
96         RT_P2P_SPIN_LOCK = 36,  // Protect P2P context
97         RT_DBG_SPIN_LOCK = 37,
98         RT_IQK_SPINLOCK = 38,
99         RT_PENDED_OID_SPINLOCK = 39,
100         RT_CHNLLIST_SPINLOCK = 40,      
101         RT_INDIC_SPINLOCK = 41, //protect indication    
102 }RT_SPINLOCK_TYPE;
103
104 #endif
105
106
107 #if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
108         #define STA_INFO_T                      RT_WLAN_STA
109         #define PSTA_INFO_T                     PRT_WLAN_STA
110
111 //    typedef unsigned long             u4Byte,*pu4Byte;
112 #define CONFIG_HW_ANTENNA_DIVERSITY 
113 #define CONFIG_SW_ANTENNA_DIVERSITY 
114
115 #elif (DM_ODM_SUPPORT_TYPE == ODM_AP)
116
117         // To let ADSL/AP project compile ok; it should be removed after all conflict are solved. Added by Annie, 2011-10-07.
118         #define ADSL_AP_BUILD_WORKAROUND
119         #define AP_BUILD_WORKAROUND
120         //
121 #ifdef CONFIG_ANT_SWITCH
122         #define CONFIG_HW_ANTENNA_DIVERSITY 
123         #if ( defined(CONFIG_NO_2G_DIVERSITY) && defined(CONFIG_NO_5G_DIVERSITY) )
124                 #define CONFIG_NOT_SUPPORT_ANTDIV 
125         #elif( !defined(CONFIG_NO_2G_DIVERSITY) && defined(CONFIG_NO_5G_DIVERSITY) )
126                 #define CONFIG_2G_SUPPORT_ANTDIV
127         #elif( defined(CONFIG_NO_2G_DIVERSITY) && !defined(CONFIG_NO_5G_DIVERSITY) )
128                 #define CONFIG_5G_SUPPORT_ANTDIV
129         #elif( !defined(CONFIG_NO_2G_DIVERSITY) && !defined(CONFIG_NO_5G_DIVERSITY) )
130                 #define CONFIG_2G5G_SUPPORT_ANTDIV 
131         #endif
132 #endif
133
134         #ifdef AP_BUILD_WORKAROUND
135         #include "../typedef.h"
136         #else
137         typedef void                                    VOID,*PVOID;
138         typedef unsigned char                   BOOLEAN,*PBOOLEAN;
139         typedef unsigned char                   u1Byte,*pu1Byte;
140         typedef unsigned short                  u2Byte,*pu2Byte;
141         typedef unsigned int                    u4Byte,*pu4Byte;
142         typedef unsigned long long              u8Byte,*pu8Byte;
143         typedef char                                    s1Byte,*ps1Byte;
144         typedef short                                   s2Byte,*ps2Byte;
145         typedef long                                    s4Byte,*ps4Byte;
146         typedef long long                               s8Byte,*ps8Byte;
147         #endif
148
149         typedef struct rtl8192cd_priv   *prtl8192cd_priv;
150         typedef struct stat_info                STA_INFO_T,*PSTA_INFO_T;
151         typedef struct timer_list               RT_TIMER, *PRT_TIMER;
152         typedef  void *                         RT_TIMER_CALL_BACK;
153
154         #define DEV_BUS_TYPE            RT_PCI_INTERFACE
155
156         #define _TRUE                           1
157         #define _FALSE                          0
158         
159 #elif (DM_ODM_SUPPORT_TYPE == ODM_ADSL)
160
161         // To let ADSL/AP project compile ok; it should be removed after all conflict are solved. Added by Annie, 2011-10-07.
162         #define ADSL_AP_BUILD_WORKAROUND
163         #define ADSL_BUILD_WORKAROUND
164         //
165
166         typedef unsigned char                   BOOLEAN,*PBOOLEAN;
167         typedef unsigned char                   u1Byte,*pu1Byte;
168         typedef unsigned short                  u2Byte,*pu2Byte;
169         typedef unsigned int                    u4Byte,*pu4Byte;
170         typedef unsigned long long              u8Byte,*pu8Byte;
171         typedef char                                    s1Byte,*ps1Byte;
172         typedef short                                   s2Byte,*ps2Byte;
173         typedef long                                    s4Byte,*ps4Byte;
174         typedef long long                               s8Byte,*ps8Byte;
175
176         typedef struct rtl8192cd_priv   *prtl8192cd_priv;
177         typedef struct stat_info                STA_INFO_T,*PSTA_INFO_T;
178         typedef struct timer_list               RT_TIMER, *PRT_TIMER;
179         typedef  void *                         RT_TIMER_CALL_BACK;
180         
181         #define DEV_BUS_TYPE            RT_PCI_INTERFACE
182
183         #define _TRUE                           1
184         #define _FALSE                          0
185
186 #elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
187         #include <drv_types.h>
188
189 #if 0
190         typedef u8                                      u1Byte, *pu1Byte;
191         typedef u16                                     u2Byte,*pu2Byte;
192         typedef u32                                     u4Byte,*pu4Byte;
193         typedef u64                                     u8Byte,*pu8Byte;
194         typedef s8                                      s1Byte,*ps1Byte;
195         typedef s16                                     s2Byte,*ps2Byte;
196         typedef s32                                     s4Byte,*ps4Byte;
197         typedef s64                                     s8Byte,*ps8Byte;
198 #else
199         #define u1Byte          u8
200         #define pu1Byte         u8*     
201
202         #define u2Byte          u16
203         #define pu2Byte         u16*            
204
205         #define u4Byte          u32
206         #define pu4Byte         u32*    
207
208         #define u8Byte          u64
209         #define pu8Byte         u64*
210
211         #define s1Byte          s8
212         #define ps1Byte         s8*     
213
214         #define s2Byte          s16
215         #define ps2Byte         s16*    
216
217         #define s4Byte          s32
218         #define ps4Byte         s32*    
219
220         #define s8Byte          s64
221         #define ps8Byte         s64*    
222         
223 #endif
224         #ifdef CONFIG_USB_HCI
225                 #define DEV_BUS_TYPE    RT_USB_INTERFACE
226         #elif defined(CONFIG_PCI_HCI)
227                 #define DEV_BUS_TYPE    RT_PCI_INTERFACE
228         #elif defined(CONFIG_SDIO_HCI)
229                 #define DEV_BUS_TYPE    RT_SDIO_INTERFACE
230         #elif defined(CONFIG_GSPI_HCI)
231                 #define DEV_BUS_TYPE    RT_SDIO_INTERFACE
232         #endif
233         
234
235         #if defined(CONFIG_LITTLE_ENDIAN)       
236                 #define ODM_ENDIAN_TYPE                 ODM_ENDIAN_LITTLE
237         #elif defined (CONFIG_BIG_ENDIAN)
238                 #define ODM_ENDIAN_TYPE                 ODM_ENDIAN_BIG
239         #endif
240         
241         typedef struct timer_list               RT_TIMER, *PRT_TIMER;
242         typedef  void *                         RT_TIMER_CALL_BACK;
243         #define STA_INFO_T                      struct sta_info
244         #define PSTA_INFO_T             struct sta_info *
245                 
246
247
248         #define TRUE    _TRUE   
249         #define FALSE   _FALSE
250
251
252         #define SET_TX_DESC_ANTSEL_A_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+8, 24, 1, __Value)
253         #define SET_TX_DESC_ANTSEL_B_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+8, 25, 1, __Value)
254         #define SET_TX_DESC_ANTSEL_C_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+28, 29, 1, __Value)
255
256         //define useless flag to avoid compile warning
257         #define USE_WORKITEM 0
258         #define         FOR_BRAZIL_PRETEST 0
259         #define   FPGA_TWO_MAC_VERIFICATION     0
260         #define RTL8881A_SUPPORT        0
261 #endif
262
263
264 #endif // __ODM_TYPES_H__
265