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 // ioctl Command code
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)
42 
43 typedef enum tagWMAC_CMD {
44 
65 
67 
68 typedef enum tagWZONETYPE {
72 } WZONETYPE;
73 
74 #define ADHOC 0
75 #define INFRA 1
76 #define BOTH 2
77 #define AP 3
78 
79 #define ADHOC_STARTED 1
80 #define ADHOC_JOINTED 2
81 
82 #define PHY80211a 0
83 #define PHY80211b 1
84 #define PHY80211g 2
85 
86 #define SSID_ID 0
87 #define SSID_MAXLEN 32
88 #define BSSID_LEN 6
89 #define WEP_NKEYS 4
90 #define WEP_KEYMAXLEN 29
91 #define WEP_40BIT_LEN 5
92 #define WEP_104BIT_LEN 13
93 #define WEP_232BIT_LEN 16
94 
95 // Ioctl interface structure
96 // Command structure
97 //
98 #pragma pack(1)
99 typedef struct tagSCmdRequest {
100  u8 name[16];
101  void *data;
102  u16 wResult;
103  u16 wCmdCode;
105 
106 //
107 // Scan
108 //
109 
110 typedef struct tagSCmdScan {
111 
112  u8 ssid[SSID_MAXLEN + 2];
113 
114 } SCmdScan, *PSCmdScan;
115 
116 //
117 // BSS Join
118 //
119 
120 typedef struct tagSCmdBSSJoin {
121 
122  u16 wBSSType;
123  u16 wBBPType;
124  u8 ssid[SSID_MAXLEN + 2];
125  u32 uChannel;
128 
130 
131 //
132 // Zonetype Setting
133 //
134 
135 typedef struct tagSCmdZoneTypeSet {
136 
139 
141 
142 typedef struct tagSWPAResult {
143  char ifname[100];
144  u8 proto;
145  u8 key_mgmt;
146  u8 eap_type;
149 
150 typedef struct tagSCmdStartAP {
151 
152  u16 wBSSType;
153  u16 wBBPType;
154  u8 ssid[SSID_MAXLEN + 2];
155  u32 uChannel;
156  u32 uBeaconInt;
158  u8 byBasicRate;
159 
161 
162 typedef struct tagSCmdSetWEP {
163 
165  u8 byKeyIndex;
169 
171 
172 typedef struct tagSBSSIDItem {
173 
174  u32 uChannel;
176  u8 abySSID[SSID_MAXLEN + 1];
178  u16 wCapInfo;
179  u8 byNetType;
181  u32 uRSSI;
182 
183 } SBSSIDItem;
184 
185 
186 typedef struct tagSBSSIDList {
187 
188  u32 uItem;
191 
192 
193 typedef struct tagSNodeItem {
194  // STA info
195  u16 wAID;
196  u8 abyMACAddr[6];
200  u16 wFlags;
202  u8 byKeyIndex;
205  // Auto rate fallback vars
210 
211 } SNodeItem;
212 
213 
214 typedef struct tagSNodeList {
215 
216  u32 uItem;
217  SNodeItem sNodeList[0];
218 
220 
221 
222 typedef struct tagSCmdLinkStatus {
223 
225  u16 wBSSType;
226  u8 byState;
228  u8 abySSID[SSID_MAXLEN + 2];
229  u32 uChannel;
230  u32 uLinkRate;
231 
233 
234 //
235 // 802.11 counter
236 //
237 typedef struct tagSDot11MIBCount {
241  u32 RetryCount;
251 
252 
253 
254 //
255 // statistic counter
256 //
257 typedef struct tagSStatMIBCount {
258  //
259  // ISR status count
260  //
261  u32 dwIsrTx0OK;
262  u32 dwIsrTx1OK;
264  u32 dwIsrRxOK;
271 
272  u32 dwIsrUnknown; /* unknown interrupt count */
273 
274  // RSR status count
275  //
277  u32 dwRsrErr;
279  u32 dwRsrCRCOk;
282  u32 dwRsrICVOk;
284  u32 dwRsrLong;
285  u32 dwRsrRunt;
286 
290 
296  // 64-bit OID
297  u32 ullRsrOK;
298 
299  // for some optional OIDs (64 bits) and DMI support
306 
314 
315  // TSR0,1 status count
316  //
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) */
323  u32 dwTsrACKData[2];
324  u32 dwTsrErr[2];
325  u32 dwAllTsrOK[2];
328 
329  u32 dwTsrTxPacket[2];
330  u32 dwTsrTxOctet[2];
331  u32 dwTsrBroadcast[2];
332  u32 dwTsrMulticast[2];
333  u32 dwTsrDirected[2];
334 
335  // RD/TD count
338 
339  u8 abyCntRxPattern[16];
340  u8 abyCntTxPattern[16];
341 
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 */
347 
348  /* 64-bit OID */
349  u32 ullTsrOK[2];
350 
351  // for some optional OIDs (64 bits) and DMI support
359 
360 typedef struct tagSCmdValue {
361 
362  u32 dwValue;
363 
365 
366 //
367 // hostapd & viawget ioctl related
368 //
369 
370 // VIAGWET_IOCTL_HOSTAPD ioctl() cmd:
371 enum {
384 };
385 
386 #define VIAWGET_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \
387 ((int) (&((struct viawget_hostapd_param *) 0)->u.generic_elem.data))
388 
389 // Maximum length for algorithm names (-1 for nul termination) used in ioctl()
390 
391 struct viawget_hostapd_param {
392  u32 cmd;
393  u8 sta_addr[6];
394  union {
395  struct {
396  u16 aid;
397  u16 capability;
399  } add_sta;
400  struct {
402  } get_info_sta;
403  struct {
404  u8 alg;
405  u32 flags;
406  u32 err;
407  u8 idx;
408  u8 seq[8];
409  u16 key_len;
410  u8 key[0];
411  } crypt;
412  struct {
413  u32 flags_and;
414  u32 flags_or;
415  } set_flags_sta;
416  struct {
417  u16 rid;
418  u16 len;
419  u8 data[0];
420  } rid;
421  struct {
422  u8 len;
423  u8 data[0];
424  } generic_elem;
425  struct {
426  u16 cmd;
428  } mlme;
429  struct {
430  u8 ssid_len;
431  u8 ssid[32];
432  } scan_req;
433  } u;
434 };
435 
436 /*--------------------- Export Classes ----------------------------*/
437 
438 /*--------------------- Export Variables --------------------------*/
439 
440 /*--------------------- Export Types ------------------------------*/
441 
442 /*--------------------- Export Functions --------------------------*/
443 
444 #endif /* __IOCMD_H__ */