Staging: vt6655: remove U16 custom macro
[deliverable/linux.git] / drivers / staging / vt6655 / iocmd.h
CommitLineData
1cb648b3 1/*
612822f5
JL
2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
3 * All rights reserved.
1cb648b3
FB
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * File: iocmd.h
20 *
21 * Purpose: Handles the viawget ioctl private interface functions
22 *
23 * Author: Lyndon Chen
24 *
25 * Date: May 8, 2002
26 *
27 */
28
29#ifndef __IOCMD_H__
30#define __IOCMD_H__
31
1cb648b3 32#include "ttype.h"
1cb648b3
FB
33
34/*--------------------- Export Definitions -------------------------*/
35
36#if !defined(DEF)
37#define DEF
38#endif
39
40//typedef int BOOL;
41//typedef uint32_t u32;
42//typedef uint16_t u16;
43//typedef uint8_t u8;
44
45
46// ioctl Command code
47#define MAGIC_CODE 0x3142
48#define IOCTL_CMD_TEST (SIOCDEVPRIVATE + 0)
49#define IOCTL_CMD_SET (SIOCDEVPRIVATE + 1)
50#define IOCTL_CMD_HOSTAPD (SIOCDEVPRIVATE + 2)
51#define IOCTL_CMD_WPA (SIOCDEVPRIVATE + 3)
52
53
54typedef enum tagWMAC_CMD {
55
56 WLAN_CMD_BSS_SCAN,
57 WLAN_CMD_BSS_JOIN,
58 WLAN_CMD_DISASSOC,
59 WLAN_CMD_SET_WEP,
60 WLAN_CMD_GET_LINK,
61 WLAN_CMD_GET_LISTLEN,
62 WLAN_CMD_GET_LIST,
63 WLAN_CMD_GET_MIB,
64 WLAN_CMD_GET_STAT,
65 WLAN_CMD_STOP_MAC,
66 WLAN_CMD_START_MAC,
67 WLAN_CMD_AP_START,
68 WLAN_CMD_SET_HOSTAPD,
69 WLAN_CMD_SET_HOSTAPD_STA,
70 WLAN_CMD_SET_802_1X,
71 WLAN_CMD_SET_HOST_WEP,
72 WLAN_CMD_SET_WPA,
73 WLAN_CMD_GET_NODE_CNT,
612822f5 74 WLAN_CMD_ZONETYPE_SET,
1cb648b3
FB
75 WLAN_CMD_GET_NODE_LIST
76
a884847a 77} WMAC_CMD, *PWMAC_CMD;
1cb648b3 78
612822f5 79typedef enum tagWZONETYPE {
1cb648b3
FB
80 ZoneType_USA=0,
81 ZoneType_Japan=1,
82 ZoneType_Europe=2
83}WZONETYPE;
84
85#define ADHOC 0
86#define INFRA 1
87#define BOTH 2
88#define AP 3
89
90#define ADHOC_STARTED 1
91#define ADHOC_JOINTED 2
92
93
94#define PHY80211a 0
95#define PHY80211b 1
96#define PHY80211g 2
97
98#define SSID_ID 0
99#define SSID_MAXLEN 32
100#define BSSID_LEN 6
101#define WEP_NKEYS 4
102#define WEP_KEYMAXLEN 29
103#define WEP_40BIT_LEN 5
104#define WEP_104BIT_LEN 13
105#define WEP_232BIT_LEN 16
106
1cb648b3
FB
107// Ioctl interface structure
108// Command structure
109//
110#pragma pack(1)
111typedef struct tagSCmdRequest {
737c3d70 112 u8 name[16];
1cb648b3 113 void *data;
c17ce8c2
CC
114 u16 wResult;
115 u16 wCmdCode;
1cb648b3
FB
116} SCmdRequest, *PSCmdRequest;
117
1cb648b3
FB
118//
119// Scan
120//
121
122typedef struct tagSCmdScan {
123
737c3d70 124 u8 ssid[SSID_MAXLEN + 2];
1cb648b3
FB
125
126} SCmdScan, *PSCmdScan;
127
128
129//
130// BSS Join
131//
132
133typedef struct tagSCmdBSSJoin {
134
c17ce8c2
CC
135 u16 wBSSType;
136 u16 wBBPType;
737c3d70 137 u8 ssid[SSID_MAXLEN + 2];
1cb648b3
FB
138 U32 uChannel;
139 BOOL bPSEnable;
140 BOOL bShareKeyAuth;
141
142} SCmdBSSJoin, *PSCmdBSSJoin;
143
612822f5
JL
144//
145// Zonetype Setting
146//
147
1cb648b3
FB
148typedef struct tagSCmdZoneTypeSet {
149
150 BOOL bWrite;
151 WZONETYPE ZoneType;
152
153} SCmdZoneTypeSet, *PSCmdZoneTypeSet;
154
155#ifdef WPA_SM_Transtatus
156typedef struct tagSWPAResult {
157 char ifname[100];
737c3d70
CC
158 u8 proto;
159 u8 key_mgmt;
160 u8 eap_type;
1cb648b3
FB
161 BOOL authenticated;
162} SWPAResult, *PSWPAResult;
163#endif
164
1cb648b3
FB
165typedef struct tagSCmdStartAP {
166
c17ce8c2
CC
167 u16 wBSSType;
168 u16 wBBPType;
737c3d70 169 u8 ssid[SSID_MAXLEN + 2];
1cb648b3
FB
170 U32 uChannel;
171 U32 uBeaconInt;
172 BOOL bShareKeyAuth;
737c3d70 173 u8 byBasicRate;
1cb648b3
FB
174
175} SCmdStartAP, *PSCmdStartAP;
176
177
178typedef struct tagSCmdSetWEP {
179
180 BOOL bEnableWep;
737c3d70
CC
181 u8 byKeyIndex;
182 u8 abyWepKey[WEP_NKEYS][WEP_KEYMAXLEN];
1cb648b3
FB
183 BOOL bWepKeyAvailable[WEP_NKEYS];
184 U32 auWepKeyLength[WEP_NKEYS];
185
186} SCmdSetWEP, *PSCmdSetWEP;
187
188
189
190typedef struct tagSBSSIDItem {
191
192 U32 uChannel;
737c3d70
CC
193 u8 abyBSSID[BSSID_LEN];
194 u8 abySSID[SSID_MAXLEN + 1];
1cb648b3 195 //2006-1116-01,<Modify> by NomadZhao
c17ce8c2
CC
196 //u16 wBeaconInterval;
197 //u16 wCapInfo;
737c3d70
CC
198 //u8 byNetType;
199 u8 byNetType;
c17ce8c2
CC
200 u16 wBeaconInterval;
201 u16 wCapInfo; // for address of byNetType at align 4
1cb648b3
FB
202
203 BOOL bWEPOn;
204 U32 uRSSI;
205
206} SBSSIDItem;
207
208
209typedef struct tagSBSSIDList {
210
211 U32 uItem;
212 SBSSIDItem sBSSIDList[0];
213} SBSSIDList, *PSBSSIDList;
214
215
216typedef struct tagSCmdLinkStatus {
217
218 BOOL bLink;
c17ce8c2 219 u16 wBSSType;
737c3d70
CC
220 u8 byState;
221 u8 abyBSSID[BSSID_LEN];
222 u8 abySSID[SSID_MAXLEN + 2];
1cb648b3
FB
223 U32 uChannel;
224 U32 uLinkRate;
225
226} SCmdLinkStatus, *PSCmdLinkStatus;
227
228//
229// 802.11 counter
230//
231typedef struct tagSDot11MIBCount {
232 U32 TransmittedFragmentCount;
233 U32 MulticastTransmittedFrameCount;
234 U32 FailedCount;
235 U32 RetryCount;
236 U32 MultipleRetryCount;
237 U32 RTSSuccessCount;
238 U32 RTSFailureCount;
239 U32 ACKFailureCount;
240 U32 FrameDuplicateCount;
241 U32 ReceivedFragmentCount;
242 U32 MulticastReceivedFrameCount;
243 U32 FCSErrorCount;
a884847a 244} SDot11MIBCount, *PSDot11MIBCount;
1cb648b3
FB
245
246
247
248//
249// statistic counter
250//
251typedef struct tagSStatMIBCount {
252 //
253 // ISR status count
254 //
255 U32 dwIsrTx0OK;
256 U32 dwIsrTx1OK;
257 U32 dwIsrBeaconTxOK;
258 U32 dwIsrRxOK;
259 U32 dwIsrTBTTInt;
260 U32 dwIsrSTIMERInt;
261 U32 dwIsrUnrecoverableError;
262 U32 dwIsrSoftInterrupt;
263 U32 dwIsrRxNoBuf;
264 /////////////////////////////////////
265
266 U32 dwIsrUnknown; // unknown interrupt count
267
268 // RSR status count
269 //
270 U32 dwRsrFrmAlgnErr;
271 U32 dwRsrErr;
272 U32 dwRsrCRCErr;
273 U32 dwRsrCRCOk;
274 U32 dwRsrBSSIDOk;
275 U32 dwRsrADDROk;
276 U32 dwRsrICVOk;
277 U32 dwNewRsrShortPreamble;
278 U32 dwRsrLong;
279 U32 dwRsrRunt;
280
281 U32 dwRsrRxControl;
282 U32 dwRsrRxData;
283 U32 dwRsrRxManage;
284
285 U32 dwRsrRxPacket;
286 U32 dwRsrRxOctet;
287 U32 dwRsrBroadcast;
288 U32 dwRsrMulticast;
289 U32 dwRsrDirected;
290 // 64-bit OID
291 U32 ullRsrOK;
292
293 // for some optional OIDs (64 bits) and DMI support
294 U32 ullRxBroadcastBytes;
295 U32 ullRxMulticastBytes;
296 U32 ullRxDirectedBytes;
297 U32 ullRxBroadcastFrames;
298 U32 ullRxMulticastFrames;
299 U32 ullRxDirectedFrames;
300
301 U32 dwRsrRxFragment;
302 U32 dwRsrRxFrmLen64;
303 U32 dwRsrRxFrmLen65_127;
304 U32 dwRsrRxFrmLen128_255;
305 U32 dwRsrRxFrmLen256_511;
306 U32 dwRsrRxFrmLen512_1023;
307 U32 dwRsrRxFrmLen1024_1518;
308
309 // TSR0,1 status count
310 //
311 U32 dwTsrTotalRetry[2]; // total collision retry count
312 U32 dwTsrOnceRetry[2]; // this packet only occur one collision
313 U32 dwTsrMoreThanOnceRetry[2]; // this packet occur more than one collision
314 U32 dwTsrRetry[2]; // this packet has ever occur collision,
315 // that is (dwTsrOnceCollision0 + dwTsrMoreThanOnceCollision0)
316 U32 dwTsrACKData[2];
317 U32 dwTsrErr[2];
318 U32 dwAllTsrOK[2];
319 U32 dwTsrRetryTimeout[2];
320 U32 dwTsrTransmitTimeout[2];
321
322 U32 dwTsrTxPacket[2];
323 U32 dwTsrTxOctet[2];
324 U32 dwTsrBroadcast[2];
325 U32 dwTsrMulticast[2];
326 U32 dwTsrDirected[2];
327
328 // RD/TD count
329 U32 dwCntRxFrmLength;
330 U32 dwCntTxBufLength;
331
737c3d70
CC
332 u8 abyCntRxPattern[16];
333 u8 abyCntTxPattern[16];
1cb648b3
FB
334
335 // Software check....
336 U32 dwCntRxDataErr; // rx buffer data software compare CRC err count
337 U32 dwCntDecryptErr; // rx buffer data software compare CRC err count
338 U32 dwCntRxICVErr; // rx buffer data software compare CRC err count
339 U32 idxRxErrorDesc; // index for rx data error RD
340
341 // 64-bit OID
342 U32 ullTsrOK[2];
343
344 // for some optional OIDs (64 bits) and DMI support
345 U32 ullTxBroadcastFrames[2];
346 U32 ullTxMulticastFrames[2];
347 U32 ullTxDirectedFrames[2];
348 U32 ullTxBroadcastBytes[2];
349 U32 ullTxMulticastBytes[2];
350 U32 ullTxDirectedBytes[2];
a884847a 351} SStatMIBCount, *PSStatMIBCount;
1cb648b3
FB
352
353
354typedef struct tagSNodeItem {
355 // STA info
c17ce8c2 356 u16 wAID;
737c3d70 357 u8 abyMACAddr[6];
c17ce8c2
CC
358 u16 wTxDataRate;
359 u16 wInActiveCount;
360 u16 wEnQueueCnt;
361 u16 wFlags;
1cb648b3 362 BOOL bPWBitOn;
737c3d70 363 u8 byKeyIndex;
c17ce8c2 364 u16 wWepKeyLength;
737c3d70 365 u8 abyWepKey[WEP_KEYMAXLEN];
1cb648b3
FB
366 // Auto rate fallback vars
367 BOOL bIsInFallback;
368 U32 uTxFailures;
369 U32 uTxAttempts;
c17ce8c2 370 u16 wFailureRatio;
1cb648b3
FB
371
372} SNodeItem;
373
374
375typedef struct tagSNodeList {
376
377 U32 uItem;
378 SNodeItem sNodeList[0];
379
380} SNodeList, *PSNodeList;
381
382
383
384typedef struct tagSCmdValue {
385
386 U32 dwValue;
387
388} SCmdValue, *PSCmdValue;
389
390
391//
392// hostapd & viawget ioctl related
393//
394
395
396// VIAGWET_IOCTL_HOSTAPD ioctl() cmd:
397enum {
398 VIAWGET_HOSTAPD_FLUSH = 1,
399 VIAWGET_HOSTAPD_ADD_STA = 2,
400 VIAWGET_HOSTAPD_REMOVE_STA = 3,
401 VIAWGET_HOSTAPD_GET_INFO_STA = 4,
402 VIAWGET_HOSTAPD_SET_ENCRYPTION = 5,
403 VIAWGET_HOSTAPD_GET_ENCRYPTION = 6,
404 VIAWGET_HOSTAPD_SET_FLAGS_STA = 7,
405 VIAWGET_HOSTAPD_SET_ASSOC_AP_ADDR = 8,
406 VIAWGET_HOSTAPD_SET_GENERIC_ELEMENT = 9,
407 VIAWGET_HOSTAPD_MLME = 10,
408 VIAWGET_HOSTAPD_SCAN_REQ = 11,
409 VIAWGET_HOSTAPD_STA_CLEAR_STATS = 12,
410};
411
412
413#define VIAWGET_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \
414((int) (&((struct viawget_hostapd_param *) 0)->u.generic_elem.data))
415
416// Maximum length for algorithm names (-1 for nul termination) used in ioctl()
417
418
419
420struct viawget_hostapd_param {
421 U32 cmd;
737c3d70 422 u8 sta_addr[6];
1cb648b3
FB
423 union {
424 struct {
c17ce8c2
CC
425 u16 aid;
426 u16 capability;
737c3d70 427 u8 tx_supp_rates;
1cb648b3
FB
428 } add_sta;
429 struct {
430 U32 inactive_sec;
431 } get_info_sta;
432 struct {
737c3d70 433 u8 alg;
1cb648b3
FB
434 U32 flags;
435 U32 err;
737c3d70
CC
436 u8 idx;
437 u8 seq[8];
c17ce8c2 438 u16 key_len;
737c3d70 439 u8 key[0];
1cb648b3
FB
440 } crypt;
441 struct {
442 U32 flags_and;
443 U32 flags_or;
444 } set_flags_sta;
445 struct {
c17ce8c2
CC
446 u16 rid;
447 u16 len;
737c3d70 448 u8 data[0];
1cb648b3
FB
449 } rid;
450 struct {
737c3d70
CC
451 u8 len;
452 u8 data[0];
1cb648b3
FB
453 } generic_elem;
454 struct {
c17ce8c2
CC
455 u16 cmd;
456 u16 reason_code;
1cb648b3
FB
457 } mlme;
458 struct {
737c3d70
CC
459 u8 ssid_len;
460 u8 ssid[32];
1cb648b3
FB
461 } scan_req;
462 } u;
463};
464
465//2006-1116-01,<Add> by NomadZhao
466#pragma pack()
467
468/*--------------------- Export Classes ----------------------------*/
469
470/*--------------------- Export Variables --------------------------*/
471
472
473/*--------------------- Export Types ------------------------------*/
474
475
476/*--------------------- Export Functions --------------------------*/
477
478
479
480#endif //__IOCMD_H__
This page took 0.149521 seconds and 5 git commands to generate.