2 * Copyright (c) 1996, 2003 VIA Networking, Inc. All rights reserved.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 * Purpose: Handles the viawget ioctl private interface functions
31 #if !defined(__TTYPE_H__)
36 /*--------------------- Export Definitions -------------------------*/
43 //typedef uint32_t u32;
44 //typedef uint16_t u16;
49 #define MAGIC_CODE 0x3142
50 #define IOCTL_CMD_TEST (SIOCDEVPRIVATE + 0)
51 #define IOCTL_CMD_SET (SIOCDEVPRIVATE + 1)
52 #define IOCTL_CMD_HOSTAPD (SIOCDEVPRIVATE + 2)
53 #define IOCTL_CMD_WPA (SIOCDEVPRIVATE + 3)
56 typedef enum tagWMAC_CMD
{
71 WLAN_CMD_SET_HOSTAPD_STA
,
73 WLAN_CMD_SET_HOST_WEP
,
75 WLAN_CMD_GET_NODE_CNT
,
76 WLAN_CMD_ZONETYPE_SET
,
77 WLAN_CMD_GET_NODE_LIST
79 } WMAC_CMD
, DEF
* PWMAC_CMD
;
81 typedef enum tagWZONETYPE
{
92 #define ADHOC_STARTED 1
93 #define ADHOC_JOINTED 2
101 #define SSID_MAXLEN 32
104 #define WEP_KEYMAXLEN 29
105 #define WEP_40BIT_LEN 5
106 #define WEP_104BIT_LEN 13
107 #define WEP_232BIT_LEN 16
110 // Ioctl interface structure
114 typedef struct tagSCmdRequest
{
119 } SCmdRequest
, *PSCmdRequest
;
126 typedef struct tagSCmdScan
{
128 U8 ssid
[SSID_MAXLEN
+ 2];
130 } SCmdScan
, *PSCmdScan
;
137 typedef struct tagSCmdBSSJoin
{
141 U8 ssid
[SSID_MAXLEN
+ 2];
146 } SCmdBSSJoin
, *PSCmdBSSJoin
;
148 typedef struct tagSCmdZoneTypeSet
{
153 } SCmdZoneTypeSet
, *PSCmdZoneTypeSet
;
155 #ifdef WPA_SM_Transtatus
156 typedef struct tagSWPAResult
{
162 } SWPAResult
, *PSWPAResult
;
166 typedef struct tagSCmdStartAP
{
170 U8 ssid
[SSID_MAXLEN
+ 2];
176 } SCmdStartAP
, *PSCmdStartAP
;
179 typedef struct tagSCmdSetWEP
{
183 U8 abyWepKey
[WEP_NKEYS
][WEP_KEYMAXLEN
];
184 BOOL bWepKeyAvailable
[WEP_NKEYS
];
185 U32 auWepKeyLength
[WEP_NKEYS
];
187 } SCmdSetWEP
, *PSCmdSetWEP
;
191 typedef struct tagSBSSIDItem
{
194 U8 abyBSSID
[BSSID_LEN
];
195 U8 abySSID
[SSID_MAXLEN
+ 1];
196 //2006-1116-01,<Modify> by NomadZhao
197 //U16 wBeaconInterval;
202 U16 wCapInfo
; // for address of byNetType at align 4
210 typedef struct tagSBSSIDList
{
213 SBSSIDItem sBSSIDList
[0];
214 } SBSSIDList
, *PSBSSIDList
;
217 typedef struct tagSCmdLinkStatus
{
222 U8 abyBSSID
[BSSID_LEN
];
223 U8 abySSID
[SSID_MAXLEN
+ 2];
227 } SCmdLinkStatus
, *PSCmdLinkStatus
;
232 typedef struct tagSDot11MIBCount
{
233 U32 TransmittedFragmentCount
;
234 U32 MulticastTransmittedFrameCount
;
237 U32 MultipleRetryCount
;
241 U32 FrameDuplicateCount
;
242 U32 ReceivedFragmentCount
;
243 U32 MulticastReceivedFrameCount
;
245 } SDot11MIBCount
, DEF
* PSDot11MIBCount
;
252 typedef struct tagSStatMIBCount
{
262 U32 dwIsrUnrecoverableError
;
263 U32 dwIsrSoftInterrupt
;
265 /////////////////////////////////////
267 U32 dwIsrUnknown
; // unknown interrupt count
278 U32 dwNewRsrShortPreamble
;
294 // for some optional OIDs (64 bits) and DMI support
295 U32 ullRxBroadcastBytes
;
296 U32 ullRxMulticastBytes
;
297 U32 ullRxDirectedBytes
;
298 U32 ullRxBroadcastFrames
;
299 U32 ullRxMulticastFrames
;
300 U32 ullRxDirectedFrames
;
304 U32 dwRsrRxFrmLen65_127
;
305 U32 dwRsrRxFrmLen128_255
;
306 U32 dwRsrRxFrmLen256_511
;
307 U32 dwRsrRxFrmLen512_1023
;
308 U32 dwRsrRxFrmLen1024_1518
;
310 // TSR0,1 status count
312 U32 dwTsrTotalRetry
[2]; // total collision retry count
313 U32 dwTsrOnceRetry
[2]; // this packet only occur one collision
314 U32 dwTsrMoreThanOnceRetry
[2]; // this packet occur more than one collision
315 U32 dwTsrRetry
[2]; // this packet has ever occur collision,
316 // that is (dwTsrOnceCollision0 + dwTsrMoreThanOnceCollision0)
320 U32 dwTsrRetryTimeout
[2];
321 U32 dwTsrTransmitTimeout
[2];
323 U32 dwTsrTxPacket
[2];
325 U32 dwTsrBroadcast
[2];
326 U32 dwTsrMulticast
[2];
327 U32 dwTsrDirected
[2];
330 U32 dwCntRxFrmLength
;
331 U32 dwCntTxBufLength
;
333 U8 abyCntRxPattern
[16];
334 U8 abyCntTxPattern
[16];
336 // Software check....
337 U32 dwCntRxDataErr
; // rx buffer data software compare CRC err count
338 U32 dwCntDecryptErr
; // rx buffer data software compare CRC err count
339 U32 dwCntRxICVErr
; // rx buffer data software compare CRC err count
340 U32 idxRxErrorDesc
; // index for rx data error RD
345 // for some optional OIDs (64 bits) and DMI support
346 U32 ullTxBroadcastFrames
[2];
347 U32 ullTxMulticastFrames
[2];
348 U32 ullTxDirectedFrames
[2];
349 U32 ullTxBroadcastBytes
[2];
350 U32 ullTxMulticastBytes
[2];
351 U32 ullTxDirectedBytes
[2];
352 } SStatMIBCount
, DEF
* PSStatMIBCount
;
355 typedef struct tagSNodeItem
{
366 U8 abyWepKey
[WEP_KEYMAXLEN
];
367 // Auto rate fallback vars
376 typedef struct tagSNodeList
{
379 SNodeItem sNodeList
[0];
381 } SNodeList
, *PSNodeList
;
385 typedef struct tagSCmdValue
{
389 } SCmdValue
, *PSCmdValue
;
393 // hostapd & viawget ioctl related
397 // VIAGWET_IOCTL_HOSTAPD ioctl() cmd:
399 VIAWGET_HOSTAPD_FLUSH
= 1,
400 VIAWGET_HOSTAPD_ADD_STA
= 2,
401 VIAWGET_HOSTAPD_REMOVE_STA
= 3,
402 VIAWGET_HOSTAPD_GET_INFO_STA
= 4,
403 VIAWGET_HOSTAPD_SET_ENCRYPTION
= 5,
404 VIAWGET_HOSTAPD_GET_ENCRYPTION
= 6,
405 VIAWGET_HOSTAPD_SET_FLAGS_STA
= 7,
406 VIAWGET_HOSTAPD_SET_ASSOC_AP_ADDR
= 8,
407 VIAWGET_HOSTAPD_SET_GENERIC_ELEMENT
= 9,
408 VIAWGET_HOSTAPD_MLME
= 10,
409 VIAWGET_HOSTAPD_SCAN_REQ
= 11,
410 VIAWGET_HOSTAPD_STA_CLEAR_STATS
= 12,
414 #define VIAWGET_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \
415 ((int) (&((struct viawget_hostapd_param *) 0)->u.generic_elem.data))
417 // Maximum length for algorithm names (-1 for nul termination) used in ioctl()
421 struct viawget_hostapd_param
{
466 //2006-1116-01,<Add> by NomadZhao
469 /*--------------------- Export Classes ----------------------------*/
471 /*--------------------- Export Variables --------------------------*/
474 /*--------------------- Export Types ------------------------------*/
477 /*--------------------- Export Functions --------------------------*/