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 /* 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
{
55 WLAN_CMD_SET_HOSTAPD_STA
,
57 WLAN_CMD_SET_HOST_WEP
,
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
{
75 #define ADHOC_STARTED 1
76 #define ADHOC_JOINTED 2
83 #define SSID_MAXLEN 32
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 */
93 typedef struct tagSCmdRequest
{
98 } SCmdRequest
, *PSCmdRequest
;
101 typedef struct tagSCmdScan
{
102 u8 ssid
[SSID_MAXLEN
+ 2];
103 } SCmdScan
, *PSCmdScan
;
106 typedef struct tagSCmdBSSJoin
{
109 u8 ssid
[SSID_MAXLEN
+ 2];
113 } SCmdBSSJoin
, *PSCmdBSSJoin
;
115 /* Zonetype Setting */
116 typedef struct tagSCmdZoneTypeSet
{
119 } SCmdZoneTypeSet
, *PSCmdZoneTypeSet
;
121 #ifdef WPA_SM_Transtatus
122 typedef struct tagSWPAResult
{
128 } SWPAResult
, *PSWPAResult
;
131 typedef struct tagSCmdStartAP
{
134 u8 ssid
[SSID_MAXLEN
+ 2];
139 } SCmdStartAP
, *PSCmdStartAP
;
141 typedef struct tagSCmdSetWEP
{
144 u8 abyWepKey
[WEP_NKEYS
][WEP_KEYMAXLEN
];
145 bool bWepKeyAvailable
[WEP_NKEYS
];
146 u32 auWepKeyLength
[WEP_NKEYS
];
147 } SCmdSetWEP
, *PSCmdSetWEP
;
149 typedef struct tagSBSSIDItem
{
151 u8 abyBSSID
[BSSID_LEN
];
152 u8 abySSID
[SSID_MAXLEN
+ 1];
155 u16 wCapInfo
; /* for address of byNetType at align 4 */
161 typedef struct tagSBSSIDList
{
163 SBSSIDItem sBSSIDList
[0];
164 } SBSSIDList
, *PSBSSIDList
;
166 typedef struct tagSCmdLinkStatus
{
170 u8 abyBSSID
[BSSID_LEN
];
171 u8 abySSID
[SSID_MAXLEN
+ 2];
174 } SCmdLinkStatus
, *PSCmdLinkStatus
;
177 typedef struct tagSDot11MIBCount
{
178 u32 TransmittedFragmentCount
;
179 u32 MulticastTransmittedFrameCount
;
182 u32 MultipleRetryCount
;
186 u32 FrameDuplicateCount
;
187 u32 ReceivedFragmentCount
;
188 u32 MulticastReceivedFrameCount
;
190 } SDot11MIBCount
, *PSDot11MIBCount
;
192 /* statistic counter */
193 typedef struct tagSStatMIBCount
{
194 /* ISR status count */
201 u32 dwIsrUnrecoverableError
;
202 u32 dwIsrSoftInterrupt
;
207 /* RSR status count */
215 u32 dwNewRsrShortPreamble
;
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
;
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) */
256 u32 dwTsrRetryTimeout
[2];
257 u32 dwTsrTransmitTimeout
[2];
259 u32 dwTsrTxPacket
[2];
261 u32 dwTsrBroadcast
[2];
262 u32 dwTsrMulticast
[2];
263 u32 dwTsrDirected
[2];
266 u32 dwCntRxFrmLength
;
267 u32 dwCntTxBufLength
;
269 u8 abyCntRxPattern
[16];
270 u8 abyCntTxPattern
[16];
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 */
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
{
301 u8 abyWepKey
[WEP_KEYMAXLEN
];
302 /* Auto rate fallback vars */
309 typedef struct tagSNodeList
{
311 SNodeItem sNodeList
[0];
312 } SNodeList
, *PSNodeList
;
314 typedef struct tagSCmdValue
{
316 } SCmdValue
, *PSCmdValue
;
318 /* hostapd & viawget ioctl related */
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
{
386 #endif /* __IOCMD_H__ */