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 -------------------------*/
37 #define MAGIC_CODE 0x3142
38 #define IOCTL_CMD_TEST (SIOCDEVPRIVATE + 0)
39 #define IOCTL_CMD_SET (SIOCDEVPRIVATE + 1)
40 #define IOCTL_CMD_HOSTAPD (SIOCDEVPRIVATE + 2)
41 #define IOCTL_CMD_WPA (SIOCDEVPRIVATE + 3)
43 typedef enum tagWMAC_CMD
{
58 WLAN_CMD_SET_HOSTAPD_STA
,
60 WLAN_CMD_SET_HOST_WEP
,
62 WLAN_CMD_GET_NODE_CNT
,
63 WLAN_CMD_ZONETYPE_SET
,
64 WLAN_CMD_GET_NODE_LIST
66 } WMAC_CMD
, *PWMAC_CMD
;
68 typedef enum tagWZONETYPE
{
79 #define ADHOC_STARTED 1
80 #define ADHOC_JOINTED 2
87 #define SSID_MAXLEN 32
90 #define WEP_KEYMAXLEN 29
91 #define WEP_40BIT_LEN 5
92 #define WEP_104BIT_LEN 13
93 #define WEP_232BIT_LEN 16
95 // Ioctl interface structure
99 typedef struct tagSCmdRequest
{
104 } SCmdRequest
, *PSCmdRequest
;
110 typedef struct tagSCmdScan
{
112 u8 ssid
[SSID_MAXLEN
+ 2];
114 } SCmdScan
, *PSCmdScan
;
120 typedef struct tagSCmdBSSJoin
{
124 u8 ssid
[SSID_MAXLEN
+ 2];
129 } SCmdBSSJoin
, *PSCmdBSSJoin
;
135 typedef struct tagSCmdZoneTypeSet
{
140 } SCmdZoneTypeSet
, *PSCmdZoneTypeSet
;
142 typedef struct tagSWPAResult
{
148 } SWPAResult
, *PSWPAResult
;
150 typedef struct tagSCmdStartAP
{
154 u8 ssid
[SSID_MAXLEN
+ 2];
160 } SCmdStartAP
, *PSCmdStartAP
;
162 typedef struct tagSCmdSetWEP
{
166 u8 abyWepKey
[WEP_NKEYS
][WEP_KEYMAXLEN
];
167 BOOL bWepKeyAvailable
[WEP_NKEYS
];
168 u32 auWepKeyLength
[WEP_NKEYS
];
170 } SCmdSetWEP
, *PSCmdSetWEP
;
172 typedef struct tagSBSSIDItem
{
175 u8 abyBSSID
[BSSID_LEN
];
176 u8 abySSID
[SSID_MAXLEN
+ 1];
186 typedef struct tagSBSSIDList
{
189 SBSSIDItem sBSSIDList
[0];
190 } SBSSIDList
, *PSBSSIDList
;
193 typedef struct tagSNodeItem
{
204 u8 abyWepKey
[WEP_KEYMAXLEN
];
205 // Auto rate fallback vars
214 typedef struct tagSNodeList
{
217 SNodeItem sNodeList
[0];
219 } SNodeList
, *PSNodeList
;
222 typedef struct tagSCmdLinkStatus
{
227 u8 abyBSSID
[BSSID_LEN
];
228 u8 abySSID
[SSID_MAXLEN
+ 2];
232 } SCmdLinkStatus
, *PSCmdLinkStatus
;
237 typedef struct tagSDot11MIBCount
{
238 u32 TransmittedFragmentCount
;
239 u32 MulticastTransmittedFrameCount
;
242 u32 MultipleRetryCount
;
246 u32 FrameDuplicateCount
;
247 u32 ReceivedFragmentCount
;
248 u32 MulticastReceivedFrameCount
;
250 } SDot11MIBCount
, *PSDot11MIBCount
;
257 typedef struct tagSStatMIBCount
{
267 u32 dwIsrUnrecoverableError
;
268 u32 dwIsrSoftInterrupt
;
270 /////////////////////////////////////
272 u32 dwIsrUnknown
; /* unknown interrupt count */
283 u32 dwNewRsrShortPreamble
;
299 // for some optional OIDs (64 bits) and DMI support
300 u32 ullRxBroadcastBytes
;
301 u32 ullRxMulticastBytes
;
302 u32 ullRxDirectedBytes
;
303 u32 ullRxBroadcastFrames
;
304 u32 ullRxMulticastFrames
;
305 u32 ullRxDirectedFrames
;
309 u32 dwRsrRxFrmLen65_127
;
310 u32 dwRsrRxFrmLen128_255
;
311 u32 dwRsrRxFrmLen256_511
;
312 u32 dwRsrRxFrmLen512_1023
;
313 u32 dwRsrRxFrmLen1024_1518
;
315 // TSR0,1 status count
317 u32 dwTsrTotalRetry
[2]; /* total collision retry count */
318 u32 dwTsrOnceRetry
[2]; /* this packet had one collision */
319 u32 dwTsrMoreThanOnceRetry
[2]; /* this packet had many collisions */
320 u32 dwTsrRetry
[2]; /* this packet has ever occur collision,
321 * that is (dwTsrOnceCollision0 plus
322 * dwTsrMoreThanOnceCollision0) */
326 u32 dwTsrRetryTimeout
[2];
327 u32 dwTsrTransmitTimeout
[2];
329 u32 dwTsrTxPacket
[2];
331 u32 dwTsrBroadcast
[2];
332 u32 dwTsrMulticast
[2];
333 u32 dwTsrDirected
[2];
336 u32 dwCntRxFrmLength
;
337 u32 dwCntTxBufLength
;
339 u8 abyCntRxPattern
[16];
340 u8 abyCntTxPattern
[16];
342 /* Software check.... */
343 u32 dwCntRxDataErr
; /* rx buffer data CRC err count */
344 u32 dwCntDecryptErr
; /* rx buffer data CRC err count */
345 u32 dwCntRxICVErr
; /* rx buffer data CRC err count */
346 u32 idxRxErrorDesc
; /* index for rx data error RD */
351 // for some optional OIDs (64 bits) and DMI support
352 u32 ullTxBroadcastFrames
[2];
353 u32 ullTxMulticastFrames
[2];
354 u32 ullTxDirectedFrames
[2];
355 u32 ullTxBroadcastBytes
[2];
356 u32 ullTxMulticastBytes
[2];
357 u32 ullTxDirectedBytes
[2];
358 } SStatMIBCount
, *PSStatMIBCount
;
360 typedef struct tagSCmdValue
{
364 } SCmdValue
, *PSCmdValue
;
367 // hostapd & viawget ioctl related
370 // VIAGWET_IOCTL_HOSTAPD ioctl() cmd:
372 VIAWGET_HOSTAPD_FLUSH
= 1,
373 VIAWGET_HOSTAPD_ADD_STA
= 2,
374 VIAWGET_HOSTAPD_REMOVE_STA
= 3,
375 VIAWGET_HOSTAPD_GET_INFO_STA
= 4,
376 VIAWGET_HOSTAPD_SET_ENCRYPTION
= 5,
377 VIAWGET_HOSTAPD_GET_ENCRYPTION
= 6,
378 VIAWGET_HOSTAPD_SET_FLAGS_STA
= 7,
379 VIAWGET_HOSTAPD_SET_ASSOC_AP_ADDR
= 8,
380 VIAWGET_HOSTAPD_SET_GENERIC_ELEMENT
= 9,
381 VIAWGET_HOSTAPD_MLME
= 10,
382 VIAWGET_HOSTAPD_SCAN_REQ
= 11,
383 VIAWGET_HOSTAPD_STA_CLEAR_STATS
= 12,
386 #define VIAWGET_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \
387 ((int) (&((struct viawget_hostapd_param *) 0)->u.generic_elem.data))
389 // Maximum length for algorithm names (-1 for nul termination) used in ioctl()
391 struct viawget_hostapd_param
{
436 /*--------------------- Export Classes ----------------------------*/
438 /*--------------------- Export Variables --------------------------*/
440 /*--------------------- Export Types ------------------------------*/
442 /*--------------------- Export Functions --------------------------*/
444 #endif /* __IOCMD_H__ */