1/**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19#ifndef _UAPI_LINUX_WIRELESS_H 20#define _UAPI_LINUX_WIRELESS_H 21#include <linux/types.h> 22#include <linux/socket.h> 23#include <linux/if.h> 24#define WIRELESS_EXT 22 25#define SIOCSIWCOMMIT 0x8B00 26#define SIOCGIWNAME 0x8B01 27#define SIOCSIWNWID 0x8B02 28#define SIOCGIWNWID 0x8B03 29#define SIOCSIWFREQ 0x8B04 30#define SIOCGIWFREQ 0x8B05 31#define SIOCSIWMODE 0x8B06 32#define SIOCGIWMODE 0x8B07 33#define SIOCSIWSENS 0x8B08 34#define SIOCGIWSENS 0x8B09 35#define SIOCSIWRANGE 0x8B0A 36#define SIOCGIWRANGE 0x8B0B 37#define SIOCSIWPRIV 0x8B0C 38#define SIOCGIWPRIV 0x8B0D 39#define SIOCSIWSTATS 0x8B0E 40#define SIOCGIWSTATS 0x8B0F 41#define SIOCSIWSPY 0x8B10 42#define SIOCGIWSPY 0x8B11 43#define SIOCSIWTHRSPY 0x8B12 44#define SIOCGIWTHRSPY 0x8B13 45#define SIOCSIWAP 0x8B14 46#define SIOCGIWAP 0x8B15 47#define SIOCGIWAPLIST 0x8B17 48#define SIOCSIWSCAN 0x8B18 49#define SIOCGIWSCAN 0x8B19 50#define SIOCSIWESSID 0x8B1A 51#define SIOCGIWESSID 0x8B1B 52#define SIOCSIWNICKN 0x8B1C 53#define SIOCGIWNICKN 0x8B1D 54#define SIOCSIWRATE 0x8B20 55#define SIOCGIWRATE 0x8B21 56#define SIOCSIWRTS 0x8B22 57#define SIOCGIWRTS 0x8B23 58#define SIOCSIWFRAG 0x8B24 59#define SIOCGIWFRAG 0x8B25 60#define SIOCSIWTXPOW 0x8B26 61#define SIOCGIWTXPOW 0x8B27 62#define SIOCSIWRETRY 0x8B28 63#define SIOCGIWRETRY 0x8B29 64#define SIOCSIWENCODE 0x8B2A 65#define SIOCGIWENCODE 0x8B2B 66#define SIOCSIWPOWER 0x8B2C 67#define SIOCGIWPOWER 0x8B2D 68#define SIOCSIWGENIE 0x8B30 69#define SIOCGIWGENIE 0x8B31 70#define SIOCSIWMLME 0x8B16 71#define SIOCSIWAUTH 0x8B32 72#define SIOCGIWAUTH 0x8B33 73#define SIOCSIWENCODEEXT 0x8B34 74#define SIOCGIWENCODEEXT 0x8B35 75#define SIOCSIWPMKSA 0x8B36 76#define SIOCIWFIRSTPRIV 0x8BE0 77#define SIOCIWLASTPRIV 0x8BFF 78#define SIOCIWFIRST 0x8B00 79#define SIOCIWLAST SIOCIWLASTPRIV 80#define IW_IOCTL_IDX(cmd) ((cmd) - SIOCIWFIRST) 81#define IW_HANDLER(id,func) [IW_IOCTL_IDX(id)] = func 82#define IW_IS_SET(cmd) (! ((cmd) & 0x1)) 83#define IW_IS_GET(cmd) ((cmd) & 0x1) 84#define IWEVTXDROP 0x8C00 85#define IWEVQUAL 0x8C01 86#define IWEVCUSTOM 0x8C02 87#define IWEVREGISTERED 0x8C03 88#define IWEVEXPIRED 0x8C04 89#define IWEVGENIE 0x8C05 90#define IWEVMICHAELMICFAILURE 0x8C06 91#define IWEVASSOCREQIE 0x8C07 92#define IWEVASSOCRESPIE 0x8C08 93#define IWEVPMKIDCAND 0x8C09 94#define IWEVFIRST 0x8C00 95#define IW_EVENT_IDX(cmd) ((cmd) - IWEVFIRST) 96#define IW_PRIV_TYPE_MASK 0x7000 97#define IW_PRIV_TYPE_NONE 0x0000 98#define IW_PRIV_TYPE_BYTE 0x1000 99#define IW_PRIV_TYPE_CHAR 0x2000 100#define IW_PRIV_TYPE_INT 0x4000 101#define IW_PRIV_TYPE_FLOAT 0x5000 102#define IW_PRIV_TYPE_ADDR 0x6000 103#define IW_PRIV_SIZE_FIXED 0x0800 104#define IW_PRIV_SIZE_MASK 0x07FF 105#define IW_MAX_FREQUENCIES 32 106#define IW_MAX_BITRATES 32 107#define IW_MAX_TXPOWER 8 108#define IW_MAX_SPY 8 109#define IW_MAX_AP 64 110#define IW_ESSID_MAX_SIZE 32 111#define IW_MODE_AUTO 0 112#define IW_MODE_ADHOC 1 113#define IW_MODE_INFRA 2 114#define IW_MODE_MASTER 3 115#define IW_MODE_REPEAT 4 116#define IW_MODE_SECOND 5 117#define IW_MODE_MONITOR 6 118#define IW_MODE_MESH 7 119#define IW_QUAL_QUAL_UPDATED 0x01 120#define IW_QUAL_LEVEL_UPDATED 0x02 121#define IW_QUAL_NOISE_UPDATED 0x04 122#define IW_QUAL_ALL_UPDATED 0x07 123#define IW_QUAL_DBM 0x08 124#define IW_QUAL_QUAL_INVALID 0x10 125#define IW_QUAL_LEVEL_INVALID 0x20 126#define IW_QUAL_NOISE_INVALID 0x40 127#define IW_QUAL_RCPI 0x80 128#define IW_QUAL_ALL_INVALID 0x70 129#define IW_FREQ_AUTO 0x00 130#define IW_FREQ_FIXED 0x01 131#define IW_MAX_ENCODING_SIZES 8 132#define IW_ENCODING_TOKEN_MAX 64 133#define IW_ENCODE_INDEX 0x00FF 134#define IW_ENCODE_FLAGS 0xFF00 135#define IW_ENCODE_MODE 0xF000 136#define IW_ENCODE_DISABLED 0x8000 137#define IW_ENCODE_ENABLED 0x0000 138#define IW_ENCODE_RESTRICTED 0x4000 139#define IW_ENCODE_OPEN 0x2000 140#define IW_ENCODE_NOKEY 0x0800 141#define IW_ENCODE_TEMP 0x0400 142#define IW_POWER_ON 0x0000 143#define IW_POWER_TYPE 0xF000 144#define IW_POWER_PERIOD 0x1000 145#define IW_POWER_TIMEOUT 0x2000 146#define IW_POWER_MODE 0x0F00 147#define IW_POWER_UNICAST_R 0x0100 148#define IW_POWER_MULTICAST_R 0x0200 149#define IW_POWER_ALL_R 0x0300 150#define IW_POWER_FORCE_S 0x0400 151#define IW_POWER_REPEATER 0x0800 152#define IW_POWER_MODIFIER 0x000F 153#define IW_POWER_MIN 0x0001 154#define IW_POWER_MAX 0x0002 155#define IW_POWER_RELATIVE 0x0004 156#define IW_TXPOW_TYPE 0x00FF 157#define IW_TXPOW_DBM 0x0000 158#define IW_TXPOW_MWATT 0x0001 159#define IW_TXPOW_RELATIVE 0x0002 160#define IW_TXPOW_RANGE 0x1000 161#define IW_RETRY_ON 0x0000 162#define IW_RETRY_TYPE 0xF000 163#define IW_RETRY_LIMIT 0x1000 164#define IW_RETRY_LIFETIME 0x2000 165#define IW_RETRY_MODIFIER 0x00FF 166#define IW_RETRY_MIN 0x0001 167#define IW_RETRY_MAX 0x0002 168#define IW_RETRY_RELATIVE 0x0004 169#define IW_RETRY_SHORT 0x0010 170#define IW_RETRY_LONG 0x0020 171#define IW_SCAN_DEFAULT 0x0000 172#define IW_SCAN_ALL_ESSID 0x0001 173#define IW_SCAN_THIS_ESSID 0x0002 174#define IW_SCAN_ALL_FREQ 0x0004 175#define IW_SCAN_THIS_FREQ 0x0008 176#define IW_SCAN_ALL_MODE 0x0010 177#define IW_SCAN_THIS_MODE 0x0020 178#define IW_SCAN_ALL_RATE 0x0040 179#define IW_SCAN_THIS_RATE 0x0080 180#define IW_SCAN_TYPE_ACTIVE 0 181#define IW_SCAN_TYPE_PASSIVE 1 182#define IW_SCAN_MAX_DATA 4096 183#define IW_SCAN_CAPA_NONE 0x00 184#define IW_SCAN_CAPA_ESSID 0x01 185#define IW_SCAN_CAPA_BSSID 0x02 186#define IW_SCAN_CAPA_CHANNEL 0x04 187#define IW_SCAN_CAPA_MODE 0x08 188#define IW_SCAN_CAPA_RATE 0x10 189#define IW_SCAN_CAPA_TYPE 0x20 190#define IW_SCAN_CAPA_TIME 0x40 191#define IW_CUSTOM_MAX 256 192#define IW_GENERIC_IE_MAX 1024 193#define IW_MLME_DEAUTH 0 194#define IW_MLME_DISASSOC 1 195#define IW_MLME_AUTH 2 196#define IW_MLME_ASSOC 3 197#define IW_AUTH_INDEX 0x0FFF 198#define IW_AUTH_FLAGS 0xF000 199#define IW_AUTH_WPA_VERSION 0 200#define IW_AUTH_CIPHER_PAIRWISE 1 201#define IW_AUTH_CIPHER_GROUP 2 202#define IW_AUTH_KEY_MGMT 3 203#define IW_AUTH_TKIP_COUNTERMEASURES 4 204#define IW_AUTH_DROP_UNENCRYPTED 5 205#define IW_AUTH_80211_AUTH_ALG 6 206#define IW_AUTH_WPA_ENABLED 7 207#define IW_AUTH_RX_UNENCRYPTED_EAPOL 8 208#define IW_AUTH_ROAMING_CONTROL 9 209#define IW_AUTH_PRIVACY_INVOKED 10 210#define IW_AUTH_CIPHER_GROUP_MGMT 11 211#define IW_AUTH_MFP 12 212#define IW_AUTH_WPA_VERSION_DISABLED 0x00000001 213#define IW_AUTH_WPA_VERSION_WPA 0x00000002 214#define IW_AUTH_WPA_VERSION_WPA2 0x00000004 215#define IW_AUTH_CIPHER_NONE 0x00000001 216#define IW_AUTH_CIPHER_WEP40 0x00000002 217#define IW_AUTH_CIPHER_TKIP 0x00000004 218#define IW_AUTH_CIPHER_CCMP 0x00000008 219#define IW_AUTH_CIPHER_WEP104 0x00000010 220#define IW_AUTH_CIPHER_AES_CMAC 0x00000020 221#define IW_AUTH_KEY_MGMT_802_1X 1 222#define IW_AUTH_KEY_MGMT_PSK 2 223#define IW_AUTH_ALG_OPEN_SYSTEM 0x00000001 224#define IW_AUTH_ALG_SHARED_KEY 0x00000002 225#define IW_AUTH_ALG_LEAP 0x00000004 226#define IW_AUTH_ROAMING_ENABLE 0 227#define IW_AUTH_ROAMING_DISABLE 1 228#define IW_AUTH_MFP_DISABLED 0 229#define IW_AUTH_MFP_OPTIONAL 1 230#define IW_AUTH_MFP_REQUIRED 2 231#define IW_ENCODE_SEQ_MAX_SIZE 8 232#define IW_ENCODE_ALG_NONE 0 233#define IW_ENCODE_ALG_WEP 1 234#define IW_ENCODE_ALG_TKIP 2 235#define IW_ENCODE_ALG_CCMP 3 236#define IW_ENCODE_ALG_PMK 4 237#define IW_ENCODE_ALG_AES_CMAC 5 238#define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001 239#define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002 240#define IW_ENCODE_EXT_GROUP_KEY 0x00000004 241#define IW_ENCODE_EXT_SET_TX_KEY 0x00000008 242#define IW_MICFAILURE_KEY_ID 0x00000003 243#define IW_MICFAILURE_GROUP 0x00000004 244#define IW_MICFAILURE_PAIRWISE 0x00000008 245#define IW_MICFAILURE_STAKEY 0x00000010 246#define IW_MICFAILURE_COUNT 0x00000060 247#define IW_ENC_CAPA_WPA 0x00000001 248#define IW_ENC_CAPA_WPA2 0x00000002 249#define IW_ENC_CAPA_CIPHER_TKIP 0x00000004 250#define IW_ENC_CAPA_CIPHER_CCMP 0x00000008 251#define IW_ENC_CAPA_4WAY_HANDSHAKE 0x00000010 252#define IW_EVENT_CAPA_BASE(cmd) ((cmd >= SIOCIWFIRSTPRIV) ? (cmd - SIOCIWFIRSTPRIV + 0x60) : (cmd - SIOCIWFIRST)) 253#define IW_EVENT_CAPA_INDEX(cmd) (IW_EVENT_CAPA_BASE(cmd) >> 5) 254#define IW_EVENT_CAPA_MASK(cmd) (1 << (IW_EVENT_CAPA_BASE(cmd) & 0x1F)) 255#define IW_EVENT_CAPA_K_0 (IW_EVENT_CAPA_MASK(0x8B04) | IW_EVENT_CAPA_MASK(0x8B06) | IW_EVENT_CAPA_MASK(0x8B1A)) 256#define IW_EVENT_CAPA_K_1 (IW_EVENT_CAPA_MASK(0x8B2A)) 257#define IW_EVENT_CAPA_SET(event_capa,cmd) (event_capa[IW_EVENT_CAPA_INDEX(cmd)] |= IW_EVENT_CAPA_MASK(cmd)) 258#define IW_EVENT_CAPA_SET_KERNEL(event_capa) { event_capa[0] |= IW_EVENT_CAPA_K_0; event_capa[1] |= IW_EVENT_CAPA_K_1; } 259struct iw_param { 260 __s32 value; 261 __u8 fixed; 262 __u8 disabled; 263 __u16 flags; 264}; 265struct iw_point { 266 void __user * pointer; 267 __u16 length; 268 __u16 flags; 269}; 270struct iw_freq { 271 __s32 m; 272 __s16 e; 273 __u8 i; 274 __u8 flags; 275}; 276struct iw_quality { 277 __u8 qual; 278 __u8 level; 279 __u8 noise; 280 __u8 updated; 281}; 282struct iw_discarded { 283 __u32 nwid; 284 __u32 code; 285 __u32 fragment; 286 __u32 retries; 287 __u32 misc; 288}; 289struct iw_missed { 290 __u32 beacon; 291}; 292struct iw_thrspy { 293 struct sockaddr addr; 294 struct iw_quality qual; 295 struct iw_quality low; 296 struct iw_quality high; 297}; 298struct iw_scan_req { 299 __u8 scan_type; 300 __u8 essid_len; 301 __u8 num_channels; 302 __u8 flags; 303 struct sockaddr bssid; 304 __u8 essid[IW_ESSID_MAX_SIZE]; 305 __u32 min_channel_time; 306 __u32 max_channel_time; 307 struct iw_freq channel_list[IW_MAX_FREQUENCIES]; 308}; 309struct iw_encode_ext { 310 __u32 ext_flags; 311 __u8 tx_seq[IW_ENCODE_SEQ_MAX_SIZE]; 312 __u8 rx_seq[IW_ENCODE_SEQ_MAX_SIZE]; 313 struct sockaddr addr; 314 __u16 alg; 315 __u16 key_len; 316 __u8 key[0]; 317}; 318struct iw_mlme { 319 __u16 cmd; 320 __u16 reason_code; 321 struct sockaddr addr; 322}; 323#define IW_PMKSA_ADD 1 324#define IW_PMKSA_REMOVE 2 325#define IW_PMKSA_FLUSH 3 326#define IW_PMKID_LEN 16 327struct iw_pmksa { 328 __u32 cmd; 329 struct sockaddr bssid; 330 __u8 pmkid[IW_PMKID_LEN]; 331}; 332struct iw_michaelmicfailure { 333 __u32 flags; 334 struct sockaddr src_addr; 335 __u8 tsc[IW_ENCODE_SEQ_MAX_SIZE]; 336}; 337#define IW_PMKID_CAND_PREAUTH 0x00000001 338struct iw_pmkid_cand { 339 __u32 flags; 340 __u32 index; 341 struct sockaddr bssid; 342}; 343struct iw_statistics { 344 __u16 status; 345 struct iw_quality qual; 346 struct iw_discarded discard; 347 struct iw_missed miss; 348}; 349union iwreq_data { 350 char name[IFNAMSIZ]; 351 struct iw_point essid; 352 struct iw_param nwid; 353 struct iw_freq freq; 354 struct iw_param sens; 355 struct iw_param bitrate; 356 struct iw_param txpower; 357 struct iw_param rts; 358 struct iw_param frag; 359 __u32 mode; 360 struct iw_param retry; 361 struct iw_point encoding; 362 struct iw_param power; 363 struct iw_quality qual; 364 struct sockaddr ap_addr; 365 struct sockaddr addr; 366 struct iw_param param; 367 struct iw_point data; 368}; 369struct iwreq { 370 union { 371 char ifrn_name[IFNAMSIZ]; 372 } ifr_ifrn; 373 union iwreq_data u; 374}; 375struct iw_range { 376 __u32 throughput; 377 __u32 min_nwid; 378 __u32 max_nwid; 379 __u16 old_num_channels; 380 __u8 old_num_frequency; 381 __u8 scan_capa; 382 __u32 event_capa[6]; 383 __s32 sensitivity; 384 struct iw_quality max_qual; 385 struct iw_quality avg_qual; 386 __u8 num_bitrates; 387 __s32 bitrate[IW_MAX_BITRATES]; 388 __s32 min_rts; 389 __s32 max_rts; 390 __s32 min_frag; 391 __s32 max_frag; 392 __s32 min_pmp; 393 __s32 max_pmp; 394 __s32 min_pmt; 395 __s32 max_pmt; 396 __u16 pmp_flags; 397 __u16 pmt_flags; 398 __u16 pm_capa; 399 __u16 encoding_size[IW_MAX_ENCODING_SIZES]; 400 __u8 num_encoding_sizes; 401 __u8 max_encoding_tokens; 402 __u8 encoding_login_index; 403 __u16 txpower_capa; 404 __u8 num_txpower; 405 __s32 txpower[IW_MAX_TXPOWER]; 406 __u8 we_version_compiled; 407 __u8 we_version_source; 408 __u16 retry_capa; 409 __u16 retry_flags; 410 __u16 r_time_flags; 411 __s32 min_retry; 412 __s32 max_retry; 413 __s32 min_r_time; 414 __s32 max_r_time; 415 __u16 num_channels; 416 __u8 num_frequency; 417 struct iw_freq freq[IW_MAX_FREQUENCIES]; 418 __u32 enc_capa; 419}; 420struct iw_priv_args { 421 __u32 cmd; 422 __u16 set_args; 423 __u16 get_args; 424 char name[IFNAMSIZ]; 425}; 426struct iw_event { 427 __u16 len; 428 __u16 cmd; 429 union iwreq_data u; 430}; 431#define IW_EV_LCP_LEN (sizeof(struct iw_event) - sizeof(union iwreq_data)) 432#define IW_EV_CHAR_LEN (IW_EV_LCP_LEN + IFNAMSIZ) 433#define IW_EV_UINT_LEN (IW_EV_LCP_LEN + sizeof(__u32)) 434#define IW_EV_FREQ_LEN (IW_EV_LCP_LEN + sizeof(struct iw_freq)) 435#define IW_EV_PARAM_LEN (IW_EV_LCP_LEN + sizeof(struct iw_param)) 436#define IW_EV_ADDR_LEN (IW_EV_LCP_LEN + sizeof(struct sockaddr)) 437#define IW_EV_QUAL_LEN (IW_EV_LCP_LEN + sizeof(struct iw_quality)) 438#define IW_EV_POINT_OFF (((char *) & (((struct iw_point *) NULL)->length)) - (char *) NULL) 439#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - IW_EV_POINT_OFF) 440#define IW_EV_LCP_PK_LEN (4) 441#define IW_EV_CHAR_PK_LEN (IW_EV_LCP_PK_LEN + IFNAMSIZ) 442#define IW_EV_UINT_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(__u32)) 443#define IW_EV_FREQ_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_freq)) 444#define IW_EV_PARAM_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_param)) 445#define IW_EV_ADDR_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct sockaddr)) 446#define IW_EV_QUAL_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_quality)) 447#define IW_EV_POINT_PK_LEN (IW_EV_LCP_PK_LEN + 4) 448#endif 449