1845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
2845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * This file define a set of standard wireless extensions
3845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
4dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt * Version :	22	16.3.07
5845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
6845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Authors :	Jean Tourrilhes - HPL - <jt@hpl.hp.com>
7dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved.
8845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
9845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
10845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#ifndef _LINUX_WIRELESS_H
11845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define _LINUX_WIRELESS_H
12845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
13845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/************************** DOCUMENTATION **************************/
14845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
15845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Initial APIs (1996 -> onward) :
16845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * -----------------------------
17845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Basically, the wireless extensions are for now a set of standard ioctl
18845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * call + /proc/net/wireless
19845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
20845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * The entry /proc/net/wireless give statistics and information on the
21845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * driver.
22845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * This is better than having each driver having its entry because
23845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * its centralised and we may remove the driver module safely.
24845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
25845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Ioctl are used to configure the driver and issue commands.  This is
26845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * better than command line options of insmod because we may want to
27845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * change dynamically (while the driver is running) some parameters.
28845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
29845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * The ioctl mechanimsm are copied from standard devices ioctl.
30845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * We have the list of command plus a structure descibing the
31845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * data exchanged...
32845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Note that to add these ioctl, I was obliged to modify :
33845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	# net/core/dev.c (two place + add include)
34845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	# net/ipv4/af_inet.c (one place + add include)
35845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
36845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * /proc/net/wireless is a copy of /proc/net/dev.
37845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * We have a structure for data passed from the driver to /proc/net/wireless
38845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Too add this, I've modified :
39845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	# net/core/dev.c (two other places)
40845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	# include/linux/netdevice.h (one place)
41845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	# include/linux/proc_fs.h (one place)
42845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
43845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * New driver API (2002 -> onward) :
44845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * -------------------------------
45845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * This file is only concerned with the user space API and common definitions.
46845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * The new driver API is defined and documented in :
47845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	# include/net/iw_handler.h
48845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
49845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Note as well that /proc/net/wireless implementation has now moved in :
50845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	# net/core/wireless.c
51845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
52845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Wireless Events (2002 -> onward) :
53845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * --------------------------------
54845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Events are defined at the end of this file, and implemented in :
55845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	# net/core/wireless.c
56845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
57845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Other comments :
58845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * --------------
59845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Do not add here things that are redundant with other mechanisms
60845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * (drivers init, ifconfig, /proc/net/dev, ...) and with are not
61845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * wireless specific.
62845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
63845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * These wireless extensions are not magic : each driver has to provide
64845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * support for them...
65845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
66845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * IMPORTANT NOTE : As everything in the kernel, this is very much a
67845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * work in progress. Contact me if you have ideas of improvements...
68845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
69845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
70845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/***************************** INCLUDES *****************************/
71845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
72dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#include <linux/types.h>		/* for __u* and __s* typedefs */
73845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#include <linux/socket.h>		/* for "struct sockaddr" et al	*/
74845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#include <linux/if.h>			/* for IFNAMSIZ and co... */
75845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
76845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/***************************** VERSION *****************************/
77845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
78845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * This constant is used to know the availability of the wireless
79845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * extensions and to know which version of wireless extensions it is
80845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * (there is some stuff that will be added in the future...)
81845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * I just plan to increment with each new version.
82845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
83dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define WIRELESS_EXT	22
84845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
85845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
86845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Changes :
87845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
88845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * V2 to V3
89845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * --------
90845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	Alan Cox start some incompatibles changes. I've integrated a bit more.
91845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Encryption renamed to Encode to avoid US regulation problems
92845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Frequency changed from float to struct to avoid problems on old 386
93845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
94845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * V3 to V4
95845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * --------
96845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add sensitivity
97845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
98845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * V4 to V5
99845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * --------
100845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Missing encoding definitions in range
101845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Access points stuff
102845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
103845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * V5 to V6
104845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * --------
105845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- 802.11 support (ESSID ioctls)
106845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
107845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * V6 to V7
108845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * --------
109845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- define IW_ESSID_MAX_SIZE and IW_MAX_AP
110845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
111845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * V7 to V8
112845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * --------
113845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Changed my e-mail address
114845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- More 802.11 support (nickname, rate, rts, frag)
115845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- List index in frequencies
116845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
117845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * V8 to V9
118845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * --------
119845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Support for 'mode of operation' (ad-hoc, managed...)
120845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Support for unicast and multicast power saving
121845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Change encoding to support larger tokens (>64 bits)
122845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Updated iw_params (disable, flags) and use it for NWID
123845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Extracted iw_point from iwreq for clarity
124845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
125845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * V9 to V10
126845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * ---------
127845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add PM capability to range structure
128845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add PM modifier : MAX/MIN/RELATIVE
129845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add encoding option : IW_ENCODE_NOKEY
130845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add TxPower ioctls (work like TxRate)
131845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
132845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * V10 to V11
133845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * ----------
134845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add WE version in range (help backward/forward compatibility)
135845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add retry ioctls (work like PM)
136845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
137845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * V11 to V12
138845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * ----------
139845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add SIOCSIWSTATS to get /proc/net/wireless programatically
140845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add DEV PRIVATE IOCTL to avoid collisions in SIOCDEVPRIVATE space
141845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add new statistics (frag, retry, beacon)
142845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add average quality (for user space calibration)
143845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
144845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * V12 to V13
145845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * ----------
146845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Document creation of new driver API.
147845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Extract union iwreq_data from struct iwreq (for new driver API).
148845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Rename SIOCSIWNAME as SIOCSIWCOMMIT
149845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
150845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * V13 to V14
151845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * ----------
152845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Wireless Events support : define struct iw_event
153845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Define additional specific event numbers
154845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add "addr" and "param" fields in union iwreq_data
155845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- AP scanning stuff (SIOCSIWSCAN and friends)
156845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
157845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * V14 to V15
158845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * ----------
159845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add IW_PRIV_TYPE_ADDR for struct sockaddr private arg
160845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Make struct iw_freq signed (both m & e), add explicit padding
161845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add IWEVCUSTOM for driver specific event/scanning token
162845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add IW_MAX_GET_SPY for driver returning a lot of addresses
163845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add IW_TXPOW_RANGE for range of Tx Powers
164845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add IWEVREGISTERED & IWEVEXPIRED events for Access Points
165845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add IW_MODE_MONITOR for passive monitor
166845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
167845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * V15 to V16
168845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * ----------
169845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Increase the number of bitrates in iw_range to 32 (for 802.11g)
170845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Increase the number of frequencies in iw_range to 32 (for 802.11b+a)
171845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Reshuffle struct iw_range for increases, add filler
172845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Increase IW_MAX_AP to 64 for driver returning a lot of addresses
173845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Remove IW_MAX_GET_SPY because conflict with enhanced spy support
174845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add SIOCSIWTHRSPY/SIOCGIWTHRSPY and "struct iw_thrspy"
175845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add IW_ENCODE_TEMP and iw_range->encoding_login_index
176845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
177845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * V16 to V17
178845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * ----------
179845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add flags to frequency -> auto/fixed
180845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Document (struct iw_quality *)->updated, add new flags (INVALID)
181845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Wireless Event capability in struct iw_range
182845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add support for relative TxPower (yick !)
183845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
184845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * V17 to V18 (From Jouni Malinen <j@w1.fi>)
185845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * ----------
186845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add support for WPA/WPA2
187845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add extended encoding configuration (SIOCSIWENCODEEXT and
188845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	  SIOCGIWENCODEEXT)
189845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add SIOCSIWGENIE/SIOCGIWGENIE
190845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add SIOCSIWMLME
191845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add SIOCSIWPMKSA
192845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add struct iw_range bit field for supported encoding capabilities
193845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add optional scan request parameters for SIOCSIWSCAN
194845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add SIOCSIWAUTH/SIOCGIWAUTH for setting authentication and WPA
195845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	  related parameters (extensible up to 4096 parameter values)
196845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add wireless events: IWEVGENIE, IWEVMICHAELMICFAILURE,
197845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	  IWEVASSOCREQIE, IWEVASSOCRESPIE, IWEVPMKIDCAND
198845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
199845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * V18 to V19
200845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * ----------
201845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Remove (struct iw_point *)->pointer from events and streams
202845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Remove header includes to help user space
203845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Increase IW_ENCODING_TOKEN_MAX from 32 to 64
204845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add IW_QUAL_ALL_UPDATED and IW_QUAL_ALL_INVALID macros
205845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add explicit flag to tell stats are in dBm : IW_QUAL_DBM
206845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	- Add IW_IOCTL_IDX() and IW_EVENT_IDX() macros
207dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt *
208dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt * V19 to V20
209dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt * ----------
210dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt *	- RtNetlink requests support (SET/GET)
211dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt *
212dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt * V20 to V21
213dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt * ----------
214dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt *	- Remove (struct net_device *)->get_wireless_stats()
215dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt *	- Change length in ESSID and NICK to strlen() instead of strlen()+1
216dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt *	- Add IW_RETRY_SHORT/IW_RETRY_LONG retry modifiers
217dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt *	- Power/Retry relative values no longer * 100000
218dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt *	- Add explicit flag to tell stats are in 802.11k RCPI : IW_QUAL_RCPI
219dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt *
220dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt * V21 to V22
221dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt * ----------
222dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt *	- Prevent leaking of kernel space in stream on 64 bits.
223845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
224845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
225845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/**************************** CONSTANTS ****************************/
226845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
227845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* -------------------------- IOCTL LIST -------------------------- */
228845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
229845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Wireless Identification */
230845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWCOMMIT	0x8B00		/* Commit pending changes to driver */
231845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWNAME	0x8B01		/* get name == wireless protocol */
232845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* SIOCGIWNAME is used to verify the presence of Wireless Extensions.
233845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Common values : "IEEE 802.11-DS", "IEEE 802.11-FH", "IEEE 802.11b"...
234845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Don't put the name of your driver there, it's useless. */
235845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
236845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Basic operations */
237845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWNWID	0x8B02		/* set network id (pre-802.11) */
238845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWNWID	0x8B03		/* get network id (the cell) */
239845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWFREQ	0x8B04		/* set channel/frequency (Hz) */
240845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWFREQ	0x8B05		/* get channel/frequency (Hz) */
241845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWMODE	0x8B06		/* set operation mode */
242845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWMODE	0x8B07		/* get operation mode */
243845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWSENS	0x8B08		/* set sensitivity (dBm) */
244845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWSENS	0x8B09		/* get sensitivity (dBm) */
245845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
246845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Informative stuff */
247845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWRANGE	0x8B0A		/* Unused */
248845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWRANGE	0x8B0B		/* Get range of parameters */
249845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWPRIV	0x8B0C		/* Unused */
250845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWPRIV	0x8B0D		/* get private ioctl interface info */
251845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWSTATS	0x8B0E		/* Unused */
252845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWSTATS	0x8B0F		/* Get /proc/net/wireless stats */
253845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* SIOCGIWSTATS is strictly used between user space and the kernel, and
254845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * is never passed to the driver (i.e. the driver will never see it). */
255845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
256845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Spy support (statistics per MAC address - used for Mobile IP support) */
257845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWSPY	0x8B10		/* set spy addresses */
258845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWSPY	0x8B11		/* get spy info (quality of link) */
259845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWTHRSPY	0x8B12		/* set spy threshold (spy event) */
260845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWTHRSPY	0x8B13		/* get spy threshold */
261845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
262845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Access Point manipulation */
263845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWAP	0x8B14		/* set access point MAC addresses */
264845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWAP	0x8B15		/* get access point MAC addresses */
265845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWAPLIST	0x8B17		/* Deprecated in favor of scanning */
266845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWSCAN	0x8B18		/* trigger scanning (list cells) */
267845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWSCAN	0x8B19		/* get scanning results */
268845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
269845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* 802.11 specific support */
270845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWESSID	0x8B1A		/* set ESSID (network name) */
271845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWESSID	0x8B1B		/* get ESSID */
272845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWNICKN	0x8B1C		/* set node name/nickname */
273845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWNICKN	0x8B1D		/* get node name/nickname */
274845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* As the ESSID and NICKN are strings up to 32 bytes long, it doesn't fit
275845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * within the 'iwreq' structure, so we need to use the 'data' member to
276845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * point to a string in user space, like it is done for RANGE... */
277845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
278845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Other parameters useful in 802.11 and some other devices */
279845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWRATE	0x8B20		/* set default bit rate (bps) */
280845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWRATE	0x8B21		/* get default bit rate (bps) */
281845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWRTS	0x8B22		/* set RTS/CTS threshold (bytes) */
282845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWRTS	0x8B23		/* get RTS/CTS threshold (bytes) */
283845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWFRAG	0x8B24		/* set fragmentation thr (bytes) */
284845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWFRAG	0x8B25		/* get fragmentation thr (bytes) */
285845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWTXPOW	0x8B26		/* set transmit power (dBm) */
286845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWTXPOW	0x8B27		/* get transmit power (dBm) */
287845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWRETRY	0x8B28		/* set retry limits and lifetime */
288845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWRETRY	0x8B29		/* get retry limits and lifetime */
289845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
290845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Encoding stuff (scrambling, hardware security, WEP...) */
291845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWENCODE	0x8B2A		/* set encoding token & mode */
292845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWENCODE	0x8B2B		/* get encoding token & mode */
293845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Power saving stuff (power management, unicast and multicast) */
294845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWPOWER	0x8B2C		/* set Power Management settings */
295845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWPOWER	0x8B2D		/* get Power Management settings */
296845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
297845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* WPA : Generic IEEE 802.11 informatiom element (e.g., for WPA/RSN/WMM).
298845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * This ioctl uses struct iw_point and data buffer that includes IE id and len
299845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * fields. More than one IE may be included in the request. Setting the generic
300845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * IE to empty buffer (len=0) removes the generic IE from the driver. Drivers
301845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * are allowed to generate their own WPA/RSN IEs, but in these cases, drivers
302845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * are required to report the used IE as a wireless event, e.g., when
303845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * associating with an AP. */
304845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWGENIE	0x8B30		/* set generic IE */
305845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWGENIE	0x8B31		/* get generic IE */
306845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
307845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* WPA : IEEE 802.11 MLME requests */
308845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWMLME	0x8B16		/* request MLME operation; uses
309845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * struct iw_mlme */
310845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* WPA : Authentication mode parameters */
311845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWAUTH	0x8B32		/* set authentication mode params */
312845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWAUTH	0x8B33		/* get authentication mode params */
313845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
314845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* WPA : Extended version of encoding configuration */
315845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWENCODEEXT 0x8B34		/* set encoding token & mode */
316845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCGIWENCODEEXT 0x8B35		/* get encoding token & mode */
317845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
318845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* WPA2 : PMKSA cache management */
319845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCSIWPMKSA	0x8B36		/* PMKSA cache operation */
320845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
321845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* -------------------- DEV PRIVATE IOCTL LIST -------------------- */
322845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
323845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* These 32 ioctl are wireless device private, for 16 commands.
324845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Each driver is free to use them for whatever purpose it chooses,
325845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * however the driver *must* export the description of those ioctls
326845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * with SIOCGIWPRIV and *must* use arguments as defined below.
327845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * If you don't follow those rules, DaveM is going to hate you (reason :
328845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * it make mixed 32/64bit operation impossible).
329845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
330845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCIWFIRSTPRIV	0x8BE0
331845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCIWLASTPRIV	0x8BFF
332845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Previously, we were using SIOCDEVPRIVATE, but we now have our
333845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * separate range because of collisions with other tools such as
334845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * 'mii-tool'.
335845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * We now have 32 commands, so a bit more space ;-).
336dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt * Also, all 'even' commands are only usable by root and don't return the
337845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * content of ifr/iwr to user (but you are not obliged to use the set/get
338845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * convention, just use every other two command). More details in iwpriv.c.
339845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * And I repeat : you are not forced to use them with iwpriv, but you
340845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * must be compliant with it.
341845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
342845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
343845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* ------------------------- IOCTL STUFF ------------------------- */
344845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
345845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* The first and the last (range) */
346845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCIWFIRST	0x8B00
347845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define SIOCIWLAST	SIOCIWLASTPRIV		/* 0x8BFF */
348845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_IOCTL_IDX(cmd)	((cmd) - SIOCIWFIRST)
349845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
350dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt/* Odd : get (world access), even : set (root access) */
351845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_IS_SET(cmd)	(!((cmd) & 0x1))
352845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_IS_GET(cmd)	((cmd) & 0x1)
353845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
354845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* ----------------------- WIRELESS EVENTS ----------------------- */
355845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Those are *NOT* ioctls, do not issue request on them !!! */
356845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Most events use the same identifier as ioctl requests */
357845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
358845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IWEVTXDROP	0x8C00		/* Packet dropped to excessive retry */
359845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IWEVQUAL	0x8C01		/* Quality part of statistics (scan) */
360845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IWEVCUSTOM	0x8C02		/* Driver specific ascii string */
361845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IWEVREGISTERED	0x8C03		/* Discovered a new node (AP mode) */
362845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IWEVEXPIRED	0x8C04		/* Expired a node (AP mode) */
363845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IWEVGENIE	0x8C05		/* Generic IE (WPA, RSN, WMM, ..)
364845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * (scan results); This includes id and
365845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * length fields. One IWEVGENIE may
366845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * contain more than one IE. Scan
367845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * results may contain one or more
368845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * IWEVGENIE events. */
369845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IWEVMICHAELMICFAILURE 0x8C06	/* Michael MIC failure
370845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * (struct iw_michaelmicfailure)
371845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 */
372845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IWEVASSOCREQIE	0x8C07		/* IEs used in (Re)Association Request.
373845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * The data includes id and length
374845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * fields and may contain more than one
375845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * IE. This event is required in
376845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * Managed mode if the driver
377845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * generates its own WPA/RSN IE. This
378845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * should be sent just before
379845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * IWEVREGISTERED event for the
380845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * association. */
381845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IWEVASSOCRESPIE	0x8C08		/* IEs used in (Re)Association
382845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * Response. The data includes id and
383845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * length fields and may contain more
384845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * than one IE. This may be sent
385845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * between IWEVASSOCREQIE and
386845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * IWEVREGISTERED events for the
387845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * association. */
388845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IWEVPMKIDCAND	0x8C09		/* PMKID candidate for RSN
389845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * pre-authentication
390845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * (struct iw_pmkid_cand) */
391845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
392845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IWEVFIRST	0x8C00
393845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_EVENT_IDX(cmd)	((cmd) - IWEVFIRST)
394845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
395845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* ------------------------- PRIVATE INFO ------------------------- */
396845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
397845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * The following is used with SIOCGIWPRIV. It allow a driver to define
398845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * the interface (name, type of data) for its private ioctl.
399845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Privates ioctl are SIOCIWFIRSTPRIV -> SIOCIWLASTPRIV
400845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
401845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
402845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_PRIV_TYPE_MASK	0x7000	/* Type of arguments */
403845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_PRIV_TYPE_NONE	0x0000
404845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_PRIV_TYPE_BYTE	0x1000	/* Char as number */
405845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_PRIV_TYPE_CHAR	0x2000	/* Char as character */
406845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_PRIV_TYPE_INT	0x4000	/* 32 bits int */
407845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_PRIV_TYPE_FLOAT	0x5000	/* struct iw_freq */
408845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_PRIV_TYPE_ADDR	0x6000	/* struct sockaddr */
409845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
410845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_PRIV_SIZE_FIXED	0x0800	/* Variable or fixed number of args */
411845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
412845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_PRIV_SIZE_MASK	0x07FF	/* Max number of those args */
413845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
414845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
415845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Note : if the number of args is fixed and the size < 16 octets,
416845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * instead of passing a pointer we will put args in the iwreq struct...
417845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
418845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
419845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* ----------------------- OTHER CONSTANTS ----------------------- */
420845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
421845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Maximum frequencies in the range struct */
422845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_MAX_FREQUENCIES	32
423845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Note : if you have something like 80 frequencies,
424845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * don't increase this constant and don't fill the frequency list.
425845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * The user will be able to set by channel anyway... */
426845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
427845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Maximum bit rates in the range struct */
428845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_MAX_BITRATES		32
429845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
430845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Maximum tx powers in the range struct */
431845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_MAX_TXPOWER		8
432845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Note : if you more than 8 TXPowers, just set the max and min or
433845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * a few of them in the struct iw_range. */
434845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
435845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Maximum of address that you may set with SPY */
436845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_MAX_SPY		8
437845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
438845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Maximum of address that you may get in the
439845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project   list of access points in range */
440845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_MAX_AP		64
441845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
442845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Maximum size of the ESSID and NICKN strings */
443845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ESSID_MAX_SIZE	32
444845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
445845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Modes of operation */
446845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_MODE_AUTO	0	/* Let the driver decides */
447845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_MODE_ADHOC	1	/* Single cell network */
448845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_MODE_INFRA	2	/* Multi cell network, roaming, ... */
449845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_MODE_MASTER	3	/* Synchronisation master or Access Point */
450845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_MODE_REPEAT	4	/* Wireless Repeater (forwarder) */
451845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_MODE_SECOND	5	/* Secondary master/repeater (backup) */
452845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_MODE_MONITOR	6	/* Passive monitor (listen only) */
453dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_MODE_MESH	7	/* Mesh (IEEE 802.11s) network */
454845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
455845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Statistics flags (bitmask in updated) */
456845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_QUAL_QUAL_UPDATED	0x01	/* Value was updated since last read */
457845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_QUAL_LEVEL_UPDATED	0x02
458845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_QUAL_NOISE_UPDATED	0x04
459845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_QUAL_ALL_UPDATED	0x07
460845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_QUAL_DBM		0x08	/* Level + Noise are dBm */
461845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_QUAL_QUAL_INVALID	0x10	/* Driver doesn't provide value */
462845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_QUAL_LEVEL_INVALID	0x20
463845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_QUAL_NOISE_INVALID	0x40
464dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_QUAL_RCPI		0x80	/* Level + Noise are 802.11k RCPI */
465845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_QUAL_ALL_INVALID	0x70
466845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
467845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Frequency flags */
468845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_FREQ_AUTO		0x00	/* Let the driver decides */
469845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_FREQ_FIXED		0x01	/* Force a specific value */
470845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
471845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Maximum number of size of encoding token available
472845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * they are listed in the range structure */
473845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_MAX_ENCODING_SIZES	8
474845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
475845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Maximum size of the encoding token in bytes */
476845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENCODING_TOKEN_MAX	64	/* 512 bits (for now) */
477845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
478845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Flags for encoding (along with the token) */
479845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENCODE_INDEX		0x00FF	/* Token index (if needed) */
480845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENCODE_FLAGS		0xFF00	/* Flags defined below */
481845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENCODE_MODE		0xF000	/* Modes defined below */
482845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENCODE_DISABLED	0x8000	/* Encoding disabled */
483845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENCODE_ENABLED	0x0000	/* Encoding enabled */
484845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENCODE_RESTRICTED	0x4000	/* Refuse non-encoded packets */
485845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENCODE_OPEN		0x2000	/* Accept non-encoded packets */
486845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENCODE_NOKEY		0x0800  /* Key is write only, so not present */
487845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENCODE_TEMP		0x0400  /* Temporary key */
488845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
489845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Power management flags available (along with the value, if any) */
490845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_POWER_ON		0x0000	/* No details... */
491845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_POWER_TYPE		0xF000	/* Type of parameter */
492845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_POWER_PERIOD		0x1000	/* Value is a period/duration of  */
493845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_POWER_TIMEOUT	0x2000	/* Value is a timeout (to go asleep) */
494845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_POWER_MODE		0x0F00	/* Power Management mode */
495845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_POWER_UNICAST_R	0x0100	/* Receive only unicast messages */
496845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_POWER_MULTICAST_R	0x0200	/* Receive only multicast messages */
497845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_POWER_ALL_R		0x0300	/* Receive all messages though PM */
498845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_POWER_FORCE_S	0x0400	/* Force PM procedure for sending unicast */
499845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_POWER_REPEATER	0x0800	/* Repeat broadcast messages in PM period */
500845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_POWER_MODIFIER	0x000F	/* Modify a parameter */
501845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_POWER_MIN		0x0001	/* Value is a minimum  */
502845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_POWER_MAX		0x0002	/* Value is a maximum */
503845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_POWER_RELATIVE	0x0004	/* Value is not in seconds/ms/us */
504845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
505845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Transmit Power flags available */
506845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_TXPOW_TYPE		0x00FF	/* Type of value */
507845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_TXPOW_DBM		0x0000	/* Value is in dBm */
508845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_TXPOW_MWATT		0x0001	/* Value is in mW */
509845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_TXPOW_RELATIVE	0x0002	/* Value is in arbitrary units */
510845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_TXPOW_RANGE		0x1000	/* Range of value between min/max */
511845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
512845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Retry limits and lifetime flags available */
513845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_RETRY_ON		0x0000	/* No details... */
514845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_RETRY_TYPE		0xF000	/* Type of parameter */
515845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_RETRY_LIMIT		0x1000	/* Maximum number of retries*/
516845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_RETRY_LIFETIME	0x2000	/* Maximum duration of retries in us */
517dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_RETRY_MODIFIER	0x00FF	/* Modify a parameter */
518845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_RETRY_MIN		0x0001	/* Value is a minimum  */
519845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_RETRY_MAX		0x0002	/* Value is a maximum */
520845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_RETRY_RELATIVE	0x0004	/* Value is not in seconds/ms/us */
521dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_RETRY_SHORT		0x0010	/* Value is for short packets  */
522dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_RETRY_LONG		0x0020	/* Value is for long packets */
523845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
524845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Scanning request flags */
525845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_SCAN_DEFAULT		0x0000	/* Default scan of the driver */
526845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_SCAN_ALL_ESSID	0x0001	/* Scan all ESSIDs */
527845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_SCAN_THIS_ESSID	0x0002	/* Scan only this ESSID */
528845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_SCAN_ALL_FREQ	0x0004	/* Scan all Frequencies */
529845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_SCAN_THIS_FREQ	0x0008	/* Scan only this Frequency */
530845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_SCAN_ALL_MODE	0x0010	/* Scan all Modes */
531845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_SCAN_THIS_MODE	0x0020	/* Scan only this Mode */
532845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_SCAN_ALL_RATE	0x0040	/* Scan all Bit-Rates */
533845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_SCAN_THIS_RATE	0x0080	/* Scan only this Bit-Rate */
534845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* struct iw_scan_req scan_type */
535845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_SCAN_TYPE_ACTIVE 0
536845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_SCAN_TYPE_PASSIVE 1
537845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Maximum size of returned data */
538d3f40c7fa6dafacc9ca5d4652014df5c1219b6a4Dmitry Shmidt#define IW_SCAN_MAX_DATA	8192	/* In bytes */
539845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
540dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt/* Scan capability flags - in (struct iw_range *)->scan_capa */
541dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_SCAN_CAPA_NONE		0x00
542dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_SCAN_CAPA_ESSID		0x01
543dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_SCAN_CAPA_BSSID		0x02
544dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_SCAN_CAPA_CHANNEL	0x04
545dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_SCAN_CAPA_MODE		0x08
546dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_SCAN_CAPA_RATE		0x10
547dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_SCAN_CAPA_TYPE		0x20
548dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_SCAN_CAPA_TIME		0x40
549dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt
550845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Max number of char in custom event - use multiple of them if needed */
551845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_CUSTOM_MAX		256	/* In bytes */
552845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
553845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Generic information element */
554845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_GENERIC_IE_MAX	1024
555845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
556845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* MLME requests (SIOCSIWMLME / struct iw_mlme) */
557845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_MLME_DEAUTH		0
558845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_MLME_DISASSOC	1
559dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_MLME_AUTH		2
560dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_MLME_ASSOC		3
561845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
562845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* SIOCSIWAUTH/SIOCGIWAUTH struct iw_param flags */
563845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_INDEX		0x0FFF
564845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_FLAGS		0xF000
565845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* SIOCSIWAUTH/SIOCGIWAUTH parameters (0 .. 4095)
566845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * (IW_AUTH_INDEX mask in struct iw_param flags; this is the index of the
567845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * parameter that is being set/get to; value will be read/written to
568845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * struct iw_param value field) */
569845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_WPA_VERSION		0
570845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_CIPHER_PAIRWISE		1
571845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_CIPHER_GROUP		2
572845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_KEY_MGMT		3
573845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_TKIP_COUNTERMEASURES	4
574845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_DROP_UNENCRYPTED	5
575845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_80211_AUTH_ALG		6
576845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_WPA_ENABLED		7
577845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_RX_UNENCRYPTED_EAPOL	8
578845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_ROAMING_CONTROL		9
579845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_PRIVACY_INVOKED		10
580845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
581845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* IW_AUTH_WPA_VERSION values (bit field) */
582845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_WPA_VERSION_DISABLED	0x00000001
583845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_WPA_VERSION_WPA		0x00000002
584845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_WPA_VERSION_WPA2	0x00000004
585845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
586845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* IW_AUTH_PAIRWISE_CIPHER and IW_AUTH_GROUP_CIPHER values (bit field) */
587845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_CIPHER_NONE	0x00000001
588845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_CIPHER_WEP40	0x00000002
589845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_CIPHER_TKIP	0x00000004
590845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_CIPHER_CCMP	0x00000008
591845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_CIPHER_WEP104	0x00000010
592845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
593845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* IW_AUTH_KEY_MGMT values (bit field) */
594845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_KEY_MGMT_802_1X	1
595845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_KEY_MGMT_PSK	2
596845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
597845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* IW_AUTH_80211_AUTH_ALG values (bit field) */
598845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_ALG_OPEN_SYSTEM	0x00000001
599845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_ALG_SHARED_KEY	0x00000002
600845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_ALG_LEAP	0x00000004
601845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
602845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* IW_AUTH_ROAMING_CONTROL values */
603845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_ROAMING_ENABLE	0	/* driver/firmware based roaming */
604845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_AUTH_ROAMING_DISABLE	1	/* user space program used for roaming
605845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * control */
606845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
607845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* SIOCSIWENCODEEXT definitions */
608845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENCODE_SEQ_MAX_SIZE	8
609845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* struct iw_encode_ext ->alg */
610845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENCODE_ALG_NONE	0
611845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENCODE_ALG_WEP	1
612845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENCODE_ALG_TKIP	2
613845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENCODE_ALG_CCMP	3
614dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_ENCODE_ALG_PMK	4
615845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* struct iw_encode_ext ->ext_flags */
616845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENCODE_EXT_TX_SEQ_VALID	0x00000001
617845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENCODE_EXT_RX_SEQ_VALID	0x00000002
618845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENCODE_EXT_GROUP_KEY		0x00000004
619845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENCODE_EXT_SET_TX_KEY	0x00000008
620845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
621845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* IWEVMICHAELMICFAILURE : struct iw_michaelmicfailure ->flags */
622845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_MICFAILURE_KEY_ID	0x00000003 /* Key ID 0..3 */
623845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_MICFAILURE_GROUP	0x00000004
624845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_MICFAILURE_PAIRWISE	0x00000008
625845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_MICFAILURE_STAKEY	0x00000010
626845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_MICFAILURE_COUNT	0x00000060 /* 1 or 2 (0 = count not supported)
627845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					    */
628845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
629845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Bit field values for enc_capa in struct iw_range */
630845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENC_CAPA_WPA		0x00000001
631845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENC_CAPA_WPA2	0x00000002
632845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENC_CAPA_CIPHER_TKIP	0x00000004
633845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_ENC_CAPA_CIPHER_CCMP	0x00000008
634dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_ENC_CAPA_4WAY_HANDSHAKE	0x00000010
635845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
636845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Event capability macros - in (struct iw_range *)->event_capa
637845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Because we have more than 32 possible events, we use an array of
638845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * 32 bit bitmasks. Note : 32 bits = 0x20 = 2^5. */
639845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_EVENT_CAPA_BASE(cmd)		((cmd >= SIOCIWFIRSTPRIV) ? \
640845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 (cmd - SIOCIWFIRSTPRIV + 0x60) : \
641845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 (cmd - SIOCSIWCOMMIT))
642845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_EVENT_CAPA_INDEX(cmd)	(IW_EVENT_CAPA_BASE(cmd) >> 5)
643845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_EVENT_CAPA_MASK(cmd)		(1 << (IW_EVENT_CAPA_BASE(cmd) & 0x1F))
644845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Event capability constants - event autogenerated by the kernel
645845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * This list is valid for most 802.11 devices, customise as needed... */
646845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_EVENT_CAPA_K_0	(IW_EVENT_CAPA_MASK(0x8B04) | \
647845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project				 IW_EVENT_CAPA_MASK(0x8B06) | \
648845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project				 IW_EVENT_CAPA_MASK(0x8B1A))
649845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_EVENT_CAPA_K_1	(IW_EVENT_CAPA_MASK(0x8B2A))
650845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* "Easy" macro to set events in iw_range (less efficient) */
651845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_EVENT_CAPA_SET(event_capa, cmd) (event_capa[IW_EVENT_CAPA_INDEX(cmd)] |= IW_EVENT_CAPA_MASK(cmd))
652845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_EVENT_CAPA_SET_KERNEL(event_capa) {event_capa[0] |= IW_EVENT_CAPA_K_0; event_capa[1] |= IW_EVENT_CAPA_K_1; }
653845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
654845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
655845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/****************************** TYPES ******************************/
656845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
657845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* --------------------------- SUBTYPES --------------------------- */
658845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
659845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	Generic format for most parameters that fit in an int
660845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
661845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Projectstruct	iw_param
662845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project{
663845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project  __s32		value;		/* The value of the parameter itself */
664845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project  __u8		fixed;		/* Hardware should not use auto select */
665845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project  __u8		disabled;	/* Disable the feature */
666845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project  __u16		flags;		/* Various specifc flags (if any) */
667845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project};
668845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
669845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
670845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	For all data larger than 16 octets, we need to use a
671845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	pointer to memory allocated in user space.
672845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
673845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Projectstruct	iw_point
674845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project{
675845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project  void __user	*pointer;	/* Pointer to the data  (in user space) */
676845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project  __u16		length;		/* number of fields or size in bytes */
677845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project  __u16		flags;		/* Optional params */
678845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project};
679845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
680dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#ifdef __KERNEL__
681dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#ifdef CONFIG_COMPAT
682dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt
683dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#include <linux/compat.h>
684dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt
685dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidtstruct compat_iw_point {
686dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt	compat_caddr_t pointer;
687dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt	__u16 length;
688dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt	__u16 flags;
689dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt};
690dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#endif
691dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#endif
692dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt
693845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
694845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	A frequency
695845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	For numbers lower than 10^9, we encode the number in 'm' and
696845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	set 'e' to 0
697845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	For number greater than 10^9, we divide it by the lowest power
698845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	of 10 to get 'm' lower than 10^9, with 'm'= f / (10^'e')...
699845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	The power of 10 is in 'e', the result of the division is in 'm'.
700845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
701845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Projectstruct	iw_freq
702845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project{
703845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__s32		m;		/* Mantissa */
704845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__s16		e;		/* Exponent */
705845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		i;		/* List index (when in range struct) */
706845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		flags;		/* Flags (fixed/auto) */
707845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project};
708845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
709845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
710845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	Quality of the link
711845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
712845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Projectstruct	iw_quality
713845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project{
714845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		qual;		/* link quality (%retries, SNR,
715845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					   %missed beacons or better...) */
716845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		level;		/* signal level (dBm) */
717845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		noise;		/* noise level (dBm) */
718845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		updated;	/* Flags to know if updated */
719845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project};
720845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
721845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
722845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	Packet discarded in the wireless adapter due to
723845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	"wireless" specific problems...
724845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	Note : the list of counter and statistics in net_device_stats
725845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	is already pretty exhaustive, and you should use that first.
726845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	This is only additional stats...
727845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
728845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Projectstruct	iw_discarded
729845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project{
730845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u32		nwid;		/* Rx : Wrong nwid/essid */
731845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u32		code;		/* Rx : Unable to code/decode (WEP) */
732845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u32		fragment;	/* Rx : Can't perform MAC reassembly */
733845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u32		retries;	/* Tx : Max MAC retries num reached */
734845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u32		misc;		/* Others cases */
735845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project};
736845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
737845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
738845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	Packet/Time period missed in the wireless adapter due to
739845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	"wireless" specific problems...
740845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
741845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Projectstruct	iw_missed
742845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project{
743845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u32		beacon;		/* Missed beacons/superframe */
744845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project};
745845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
746845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
747845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	Quality range (for spy threshold)
748845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
749845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Projectstruct	iw_thrspy
750845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project{
751845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct sockaddr		addr;		/* Source address (hw/mac) */
752845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_quality	qual;		/* Quality of the link */
753845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_quality	low;		/* Low threshold */
754845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_quality	high;		/* High threshold */
755845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project};
756845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
757845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
758845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	Optional data for scan request
759845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
760845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	Note: these optional parameters are controlling parameters for the
761845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	scanning behavior, these do not apply to getting scan results
762845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	(SIOCGIWSCAN). Drivers are expected to keep a local BSS table and
763845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	provide a merged results with all BSSes even if the previous scan
764845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	request limited scanning to a subset, e.g., by specifying an SSID.
765845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	Especially, scan results are required to include an entry for the
766845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	current BSS if the driver is in Managed mode and associated with an AP.
767845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
768845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Projectstruct	iw_scan_req
769845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project{
770845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		scan_type; /* IW_SCAN_TYPE_{ACTIVE,PASSIVE} */
771845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		essid_len;
772845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		num_channels; /* num entries in channel_list;
773845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project				       * 0 = scan all allowed channels */
774845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		flags; /* reserved as padding; use zero, this may
775845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project				* be used in the future for adding flags
776845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project				* to request different scan behavior */
777845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct sockaddr	bssid; /* ff:ff:ff:ff:ff:ff for broadcast BSSID or
778845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project				* individual address of a specific BSS */
779845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
780845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/*
781845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * Use this ESSID if IW_SCAN_THIS_ESSID flag is used instead of using
782845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * the current ESSID. This allows scan requests for specific ESSID
783845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * without having to change the current ESSID and potentially breaking
784845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * the current association.
785845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 */
786845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		essid[IW_ESSID_MAX_SIZE];
787845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
788845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/*
789845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * Optional parameters for changing the default scanning behavior.
790845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * These are based on the MLME-SCAN.request from IEEE Std 802.11.
791845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * TU is 1.024 ms. If these are set to 0, driver is expected to use
792845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * reasonable default values. min_channel_time defines the time that
793845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * will be used to wait for the first reply on each channel. If no
794845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * replies are received, next channel will be scanned after this. If
795845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * replies are received, total time waited on the channel is defined by
796845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * max_channel_time.
797845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 */
798845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u32		min_channel_time; /* in TU */
799845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u32		max_channel_time; /* in TU */
800845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
801845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_freq	channel_list[IW_MAX_FREQUENCIES];
802845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project};
803845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
804845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* ------------------------- WPA SUPPORT ------------------------- */
805845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
806845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
807845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	Extended data structure for get/set encoding (this is used with
808845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	SIOCSIWENCODEEXT/SIOCGIWENCODEEXT. struct iw_point and IW_ENCODE_*
809845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	flags are used in the same way as with SIOCSIWENCODE/SIOCGIWENCODE and
810845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	only the data contents changes (key data -> this structure, including
811845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	key data).
812845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
813845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	If the new key is the first group key, it will be set as the default
814845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	TX key. Otherwise, default TX key index is only changed if
815845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	IW_ENCODE_EXT_SET_TX_KEY flag is set.
816845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
817845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	Key will be changed with SIOCSIWENCODEEXT in all cases except for
818845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	special "change TX key index" operation which is indicated by setting
819845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	key_len = 0 and ext_flags |= IW_ENCODE_EXT_SET_TX_KEY.
820845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
821845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	tx_seq/rx_seq are only used when respective
822845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	IW_ENCODE_EXT_{TX,RX}_SEQ_VALID flag is set in ext_flags. Normal
823845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	TKIP/CCMP operation is to set RX seq with SIOCSIWENCODEEXT and start
824845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	TX seq from zero whenever key is changed. SIOCGIWENCODEEXT is normally
825845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	used only by an Authenticator (AP or an IBSS station) to get the
826845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	current TX sequence number. Using TX_SEQ_VALID for SIOCSIWENCODEEXT and
827845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	RX_SEQ_VALID for SIOCGIWENCODEEXT are optional, but can be useful for
828845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	debugging/testing.
829845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
830845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Projectstruct	iw_encode_ext
831845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project{
832845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u32		ext_flags; /* IW_ENCODE_EXT_* */
833845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		tx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
834845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		rx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
835845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct sockaddr	addr; /* ff:ff:ff:ff:ff:ff for broadcast/multicast
836845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project			       * (group) keys or unicast address for
837845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project			       * individual keys */
838845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u16		alg; /* IW_ENCODE_ALG_* */
839845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u16		key_len;
840845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		key[0];
841845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project};
842845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
843845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* SIOCSIWMLME data */
844845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Projectstruct	iw_mlme
845845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project{
846845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u16		cmd; /* IW_MLME_* */
847845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u16		reason_code;
848845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct sockaddr	addr;
849845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project};
850845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
851845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* SIOCSIWPMKSA data */
852845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_PMKSA_ADD		1
853845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_PMKSA_REMOVE		2
854845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_PMKSA_FLUSH		3
855845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
856845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_PMKID_LEN	16
857845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
858845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Projectstruct	iw_pmksa
859845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project{
860845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u32		cmd; /* IW_PMKSA_* */
861845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct sockaddr	bssid;
862845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		pmkid[IW_PMKID_LEN];
863845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project};
864845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
865845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* IWEVMICHAELMICFAILURE data */
866845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Projectstruct	iw_michaelmicfailure
867845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project{
868845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u32		flags;
869845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct sockaddr	src_addr;
870845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		tsc[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
871845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project};
872845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
873845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* IWEVPMKIDCAND data */
874845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_PMKID_CAND_PREAUTH	0x00000001 /* RNS pre-authentication enabled */
875845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Projectstruct	iw_pmkid_cand
876845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project{
877845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u32		flags; /* IW_PMKID_CAND_* */
878845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u32		index; /* the smaller the index, the higher the
879845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project				* priority */
880845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct sockaddr	bssid;
881845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project};
882845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
883845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* ------------------------ WIRELESS STATS ------------------------ */
884845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
885845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Wireless statistics (used for /proc/net/wireless)
886845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
887845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Projectstruct	iw_statistics
888845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project{
889845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u16		status;		/* Status
890845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * - device dependent for now */
891845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
892845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_quality	qual;		/* Quality of the link
893845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project						 * (instant/mean/max) */
894845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_discarded	discard;	/* Packet discarded counts */
895845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_missed	miss;		/* Packet missed counts */
896845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project};
897845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
898845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* ------------------------ IOCTL REQUEST ------------------------ */
899845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
900845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * This structure defines the payload of an ioctl, and is used
901845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * below.
902845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *
903845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Note that this structure should fit on the memory footprint
904845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * of iwreq (which is the same as ifreq), which mean a max size of
905845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * 16 octets = 128 bits. Warning, pointers might be 64 bits wide...
906845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * You should check this when increasing the structures defined
907845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * above in this file...
908845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
909845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Projectunion	iwreq_data
910845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project{
911845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* Config - generic */
912845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	char		name[IFNAMSIZ];
913845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* Name : used to verify the presence of  wireless extensions.
914845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * Name of the protocol/provider... */
915845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
916845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_point	essid;		/* Extended network name */
917845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_param	nwid;		/* network id (or domain - the cell) */
918845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_freq	freq;		/* frequency or channel :
919845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * 0-1000 = channel
920845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project					 * > 1000 = frequency in Hz */
921845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
922845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_param	sens;		/* signal level threshold */
923845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_param	bitrate;	/* default bit rate */
924845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_param	txpower;	/* default transmit power */
925845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_param	rts;		/* RTS threshold threshold */
926845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_param	frag;		/* Fragmentation threshold */
927845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u32		mode;		/* Operation mode */
928845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_param	retry;		/* Retry limits & lifetime */
929845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
930845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_point	encoding;	/* Encoding stuff : tokens */
931845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_param	power;		/* PM duration/timeout */
932845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_quality qual;		/* Quality part of statistics */
933845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
934845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct sockaddr	ap_addr;	/* Access point address */
935845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct sockaddr	addr;		/* Destination address (hw/mac) */
936845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
937845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_param	param;		/* Other small parameters */
938845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_point	data;		/* Other large parameters */
939845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project};
940845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
941845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
942845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * The structure to exchange data for ioctl.
943845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * This structure is the same as 'struct ifreq', but (re)defined for
944845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * convenience...
945845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Do I need to remind you about structure size (32 octets) ?
946845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
947845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Projectstruct	iwreq
948845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project{
949845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	union
950845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	{
951845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project		char	ifrn_name[IFNAMSIZ];	/* if name, e.g. "eth0" */
952845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	} ifr_ifrn;
953845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
954845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* Data part (defined just above) */
955845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	union	iwreq_data	u;
956845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project};
957845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
958845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* -------------------------- IOCTL DATA -------------------------- */
959845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
960845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	For those ioctl which want to exchange mode data that what could
961845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	fit in the above structure...
962845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
963845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
964845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
965845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project *	Range of parameters
966845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
967845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
968845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Projectstruct	iw_range
969845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project{
970845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* Informative stuff (to choose between different interface) */
971845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u32		throughput;	/* To give an idea... */
972845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* In theory this value should be the maximum benchmarked
973845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * TCP/IP throughput, because with most of these devices the
974845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * bit rate is meaningless (overhead an co) to estimate how
975845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * fast the connection will go and pick the fastest one.
976845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * I suggest people to play with Netperf or any benchmark...
977845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 */
978845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
979845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* NWID (or domain id) */
980845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u32		min_nwid;	/* Minimal NWID we are able to set */
981845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u32		max_nwid;	/* Maximal NWID we are able to set */
982845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
983845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* Old Frequency (backward compat - moved lower ) */
984845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u16		old_num_channels;
985845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		old_num_frequency;
986845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
987dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt	/* Scan capabilities */
988dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt	__u8		scan_capa; 	/* IW_SCAN_CAPA_* bit field */
989dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt
990845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* Wireless event capability bitmasks */
991845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u32		event_capa[6];
992845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
993845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* signal level threshold range */
994845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__s32		sensitivity;
995845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
996845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* Quality of link & SNR stuff */
997845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* Quality range (link, level, noise)
998845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * If the quality is absolute, it will be in the range [0 ; max_qual],
999845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * if the quality is dBm, it will be in the range [max_qual ; 0].
1000845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * Don't forget that we use 8 bit arithmetics... */
1001845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_quality	max_qual;	/* Quality of the link */
1002845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* This should contain the average/typical values of the quality
1003845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * indicator. This should be the threshold between a "good" and
1004845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * a "bad" link (example : monitor going from green to orange).
1005845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * Currently, user space apps like quality monitors don't have any
1006845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * way to calibrate the measurement. With this, they can split
1007845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * the range between 0 and max_qual in different quality level
1008845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * (using a geometric subdivision centered on the average).
1009845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * I expect that people doing the user space apps will feedback
1010845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * us on which value we need to put in each driver... */
1011845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_quality	avg_qual;	/* Quality of the link */
1012845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
1013845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* Rates */
1014845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		num_bitrates;	/* Number of entries in the list */
1015845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__s32		bitrate[IW_MAX_BITRATES];	/* list, in bps */
1016845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
1017845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* RTS threshold */
1018845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__s32		min_rts;	/* Minimal RTS threshold */
1019845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__s32		max_rts;	/* Maximal RTS threshold */
1020845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
1021845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* Frag threshold */
1022845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__s32		min_frag;	/* Minimal frag threshold */
1023845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__s32		max_frag;	/* Maximal frag threshold */
1024845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
1025845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* Power Management duration & timeout */
1026845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__s32		min_pmp;	/* Minimal PM period */
1027845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__s32		max_pmp;	/* Maximal PM period */
1028845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__s32		min_pmt;	/* Minimal PM timeout */
1029845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__s32		max_pmt;	/* Maximal PM timeout */
1030845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u16		pmp_flags;	/* How to decode max/min PM period */
1031845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u16		pmt_flags;	/* How to decode max/min PM timeout */
1032845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u16		pm_capa;	/* What PM options are supported */
1033845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
1034845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* Encoder stuff */
1035845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u16	encoding_size[IW_MAX_ENCODING_SIZES];	/* Different token sizes */
1036845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8	num_encoding_sizes;	/* Number of entry in the list */
1037845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8	max_encoding_tokens;	/* Max number of tokens */
1038845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* For drivers that need a "login/passwd" form */
1039845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8	encoding_login_index;	/* token index for login token */
1040845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
1041845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* Transmit power */
1042845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u16		txpower_capa;	/* What options are supported */
1043845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		num_txpower;	/* Number of entries in the list */
1044845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__s32		txpower[IW_MAX_TXPOWER];	/* list, in bps */
1045845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
1046845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* Wireless Extension version info */
1047845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		we_version_compiled;	/* Must be WIRELESS_EXT */
1048845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		we_version_source;	/* Last update of source */
1049845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
1050845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* Retry limits and lifetime */
1051845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u16		retry_capa;	/* What retry options are supported */
1052845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u16		retry_flags;	/* How to decode max/min retry limit */
1053845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u16		r_time_flags;	/* How to decode max/min retry life */
1054845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__s32		min_retry;	/* Minimal number of retries */
1055845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__s32		max_retry;	/* Maximal number of retries */
1056845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__s32		min_r_time;	/* Minimal retry lifetime */
1057845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__s32		max_r_time;	/* Maximal retry lifetime */
1058845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
1059845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* Frequency */
1060845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u16		num_channels;	/* Number of channels [0; num - 1] */
1061845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u8		num_frequency;	/* Number of entry in the list */
1062845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	struct iw_freq	freq[IW_MAX_FREQUENCIES];	/* list */
1063845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	/* Note : this frequency list doesn't need to fit channel numbers,
1064845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	 * because each entry contain its channel index */
1065845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
1066dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt	__u32		enc_capa;	/* IW_ENC_CAPA_* bit field */
1067845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project};
1068845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
1069845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
1070845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Private ioctl interface information
1071845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
1072845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
1073845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Projectstruct	iw_priv_args
1074845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project{
1075845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u32		cmd;		/* Number of the ioctl to issue */
1076845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u16		set_args;	/* Type and number of args */
1077845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u16		get_args;	/* Type and number of args */
1078845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	char		name[IFNAMSIZ];	/* Name of the extension */
1079845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project};
1080845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
1081845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* ----------------------- WIRELESS EVENTS ----------------------- */
1082845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
1083845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * Wireless events are carried through the rtnetlink socket to user
1084845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * space. They are encapsulated in the IFLA_WIRELESS field of
1085845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * a RTM_NEWLINK message.
1086845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
1087845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
1088845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/*
1089845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * A Wireless Event. Contains basically the same data as the ioctl...
1090845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project */
1091845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Projectstruct iw_event
1092845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project{
1093dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt	__u16		len;			/* Real length of this stuff */
1094845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	__u16		cmd;			/* Wireless IOCTL */
1095845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project	union iwreq_data	u;		/* IOCTL fixed payload */
1096845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project};
1097845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
1098845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Size of the Event prefix (including padding and alignement junk) */
1099845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_EV_LCP_LEN	(sizeof(struct iw_event) - sizeof(union iwreq_data))
1100845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* Size of the various events */
1101845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_EV_CHAR_LEN	(IW_EV_LCP_LEN + IFNAMSIZ)
1102845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_EV_UINT_LEN	(IW_EV_LCP_LEN + sizeof(__u32))
1103845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_EV_FREQ_LEN	(IW_EV_LCP_LEN + sizeof(struct iw_freq))
1104845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_EV_PARAM_LEN	(IW_EV_LCP_LEN + sizeof(struct iw_param))
1105845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_EV_ADDR_LEN	(IW_EV_LCP_LEN + sizeof(struct sockaddr))
1106845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_EV_QUAL_LEN	(IW_EV_LCP_LEN + sizeof(struct iw_quality))
1107845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
1108845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project/* iw_point events are special. First, the payload (extra data) come at
1109845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * the end of the event, so they are bigger than IW_EV_POINT_LEN. Second,
1110845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project * we omit the pointer, so start at an offset. */
1111845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_EV_POINT_OFF (((char *) &(((struct iw_point *) NULL)->length)) - \
1112845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project			  (char *) NULL)
1113845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#define IW_EV_POINT_LEN	(IW_EV_LCP_LEN + sizeof(struct iw_point) - \
1114845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project			 IW_EV_POINT_OFF)
1115845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project
1116dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#ifdef __KERNEL__
1117dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#ifdef CONFIG_COMPAT
1118dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidtstruct __compat_iw_event {
1119dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt	__u16		len;			/* Real length of this stuff */
1120dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt	__u16		cmd;			/* Wireless IOCTL */
1121dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt	compat_caddr_t	pointer;
1122dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt};
1123dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_EV_COMPAT_LCP_LEN offsetof(struct __compat_iw_event, pointer)
1124dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_EV_COMPAT_POINT_OFF offsetof(struct compat_iw_point, length)
1125dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_EV_COMPAT_POINT_LEN	\
1126dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt	(IW_EV_COMPAT_LCP_LEN + sizeof(struct compat_iw_point) - \
1127dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt	 IW_EV_COMPAT_POINT_OFF)
1128dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#endif
1129dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#endif
1130dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt
1131dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt/* Size of the Event prefix when packed in stream */
1132dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_EV_LCP_PK_LEN	(4)
1133dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt/* Size of the various events when packed in stream */
1134dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_EV_CHAR_PK_LEN	(IW_EV_LCP_PK_LEN + IFNAMSIZ)
1135dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_EV_UINT_PK_LEN	(IW_EV_LCP_PK_LEN + sizeof(__u32))
1136dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_EV_FREQ_PK_LEN	(IW_EV_LCP_PK_LEN + sizeof(struct iw_freq))
1137dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_EV_PARAM_PK_LEN	(IW_EV_LCP_PK_LEN + sizeof(struct iw_param))
1138dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_EV_ADDR_PK_LEN	(IW_EV_LCP_PK_LEN + sizeof(struct sockaddr))
1139dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_EV_QUAL_PK_LEN	(IW_EV_LCP_PK_LEN + sizeof(struct iw_quality))
1140dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt#define IW_EV_POINT_PK_LEN	(IW_EV_LCP_LEN + 4)
1141dd4fc9341a41e44c2c1879b71e4098018880230cDmitry Shmidt
1142845e0124d42b67ef926fbae32a7f61d2e5109ebdThe Android Open Source Project#endif	/* _LINUX_WIRELESS_H */
1143