support different wifi bt chip auto compatible
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / combo_mt66xx / mt6628 / wlan / os / linux / include / gl_wext_priv.h
1 /*
2 ** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/include/gl_wext_priv.h#3 $
3 */
4
5 /*! \file   gl_wext_priv.h
6     \brief  This file includes private ioctl support.
7 */
8
9
10
11 /*
12 ** $Log: gl_wext_priv.h $
13  *
14  * 01 16 2012 wh.su
15  * [WCXRP00001170] [MT6620 Wi-Fi][Driver] Adding the related code for set/get band ioctl
16  * Adding the template code for set / get band IOCTL (with ICS supplicant_6)..
17  *
18  * 01 05 2012 wh.su
19  * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function
20  * Adding the related ioctl / wlan oid function to set the Tx power cfg.
21  *
22  * 01 02 2012 wh.su
23  * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function
24  * Adding the proto type function for set_int set_tx_power and get int get_ch_list.
25  *
26  * 11 08 2011 yuche.tsai
27  * [WCXRP00001094] [Volunteer Patch][Driver] Driver version & supplicant version query & set support for service discovery version check.
28  * Add a CMD ID for P2P driver version query.
29  *
30  * 03 17 2011 chinglan.wang
31  * [WCXRP00000570] [MT6620 Wi-Fi][Driver] Add Wi-Fi Protected Setup v2.0 feature
32  * .
33  *
34  * 03 02 2011 wh.su
35  * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code
36  * Add security check code.
37  *
38  * 01 27 2011 cm.chang
39  * [WCXRP00000402] [MT6620 Wi-Fi][Driver] Enable MCR read/write by iwpriv by default
40  * .
41  *
42  * 01 20 2011 eddie.chen
43  * [WCXRP00000374] [MT6620 Wi-Fi][DRV] SW debug control
44  * Add Oid for sw control debug command
45  *
46  * 01 07 2011 cm.chang
47  * [WCXRP00000336] [MT6620 Wi-Fi][Driver] Add test mode commands in normal phone operation
48  * Add a new compiling option to control if MCR read/write is permitted
49  *
50  * 12 31 2010 cm.chang
51  * [WCXRP00000336] [MT6620 Wi-Fi][Driver] Add test mode commands in normal phone operation
52  * Add some iwpriv commands to support test mode operation
53  *
54  * 11 08 2010 wh.su
55  * [WCXRP00000171] [MT6620 Wi-Fi][Driver] Add message check code same behavior as mt5921
56  * add the message check code from mt5921.
57  *
58  * 10 18 2010 cp.wu
59  * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000086] [MT6620 Wi-Fi][Driver] The mac address is all zero at android
60  * complete implementation of Android NVRAM access
61  *
62  * 09 23 2010 cp.wu
63  * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check
64  * add skeleton for NVRAM integration
65  *
66  * 08 04 2010 cp.wu
67  * NULL
68  * revert changelist #15371, efuse read/write access will be done by RF test approach
69  *
70  * 08 04 2010 cp.wu
71  * NULL
72  * add OID definitions for EFUSE read/write access.
73  *
74  * 07 08 2010 cp.wu
75  *
76  * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
77  *
78  * 06 06 2010 kevin.huang
79  * [WPD00003832][MT6620 5931] Create driver base
80  * [MT6620 5931] Create driver base
81  *
82  * 03 31 2010 wh.su
83  * [WPD00003816][MT6620 Wi-Fi] Adding the security support
84  * modify the wapi related code for new driver's design.
85  *
86  * 03 24 2010 jeffrey.chang
87  * [WPD00003826]Initial import for Linux port
88  * initial import for Linux port
89 **  \main\maintrunk.MT5921\16 2009-09-29 16:47:23 GMT mtk01090
90 **  Remove unused functions
91 **  \main\maintrunk.MT5921\15 2009-09-28 20:19:31 GMT mtk01090
92 **  Add private ioctl to carry OID structures. Restructure public/private ioctl interfaces to Linux kernel.
93 **  \main\maintrunk.MT5921\14 2009-05-07 22:26:06 GMT mtk01089
94 **  add private IO control for Linux BWCS
95 **  \main\maintrunk.MT5921\13 2008-08-29 14:55:20 GMT mtk01088
96 **  adjust the code to meet coding style
97 **  \main\maintrunk.MT5921\12 2008-07-16 15:23:45 GMT mtk01104
98 **  Support GPIO2 mode
99 **  \main\maintrunk.MT5921\11 2008-07-14 13:55:58 GMT mtk01104
100 **  Support PRIV_CMD_BT_COEXIST
101 **  \main\maintrunk.MT5921\10 2008-07-09 00:20:24 GMT mtk01461
102 **  Add priv oid to support WMM_PS_TEST
103 **  \main\maintrunk.MT5921\9 2008-05-30 20:27:24 GMT mtk01461
104 **  Add POWER_MODE Private IOCTL cmd
105 **  \main\maintrunk.MT5921\8 2008-04-17 23:06:44 GMT mtk01461
106 **  Add iwpriv support for AdHocMode setting
107 **  \main\maintrunk.MT5921\7 2008-03-31 21:01:24 GMT mtk01461
108 **  Add priv IOCTL for VOIP settings
109 **  \main\maintrunk.MT5921\6 2008-03-31 13:49:47 GMT mtk01461
110 **  add priv ioctl arg definition for turning on / off roaming
111 **  \main\maintrunk.MT5921\5 2008-03-26 15:35:09 GMT mtk01461
112 **  Add CSUM offload priv ioctl for Linux
113 **  \main\maintrunk.MT5921\4 2008-03-11 14:51:11 GMT mtk01461
114 **  Refine private IOCTL functions
115 **  \main\maintrunk.MT5921\3 2007-11-06 19:36:25 GMT mtk01088
116 **  add the WPS related code
117 */
118
119 #ifndef _GL_WEXT_PRIV_H
120 #define _GL_WEXT_PRIV_H
121 /*******************************************************************************
122 *                         C O M P I L E R   F L A G S
123 ********************************************************************************
124 */
125 /* If it is set to 1, iwpriv will support register read/write */
126 #define CFG_SUPPORT_PRIV_MCR_RW         1
127
128 /*******************************************************************************
129 *                    E X T E R N A L   R E F E R E N C E S
130 ********************************************************************************
131 */
132
133 /*******************************************************************************
134 *                              C O N S T A N T S
135 ********************************************************************************
136 */
137 /* New wireless extensions API - SET/GET convention (even ioctl numbers are
138  * root only)
139  */
140 #define IOCTL_SET_INT                   (SIOCIWFIRSTPRIV + 0)
141 #define IOCTL_GET_INT                   (SIOCIWFIRSTPRIV + 1)
142
143 #define IOCTL_SET_ADDRESS               (SIOCIWFIRSTPRIV + 2)
144 #define IOCTL_GET_ADDRESS               (SIOCIWFIRSTPRIV + 3)
145 #define IOCTL_SET_STR                   (SIOCIWFIRSTPRIV + 4)
146 #define IOCTL_GET_STR                   (SIOCIWFIRSTPRIV + 5)
147 #define IOCTL_SET_KEY                   (SIOCIWFIRSTPRIV + 6)
148 #define IOCTL_GET_KEY                   (SIOCIWFIRSTPRIV + 7)
149 #define IOCTL_SET_STRUCT                (SIOCIWFIRSTPRIV + 8)
150 #define IOCTL_GET_STRUCT                (SIOCIWFIRSTPRIV + 9)
151 #define IOCTL_SET_STRUCT_FOR_EM         (SIOCIWFIRSTPRIV + 11)
152 #define IOCTL_SET_INTS                  (SIOCIWFIRSTPRIV + 12)
153 #define IOCTL_GET_INTS                  (SIOCIWFIRSTPRIV + 13)
154
155 #define PRIV_CMD_REG_DOMAIN             0
156 #define PRIV_CMD_BEACON_PERIOD          1
157 #define PRIV_CMD_ADHOC_MODE             2
158
159 #if CFG_TCP_IP_CHKSUM_OFFLOAD
160     #define PRIV_CMD_CSUM_OFFLOAD       3
161 #endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */
162
163 #define PRIV_CMD_ROAMING                4
164 #define PRIV_CMD_VOIP_DELAY             5
165 #define PRIV_CMD_POWER_MODE             6
166
167 #define PRIV_CMD_WMM_PS                 7
168 #define PRIV_CMD_BT_COEXIST             8
169 #define PRIV_GPIO2_MODE                 9
170
171 #define PRIV_CUSTOM_SET_PTA                     10
172 #define PRIV_CUSTOM_CONTINUOUS_POLL     11
173 #define PRIV_CUSTOM_SINGLE_ANTENNA              12
174 #define PRIV_CUSTOM_BWCS_CMD                    13
175 #define PRIV_CUSTOM_DISABLE_BEACON_DETECTION    14//later
176 #define PRIV_CMD_OID                    15
177 #define PRIV_SEC_MSG_OID                16
178
179 #define PRIV_CMD_TEST_MODE              17
180 #define PRIV_CMD_TEST_CMD               18
181 #define PRIV_CMD_ACCESS_MCR             19
182 #define PRIV_CMD_SW_CTRL                20
183
184 #if 1 /* ANTI_PRIVCY */
185 #define PRIV_SEC_CHECK_OID              21
186 #endif
187
188 #define PRIV_CMD_WSC_PROBE_REQ          22
189
190 #define PRIV_CMD_P2P_VERSION                   23
191
192 #define PRIV_CMD_GET_CH_LIST            24
193
194 #define PRIV_CMD_SET_TX_POWER           25
195
196 #define PRIV_CMD_BAND_CONFIG            26
197
198 #define PRIV_CMD_DUMP_MEM               27
199
200 #define PRIV_CMD_P2P_MODE               28
201
202 #define PRIV_CMD_GET_BUILD_DATE_CODE    29
203
204 /* 802.3 Objects (Ethernet) */
205 #define OID_802_3_CURRENT_ADDRESS           0x01010102
206
207 /* IEEE 802.11 OIDs */
208 #define OID_802_11_SUPPORTED_RATES              0x0D01020E
209 #define OID_802_11_CONFIGURATION                0x0D010211
210
211 /* PnP and PM OIDs, NDIS default OIDS */
212 #define OID_PNP_SET_POWER                               0xFD010101
213
214 #define OID_CUSTOM_OID_INTERFACE_VERSION                0xFFA0C000
215
216 /* MT5921 specific OIDs */
217 #define OID_CUSTOM_BT_COEXIST_CTRL                      0xFFA0C580
218 #define OID_CUSTOM_POWER_MANAGEMENT_PROFILE             0xFFA0C581
219 #define OID_CUSTOM_PATTERN_CONFIG                       0xFFA0C582
220 #define OID_CUSTOM_BG_SSID_SEARCH_CONFIG                0xFFA0C583
221 #define OID_CUSTOM_VOIP_SETUP                           0xFFA0C584
222 #define OID_CUSTOM_ADD_TS                               0xFFA0C585
223 #define OID_CUSTOM_DEL_TS                               0xFFA0C586
224 #define OID_CUSTOM_SLT                               0xFFA0C587
225 #define OID_CUSTOM_ROAMING_EN                           0xFFA0C588
226 #define OID_CUSTOM_WMM_PS_TEST                          0xFFA0C589
227 #define OID_CUSTOM_COUNTRY_STRING                       0xFFA0C58A
228 #define OID_CUSTOM_MULTI_DOMAIN_CAPABILITY              0xFFA0C58B
229 #define OID_CUSTOM_GPIO2_MODE                           0xFFA0C58C
230 #define OID_CUSTOM_CONTINUOUS_POLL                      0xFFA0C58D
231 #define OID_CUSTOM_DISABLE_BEACON_DETECTION             0xFFA0C58E
232
233 /* CR1460, WPS privacy bit check disable */
234 #define OID_CUSTOM_DISABLE_PRIVACY_CHECK                0xFFA0C600
235
236 /* Precedent OIDs */
237 #define OID_CUSTOM_MCR_RW                               0xFFA0C801
238 #define OID_CUSTOM_EEPROM_RW                            0xFFA0C803
239 #define OID_CUSTOM_SW_CTRL                              0xFFA0C805
240 #define OID_CUSTOM_MEM_DUMP                             0xFFA0C807
241
242
243 /* RF Test specific OIDs */
244 #define OID_CUSTOM_TEST_MODE                            0xFFA0C901
245 #define OID_CUSTOM_TEST_RX_STATUS                       0xFFA0C903
246 #define OID_CUSTOM_TEST_TX_STATUS                       0xFFA0C905
247 #define OID_CUSTOM_ABORT_TEST_MODE                      0xFFA0C906
248 #define OID_CUSTOM_MTK_WIFI_TEST                        0xFFA0C911
249
250 /* BWCS */
251 #define OID_CUSTOM_BWCS_CMD                             0xFFA0C931
252 #define OID_CUSTOM_SINGLE_ANTENNA                       0xFFA0C932
253 #define OID_CUSTOM_SET_PTA                              0xFFA0C933
254
255 /* NVRAM */
256 #define OID_CUSTOM_MTK_NVRAM_RW                         0xFFA0C941
257 #define OID_CUSTOM_CFG_SRC_TYPE                         0xFFA0C942
258 #define OID_CUSTOM_EEPROM_TYPE                          0xFFA0C943
259
260
261 #if CFG_SUPPORT_WAPI
262 #define OID_802_11_WAPI_MODE                            0xFFA0CA00
263 #define OID_802_11_WAPI_ASSOC_INFO                      0xFFA0CA01
264 #define OID_802_11_SET_WAPI_KEY                         0xFFA0CA02
265 #endif
266
267 #if CFG_SUPPORT_WPS2
268 #define OID_802_11_WSC_ASSOC_INFO                       0xFFA0CB00
269 #endif
270
271
272 /* Define magic key of test mode (Don't change it for future compatibity) */
273 #define PRIV_CMD_TEST_MAGIC_KEY                         2011
274
275 /*******************************************************************************
276 *                             D A T A   T Y P E S
277 ********************************************************************************
278 */
279 /* NIC BBCR configuration entry structure */
280 typedef struct _PRIV_CONFIG_ENTRY {
281     UINT_8      ucOffset;
282     UINT_8      ucValue;
283 } PRIV_CONFIG_ENTRY, *PPRIV_CONFIG_ENTRY;
284
285 typedef WLAN_STATUS (*PFN_OID_HANDLER_FUNC_REQ) (
286     IN  PVOID       prAdapter,
287     IN OUT PVOID    pvBuf,
288     IN  UINT_32     u4BufLen,
289     OUT PUINT_32    pu4OutInfoLen
290     );
291
292 typedef enum _ENUM_OID_METHOD_T {
293     ENUM_OID_GLUE_ONLY,
294     ENUM_OID_GLUE_EXTENSION,
295     ENUM_OID_DRIVER_CORE
296 } ENUM_OID_METHOD_T, *P_ENUM_OID_METHOD_T;
297
298 /* OID set/query processing entry */
299 typedef struct _WLAN_REQ_ENTRY {
300     UINT_32            rOid;            /* OID */
301     PUINT_8             pucOidName;      /* OID name text */
302     BOOLEAN             fgQryBufLenChecking;
303     BOOLEAN             fgSetBufLenChecking;
304     ENUM_OID_METHOD_T   eOidMethod;
305     UINT_32             u4InfoBufLen;
306     PFN_OID_HANDLER_FUNC_REQ    pfOidQueryHandler; /*  PFN_OID_HANDLER_FUNC*/
307     PFN_OID_HANDLER_FUNC_REQ    pfOidSetHandler; /* PFN_OID_HANDLER_FUNC */
308 } WLAN_REQ_ENTRY, *P_WLAN_REQ_ENTRY;
309
310 typedef struct _NDIS_TRANSPORT_STRUCT {
311     UINT_32 ndisOidCmd;
312     UINT_32 inNdisOidlength;
313     UINT_32 outNdisOidLength;
314     UINT_8 ndisOidContent[16];
315 } NDIS_TRANSPORT_STRUCT, *P_NDIS_TRANSPORT_STRUCT;
316
317 /*******************************************************************************
318 *                            P U B L I C   D A T A
319 ********************************************************************************
320 */
321
322 /*******************************************************************************
323 *                           P R I V A T E   D A T A
324 ********************************************************************************
325 */
326
327 /*******************************************************************************
328 *                                 M A C R O S
329 ********************************************************************************
330 */
331
332 /*******************************************************************************
333 *                  F U N C T I O N   D E C L A R A T I O N S
334 ********************************************************************************
335 */
336
337 int
338 priv_set_int(
339     IN struct net_device *prNetDev,
340     IN struct iw_request_info *prIwReqInfo,
341     IN union iwreq_data *prIwReqData,
342     IN char *pcExtra
343     );
344
345 int
346 priv_get_int(
347     IN struct net_device *prNetDev,
348     IN struct iw_request_info *prIwReqInfo,
349     IN union iwreq_data *prIwReqData,
350     IN OUT char *pcExtra
351     );
352
353 int
354 priv_set_ints(
355     IN struct net_device *prNetDev,
356     IN struct iw_request_info *prIwReqInfo,
357     IN union iwreq_data *prIwReqData,
358     IN char *pcExtra
359     );
360
361 int
362 priv_get_ints(
363     IN struct net_device *prNetDev,
364     IN struct iw_request_info *prIwReqInfo,
365     IN union iwreq_data *prIwReqData,
366     IN OUT char *pcExtra
367     );
368
369 int
370 priv_set_struct(
371     IN struct net_device *prNetDev,
372     IN struct iw_request_info *prIwReqInfo,
373     IN union iwreq_data *prIwReqData,
374     IN char *pcExtra
375     );
376
377 int
378 priv_get_struct (
379     IN struct net_device *prNetDev,
380     IN struct iw_request_info *prIwReqInfo,
381     IN union iwreq_data *prIwReqData,
382     IN OUT char *pcExtra
383     );
384
385 int
386 priv_support_ioctl (
387     IN struct net_device *prDev,
388     IN OUT struct ifreq *prReq,
389     IN int i4Cmd
390     );
391
392 /*******************************************************************************
393 *                              F U N C T I O N S
394 ********************************************************************************
395 */
396
397 #endif /* _GL_WEXT_PRIV_H */
398