xenbus_client.c: correct exit path for xenbus_map_ring_valloc_hvm
[linux/fpc-iii.git] / drivers / staging / vt6656 / iocmd.h
blobf3406da7336e0cab1c3f32a176563c1f3012e9cb
1 /*
2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
3 * All rights reserved.
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.
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.
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.
19 * File: iocmd.h
21 * Purpose: Handles the viawget ioctl private interface functions
23 * Author: Lyndon Chen
25 * Date: May 8, 2002
29 #ifndef __IOCMD_H__
30 #define __IOCMD_H__
32 // ioctl Command code
33 #define MAGIC_CODE 0x3142
34 #define IOCTL_CMD_TEST (SIOCDEVPRIVATE + 0)
35 #define IOCTL_CMD_SET (SIOCDEVPRIVATE + 1)
36 #define IOCTL_CMD_HOSTAPD (SIOCDEVPRIVATE + 2)
37 #define IOCTL_CMD_WPA (SIOCDEVPRIVATE + 3)
39 typedef enum tagWMAC_CMD {
41 WLAN_CMD_BSS_SCAN,
42 WLAN_CMD_BSS_JOIN,
43 WLAN_CMD_DISASSOC,
44 WLAN_CMD_SET_WEP,
45 WLAN_CMD_GET_LINK,
46 WLAN_CMD_GET_LISTLEN,
47 WLAN_CMD_GET_LIST,
48 WLAN_CMD_GET_MIB,
49 WLAN_CMD_GET_STAT,
50 WLAN_CMD_STOP_MAC,
51 WLAN_CMD_START_MAC,
52 WLAN_CMD_AP_START,
53 WLAN_CMD_SET_HOSTAPD,
54 WLAN_CMD_SET_HOSTAPD_STA,
55 WLAN_CMD_SET_802_1X,
56 WLAN_CMD_SET_HOST_WEP,
57 WLAN_CMD_SET_WPA,
58 WLAN_CMD_GET_NODE_CNT,
59 WLAN_CMD_ZONETYPE_SET,
60 WLAN_CMD_GET_NODE_LIST
62 } WMAC_CMD, *PWMAC_CMD;
64 typedef enum tagWZONETYPE {
65 ZoneType_USA = 0,
66 ZoneType_Japan = 1,
67 ZoneType_Europe = 2
68 } WZONETYPE;
70 #define ADHOC 0
71 #define INFRA 1
72 #define BOTH 2
73 #define AP 3
75 #define ADHOC_STARTED 1
76 #define ADHOC_JOINTED 2
78 #define PHY80211a 0
79 #define PHY80211b 1
80 #define PHY80211g 2
82 #define SSID_ID 0
83 #define SSID_MAXLEN 32
84 #define BSSID_LEN 6
85 #define WEP_NKEYS 4
86 #define WEP_KEYMAXLEN 29
87 #define WEP_40BIT_LEN 5
88 #define WEP_104BIT_LEN 13
89 #define WEP_232BIT_LEN 16
91 // Ioctl interface structure
92 // Command structure
94 typedef struct tagSCmdRequest {
95 u8 name[16];
96 void *data;
97 u16 wResult;
98 u16 wCmdCode;
99 } __packed SCmdRequest, *PSCmdRequest;
102 // Scan
105 typedef struct tagSCmdScan {
107 u8 ssid[SSID_MAXLEN + 2];
109 } __packed SCmdScan, *PSCmdScan;
112 // BSS Join
115 typedef struct tagSCmdBSSJoin {
117 u16 wBSSType;
118 u16 wBBPType;
119 u8 ssid[SSID_MAXLEN + 2];
120 u32 uChannel;
121 bool bPSEnable;
122 bool bShareKeyAuth;
124 } __packed SCmdBSSJoin, *PSCmdBSSJoin;
127 // Zonetype Setting
130 typedef struct tagSCmdZoneTypeSet {
132 bool bWrite;
133 WZONETYPE ZoneType;
135 } __packed SCmdZoneTypeSet, *PSCmdZoneTypeSet;
137 typedef struct tagSWPAResult {
138 char ifname[100];
139 u8 proto;
140 u8 key_mgmt;
141 u8 eap_type;
142 bool authenticated;
143 } __packed SWPAResult, *PSWPAResult;
145 typedef struct tagSCmdStartAP {
147 u16 wBSSType;
148 u16 wBBPType;
149 u8 ssid[SSID_MAXLEN + 2];
150 u32 uChannel;
151 u32 uBeaconInt;
152 bool bShareKeyAuth;
153 u8 byBasicRate;
155 } __packed SCmdStartAP, *PSCmdStartAP;
157 typedef struct tagSCmdSetWEP {
159 bool bEnableWep;
160 u8 byKeyIndex;
161 u8 abyWepKey[WEP_NKEYS][WEP_KEYMAXLEN];
162 bool bWepKeyAvailable[WEP_NKEYS];
163 u32 auWepKeyLength[WEP_NKEYS];
165 } __packed SCmdSetWEP, *PSCmdSetWEP;
167 typedef struct tagSBSSIDItem {
169 u32 uChannel;
170 u8 abyBSSID[BSSID_LEN];
171 u8 abySSID[SSID_MAXLEN + 1];
172 u16 wBeaconInterval;
173 u16 wCapInfo;
174 u8 byNetType;
175 bool bWEPOn;
176 u32 uRSSI;
178 } __packed SBSSIDItem;
180 typedef struct tagSBSSIDList {
182 u32 uItem;
183 SBSSIDItem sBSSIDList[0];
184 } __packed SBSSIDList, *PSBSSIDList;
186 typedef struct tagSNodeItem {
187 // STA info
188 u16 wAID;
189 u8 abyMACAddr[6];
190 u16 wTxDataRate;
191 u16 wInActiveCount;
192 u16 wEnQueueCnt;
193 u16 wFlags;
194 bool bPWBitOn;
195 u8 byKeyIndex;
196 u16 wWepKeyLength;
197 u8 abyWepKey[WEP_KEYMAXLEN];
198 // Auto rate fallback vars
199 bool bIsInFallback;
200 u32 uTxFailures;
201 u32 uTxAttempts;
202 u16 wFailureRatio;
204 } __packed SNodeItem;
206 typedef struct tagSNodeList {
208 u32 uItem;
209 SNodeItem sNodeList[0];
211 } __packed SNodeList, *PSNodeList;
213 typedef struct tagSCmdLinkStatus {
215 bool bLink;
216 u16 wBSSType;
217 u8 byState;
218 u8 abyBSSID[BSSID_LEN];
219 u8 abySSID[SSID_MAXLEN + 2];
220 u32 uChannel;
221 u32 uLinkRate;
223 } __packed SCmdLinkStatus, *PSCmdLinkStatus;
226 // 802.11 counter
228 typedef struct tagSDot11MIBCount {
229 u32 TransmittedFragmentCount;
230 u32 MulticastTransmittedFrameCount;
231 u32 FailedCount;
232 u32 RetryCount;
233 u32 MultipleRetryCount;
234 u32 RTSSuccessCount;
235 u32 RTSFailureCount;
236 u32 ACKFailureCount;
237 u32 FrameDuplicateCount;
238 u32 ReceivedFragmentCount;
239 u32 MulticastReceivedFrameCount;
240 u32 FCSErrorCount;
241 } __packed SDot11MIBCount, *PSDot11MIBCount;
244 // statistic counter
246 typedef struct tagSStatMIBCount {
248 // ISR status count
250 u32 dwIsrTx0OK;
251 u32 dwIsrTx1OK;
252 u32 dwIsrBeaconTxOK;
253 u32 dwIsrRxOK;
254 u32 dwIsrTBTTInt;
255 u32 dwIsrSTIMERInt;
256 u32 dwIsrUnrecoverableError;
257 u32 dwIsrSoftInterrupt;
258 u32 dwIsrRxNoBuf;
259 /////////////////////////////////////
261 u32 dwIsrUnknown; /* unknown interrupt count */
263 // RSR status count
265 u32 dwRsrFrmAlgnErr;
266 u32 dwRsrErr;
267 u32 dwRsrCRCErr;
268 u32 dwRsrCRCOk;
269 u32 dwRsrBSSIDOk;
270 u32 dwRsrADDROk;
271 u32 dwRsrICVOk;
272 u32 dwNewRsrShortPreamble;
273 u32 dwRsrLong;
274 u32 dwRsrRunt;
276 u32 dwRsrRxControl;
277 u32 dwRsrRxData;
278 u32 dwRsrRxManage;
280 u32 dwRsrRxPacket;
281 u32 dwRsrRxOctet;
282 u32 dwRsrBroadcast;
283 u32 dwRsrMulticast;
284 u32 dwRsrDirected;
285 // 64-bit OID
286 u32 ullRsrOK;
288 // for some optional OIDs (64 bits) and DMI support
289 u32 ullRxBroadcastBytes;
290 u32 ullRxMulticastBytes;
291 u32 ullRxDirectedBytes;
292 u32 ullRxBroadcastFrames;
293 u32 ullRxMulticastFrames;
294 u32 ullRxDirectedFrames;
296 u32 dwRsrRxFragment;
297 u32 dwRsrRxFrmLen64;
298 u32 dwRsrRxFrmLen65_127;
299 u32 dwRsrRxFrmLen128_255;
300 u32 dwRsrRxFrmLen256_511;
301 u32 dwRsrRxFrmLen512_1023;
302 u32 dwRsrRxFrmLen1024_1518;
304 // TSR0,1 status count
306 u32 dwTsrTotalRetry[2]; /* total collision retry count */
307 u32 dwTsrOnceRetry[2]; /* this packet had one collision */
308 u32 dwTsrMoreThanOnceRetry[2]; /* this packet had many collisions */
309 u32 dwTsrRetry[2]; /* this packet has ever occur collision,
310 * that is (dwTsrOnceCollision0 plus
311 * dwTsrMoreThanOnceCollision0) */
312 u32 dwTsrACKData[2];
313 u32 dwTsrErr[2];
314 u32 dwAllTsrOK[2];
315 u32 dwTsrRetryTimeout[2];
316 u32 dwTsrTransmitTimeout[2];
318 u32 dwTsrTxPacket[2];
319 u32 dwTsrTxOctet[2];
320 u32 dwTsrBroadcast[2];
321 u32 dwTsrMulticast[2];
322 u32 dwTsrDirected[2];
324 // RD/TD count
325 u32 dwCntRxFrmLength;
326 u32 dwCntTxBufLength;
328 u8 abyCntRxPattern[16];
329 u8 abyCntTxPattern[16];
331 /* Software check.... */
332 u32 dwCntRxDataErr; /* rx buffer data CRC err count */
333 u32 dwCntDecryptErr; /* rx buffer data CRC err count */
334 u32 dwCntRxICVErr; /* rx buffer data CRC err count */
335 u32 idxRxErrorDesc; /* index for rx data error RD */
337 /* 64-bit OID */
338 u32 ullTsrOK[2];
340 // for some optional OIDs (64 bits) and DMI support
341 u32 ullTxBroadcastFrames[2];
342 u32 ullTxMulticastFrames[2];
343 u32 ullTxDirectedFrames[2];
344 u32 ullTxBroadcastBytes[2];
345 u32 ullTxMulticastBytes[2];
346 u32 ullTxDirectedBytes[2];
347 } __packed SStatMIBCount, *PSStatMIBCount;
349 typedef struct tagSCmdValue {
351 u32 dwValue;
353 } __packed SCmdValue, *PSCmdValue;
356 // hostapd & viawget ioctl related
359 // VIAGWET_IOCTL_HOSTAPD ioctl() cmd:
360 enum {
361 VIAWGET_HOSTAPD_FLUSH = 1,
362 VIAWGET_HOSTAPD_ADD_STA = 2,
363 VIAWGET_HOSTAPD_REMOVE_STA = 3,
364 VIAWGET_HOSTAPD_GET_INFO_STA = 4,
365 VIAWGET_HOSTAPD_SET_ENCRYPTION = 5,
366 VIAWGET_HOSTAPD_GET_ENCRYPTION = 6,
367 VIAWGET_HOSTAPD_SET_FLAGS_STA = 7,
368 VIAWGET_HOSTAPD_SET_ASSOC_AP_ADDR = 8,
369 VIAWGET_HOSTAPD_SET_GENERIC_ELEMENT = 9,
370 VIAWGET_HOSTAPD_MLME = 10,
371 VIAWGET_HOSTAPD_SCAN_REQ = 11,
372 VIAWGET_HOSTAPD_STA_CLEAR_STATS = 12,
375 #define VIAWGET_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \
376 ((int) (&((struct viawget_hostapd_param *) 0)->u.generic_elem.data))
378 // Maximum length for algorithm names (-1 for nul termination) used in ioctl()
380 struct viawget_hostapd_param {
381 u32 cmd;
382 u8 sta_addr[6];
383 union {
384 struct {
385 u16 aid;
386 u16 capability;
387 u8 tx_supp_rates;
388 } add_sta;
389 struct {
390 u32 inactive_sec;
391 } get_info_sta;
392 struct {
393 u8 alg;
394 u32 flags;
395 u32 err;
396 u8 idx;
397 u8 seq[8];
398 u16 key_len;
399 u8 key[0];
400 } crypt;
401 struct {
402 u32 flags_and;
403 u32 flags_or;
404 } set_flags_sta;
405 struct {
406 u16 rid;
407 u16 len;
408 u8 data[0];
409 } rid;
410 struct {
411 u8 len;
412 u8 data[0];
413 } generic_elem;
414 struct {
415 u16 cmd;
416 u16 reason_code;
417 } mlme;
418 struct {
419 u8 ssid_len;
420 u8 ssid[32];
421 } scan_req;
422 } u;
423 } __packed;
425 #endif /* __IOCMD_H__ */