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