staging: vt6655: dead code remove iowpa.h
[linux-2.6/btrfs-unstable.git] / drivers / staging / vt6655 / iocmd.h
blob804c903404a1c0195e53f18f943fe5c455b73c97
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 #include "ttype.h"
34 /* ioctl Command code */
35 #define MAGIC_CODE 0x3142
36 #define IOCTL_CMD_TEST (SIOCDEVPRIVATE + 0)
37 #define IOCTL_CMD_SET (SIOCDEVPRIVATE + 1)
38 #define IOCTL_CMD_HOSTAPD (SIOCDEVPRIVATE + 2)
39 #define IOCTL_CMD_WPA (SIOCDEVPRIVATE + 3)
41 typedef enum tagWMAC_CMD {
42 WLAN_CMD_BSS_SCAN,
43 WLAN_CMD_BSS_JOIN,
44 WLAN_CMD_DISASSOC,
45 WLAN_CMD_SET_WEP,
46 WLAN_CMD_GET_LINK,
47 WLAN_CMD_GET_LISTLEN,
48 WLAN_CMD_GET_LIST,
49 WLAN_CMD_GET_MIB,
50 WLAN_CMD_GET_STAT,
51 WLAN_CMD_STOP_MAC,
52 WLAN_CMD_START_MAC,
53 WLAN_CMD_AP_START,
54 WLAN_CMD_SET_HOSTAPD,
55 WLAN_CMD_SET_HOSTAPD_STA,
56 WLAN_CMD_SET_802_1X,
57 WLAN_CMD_SET_HOST_WEP,
58 WLAN_CMD_SET_WPA,
59 WLAN_CMD_GET_NODE_CNT,
60 WLAN_CMD_ZONETYPE_SET,
61 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, Command structure */
92 #pragma pack(1)
93 typedef struct tagSCmdRequest {
94 u8 name[16];
95 void __user *data;
96 u16 wResult;
97 u16 wCmdCode;
98 } SCmdRequest, *PSCmdRequest;
100 /* Scan */
101 typedef struct tagSCmdScan {
102 u8 ssid[SSID_MAXLEN + 2];
103 } SCmdScan, *PSCmdScan;
105 /* BSS Join */
106 typedef struct tagSCmdBSSJoin {
107 u16 wBSSType;
108 u16 wBBPType;
109 u8 ssid[SSID_MAXLEN + 2];
110 u32 uChannel;
111 bool bPSEnable;
112 bool bShareKeyAuth;
113 } SCmdBSSJoin, *PSCmdBSSJoin;
115 /* Zonetype Setting */
116 typedef struct tagSCmdZoneTypeSet {
117 bool bWrite;
118 WZONETYPE ZoneType;
119 } SCmdZoneTypeSet, *PSCmdZoneTypeSet;
121 #ifdef WPA_SM_Transtatus
122 typedef struct tagSWPAResult {
123 char ifname[100];
124 u8 proto;
125 u8 key_mgmt;
126 u8 eap_type;
127 bool authenticated;
128 } SWPAResult, *PSWPAResult;
129 #endif
131 typedef struct tagSCmdStartAP {
132 u16 wBSSType;
133 u16 wBBPType;
134 u8 ssid[SSID_MAXLEN + 2];
135 u32 uChannel;
136 u32 uBeaconInt;
137 bool bShareKeyAuth;
138 u8 byBasicRate;
139 } SCmdStartAP, *PSCmdStartAP;
141 typedef struct tagSCmdSetWEP {
142 bool bEnableWep;
143 u8 byKeyIndex;
144 u8 abyWepKey[WEP_NKEYS][WEP_KEYMAXLEN];
145 bool bWepKeyAvailable[WEP_NKEYS];
146 u32 auWepKeyLength[WEP_NKEYS];
147 } SCmdSetWEP, *PSCmdSetWEP;
149 typedef struct tagSBSSIDItem {
150 u32 uChannel;
151 u8 abyBSSID[BSSID_LEN];
152 u8 abySSID[SSID_MAXLEN + 1];
153 u8 byNetType;
154 u16 wBeaconInterval;
155 u16 wCapInfo; /* for address of byNetType at align 4 */
157 bool bWEPOn;
158 u32 uRSSI;
159 } SBSSIDItem;
161 typedef struct tagSBSSIDList {
162 u32 uItem;
163 SBSSIDItem sBSSIDList[0];
164 } SBSSIDList, *PSBSSIDList;
166 typedef struct tagSCmdLinkStatus {
167 bool bLink;
168 u16 wBSSType;
169 u8 byState;
170 u8 abyBSSID[BSSID_LEN];
171 u8 abySSID[SSID_MAXLEN + 2];
172 u32 uChannel;
173 u32 uLinkRate;
174 } SCmdLinkStatus, *PSCmdLinkStatus;
176 /* 802.11 counter */
177 typedef struct tagSDot11MIBCount {
178 u32 TransmittedFragmentCount;
179 u32 MulticastTransmittedFrameCount;
180 u32 FailedCount;
181 u32 RetryCount;
182 u32 MultipleRetryCount;
183 u32 RTSSuccessCount;
184 u32 RTSFailureCount;
185 u32 ACKFailureCount;
186 u32 FrameDuplicateCount;
187 u32 ReceivedFragmentCount;
188 u32 MulticastReceivedFrameCount;
189 u32 FCSErrorCount;
190 } SDot11MIBCount, *PSDot11MIBCount;
192 /* statistic counter */
193 typedef struct tagSStatMIBCount {
194 /* ISR status count */
195 u32 dwIsrTx0OK;
196 u32 dwIsrTx1OK;
197 u32 dwIsrBeaconTxOK;
198 u32 dwIsrRxOK;
199 u32 dwIsrTBTTInt;
200 u32 dwIsrSTIMERInt;
201 u32 dwIsrUnrecoverableError;
202 u32 dwIsrSoftInterrupt;
203 u32 dwIsrRxNoBuf;
205 u32 dwIsrUnknown;
207 /* RSR status count */
208 u32 dwRsrFrmAlgnErr;
209 u32 dwRsrErr;
210 u32 dwRsrCRCErr;
211 u32 dwRsrCRCOk;
212 u32 dwRsrBSSIDOk;
213 u32 dwRsrADDROk;
214 u32 dwRsrICVOk;
215 u32 dwNewRsrShortPreamble;
216 u32 dwRsrLong;
217 u32 dwRsrRunt;
219 u32 dwRsrRxControl;
220 u32 dwRsrRxData;
221 u32 dwRsrRxManage;
223 u32 dwRsrRxPacket;
224 u32 dwRsrRxOctet;
225 u32 dwRsrBroadcast;
226 u32 dwRsrMulticast;
227 u32 dwRsrDirected;
228 /* 64-bit OID */
229 u32 ullRsrOK;
231 /* for some optional OIDs (64 bits) and DMI support */
232 u32 ullRxBroadcastBytes;
233 u32 ullRxMulticastBytes;
234 u32 ullRxDirectedBytes;
235 u32 ullRxBroadcastFrames;
236 u32 ullRxMulticastFrames;
237 u32 ullRxDirectedFrames;
239 u32 dwRsrRxFragment;
240 u32 dwRsrRxFrmLen64;
241 u32 dwRsrRxFrmLen65_127;
242 u32 dwRsrRxFrmLen128_255;
243 u32 dwRsrRxFrmLen256_511;
244 u32 dwRsrRxFrmLen512_1023;
245 u32 dwRsrRxFrmLen1024_1518;
247 /* TSR0,1 status count */
248 u32 dwTsrTotalRetry[2]; /* total collision retry count */
249 u32 dwTsrOnceRetry[2]; /* this packet only occur one collision */
250 u32 dwTsrMoreThanOnceRetry[2]; /* this packet occur more than one collision */
251 u32 dwTsrRetry[2]; /* this packet has ever occur collision */
252 /* that is (dwTsrOnceCollision0 + dwTsrMoreThanOnceCollision0) */
253 u32 dwTsrACKData[2];
254 u32 dwTsrErr[2];
255 u32 dwAllTsrOK[2];
256 u32 dwTsrRetryTimeout[2];
257 u32 dwTsrTransmitTimeout[2];
259 u32 dwTsrTxPacket[2];
260 u32 dwTsrTxOctet[2];
261 u32 dwTsrBroadcast[2];
262 u32 dwTsrMulticast[2];
263 u32 dwTsrDirected[2];
265 /* RD/TD count */
266 u32 dwCntRxFrmLength;
267 u32 dwCntTxBufLength;
269 u8 abyCntRxPattern[16];
270 u8 abyCntTxPattern[16];
272 /* Software check */
273 u32 dwCntRxDataErr; /* rx buffer data software compare CRC err count */
274 u32 dwCntDecryptErr; /* rx buffer data software compare CRC err count */
275 u32 dwCntRxICVErr; /* rx buffer data software compare CRC err count */
276 u32 idxRxErrorDesc; /* index for rx data error RD */
278 /* 64-bit OID */
279 u32 ullTsrOK[2];
281 /* for some optional OIDs (64 bits) and DMI support */
282 u32 ullTxBroadcastFrames[2];
283 u32 ullTxMulticastFrames[2];
284 u32 ullTxDirectedFrames[2];
285 u32 ullTxBroadcastBytes[2];
286 u32 ullTxMulticastBytes[2];
287 u32 ullTxDirectedBytes[2];
288 } SStatMIBCount, *PSStatMIBCount;
290 typedef struct tagSNodeItem {
291 /* STA info */
292 u16 wAID;
293 u8 abyMACAddr[6];
294 u16 wTxDataRate;
295 u16 wInActiveCount;
296 u16 wEnQueueCnt;
297 u16 wFlags;
298 bool bPWBitOn;
299 u8 byKeyIndex;
300 u16 wWepKeyLength;
301 u8 abyWepKey[WEP_KEYMAXLEN];
302 /* Auto rate fallback vars */
303 bool bIsInFallback;
304 u32 uTxFailures;
305 u32 uTxAttempts;
306 u16 wFailureRatio;
307 } SNodeItem;
309 typedef struct tagSNodeList {
310 u32 uItem;
311 SNodeItem sNodeList[0];
312 } SNodeList, *PSNodeList;
314 typedef struct tagSCmdValue {
315 u32 dwValue;
316 } SCmdValue, *PSCmdValue;
318 /* hostapd & viawget ioctl related */
319 enum {
320 VIAWGET_HOSTAPD_FLUSH = 1,
321 VIAWGET_HOSTAPD_ADD_STA = 2,
322 VIAWGET_HOSTAPD_REMOVE_STA = 3,
323 VIAWGET_HOSTAPD_GET_INFO_STA = 4,
324 VIAWGET_HOSTAPD_SET_ENCRYPTION = 5,
325 VIAWGET_HOSTAPD_GET_ENCRYPTION = 6,
326 VIAWGET_HOSTAPD_SET_FLAGS_STA = 7,
327 VIAWGET_HOSTAPD_SET_ASSOC_AP_ADDR = 8,
328 VIAWGET_HOSTAPD_SET_GENERIC_ELEMENT = 9,
329 VIAWGET_HOSTAPD_MLME = 10,
330 VIAWGET_HOSTAPD_SCAN_REQ = 11,
331 VIAWGET_HOSTAPD_STA_CLEAR_STATS = 12,
334 #define VIAWGET_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \
335 ((int)(&((struct viawget_hostapd_param *)0)->u.generic_elem.data))
337 /*Maximum length for algorithm names (-1 for nul termination) used in ioctl()*/
339 struct viawget_hostapd_param {
340 u32 cmd;
341 u8 sta_addr[6];
342 union {
343 struct {
344 u16 aid;
345 u16 capability;
346 u8 tx_supp_rates;
347 } add_sta;
348 struct {
349 u32 inactive_sec;
350 } get_info_sta;
351 struct {
352 u8 alg;
353 u32 flags;
354 u32 err;
355 u8 idx;
356 u8 seq[8];
357 u16 key_len;
358 u8 key[0];
359 } crypt;
360 struct {
361 u32 flags_and;
362 u32 flags_or;
363 } set_flags_sta;
364 struct {
365 u16 rid;
366 u16 len;
367 u8 data[0];
368 } rid;
369 struct {
370 u8 len;
371 u8 data[0];
372 } generic_elem;
373 struct {
374 u16 cmd;
375 u16 reason_code;
376 } mlme;
377 struct {
378 u8 ssid_len;
379 u8 ssid[32];
380 } scan_req;
381 } u;
384 #pragma pack()
386 #endif /* __IOCMD_H__ */