1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29#ifndef __IOCMD_H__
30#define __IOCMD_H__
31
32#include "ttype.h"
33
34
35
36
37
38
39
40
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)
46
47typedef enum tagWMAC_CMD {
48 WLAN_CMD_BSS_SCAN,
49 WLAN_CMD_BSS_JOIN,
50 WLAN_CMD_DISASSOC,
51 WLAN_CMD_SET_WEP,
52 WLAN_CMD_GET_LINK,
53 WLAN_CMD_GET_LISTLEN,
54 WLAN_CMD_GET_LIST,
55 WLAN_CMD_GET_MIB,
56 WLAN_CMD_GET_STAT,
57 WLAN_CMD_STOP_MAC,
58 WLAN_CMD_START_MAC,
59 WLAN_CMD_AP_START,
60 WLAN_CMD_SET_HOSTAPD,
61 WLAN_CMD_SET_HOSTAPD_STA,
62 WLAN_CMD_SET_802_1X,
63 WLAN_CMD_SET_HOST_WEP,
64 WLAN_CMD_SET_WPA,
65 WLAN_CMD_GET_NODE_CNT,
66 WLAN_CMD_ZONETYPE_SET,
67 WLAN_CMD_GET_NODE_LIST
68} WMAC_CMD, *PWMAC_CMD;
69
70typedef enum tagWZONETYPE {
71 ZoneType_USA = 0,
72 ZoneType_Japan = 1,
73 ZoneType_Europe = 2
74} WZONETYPE;
75
76#define ADHOC 0
77#define INFRA 1
78#define BOTH 2
79#define AP 3
80
81#define ADHOC_STARTED 1
82#define ADHOC_JOINTED 2
83
84#define PHY80211a 0
85#define PHY80211b 1
86#define PHY80211g 2
87
88#define SSID_ID 0
89#define SSID_MAXLEN 32
90#define BSSID_LEN 6
91#define WEP_NKEYS 4
92#define WEP_KEYMAXLEN 29
93#define WEP_40BIT_LEN 5
94#define WEP_104BIT_LEN 13
95#define WEP_232BIT_LEN 16
96
97
98
99
100#pragma pack(1)
101typedef struct tagSCmdRequest {
102 u8 name[16];
103 void *data;
104 u16 wResult;
105 u16 wCmdCode;
106} SCmdRequest, *PSCmdRequest;
107
108
109
110
111
112typedef struct tagSCmdScan {
113 u8 ssid[SSID_MAXLEN + 2];
114} SCmdScan, *PSCmdScan;
115
116
117
118
119
120typedef struct tagSCmdBSSJoin {
121 u16 wBSSType;
122 u16 wBBPType;
123 u8 ssid[SSID_MAXLEN + 2];
124 u32 uChannel;
125 bool bPSEnable;
126 bool bShareKeyAuth;
127} SCmdBSSJoin, *PSCmdBSSJoin;
128
129
130
131
132
133typedef struct tagSCmdZoneTypeSet {
134 bool bWrite;
135 WZONETYPE ZoneType;
136} SCmdZoneTypeSet, *PSCmdZoneTypeSet;
137
138#ifdef WPA_SM_Transtatus
139typedef struct tagSWPAResult {
140 char ifname[100];
141 u8 proto;
142 u8 key_mgmt;
143 u8 eap_type;
144 bool authenticated;
145} SWPAResult, *PSWPAResult;
146#endif
147
148typedef struct tagSCmdStartAP {
149 u16 wBSSType;
150 u16 wBBPType;
151 u8 ssid[SSID_MAXLEN + 2];
152 u32 uChannel;
153 u32 uBeaconInt;
154 bool bShareKeyAuth;
155 u8 byBasicRate;
156} SCmdStartAP, *PSCmdStartAP;
157
158typedef struct tagSCmdSetWEP {
159 bool bEnableWep;
160 u8 byKeyIndex;
161 u8 abyWepKey[WEP_NKEYS][WEP_KEYMAXLEN];
162 bool bWepKeyAvailable[WEP_NKEYS];
163 u32 auWepKeyLength[WEP_NKEYS];
164} SCmdSetWEP, *PSCmdSetWEP;
165
166typedef struct tagSBSSIDItem {
167 u32 uChannel;
168 u8 abyBSSID[BSSID_LEN];
169 u8 abySSID[SSID_MAXLEN + 1];
170
171
172
173
174 u8 byNetType;
175 u16 wBeaconInterval;
176 u16 wCapInfo;
177
178 bool bWEPOn;
179 u32 uRSSI;
180} SBSSIDItem;
181
182typedef struct tagSBSSIDList {
183 u32 uItem;
184 SBSSIDItem sBSSIDList[0];
185} SBSSIDList, *PSBSSIDList;
186
187typedef struct tagSCmdLinkStatus {
188 bool bLink;
189 u16 wBSSType;
190 u8 byState;
191 u8 abyBSSID[BSSID_LEN];
192 u8 abySSID[SSID_MAXLEN + 2];
193 u32 uChannel;
194 u32 uLinkRate;
195} SCmdLinkStatus, *PSCmdLinkStatus;
196
197
198
199
200typedef struct tagSDot11MIBCount {
201 u32 TransmittedFragmentCount;
202 u32 MulticastTransmittedFrameCount;
203 u32 FailedCount;
204 u32 RetryCount;
205 u32 MultipleRetryCount;
206 u32 RTSSuccessCount;
207 u32 RTSFailureCount;
208 u32 ACKFailureCount;
209 u32 FrameDuplicateCount;
210 u32 ReceivedFragmentCount;
211 u32 MulticastReceivedFrameCount;
212 u32 FCSErrorCount;
213} SDot11MIBCount, *PSDot11MIBCount;
214
215
216
217
218typedef struct tagSStatMIBCount {
219
220
221
222 u32 dwIsrTx0OK;
223 u32 dwIsrTx1OK;
224 u32 dwIsrBeaconTxOK;
225 u32 dwIsrRxOK;
226 u32 dwIsrTBTTInt;
227 u32 dwIsrSTIMERInt;
228 u32 dwIsrUnrecoverableError;
229 u32 dwIsrSoftInterrupt;
230 u32 dwIsrRxNoBuf;
231
232
233 u32 dwIsrUnknown;
234
235
236
237 u32 dwRsrFrmAlgnErr;
238 u32 dwRsrErr;
239 u32 dwRsrCRCErr;
240 u32 dwRsrCRCOk;
241 u32 dwRsrBSSIDOk;
242 u32 dwRsrADDROk;
243 u32 dwRsrICVOk;
244 u32 dwNewRsrShortPreamble;
245 u32 dwRsrLong;
246 u32 dwRsrRunt;
247
248 u32 dwRsrRxControl;
249 u32 dwRsrRxData;
250 u32 dwRsrRxManage;
251
252 u32 dwRsrRxPacket;
253 u32 dwRsrRxOctet;
254 u32 dwRsrBroadcast;
255 u32 dwRsrMulticast;
256 u32 dwRsrDirected;
257
258 u32 ullRsrOK;
259
260
261 u32 ullRxBroadcastBytes;
262 u32 ullRxMulticastBytes;
263 u32 ullRxDirectedBytes;
264 u32 ullRxBroadcastFrames;
265 u32 ullRxMulticastFrames;
266 u32 ullRxDirectedFrames;
267
268 u32 dwRsrRxFragment;
269 u32 dwRsrRxFrmLen64;
270 u32 dwRsrRxFrmLen65_127;
271 u32 dwRsrRxFrmLen128_255;
272 u32 dwRsrRxFrmLen256_511;
273 u32 dwRsrRxFrmLen512_1023;
274 u32 dwRsrRxFrmLen1024_1518;
275
276
277
278 u32 dwTsrTotalRetry[2];
279 u32 dwTsrOnceRetry[2];
280 u32 dwTsrMoreThanOnceRetry[2];
281 u32 dwTsrRetry[2];
282
283 u32 dwTsrACKData[2];
284 u32 dwTsrErr[2];
285 u32 dwAllTsrOK[2];
286 u32 dwTsrRetryTimeout[2];
287 u32 dwTsrTransmitTimeout[2];
288
289 u32 dwTsrTxPacket[2];
290 u32 dwTsrTxOctet[2];
291 u32 dwTsrBroadcast[2];
292 u32 dwTsrMulticast[2];
293 u32 dwTsrDirected[2];
294
295
296 u32 dwCntRxFrmLength;
297 u32 dwCntTxBufLength;
298
299 u8 abyCntRxPattern[16];
300 u8 abyCntTxPattern[16];
301
302
303 u32 dwCntRxDataErr;
304 u32 dwCntDecryptErr;
305 u32 dwCntRxICVErr;
306 u32 idxRxErrorDesc;
307
308
309 u32 ullTsrOK[2];
310
311
312 u32 ullTxBroadcastFrames[2];
313 u32 ullTxMulticastFrames[2];
314 u32 ullTxDirectedFrames[2];
315 u32 ullTxBroadcastBytes[2];
316 u32 ullTxMulticastBytes[2];
317 u32 ullTxDirectedBytes[2];
318} SStatMIBCount, *PSStatMIBCount;
319
320typedef struct tagSNodeItem {
321
322 u16 wAID;
323 u8 abyMACAddr[6];
324 u16 wTxDataRate;
325 u16 wInActiveCount;
326 u16 wEnQueueCnt;
327 u16 wFlags;
328 bool bPWBitOn;
329 u8 byKeyIndex;
330 u16 wWepKeyLength;
331 u8 abyWepKey[WEP_KEYMAXLEN];
332
333 bool bIsInFallback;
334 u32 uTxFailures;
335 u32 uTxAttempts;
336 u16 wFailureRatio;
337} SNodeItem;
338
339typedef struct tagSNodeList {
340 u32 uItem;
341 SNodeItem sNodeList[0];
342} SNodeList, *PSNodeList;
343
344typedef struct tagSCmdValue {
345 u32 dwValue;
346} SCmdValue, *PSCmdValue;
347
348
349
350
351
352
353enum {
354 VIAWGET_HOSTAPD_FLUSH = 1,
355 VIAWGET_HOSTAPD_ADD_STA = 2,
356 VIAWGET_HOSTAPD_REMOVE_STA = 3,
357 VIAWGET_HOSTAPD_GET_INFO_STA = 4,
358 VIAWGET_HOSTAPD_SET_ENCRYPTION = 5,
359 VIAWGET_HOSTAPD_GET_ENCRYPTION = 6,
360 VIAWGET_HOSTAPD_SET_FLAGS_STA = 7,
361 VIAWGET_HOSTAPD_SET_ASSOC_AP_ADDR = 8,
362 VIAWGET_HOSTAPD_SET_GENERIC_ELEMENT = 9,
363 VIAWGET_HOSTAPD_MLME = 10,
364 VIAWGET_HOSTAPD_SCAN_REQ = 11,
365 VIAWGET_HOSTAPD_STA_CLEAR_STATS = 12,
366};
367
368#define VIAWGET_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \
369 ((int)(&((struct viawget_hostapd_param *)0)->u.generic_elem.data))
370
371
372
373struct viawget_hostapd_param {
374 u32 cmd;
375 u8 sta_addr[6];
376 union {
377 struct {
378 u16 aid;
379 u16 capability;
380 u8 tx_supp_rates;
381 } add_sta;
382 struct {
383 u32 inactive_sec;
384 } get_info_sta;
385 struct {
386 u8 alg;
387 u32 flags;
388 u32 err;
389 u8 idx;
390 u8 seq[8];
391 u16 key_len;
392 u8 key[0];
393 } crypt;
394 struct {
395 u32 flags_and;
396 u32 flags_or;
397 } set_flags_sta;
398 struct {
399 u16 rid;
400 u16 len;
401 u8 data[0];
402 } rid;
403 struct {
404 u8 len;
405 u8 data[0];
406 } generic_elem;
407 struct {
408 u16 cmd;
409 u16 reason_code;
410 } mlme;
411 struct {
412 u8 ssid_len;
413 u8 ssid[32];
414 } scan_req;
415 } u;
416};
417
418
419#pragma pack()
420
421
422
423
424
425
426
427
428
429#endif
430