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