1 /* 2 * This header was generated from the Linux kernel headers by update_headers.py, 3 * to provide necessary information from kernel to userspace, such as constants, 4 * structures, and macros, and thus, contains no copyrightable information. 5 */ 6 #ifndef _UAPI_LINUX_WIRELESS_H 7 #define _UAPI_LINUX_WIRELESS_H 8 #include <linux/types.h> 9 #include <linux/socket.h> 10 #include <linux/if.h> 11 #include <stddef.h> 12 #define WIRELESS_EXT 22 13 #define SIOCSIWCOMMIT 0x8B00 14 #define SIOCGIWNAME 0x8B01 15 #define SIOCSIWNWID 0x8B02 16 #define SIOCGIWNWID 0x8B03 17 #define SIOCSIWFREQ 0x8B04 18 #define SIOCGIWFREQ 0x8B05 19 #define SIOCSIWMODE 0x8B06 20 #define SIOCGIWMODE 0x8B07 21 #define SIOCSIWSENS 0x8B08 22 #define SIOCGIWSENS 0x8B09 23 #define SIOCSIWRANGE 0x8B0A 24 #define SIOCGIWRANGE 0x8B0B 25 #define SIOCSIWPRIV 0x8B0C 26 #define SIOCGIWPRIV 0x8B0D 27 #define SIOCSIWSTATS 0x8B0E 28 #define SIOCGIWSTATS 0x8B0F 29 #define SIOCSIWSPY 0x8B10 30 #define SIOCGIWSPY 0x8B11 31 #define SIOCSIWTHRSPY 0x8B12 32 #define SIOCGIWTHRSPY 0x8B13 33 #define SIOCSIWAP 0x8B14 34 #define SIOCGIWAP 0x8B15 35 #define SIOCGIWAPLIST 0x8B17 36 #define SIOCSIWSCAN 0x8B18 37 #define SIOCGIWSCAN 0x8B19 38 #define SIOCSIWESSID 0x8B1A 39 #define SIOCGIWESSID 0x8B1B 40 #define SIOCSIWNICKN 0x8B1C 41 #define SIOCGIWNICKN 0x8B1D 42 #define SIOCSIWRATE 0x8B20 43 #define SIOCGIWRATE 0x8B21 44 #define SIOCSIWRTS 0x8B22 45 #define SIOCGIWRTS 0x8B23 46 #define SIOCSIWFRAG 0x8B24 47 #define SIOCGIWFRAG 0x8B25 48 #define SIOCSIWTXPOW 0x8B26 49 #define SIOCGIWTXPOW 0x8B27 50 #define SIOCSIWRETRY 0x8B28 51 #define SIOCGIWRETRY 0x8B29 52 #define SIOCSIWENCODE 0x8B2A 53 #define SIOCGIWENCODE 0x8B2B 54 #define SIOCSIWPOWER 0x8B2C 55 #define SIOCGIWPOWER 0x8B2D 56 #define SIOCSIWGENIE 0x8B30 57 #define SIOCGIWGENIE 0x8B31 58 #define SIOCSIWMLME 0x8B16 59 #define SIOCSIWAUTH 0x8B32 60 #define SIOCGIWAUTH 0x8B33 61 #define SIOCSIWENCODEEXT 0x8B34 62 #define SIOCGIWENCODEEXT 0x8B35 63 #define SIOCSIWPMKSA 0x8B36 64 #define SIOCIWFIRSTPRIV 0x8BE0 65 #define SIOCIWLASTPRIV 0x8BFF 66 #define SIOCIWFIRST 0x8B00 67 #define SIOCIWLAST SIOCIWLASTPRIV 68 #define IW_IOCTL_IDX(cmd) ((cmd) - SIOCIWFIRST) 69 #define IW_HANDLER(id, func) \ 70 [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) ? \ 242 (cmd - SIOCIWFIRSTPRIV + 0x60) : \ 243 (cmd - SIOCIWFIRST)) 244 #define IW_EVENT_CAPA_INDEX(cmd) (IW_EVENT_CAPA_BASE(cmd) >> 5) 245 #define IW_EVENT_CAPA_MASK(cmd) (1 << (IW_EVENT_CAPA_BASE(cmd) & 0x1F)) 246 #define IW_EVENT_CAPA_K_0 (IW_EVENT_CAPA_MASK(0x8B04) | \ 247 IW_EVENT_CAPA_MASK(0x8B06) | \ 248 IW_EVENT_CAPA_MASK(0x8B1A)) 249 #define IW_EVENT_CAPA_K_1 (IW_EVENT_CAPA_MASK(0x8B2A)) 250 #define IW_EVENT_CAPA_SET(event_capa, cmd) (event_capa[IW_EVENT_CAPA_INDEX(cmd)] |= IW_EVENT_CAPA_MASK(cmd)) 251 #define IW_EVENT_CAPA_SET_KERNEL(event_capa) {event_capa[0] |= IW_EVENT_CAPA_K_0; event_capa[1] |= IW_EVENT_CAPA_K_1; } 252 struct iw_param { 253 __s32 value; 254 __u8 fixed; 255 __u8 disabled; 256 __u16 flags; 257 }; 258 struct iw_point { 259 void __user *pointer; 260 __u16 length; 261 __u16 flags; 262 }; 263 struct iw_freq { 264 __s32 m; 265 __s16 e; 266 __u8 i; 267 __u8 flags; 268 }; 269 struct iw_quality { 270 __u8 qual; 271 __u8 level; 272 __u8 noise; 273 __u8 updated; 274 }; 275 struct iw_discarded { 276 __u32 nwid; 277 __u32 code; 278 __u32 fragment; 279 __u32 retries; 280 __u32 misc; 281 }; 282 struct iw_missed { 283 __u32 beacon; 284 }; 285 struct iw_thrspy { 286 struct sockaddr addr; 287 struct iw_quality qual; 288 struct iw_quality low; 289 struct iw_quality high; 290 }; 291 struct iw_scan_req { 292 __u8 scan_type; 293 __u8 essid_len; 294 __u8 num_channels; 295 __u8 flags; 296 struct sockaddr bssid; 297 298 __u8 essid[IW_ESSID_MAX_SIZE]; 299 300 __u32 min_channel_time; 301 __u32 max_channel_time; 302 struct iw_freq channel_list[IW_MAX_FREQUENCIES]; 303 }; 304 struct iw_encode_ext { 305 __u32 ext_flags; 306 __u8 tx_seq[IW_ENCODE_SEQ_MAX_SIZE]; 307 __u8 rx_seq[IW_ENCODE_SEQ_MAX_SIZE]; 308 struct sockaddr addr; 309 __u16 alg; 310 __u16 key_len; 311 __u8 key[0]; 312 }; 313 struct iw_mlme { 314 __u16 cmd; 315 __u16 reason_code; 316 struct sockaddr addr; 317 }; 318 #define IW_PMKSA_ADD 1 319 #define IW_PMKSA_REMOVE 2 320 #define IW_PMKSA_FLUSH 3 321 #define IW_PMKID_LEN 16 322 struct iw_pmksa { 323 __u32 cmd; 324 struct sockaddr bssid; 325 __u8 pmkid[IW_PMKID_LEN]; 326 }; 327 struct iw_michaelmicfailure { 328 __u32 flags; 329 struct sockaddr src_addr; 330 __u8 tsc[IW_ENCODE_SEQ_MAX_SIZE]; 331 }; 332 #define IW_PMKID_CAND_PREAUTH 0x00000001 333 struct iw_pmkid_cand { 334 __u32 flags; 335 __u32 index; 336 struct sockaddr bssid; 337 }; 338 struct iw_statistics { 339 __u16 status; 340 struct iw_quality qual; 341 struct iw_discarded discard; 342 struct iw_missed miss; 343 }; 344 union iwreq_data { 345 346 char name[IFNAMSIZ]; 347 348 struct iw_point essid; 349 struct iw_param nwid; 350 struct iw_freq freq; 351 struct iw_param sens; 352 struct iw_param bitrate; 353 struct iw_param txpower; 354 struct iw_param rts; 355 struct iw_param frag; 356 __u32 mode; 357 struct iw_param retry; 358 struct iw_point encoding; 359 struct iw_param power; 360 struct iw_quality qual; 361 struct sockaddr ap_addr; 362 struct sockaddr addr; 363 struct iw_param param; 364 struct iw_point data; 365 }; 366 struct iwreq { 367 union 368 { 369 char ifrn_name[IFNAMSIZ]; 370 } ifr_ifrn; 371 372 union iwreq_data u; 373 }; 374 struct iw_range { 375 376 __u32 throughput; 377 378 379 __u32 min_nwid; 380 __u32 max_nwid; 381 382 __u16 old_num_channels; 383 __u8 old_num_frequency; 384 385 __u8 scan_capa; 386 387 __u32 event_capa[6]; 388 389 __s32 sensitivity; 390 391 392 struct iw_quality max_qual; 393 394 struct iw_quality avg_qual; 395 396 __u8 num_bitrates; 397 __s32 bitrate[IW_MAX_BITRATES]; 398 399 __s32 min_rts; 400 __s32 max_rts; 401 402 __s32 min_frag; 403 __s32 max_frag; 404 405 __s32 min_pmp; 406 __s32 max_pmp; 407 __s32 min_pmt; 408 __s32 max_pmt; 409 __u16 pmp_flags; 410 __u16 pmt_flags; 411 __u16 pm_capa; 412 413 __u16 encoding_size[IW_MAX_ENCODING_SIZES]; 414 __u8 num_encoding_sizes; 415 __u8 max_encoding_tokens; 416 417 __u8 encoding_login_index; 418 419 __u16 txpower_capa; 420 __u8 num_txpower; 421 __s32 txpower[IW_MAX_TXPOWER]; 422 423 __u8 we_version_compiled; 424 __u8 we_version_source; 425 426 __u16 retry_capa; 427 __u16 retry_flags; 428 __u16 r_time_flags; 429 __s32 min_retry; 430 __s32 max_retry; 431 __s32 min_r_time; 432 __s32 max_r_time; 433 434 __u16 num_channels; 435 __u8 num_frequency; 436 struct iw_freq freq[IW_MAX_FREQUENCIES]; 437 438 __u32 enc_capa; 439 }; 440 struct iw_priv_args { 441 __u32 cmd; 442 __u16 set_args; 443 __u16 get_args; 444 char name[IFNAMSIZ]; 445 }; 446 struct iw_event { 447 __u16 len; 448 __u16 cmd; 449 union iwreq_data u; 450 }; 451 #define IW_EV_LCP_LEN (sizeof(struct iw_event) - sizeof(union iwreq_data)) 452 #define IW_EV_CHAR_LEN (IW_EV_LCP_LEN + IFNAMSIZ) 453 #define IW_EV_UINT_LEN (IW_EV_LCP_LEN + sizeof(__u32)) 454 #define IW_EV_FREQ_LEN (IW_EV_LCP_LEN + sizeof(struct iw_freq)) 455 #define IW_EV_PARAM_LEN (IW_EV_LCP_LEN + sizeof(struct iw_param)) 456 #define IW_EV_ADDR_LEN (IW_EV_LCP_LEN + sizeof(struct sockaddr)) 457 #define IW_EV_QUAL_LEN (IW_EV_LCP_LEN + sizeof(struct iw_quality)) 458 #define IW_EV_POINT_OFF offsetof(struct iw_point, length) 459 #define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \ 460 IW_EV_POINT_OFF) 461 #define IW_EV_LCP_PK_LEN (4) 462 #define IW_EV_CHAR_PK_LEN (IW_EV_LCP_PK_LEN + IFNAMSIZ) 463 #define IW_EV_UINT_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(__u32)) 464 #define IW_EV_FREQ_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_freq)) 465 #define IW_EV_PARAM_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_param)) 466 #define IW_EV_ADDR_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct sockaddr)) 467 #define IW_EV_QUAL_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_quality)) 468 #define IW_EV_POINT_PK_LEN (IW_EV_LCP_PK_LEN + 4) 469 #endif 470