2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
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.
21 * Purpose: Handles the viawget ioctl private interface functions
34 /*--------------------- Export Definitions -------------------------*/
41 #define MAGIC_CODE 0x3142
42 #define IOCTL_CMD_TEST (SIOCDEVPRIVATE + 0)
43 #define IOCTL_CMD_SET (SIOCDEVPRIVATE + 1)
44 #define IOCTL_CMD_HOSTAPD (SIOCDEVPRIVATE + 2)
45 #define IOCTL_CMD_WPA (SIOCDEVPRIVATE + 3)
47 typedef enum tagWMAC_CMD {
62 WLAN_CMD_SET_HOSTAPD_STA,
64 WLAN_CMD_SET_HOST_WEP,
66 WLAN_CMD_GET_NODE_CNT,
67 WLAN_CMD_ZONETYPE_SET,
68 WLAN_CMD_GET_NODE_LIST
70 } WMAC_CMD, *PWMAC_CMD;
72 typedef enum tagWZONETYPE {
83 #define ADHOC_STARTED 1
84 #define ADHOC_JOINTED 2
91 #define SSID_MAXLEN 32
94 #define WEP_KEYMAXLEN 29
95 #define WEP_40BIT_LEN 5
96 #define WEP_104BIT_LEN 13
97 #define WEP_232BIT_LEN 16
99 // Ioctl interface structure
103 typedef struct tagSCmdRequest {
108 } SCmdRequest, *PSCmdRequest;
114 typedef struct tagSCmdScan {
116 u8 ssid[SSID_MAXLEN + 2];
118 } SCmdScan, *PSCmdScan;
124 typedef struct tagSCmdBSSJoin {
128 u8 ssid[SSID_MAXLEN + 2];
133 } SCmdBSSJoin, *PSCmdBSSJoin;
139 typedef struct tagSCmdZoneTypeSet {
144 } SCmdZoneTypeSet, *PSCmdZoneTypeSet;
146 typedef struct tagSWPAResult {
152 } SWPAResult, *PSWPAResult;
154 typedef struct tagSCmdStartAP {
158 u8 ssid[SSID_MAXLEN + 2];
164 } SCmdStartAP, *PSCmdStartAP;
166 typedef struct tagSCmdSetWEP {
170 u8 abyWepKey[WEP_NKEYS][WEP_KEYMAXLEN];
171 BOOL bWepKeyAvailable[WEP_NKEYS];
172 u32 auWepKeyLength[WEP_NKEYS];
174 } SCmdSetWEP, *PSCmdSetWEP;
176 typedef struct tagSBSSIDItem {
179 u8 abyBSSID[BSSID_LEN];
180 u8 abySSID[SSID_MAXLEN + 1];
190 typedef struct tagSBSSIDList {
193 SBSSIDItem sBSSIDList[0];
194 } SBSSIDList, *PSBSSIDList;
197 typedef struct tagSNodeItem {
208 u8 abyWepKey[WEP_KEYMAXLEN];
209 // Auto rate fallback vars
218 typedef struct tagSNodeList {
221 SNodeItem sNodeList[0];
223 } SNodeList, *PSNodeList;
226 typedef struct tagSCmdLinkStatus {
231 u8 abyBSSID[BSSID_LEN];
232 u8 abySSID[SSID_MAXLEN + 2];
236 } SCmdLinkStatus, *PSCmdLinkStatus;
241 typedef struct tagSDot11MIBCount {
242 u32 TransmittedFragmentCount;
243 u32 MulticastTransmittedFrameCount;
246 u32 MultipleRetryCount;
250 u32 FrameDuplicateCount;
251 u32 ReceivedFragmentCount;
252 u32 MulticastReceivedFrameCount;
254 } SDot11MIBCount, *PSDot11MIBCount;
261 typedef struct tagSStatMIBCount {
271 u32 dwIsrUnrecoverableError;
272 u32 dwIsrSoftInterrupt;
274 /////////////////////////////////////
276 u32 dwIsrUnknown; /* unknown interrupt count */
287 u32 dwNewRsrShortPreamble;
303 // for some optional OIDs (64 bits) and DMI support
304 u32 ullRxBroadcastBytes;
305 u32 ullRxMulticastBytes;
306 u32 ullRxDirectedBytes;
307 u32 ullRxBroadcastFrames;
308 u32 ullRxMulticastFrames;
309 u32 ullRxDirectedFrames;
313 u32 dwRsrRxFrmLen65_127;
314 u32 dwRsrRxFrmLen128_255;
315 u32 dwRsrRxFrmLen256_511;
316 u32 dwRsrRxFrmLen512_1023;
317 u32 dwRsrRxFrmLen1024_1518;
319 // TSR0,1 status count
321 u32 dwTsrTotalRetry[2]; /* total collision retry count */
322 u32 dwTsrOnceRetry[2]; /* this packet had one collision */
323 u32 dwTsrMoreThanOnceRetry[2]; /* this packet had many collisions */
324 u32 dwTsrRetry[2]; /* this packet has ever occur collision,
325 * that is (dwTsrOnceCollision0 plus
326 * dwTsrMoreThanOnceCollision0) */
330 u32 dwTsrRetryTimeout[2];
331 u32 dwTsrTransmitTimeout[2];
333 u32 dwTsrTxPacket[2];
335 u32 dwTsrBroadcast[2];
336 u32 dwTsrMulticast[2];
337 u32 dwTsrDirected[2];
340 u32 dwCntRxFrmLength;
341 u32 dwCntTxBufLength;
343 u8 abyCntRxPattern[16];
344 u8 abyCntTxPattern[16];
346 /* Software check.... */
347 u32 dwCntRxDataErr; /* rx buffer data CRC err count */
348 u32 dwCntDecryptErr; /* rx buffer data CRC err count */
349 u32 dwCntRxICVErr; /* rx buffer data CRC err count */
350 u32 idxRxErrorDesc; /* index for rx data error RD */
355 // for some optional OIDs (64 bits) and DMI support
356 u32 ullTxBroadcastFrames[2];
357 u32 ullTxMulticastFrames[2];
358 u32 ullTxDirectedFrames[2];
359 u32 ullTxBroadcastBytes[2];
360 u32 ullTxMulticastBytes[2];
361 u32 ullTxDirectedBytes[2];
362 } SStatMIBCount, *PSStatMIBCount;
364 typedef struct tagSCmdValue {
368 } SCmdValue, *PSCmdValue;
371 // hostapd & viawget ioctl related
374 // VIAGWET_IOCTL_HOSTAPD ioctl() cmd:
376 VIAWGET_HOSTAPD_FLUSH = 1,
377 VIAWGET_HOSTAPD_ADD_STA = 2,
378 VIAWGET_HOSTAPD_REMOVE_STA = 3,
379 VIAWGET_HOSTAPD_GET_INFO_STA = 4,
380 VIAWGET_HOSTAPD_SET_ENCRYPTION = 5,
381 VIAWGET_HOSTAPD_GET_ENCRYPTION = 6,
382 VIAWGET_HOSTAPD_SET_FLAGS_STA = 7,
383 VIAWGET_HOSTAPD_SET_ASSOC_AP_ADDR = 8,
384 VIAWGET_HOSTAPD_SET_GENERIC_ELEMENT = 9,
385 VIAWGET_HOSTAPD_MLME = 10,
386 VIAWGET_HOSTAPD_SCAN_REQ = 11,
387 VIAWGET_HOSTAPD_STA_CLEAR_STATS = 12,
390 #define VIAWGET_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \
391 ((int) (&((struct viawget_hostapd_param *) 0)->u.generic_elem.data))
393 // Maximum length for algorithm names (-1 for nul termination) used in ioctl()
395 struct viawget_hostapd_param {
440 /*--------------------- Export Classes ----------------------------*/
442 /*--------------------- Export Variables --------------------------*/
444 /*--------------------- Export Types ------------------------------*/
446 /*--------------------- Export Functions --------------------------*/
448 #endif /* __IOCMD_H__ */