Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
iocmd.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
3  * All rights reserved.
4  *
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.
9  *
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.
14  *
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.
18  *
19  * File: iocmd.h
20  *
21  * Purpose: Handles the viawget ioctl private interface functions
22  *
23  * Author: Lyndon Chen
24  *
25  * Date: May 8, 2002
26  *
27  */
28 
29 #ifndef __IOCMD_H__
30 #define __IOCMD_H__
31 
32 #include "ttype.h"
33 
34 /*--------------------- Export Definitions -------------------------*/
35 
36 //typedef uint32_t u32;
37 //typedef uint16_t u16;
38 //typedef uint8_t u8;
39 
40 
41 // ioctl Command code
42 #define MAGIC_CODE 0x3142
43 #define IOCTL_CMD_TEST (SIOCDEVPRIVATE + 0)
44 #define IOCTL_CMD_SET (SIOCDEVPRIVATE + 1)
45 #define IOCTL_CMD_HOSTAPD (SIOCDEVPRIVATE + 2)
46 #define IOCTL_CMD_WPA (SIOCDEVPRIVATE + 3)
47 
48 
49 typedef enum tagWMAC_CMD {
50 
71 
73 
74 typedef enum tagWZONETYPE {
78 }WZONETYPE;
79 
80 #define ADHOC 0
81 #define INFRA 1
82 #define BOTH 2
83 #define AP 3
84 
85 #define ADHOC_STARTED 1
86 #define ADHOC_JOINTED 2
87 
88 
89 #define PHY80211a 0
90 #define PHY80211b 1
91 #define PHY80211g 2
92 
93 #define SSID_ID 0
94 #define SSID_MAXLEN 32
95 #define BSSID_LEN 6
96 #define WEP_NKEYS 4
97 #define WEP_KEYMAXLEN 29
98 #define WEP_40BIT_LEN 5
99 #define WEP_104BIT_LEN 13
100 #define WEP_232BIT_LEN 16
101 
102 // Ioctl interface structure
103 // Command structure
104 //
105 #pragma pack(1)
106 typedef struct tagSCmdRequest {
107  u8 name[16];
108  void *data;
112 
113 //
114 // Scan
115 //
116 
117 typedef struct tagSCmdScan {
118 
120 
121 } SCmdScan, *PSCmdScan;
122 
123 
124 //
125 // BSS Join
126 //
127 
128 typedef struct tagSCmdBSSJoin {
129 
134  bool bPSEnable;
136 
138 
139 //
140 // Zonetype Setting
141 //
142 
143 typedef struct tagSCmdZoneTypeSet {
144 
145  bool bWrite;
147 
149 
150 #ifdef WPA_SM_Transtatus
151 typedef struct tagSWPAResult {
152  char ifname[100];
158 #endif
159 
160 typedef struct tagSCmdStartAP {
161 
169 
171 
172 
173 typedef struct tagSCmdSetWEP {
174 
180 
182 
183 
184 
185 typedef struct tagSBSSIDItem {
186 
190  //2006-1116-01,<Modify> by NomadZhao
191  //u16 wBeaconInterval;
192  //u16 wCapInfo;
193  //u8 byNetType;
196  u16 wCapInfo; // for address of byNetType at align 4
197 
198  bool bWEPOn;
200 
201 } SBSSIDItem;
202 
203 
204 typedef struct tagSBSSIDList {
205 
209 
210 
211 typedef struct tagSCmdLinkStatus {
212 
213  bool bLink;
220 
222 
223 //
224 // 802.11 counter
225 //
226 typedef struct tagSDot11MIBCount {
240 
241 
242 
243 //
244 // statistic counter
245 //
246 typedef struct tagSStatMIBCount {
247  //
248  // ISR status count
249  //
260 
261  u32 dwIsrUnknown; // unknown interrupt count
262 
263  // RSR status count
264  //
275 
279 
285  // 64-bit OID
287 
288  // for some optional OIDs (64 bits) and DMI support
295 
303 
304  // TSR0,1 status count
305  //
306  u32 dwTsrTotalRetry[2]; // total collision retry count
307  u32 dwTsrOnceRetry[2]; // this packet only occur one collision
308  u32 dwTsrMoreThanOnceRetry[2]; // this packet occur more than one collision
309  u32 dwTsrRetry[2]; // this packet has ever occur collision,
310  // that is (dwTsrOnceCollision0 + dwTsrMoreThanOnceCollision0)
316 
322 
323  // RD/TD count
326 
329 
330  // Software check....
331  u32 dwCntRxDataErr; // rx buffer data software compare CRC err count
332  u32 dwCntDecryptErr; // rx buffer data software compare CRC err count
333  u32 dwCntRxICVErr; // rx buffer data software compare CRC err count
334  u32 idxRxErrorDesc; // index for rx data error RD
335 
336  // 64-bit OID
338 
339  // for some optional OIDs (64 bits) and DMI support
347 
348 
349 typedef struct tagSNodeItem {
350  // STA info
357  bool bPWBitOn;
361  // Auto rate fallback vars
366 
367 } SNodeItem;
368 
369 
370 typedef struct tagSNodeList {
371 
374 
376 
377 
378 
379 typedef struct tagSCmdValue {
380 
382 
384 
385 
386 //
387 // hostapd & viawget ioctl related
388 //
389 
390 
391 // VIAGWET_IOCTL_HOSTAPD ioctl() cmd:
392 enum {
405 };
406 
407 
408 #define VIAWGET_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \
409 ((int) (&((struct viawget_hostapd_param *) 0)->u.generic_elem.data))
410 
411 // Maximum length for algorithm names (-1 for nul termination) used in ioctl()
412 
413 
414 
418  union {
419  struct {
423  } add_sta;
424  struct {
426  } get_info_sta;
427  struct {
432  u8 seq[8];
434  u8 key[0];
435  } crypt;
436  struct {
439  } set_flags_sta;
440  struct {
443  u8 data[0];
444  } rid;
445  struct {
447  u8 data[0];
448  } generic_elem;
449  struct {
452  } mlme;
453  struct {
455  u8 ssid[32];
456  } scan_req;
457  } u;
458 };
459 
460 //2006-1116-01,<Add> by NomadZhao
461 #pragma pack()
462 
463 /*--------------------- Export Classes ----------------------------*/
464 
465 /*--------------------- Export Variables --------------------------*/
466 
467 
468 /*--------------------- Export Types ------------------------------*/
469 
470 
471 /*--------------------- Export Functions --------------------------*/
472 
473 
474 
475 #endif //__IOCMD_H__