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 #ifdef WPA_SM_Transtatus
147 typedef struct tagSWPAResult
{
153 } SWPAResult
, *PSWPAResult
;
156 typedef struct tagSCmdStartAP
{
160 u8 ssid
[SSID_MAXLEN
+ 2];
166 } SCmdStartAP
, *PSCmdStartAP
;
168 typedef struct tagSCmdSetWEP
{
172 u8 abyWepKey
[WEP_NKEYS
][WEP_KEYMAXLEN
];
173 BOOL bWepKeyAvailable
[WEP_NKEYS
];
174 u32 auWepKeyLength
[WEP_NKEYS
];
176 } SCmdSetWEP
, *PSCmdSetWEP
;
178 typedef struct tagSBSSIDItem
{
181 u8 abyBSSID
[BSSID_LEN
];
182 u8 abySSID
[SSID_MAXLEN
+ 1];
192 typedef struct tagSBSSIDList
{
195 SBSSIDItem sBSSIDList
[0];
196 } SBSSIDList
, *PSBSSIDList
;
199 typedef struct tagSNodeItem
{
210 u8 abyWepKey
[WEP_KEYMAXLEN
];
211 // Auto rate fallback vars
220 typedef struct tagSNodeList
{
223 SNodeItem sNodeList
[0];
225 } SNodeList
, *PSNodeList
;
228 typedef struct tagSCmdLinkStatus
{
233 u8 abyBSSID
[BSSID_LEN
];
234 u8 abySSID
[SSID_MAXLEN
+ 2];
238 } SCmdLinkStatus
, *PSCmdLinkStatus
;
243 typedef struct tagSDot11MIBCount
{
244 u32 TransmittedFragmentCount
;
245 u32 MulticastTransmittedFrameCount
;
248 u32 MultipleRetryCount
;
252 u32 FrameDuplicateCount
;
253 u32 ReceivedFragmentCount
;
254 u32 MulticastReceivedFrameCount
;
256 } SDot11MIBCount
, *PSDot11MIBCount
;
263 typedef struct tagSStatMIBCount
{
273 u32 dwIsrUnrecoverableError
;
274 u32 dwIsrSoftInterrupt
;
276 /////////////////////////////////////
278 u32 dwIsrUnknown
; /* unknown interrupt count */
289 u32 dwNewRsrShortPreamble
;
305 // for some optional OIDs (64 bits) and DMI support
306 u32 ullRxBroadcastBytes
;
307 u32 ullRxMulticastBytes
;
308 u32 ullRxDirectedBytes
;
309 u32 ullRxBroadcastFrames
;
310 u32 ullRxMulticastFrames
;
311 u32 ullRxDirectedFrames
;
315 u32 dwRsrRxFrmLen65_127
;
316 u32 dwRsrRxFrmLen128_255
;
317 u32 dwRsrRxFrmLen256_511
;
318 u32 dwRsrRxFrmLen512_1023
;
319 u32 dwRsrRxFrmLen1024_1518
;
321 // TSR0,1 status count
323 u32 dwTsrTotalRetry
[2]; /* total collision retry count */
324 u32 dwTsrOnceRetry
[2]; /* this packet had one collision */
325 u32 dwTsrMoreThanOnceRetry
[2]; /* this packet had many collisions */
326 u32 dwTsrRetry
[2]; /* this packet has ever occur collision,
327 * that is (dwTsrOnceCollision0 plus
328 * dwTsrMoreThanOnceCollision0) */
332 u32 dwTsrRetryTimeout
[2];
333 u32 dwTsrTransmitTimeout
[2];
335 u32 dwTsrTxPacket
[2];
337 u32 dwTsrBroadcast
[2];
338 u32 dwTsrMulticast
[2];
339 u32 dwTsrDirected
[2];
342 u32 dwCntRxFrmLength
;
343 u32 dwCntTxBufLength
;
345 u8 abyCntRxPattern
[16];
346 u8 abyCntTxPattern
[16];
348 /* Software check.... */
349 u32 dwCntRxDataErr
; /* rx buffer data CRC err count */
350 u32 dwCntDecryptErr
; /* rx buffer data CRC err count */
351 u32 dwCntRxICVErr
; /* rx buffer data CRC err count */
352 u32 idxRxErrorDesc
; /* index for rx data error RD */
357 // for some optional OIDs (64 bits) and DMI support
358 u32 ullTxBroadcastFrames
[2];
359 u32 ullTxMulticastFrames
[2];
360 u32 ullTxDirectedFrames
[2];
361 u32 ullTxBroadcastBytes
[2];
362 u32 ullTxMulticastBytes
[2];
363 u32 ullTxDirectedBytes
[2];
364 } SStatMIBCount
, *PSStatMIBCount
;
366 typedef struct tagSCmdValue
{
370 } SCmdValue
, *PSCmdValue
;
373 // hostapd & viawget ioctl related
376 // VIAGWET_IOCTL_HOSTAPD ioctl() cmd:
378 VIAWGET_HOSTAPD_FLUSH
= 1,
379 VIAWGET_HOSTAPD_ADD_STA
= 2,
380 VIAWGET_HOSTAPD_REMOVE_STA
= 3,
381 VIAWGET_HOSTAPD_GET_INFO_STA
= 4,
382 VIAWGET_HOSTAPD_SET_ENCRYPTION
= 5,
383 VIAWGET_HOSTAPD_GET_ENCRYPTION
= 6,
384 VIAWGET_HOSTAPD_SET_FLAGS_STA
= 7,
385 VIAWGET_HOSTAPD_SET_ASSOC_AP_ADDR
= 8,
386 VIAWGET_HOSTAPD_SET_GENERIC_ELEMENT
= 9,
387 VIAWGET_HOSTAPD_MLME
= 10,
388 VIAWGET_HOSTAPD_SCAN_REQ
= 11,
389 VIAWGET_HOSTAPD_STA_CLEAR_STATS
= 12,
392 #define VIAWGET_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \
393 ((int) (&((struct viawget_hostapd_param *) 0)->u.generic_elem.data))
395 // Maximum length for algorithm names (-1 for nul termination) used in ioctl()
397 struct viawget_hostapd_param
{
442 /*--------------------- Export Classes ----------------------------*/
444 /*--------------------- Export Variables --------------------------*/
446 /*--------------------- Export Types ------------------------------*/
448 /*--------------------- Export Functions --------------------------*/
450 #endif /* __IOCMD_H__ */