ieee80211_ioctl.h revision 195757
1193323Sed/*- 2193323Sed * Copyright (c) 2001 Atsushi Onoe 3193323Sed * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting 4193323Sed * All rights reserved. 5193323Sed * 6193323Sed * Redistribution and use in source and binary forms, with or without 7193323Sed * modification, are permitted provided that the following conditions 8193323Sed * are met: 9193323Sed * 1. Redistributions of source code must retain the above copyright 10193323Sed * notice, this list of conditions and the following disclaimer. 11193323Sed * 2. Redistributions in binary form must reproduce the above copyright 12193323Sed * notice, this list of conditions and the following disclaimer in the 13193323Sed * documentation and/or other materials provided with the distribution. 14193323Sed * 15193323Sed * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16193323Sed * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17193323Sed * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18193323Sed * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19193323Sed * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20193323Sed * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21193323Sed * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22249423Sdim * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23249423Sdim * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24249423Sdim * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25249423Sdim * 26249423Sdim * $FreeBSD: head/sys/net80211/ieee80211_ioctl.h 195757 2009-07-18 20:19:53Z sam $ 27193323Sed */ 28193323Sed#ifndef _NET80211_IEEE80211_IOCTL_H_ 29198090Srdivacky#define _NET80211_IEEE80211_IOCTL_H_ 30198090Srdivacky 31249423Sdim/* 32193323Sed * IEEE 802.11 ioctls. 33193323Sed */ 34276479Sdim#include <net80211/_ieee80211.h> 35276479Sdim#include <net80211/ieee80211.h> 36199481Srdivacky#include <net80211/ieee80211_crypto.h> 37199481Srdivacky 38199481Srdivacky/* 39199481Srdivacky * Per/node (station) statistics. 40199481Srdivacky */ 41199481Srdivackystruct ieee80211_nodestats { 42199481Srdivacky uint32_t ns_rx_data; /* rx data frames */ 43199481Srdivacky uint32_t ns_rx_mgmt; /* rx management frames */ 44199481Srdivacky uint32_t ns_rx_ctrl; /* rx control frames */ 45199481Srdivacky uint32_t ns_rx_ucast; /* rx unicast frames */ 46199481Srdivacky uint32_t ns_rx_mcast; /* rx multi/broadcast frames */ 47199481Srdivacky uint64_t ns_rx_bytes; /* rx data count (bytes) */ 48199481Srdivacky uint64_t ns_rx_beacons; /* rx beacon frames */ 49207618Srdivacky uint32_t ns_rx_proberesp; /* rx probe response frames */ 50207618Srdivacky 51207618Srdivacky uint32_t ns_rx_dup; /* rx discard 'cuz dup */ 52199481Srdivacky uint32_t ns_rx_noprivacy; /* rx w/ wep but privacy off */ 53199481Srdivacky uint32_t ns_rx_wepfail; /* rx wep processing failed */ 54199481Srdivacky uint32_t ns_rx_demicfail; /* rx demic failed */ 55199481Srdivacky uint32_t ns_rx_decap; /* rx decapsulation failed */ 56199481Srdivacky uint32_t ns_rx_defrag; /* rx defragmentation failed */ 57276479Sdim uint32_t ns_rx_disassoc; /* rx disassociation */ 58276479Sdim uint32_t ns_rx_deauth; /* rx deauthentication */ 59199481Srdivacky uint32_t ns_rx_action; /* rx action */ 60199481Srdivacky uint32_t ns_rx_decryptcrc; /* rx decrypt failed on crc */ 61199481Srdivacky uint32_t ns_rx_unauth; /* rx on unauthorized port */ 62276479Sdim uint32_t ns_rx_unencrypted; /* rx unecrypted w/ privacy */ 63199481Srdivacky uint32_t ns_rx_drop; /* rx discard other reason */ 64199481Srdivacky 65199481Srdivacky uint32_t ns_tx_data; /* tx data frames */ 66199481Srdivacky uint32_t ns_tx_mgmt; /* tx management frames */ 67276479Sdim uint32_t ns_tx_ctrl; /* tx control frames */ 68199481Srdivacky uint32_t ns_tx_ucast; /* tx unicast frames */ 69199481Srdivacky uint32_t ns_tx_mcast; /* tx multi/broadcast frames */ 70200581Srdivacky uint64_t ns_tx_bytes; /* tx data count (bytes) */ 71199481Srdivacky uint32_t ns_tx_probereq; /* tx probe request frames */ 72199481Srdivacky 73199481Srdivacky uint32_t ns_tx_novlantag; /* tx discard 'cuz no tag */ 74199481Srdivacky uint32_t ns_tx_vlanmismatch; /* tx discard 'cuz bad tag */ 75199481Srdivacky 76199481Srdivacky uint32_t ns_ps_discard; /* ps discard 'cuz of age */ 77199481Srdivacky 78199481Srdivacky /* MIB-related state */ 79199481Srdivacky uint32_t ns_tx_assoc; /* [re]associations */ 80199481Srdivacky uint32_t ns_tx_assoc_fail; /* [re]association failures */ 81199481Srdivacky uint32_t ns_tx_auth; /* [re]authentications */ 82199481Srdivacky uint32_t ns_tx_auth_fail; /* [re]authentication failures*/ 83199481Srdivacky uint32_t ns_tx_deauth; /* deauthentications */ 84199481Srdivacky uint32_t ns_tx_deauth_code; /* last deauth reason */ 85199481Srdivacky uint32_t ns_tx_disassoc; /* disassociations */ 86199481Srdivacky uint32_t ns_tx_disassoc_code; /* last disassociation reason */ 87199481Srdivacky uint32_t ns_spare[8]; 88199481Srdivacky}; 89199481Srdivacky 90193323Sed/* 91193323Sed * Summary statistics. 92193323Sed */ 93193323Sedstruct ieee80211_stats { 94193323Sed uint32_t is_rx_badversion; /* rx frame with bad version */ 95193323Sed uint32_t is_rx_tooshort; /* rx frame too short */ 96193323Sed uint32_t is_rx_wrongbss; /* rx from wrong bssid */ 97288943Sdim uint32_t is_rx_dup; /* rx discard 'cuz dup */ 98193323Sed uint32_t is_rx_wrongdir; /* rx w/ wrong direction */ 99276479Sdim uint32_t is_rx_mcastecho; /* rx discard 'cuz mcast echo */ 100193323Sed uint32_t is_rx_notassoc; /* rx discard 'cuz sta !assoc */ 101193323Sed uint32_t is_rx_noprivacy; /* rx w/ wep but privacy off */ 102193323Sed uint32_t is_rx_unencrypted; /* rx w/o wep and privacy on */ 103199481Srdivacky uint32_t is_rx_wepfail; /* rx wep processing failed */ 104199481Srdivacky uint32_t is_rx_decap; /* rx decapsulation failed */ 105199481Srdivacky uint32_t is_rx_mgtdiscard; /* rx discard mgt frames */ 106199481Srdivacky uint32_t is_rx_ctl; /* rx ctrl frames */ 107288943Sdim uint32_t is_rx_beacon; /* rx beacon frames */ 108276479Sdim uint32_t is_rx_rstoobig; /* rx rate set truncated */ 109198090Srdivacky uint32_t is_rx_elem_missing; /* rx required element missing*/ 110193323Sed uint32_t is_rx_elem_toobig; /* rx element too big */ 111193323Sed uint32_t is_rx_elem_toosmall; /* rx element too small */ 112193323Sed uint32_t is_rx_elem_unknown; /* rx element unknown */ 113193323Sed uint32_t is_rx_badchan; /* rx frame w/ invalid chan */ 114276479Sdim uint32_t is_rx_chanmismatch; /* rx frame chan mismatch */ 115202375Srdivacky uint32_t is_rx_nodealloc; /* rx frame dropped */ 116202375Srdivacky uint32_t is_rx_ssidmismatch; /* rx frame ssid mismatch */ 117199481Srdivacky uint32_t is_rx_auth_unsupported; /* rx w/ unsupported auth alg */ 118199481Srdivacky uint32_t is_rx_auth_fail; /* rx sta auth failure */ 119218893Sdim uint32_t is_rx_auth_countermeasures;/* rx auth discard 'cuz CM */ 120193323Sed uint32_t is_rx_assoc_bss; /* rx assoc from wrong bssid */ 121193323Sed uint32_t is_rx_assoc_notauth; /* rx assoc w/o auth */ 122193323Sed uint32_t is_rx_assoc_capmismatch;/* rx assoc w/ cap mismatch */ 123193323Sed uint32_t is_rx_assoc_norate; /* rx assoc w/ no rate match */ 124193323Sed uint32_t is_rx_assoc_badwpaie; /* rx assoc w/ bad WPA IE */ 125193323Sed uint32_t is_rx_deauth; /* rx deauthentication */ 126193323Sed uint32_t is_rx_disassoc; /* rx disassociation */ 127193323Sed uint32_t is_rx_badsubtype; /* rx frame w/ unknown subtype*/ 128193323Sed uint32_t is_rx_nobuf; /* rx failed for lack of buf */ 129193323Sed uint32_t is_rx_decryptcrc; /* rx decrypt failed on crc */ 130193323Sed uint32_t is_rx_ahdemo_mgt; /* rx discard ahdemo mgt frame*/ 131199481Srdivacky uint32_t is_rx_bad_auth; /* rx bad auth request */ 132199481Srdivacky uint32_t is_rx_unauth; /* rx on unauthorized port */ 133199481Srdivacky uint32_t is_rx_badkeyid; /* rx w/ incorrect keyid */ 134199481Srdivacky uint32_t is_rx_ccmpreplay; /* rx seq# violation (CCMP) */ 135199481Srdivacky uint32_t is_rx_ccmpformat; /* rx format bad (CCMP) */ 136199481Srdivacky uint32_t is_rx_ccmpmic; /* rx MIC check failed (CCMP) */ 137199481Srdivacky uint32_t is_rx_tkipreplay; /* rx seq# violation (TKIP) */ 138199481Srdivacky uint32_t is_rx_tkipformat; /* rx format bad (TKIP) */ 139193323Sed uint32_t is_rx_tkipmic; /* rx MIC check failed (TKIP) */ 140199481Srdivacky uint32_t is_rx_tkipicv; /* rx ICV check failed (TKIP) */ 141199481Srdivacky uint32_t is_rx_badcipher; /* rx failed 'cuz key type */ 142199481Srdivacky uint32_t is_rx_nocipherctx; /* rx failed 'cuz key !setup */ 143199481Srdivacky uint32_t is_rx_acl; /* rx discard 'cuz acl policy */ 144199481Srdivacky uint32_t is_tx_nobuf; /* tx failed for lack of buf */ 145199481Srdivacky uint32_t is_tx_nonode; /* tx failed for no node */ 146199481Srdivacky uint32_t is_tx_unknownmgt; /* tx of unknown mgt frame */ 147199481Srdivacky uint32_t is_tx_badcipher; /* tx failed 'cuz key type */ 148199481Srdivacky uint32_t is_tx_nodefkey; /* tx failed 'cuz no defkey */ 149199481Srdivacky uint32_t is_tx_noheadroom; /* tx failed 'cuz no space */ 150199481Srdivacky uint32_t is_tx_fragframes; /* tx frames fragmented */ 151199481Srdivacky uint32_t is_tx_frags; /* tx fragments created */ 152199481Srdivacky uint32_t is_scan_active; /* active scans started */ 153199481Srdivacky uint32_t is_scan_passive; /* passive scans started */ 154199481Srdivacky uint32_t is_node_timeout; /* nodes timed out inactivity */ 155199481Srdivacky uint32_t is_crypto_nomem; /* no memory for crypto ctx */ 156199481Srdivacky uint32_t is_crypto_tkip; /* tkip crypto done in s/w */ 157199481Srdivacky uint32_t is_crypto_tkipenmic; /* tkip en-MIC done in s/w */ 158199481Srdivacky uint32_t is_crypto_tkipdemic; /* tkip de-MIC done in s/w */ 159199481Srdivacky uint32_t is_crypto_tkipcm; /* tkip counter measures */ 160199481Srdivacky uint32_t is_crypto_ccmp; /* ccmp crypto done in s/w */ 161193323Sed uint32_t is_crypto_wep; /* wep crypto done in s/w */ 162199481Srdivacky uint32_t is_crypto_setkey_cipher;/* cipher rejected key */ 163199481Srdivacky uint32_t is_crypto_setkey_nokey; /* no key index for setkey */ 164193323Sed uint32_t is_crypto_delkey; /* driver key delete failed */ 165199481Srdivacky uint32_t is_crypto_badcipher; /* unknown cipher */ 166199481Srdivacky uint32_t is_crypto_nocipher; /* cipher not available */ 167199481Srdivacky uint32_t is_crypto_attachfail; /* cipher attach failed */ 168199481Srdivacky uint32_t is_crypto_swfallback; /* cipher fallback to s/w */ 169199481Srdivacky uint32_t is_crypto_keyfail; /* driver key alloc failed */ 170199481Srdivacky uint32_t is_crypto_enmicfail; /* en-MIC failed */ 171199481Srdivacky uint32_t is_ibss_capmismatch; /* merge failed-cap mismatch */ 172199481Srdivacky uint32_t is_ibss_norate; /* merge failed-rate mismatch */ 173193323Sed uint32_t is_ps_unassoc; /* ps-poll for unassoc. sta */ 174199481Srdivacky uint32_t is_ps_badaid; /* ps-poll w/ incorrect aid */ 175199481Srdivacky uint32_t is_ps_qempty; /* ps-poll w/ nothing to send */ 176199481Srdivacky uint32_t is_ff_badhdr; /* fast frame rx'd w/ bad hdr */ 177199481Srdivacky uint32_t is_ff_tooshort; /* fast frame rx decap error */ 178199481Srdivacky uint32_t is_ff_split; /* fast frame rx split error */ 179199481Srdivacky uint32_t is_ff_decap; /* fast frames decap'd */ 180199481Srdivacky uint32_t is_ff_encap; /* fast frames encap'd for tx */ 181204642Srdivacky uint32_t is_rx_badbintval; /* rx frame w/ bogus bintval */ 182199481Srdivacky uint32_t is_rx_demicfail; /* rx demic failed */ 183199481Srdivacky uint32_t is_rx_defrag; /* rx defragmentation failed */ 184199481Srdivacky uint32_t is_rx_mgmt; /* rx management frames */ 185199481Srdivacky uint32_t is_rx_action; /* rx action mgt frames */ 186199481Srdivacky uint32_t is_amsdu_tooshort; /* A-MSDU rx decap error */ 187199481Srdivacky uint32_t is_amsdu_split; /* A-MSDU rx split error */ 188199481Srdivacky uint32_t is_amsdu_decap; /* A-MSDU decap'd */ 189199481Srdivacky uint32_t is_amsdu_encap; /* A-MSDU encap'd for tx */ 190199481Srdivacky uint32_t is_ampdu_bar_bad; /* A-MPDU BAR out of window */ 191199481Srdivacky uint32_t is_ampdu_bar_oow; /* A-MPDU BAR before ADDBA */ 192199481Srdivacky uint32_t is_ampdu_bar_move; /* A-MPDU BAR moved window */ 193199481Srdivacky uint32_t is_ampdu_bar_rx; /* A-MPDU BAR frames handled */ 194199481Srdivacky uint32_t is_ampdu_rx_flush; /* A-MPDU frames flushed */ 195199481Srdivacky uint32_t is_ampdu_rx_oor; /* A-MPDU frames out-of-order */ 196199481Srdivacky uint32_t is_ampdu_rx_copy; /* A-MPDU frames copied down */ 197199481Srdivacky uint32_t is_ampdu_rx_drop; /* A-MPDU frames dropped */ 198276479Sdim uint32_t is_tx_badstate; /* tx discard state != RUN */ 199199481Srdivacky uint32_t is_tx_notassoc; /* tx failed, sta not assoc */ 200199481Srdivacky uint32_t is_tx_classify; /* tx classification failed */ 201199481Srdivacky uint32_t is_dwds_mcast; /* discard mcast over dwds */ 202193323Sed uint32_t is_dwds_qdrop; /* dwds pending frame q full */ 203193323Sed uint32_t is_ht_assoc_nohtcap; /* non-HT sta rejected */ 204199481Srdivacky uint32_t is_ht_assoc_downgrade; /* HT sta forced to legacy */ 205199481Srdivacky uint32_t is_ht_assoc_norate; /* HT assoc w/ rate mismatch */ 206199481Srdivacky uint32_t is_ampdu_rx_age; /* A-MPDU sent up 'cuz of age */ 207199481Srdivacky uint32_t is_ampdu_rx_move; /* A-MPDU MSDU moved window */ 208199481Srdivacky uint32_t is_addba_reject; /* ADDBA reject 'cuz disabled */ 209199481Srdivacky uint32_t is_addba_norequest; /* ADDBA response w/o ADDBA */ 210199481Srdivacky uint32_t is_addba_badtoken; /* ADDBA response w/ wrong 211199481Srdivacky dialogtoken */ 212199481Srdivacky uint32_t is_addba_badpolicy; /* ADDBA resp w/ wrong policy */ 213199481Srdivacky uint32_t is_ampdu_stop; /* A-MPDU stream stopped */ 214199481Srdivacky uint32_t is_ampdu_stop_failed; /* A-MPDU stream not running */ 215199481Srdivacky uint32_t is_ampdu_rx_reorder; /* A-MPDU held for rx reorder */ 216199481Srdivacky uint32_t is_scan_bg; /* background scans started */ 217199481Srdivacky uint8_t is_rx_deauth_code; /* last rx'd deauth reason */ 218199481Srdivacky uint8_t is_rx_disassoc_code; /* last rx'd disassoc reason */ 219199481Srdivacky uint8_t is_rx_authfail_code; /* last rx'd auth fail reason */ 220199481Srdivacky uint32_t is_beacon_miss; /* beacon miss notification */ 221199481Srdivacky uint32_t is_rx_badstate; /* rx discard state != RUN */ 222199481Srdivacky uint32_t is_ff_flush; /* ff's flush'd from stageq */ 223199481Srdivacky uint32_t is_tx_ctl; /* tx ctrl frames */ 224199481Srdivacky uint32_t is_ampdu_rexmt; /* A-MPDU frames rexmt ok */ 225199481Srdivacky uint32_t is_ampdu_rexmt_fail; /* A-MPDU frames rexmt fail */ 226199481Srdivacky 227276479Sdim uint32_t is_mesh_wrongmesh; /* dropped 'cuz not mesh sta*/ 228199481Srdivacky uint32_t is_mesh_nolink; /* dropped 'cuz link not estab*/ 229199481Srdivacky uint32_t is_mesh_fwd_ttl; /* mesh not fwd'd 'cuz ttl 0 */ 230199481Srdivacky uint32_t is_mesh_fwd_nobuf; /* mesh not fwd'd 'cuz no mbuf*/ 231199481Srdivacky uint32_t is_mesh_fwd_tooshort; /* mesh not fwd'd 'cuz no hdr */ 232199481Srdivacky uint32_t is_mesh_fwd_disabled; /* mesh not fwd'd 'cuz disabled */ 233199481Srdivacky uint32_t is_mesh_fwd_nopath; /* mesh not fwd'd 'cuz path unknown */ 234193323Sed 235193323Sed uint32_t is_hwmp_wrongseq; /* wrong hwmp seq no. */ 236199481Srdivacky uint32_t is_hwmp_rootreqs; /* root PREQs sent */ 237193323Sed uint32_t is_hwmp_rootrann; /* root RANNs sent */ 238199481Srdivacky uint32_t is_rx_badalign; /* dropped 'cuz misaligned */ 239199481Srdivacky 240193323Sed uint32_t is_spare[15]; 241199481Srdivacky}; 242199481Srdivacky 243199481Srdivacky/* 244218893Sdim * Max size of optional information elements. We artificially 245199481Srdivacky * constrain this; it's limited only by the max frame size (and 246199481Srdivacky * the max parameter size of the wireless extensions). 247199481Srdivacky */ 248199481Srdivacky#define IEEE80211_MAX_OPT_IE 256 249199481Srdivacky 250199481Srdivacky/* 251199481Srdivacky * WPA/RSN get/set key request. Specify the key/cipher 252199481Srdivacky * type and whether the key is to be used for sending and/or 253199481Srdivacky * receiving. The key index should be set only when working 254199481Srdivacky * with global keys (use IEEE80211_KEYIX_NONE for ``no index''). 255199481Srdivacky * Otherwise a unicast/pairwise key is specified by the bssid 256199481Srdivacky * (on a station) or mac address (on an ap). They key length 257288943Sdim * must include any MIC key data; otherwise it should be no 258288943Sdim * more than IEEE80211_KEYBUF_SIZE. 259288943Sdim */ 260288943Sdimstruct ieee80211req_key { 261288943Sdim uint8_t ik_type; /* key/cipher type */ 262199481Srdivacky uint8_t ik_pad; 263199481Srdivacky uint16_t ik_keyix; /* key index */ 264261991Sdim uint8_t ik_keylen; /* key length in bytes */ 265210299Sed uint8_t ik_flags; 266199481Srdivacky/* NB: IEEE80211_KEY_XMIT and IEEE80211_KEY_RECV defined elsewhere */ 267199481Srdivacky#define IEEE80211_KEY_DEFAULT 0x80 /* default xmit key */ 268199481Srdivacky uint8_t ik_macaddr[IEEE80211_ADDR_LEN]; 269199481Srdivacky uint64_t ik_keyrsc; /* key receive sequence counter */ 270199481Srdivacky uint64_t ik_keytsc; /* key transmit sequence counter */ 271199481Srdivacky uint8_t ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE]; 272199481Srdivacky}; 273199481Srdivacky 274199481Srdivacky/* 275243830Sdim * Delete a key either by index or address. Set the index 276243830Sdim * to IEEE80211_KEYIX_NONE when deleting a unicast key. 277199481Srdivacky */ 278288943Sdimstruct ieee80211req_del_key { 279199481Srdivacky uint8_t idk_keyix; /* key index */ 280193323Sed uint8_t idk_macaddr[IEEE80211_ADDR_LEN]; 281193323Sed}; 282193323Sed 283198090Srdivacky/* 284288943Sdim * MLME state manipulation request. IEEE80211_MLME_ASSOC 285198090Srdivacky * only makes sense when operating as a station. The other 286198090Srdivacky * requests can be used when operating as a station or an 287288943Sdim * ap (to effect a station). 288198090Srdivacky */ 289288943Sdimstruct ieee80211req_mlme { 290218893Sdim uint8_t im_op; /* operation to perform */ 291198090Srdivacky#define IEEE80211_MLME_ASSOC 1 /* associate station */ 292198090Srdivacky#define IEEE80211_MLME_DISASSOC 2 /* disassociate station */ 293198090Srdivacky#define IEEE80211_MLME_DEAUTH 3 /* deauthenticate station */ 294193323Sed#define IEEE80211_MLME_AUTHORIZE 4 /* authorize station */ 295198090Srdivacky#define IEEE80211_MLME_UNAUTHORIZE 5 /* unauthorize station */ 296198090Srdivacky#define IEEE80211_MLME_AUTH 6 /* authenticate station */ 297198090Srdivacky uint8_t im_ssid_len; /* length of optional ssid */ 298198090Srdivacky uint16_t im_reason; /* 802.11 reason code */ 299198090Srdivacky uint8_t im_macaddr[IEEE80211_ADDR_LEN]; 300199481Srdivacky uint8_t im_ssid[IEEE80211_NWID_LEN]; 301199481Srdivacky}; 302199481Srdivacky 303199481Srdivacky/* 304199481Srdivacky * MAC ACL operations. 305199481Srdivacky */ 306199481Srdivackyenum { 307199481Srdivacky IEEE80211_MACCMD_POLICY_OPEN = 0, /* set policy: no ACL's */ 308199481Srdivacky IEEE80211_MACCMD_POLICY_ALLOW = 1, /* set policy: allow traffic */ 309199481Srdivacky IEEE80211_MACCMD_POLICY_DENY = 2, /* set policy: deny traffic */ 310199481Srdivacky IEEE80211_MACCMD_FLUSH = 3, /* flush ACL database */ 311199481Srdivacky IEEE80211_MACCMD_DETACH = 4, /* detach ACL policy */ 312199481Srdivacky IEEE80211_MACCMD_POLICY = 5, /* get ACL policy */ 313199481Srdivacky IEEE80211_MACCMD_LIST = 6, /* get ACL database */ 314199481Srdivacky IEEE80211_MACCMD_POLICY_RADIUS = 7, /* set policy: RADIUS managed */ 315199481Srdivacky}; 316199481Srdivacky 317199481Srdivackystruct ieee80211req_maclist { 318199481Srdivacky uint8_t ml_macaddr[IEEE80211_ADDR_LEN]; 319199481Srdivacky} __packed; 320199481Srdivacky 321199481Srdivacky/* 322199481Srdivacky * Mesh Routing Table Operations. 323199481Srdivacky */ 324199481Srdivackyenum { 325199481Srdivacky IEEE80211_MESH_RTCMD_LIST = 0, /* list HWMP routing table */ 326199481Srdivacky IEEE80211_MESH_RTCMD_FLUSH = 1, /* flush HWMP routing table */ 327202375Srdivacky IEEE80211_MESH_RTCMD_ADD = 2, /* add entry to the table */ 328202375Srdivacky IEEE80211_MESH_RTCMD_DELETE = 3, /* delete an entry from the table */ 329199481Srdivacky}; 330276479Sdim 331199481Srdivacky/* 332199481Srdivacky * HWMP root modes 333199481Srdivacky */ 334199481Srdivackyenum { 335199481Srdivacky IEEE80211_HWMP_ROOTMODE_DISABLED = 0, /* disabled */ 336199481Srdivacky IEEE80211_HWMP_ROOTMODE_NORMAL = 1, /* normal PREPs */ 337199481Srdivacky IEEE80211_HWMP_ROOTMODE_PROACTIVE = 2, /* proactive PREPS */ 338199481Srdivacky IEEE80211_HWMP_ROOTMODE_RANN = 3, /* use RANN elemid */ 339199481Srdivacky}; 340199481Srdivacky 341199481Srdivacky 342199481Srdivacky/* 343276479Sdim * Set the active channel list by IEEE channel #: each channel 344199481Srdivacky * to be marked active is set in a bit vector. Note this list is 345199481Srdivacky * intersected with the available channel list in calculating 346261991Sdim * the set of channels actually used in scanning. 347199481Srdivacky */ 348199481Srdivackystruct ieee80211req_chanlist { 349199481Srdivacky uint8_t ic_channels[32]; /* NB: can be variable length */ 350199481Srdivacky}; 351202375Srdivacky 352199481Srdivacky/* 353199481Srdivacky * Get the active channel list info. 354199481Srdivacky */ 355199481Srdivackystruct ieee80211req_chaninfo { 356207618Srdivacky u_int ic_nchans; 357199481Srdivacky struct ieee80211_channel ic_chans[1]; /* NB: variable length */ 358199481Srdivacky}; 359276479Sdim#define IEEE80211_CHANINFO_SIZE(_nchan) \ 360199481Srdivacky (sizeof(struct ieee80211req_chaninfo) + \ 361199481Srdivacky (((_nchan)-1) * sizeof(struct ieee80211_channel))) 362199481Srdivacky#define IEEE80211_CHANINFO_SPACE(_ci) \ 363199481Srdivacky IEEE80211_CHANINFO_SIZE((_ci)->ic_nchans) 364199481Srdivacky 365199481Srdivacky/* 366199481Srdivacky * Retrieve the WPA/RSN information element for an associated station. 367276479Sdim */ 368199481Srdivackystruct ieee80211req_wpaie { /* old version w/ only one ie */ 369199481Srdivacky uint8_t wpa_macaddr[IEEE80211_ADDR_LEN]; 370199481Srdivacky uint8_t wpa_ie[IEEE80211_MAX_OPT_IE]; 371199481Srdivacky}; 372199481Srdivackystruct ieee80211req_wpaie2 { 373199481Srdivacky uint8_t wpa_macaddr[IEEE80211_ADDR_LEN]; 374199481Srdivacky uint8_t wpa_ie[IEEE80211_MAX_OPT_IE]; 375199481Srdivacky uint8_t rsn_ie[IEEE80211_MAX_OPT_IE]; 376276479Sdim}; 377199481Srdivacky 378199481Srdivacky/* 379199481Srdivacky * Retrieve per-node statistics. 380202375Srdivacky */ 381261991Sdimstruct ieee80211req_sta_stats { 382193323Sed union { 383193323Sed /* NB: explicitly force 64-bit alignment */ 384204642Srdivacky uint8_t macaddr[IEEE80211_ADDR_LEN]; 385193323Sed uint64_t pad; 386198090Srdivacky } is_u; 387193323Sed struct ieee80211_nodestats is_stats; 388193323Sed}; 389193323Sed 390204642Srdivacky/* 391198090Srdivacky * Station information block; the mac address is used 392198090Srdivacky * to retrieve other data like stats, unicast key, etc. 393255804Sdim */ 394276479Sdimstruct ieee80211req_sta_info { 395193323Sed uint16_t isi_len; /* total length (mult of 4) */ 396193323Sed uint16_t isi_ie_off; /* offset to IE data */ 397193323Sed uint16_t isi_ie_len; /* IE length */ 398193323Sed uint16_t isi_freq; /* MHz */ 399193323Sed uint32_t isi_flags; /* channel flags */ 400193323Sed uint32_t isi_state; /* state flags */ 401202375Srdivacky uint8_t isi_authmode; /* authentication algorithm */ 402193323Sed int8_t isi_rssi; /* receive signal strength */ 403193323Sed int8_t isi_noise; /* noise floor */ 404193323Sed uint8_t isi_capinfo; /* capabilities */ 405288943Sdim uint8_t isi_erp; /* ERP element */ 406288943Sdim uint8_t isi_macaddr[IEEE80211_ADDR_LEN]; 407288943Sdim uint8_t isi_nrates; 408288943Sdim /* negotiated rates */ 409193323Sed uint8_t isi_rates[IEEE80211_RATE_MAXSIZE]; 410199481Srdivacky uint8_t isi_txrate; /* legacy/IEEE rate or MCS */ 411202375Srdivacky uint16_t isi_associd; /* assoc response */ 412199481Srdivacky uint16_t isi_txpower; /* current tx power */ 413199481Srdivacky uint16_t isi_vlan; /* vlan tag */ 414199481Srdivacky /* NB: [IEEE80211_NONQOS_TID] holds seq#'s for non-QoS stations */ 415199481Srdivacky uint16_t isi_txseqs[IEEE80211_TID_SIZE];/* tx seq #/TID */ 416199481Srdivacky uint16_t isi_rxseqs[IEEE80211_TID_SIZE];/* rx seq#/TID */ 417202375Srdivacky uint16_t isi_inact; /* inactivity timer */ 418202375Srdivacky uint16_t isi_txmbps; /* current tx rate in .5 Mb/s */ 419199481Srdivacky uint16_t isi_pad; 420199481Srdivacky uint32_t isi_jointime; /* time of assoc/join */ 421199481Srdivacky struct ieee80211_mimo_info isi_mimo; /* MIMO info for 11n sta's */ 422202375Srdivacky /* 11s info */ 423199481Srdivacky uint16_t isi_peerid; 424199481Srdivacky uint16_t isi_localid; 425199481Srdivacky uint8_t isi_peerstate; 426199481Srdivacky /* XXX frag state? */ 427199481Srdivacky /* variable length IE data */ 428199481Srdivacky}; 429199481Srdivacky 430202375Srdivacky/* 431202375Srdivacky * Retrieve per-station information; to retrieve all 432199481Srdivacky * specify a mac address of ff:ff:ff:ff:ff:ff. 433199481Srdivacky */ 434199481Srdivackystruct ieee80211req_sta_req { 435199481Srdivacky union { 436199481Srdivacky /* NB: explicitly force 64-bit alignment */ 437199481Srdivacky uint8_t macaddr[IEEE80211_ADDR_LEN]; 438199481Srdivacky uint64_t pad; 439202375Srdivacky } is_u; 440202375Srdivacky struct ieee80211req_sta_info info[1]; /* variable length */ 441199481Srdivacky}; 442199481Srdivacky 443199481Srdivacky/* 444202375Srdivacky * Get/set per-station tx power cap. 445199481Srdivacky */ 446199481Srdivackystruct ieee80211req_sta_txpow { 447199481Srdivacky uint8_t it_macaddr[IEEE80211_ADDR_LEN]; 448199481Srdivacky uint8_t it_txpow; 449199481Srdivacky}; 450199481Srdivacky 451199481Srdivacky/* 452202375Srdivacky * WME parameters manipulated with IEEE80211_IOC_WME_CWMIN 453202375Srdivacky * through IEEE80211_IOC_WME_ACKPOLICY are set and return 454199481Srdivacky * using i_val and i_len. i_val holds the value itself. 455199481Srdivacky * i_len specifies the AC and, as appropriate, then high bit 456199481Srdivacky * specifies whether the operation is to be applied to the 457202375Srdivacky * BSS or ourself. 458199481Srdivacky */ 459199481Srdivacky#define IEEE80211_WMEPARAM_SELF 0x0000 /* parameter applies to self */ 460199481Srdivacky#define IEEE80211_WMEPARAM_BSS 0x8000 /* parameter applies to BSS */ 461199481Srdivacky#define IEEE80211_WMEPARAM_VAL 0x7fff /* parameter value */ 462199481Srdivacky 463199481Srdivacky/* 464199481Srdivacky * Application Information Elements can be appended to a variety 465202375Srdivacky * of frames with the IEE80211_IOC_APPIE request. This request 466202375Srdivacky * piggybacks on a normal ieee80211req; the frame type is passed 467199481Srdivacky * in i_val as the 802.11 FC0 bytes and the length of the IE data 468199481Srdivacky * is passed in i_len. The data is referenced in i_data. If i_len 469199481Srdivacky * is zero then any previously configured IE data is removed. At 470202375Srdivacky * most IEEE80211_MAX_APPIE data be appened. Note that multiple 471199481Srdivacky * IE's can be supplied; the data is treated opaquely. 472199481Srdivacky */ 473199481Srdivacky#define IEEE80211_MAX_APPIE 1024 /* max app IE data */ 474199481Srdivacky/* 475199481Srdivacky * Hack: the WPA authenticator uses this mechanism to specify WPA 476193323Sed * ie's that are used instead of the ones normally constructed using 477193323Sed * the cipher state setup with separate ioctls. This avoids issues 478193323Sed * like the authenticator ordering ie data differently than the 479202375Srdivacky * net80211 layer and needing to keep separate state for WPA and RSN. 480193323Sed */ 481204642Srdivacky#define IEEE80211_APPIE_WPA \ 482276479Sdim (IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_BEACON | \ 483202375Srdivacky IEEE80211_FC0_SUBTYPE_PROBE_RESP) 484193323Sed 485193323Sed/* 486198090Srdivacky * Station mode roaming parameters. These are maintained 487193323Sed * per band/mode and control the roaming algorithm. 488193323Sed */ 489193323Sedstruct ieee80211_roamparams_req { 490 struct ieee80211_roamparam params[IEEE80211_MODE_MAX]; 491}; 492 493/* 494 * Transmit parameters. These can be used to set fixed transmit 495 * rate for each operating mode when operating as client or on a 496 * per-client basis according to the capabilities of the client 497 * (e.g. an 11b client associated to an 11g ap) when operating as 498 * an ap. 499 * 500 * MCS are distinguished from legacy rates by or'ing in 0x80. 501 */ 502struct ieee80211_txparams_req { 503 struct ieee80211_txparam params[IEEE80211_MODE_MAX]; 504}; 505 506/* 507 * Set regulatory domain state with IEEE80211_IOC_REGDOMAIN. 508 * Note this is both the regulatory description and the channel 509 * list. The get request for IEEE80211_IOC_REGDOMAIN returns 510 * only the regdomain info; the channel list is obtained 511 * separately with IEEE80211_IOC_CHANINFO. 512 */ 513struct ieee80211_regdomain_req { 514 struct ieee80211_regdomain rd; 515 struct ieee80211req_chaninfo chaninfo; 516}; 517#define IEEE80211_REGDOMAIN_SIZE(_nchan) \ 518 (sizeof(struct ieee80211_regdomain_req) + \ 519 (((_nchan)-1) * sizeof(struct ieee80211_channel))) 520#define IEEE80211_REGDOMAIN_SPACE(_req) \ 521 IEEE80211_REGDOMAIN_SIZE((_req)->chaninfo.ic_nchans) 522 523/* 524 * Get driver capabilities. Driver, hardware crypto, and 525 * HT/802.11n capabilities, and a table that describes what 526 * the radio can do. 527 */ 528struct ieee80211_devcaps_req { 529 uint32_t dc_drivercaps; /* general driver caps */ 530 uint32_t dc_cryptocaps; /* hardware crypto support */ 531 uint32_t dc_htcaps; /* HT/802.11n support */ 532 struct ieee80211req_chaninfo dc_chaninfo; 533}; 534#define IEEE80211_DEVCAPS_SIZE(_nchan) \ 535 (sizeof(struct ieee80211_devcaps_req) + \ 536 (((_nchan)-1) * sizeof(struct ieee80211_channel))) 537#define IEEE80211_DEVCAPS_SPACE(_dc) \ 538 IEEE80211_DEVCAPS_SIZE((_dc)->dc_chaninfo.ic_nchans) 539 540struct ieee80211_chanswitch_req { 541 struct ieee80211_channel csa_chan; /* new channel */ 542 int csa_mode; /* CSA mode */ 543 int csa_count; /* beacon count to switch */ 544}; 545 546/* 547 * Get/set per-station vlan tag. 548 */ 549struct ieee80211req_sta_vlan { 550 uint8_t sv_macaddr[IEEE80211_ADDR_LEN]; 551 uint16_t sv_vlan; 552}; 553 554#ifdef __FreeBSD__ 555/* 556 * FreeBSD-style ioctls. 557 */ 558/* the first member must be matched with struct ifreq */ 559struct ieee80211req { 560 char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */ 561 uint16_t i_type; /* req type */ 562 int16_t i_val; /* Index or simple value */ 563 int16_t i_len; /* Index or simple value */ 564 void *i_data; /* Extra data */ 565}; 566#define SIOCS80211 _IOW('i', 234, struct ieee80211req) 567#define SIOCG80211 _IOWR('i', 235, struct ieee80211req) 568#define SIOCG80211STATS _IOWR('i', 236, struct ifreq) 569 570#define IEEE80211_IOC_SSID 1 571#define IEEE80211_IOC_NUMSSIDS 2 572#define IEEE80211_IOC_WEP 3 573#define IEEE80211_WEP_NOSUP -1 574#define IEEE80211_WEP_OFF 0 575#define IEEE80211_WEP_ON 1 576#define IEEE80211_WEP_MIXED 2 577#define IEEE80211_IOC_WEPKEY 4 578#define IEEE80211_IOC_NUMWEPKEYS 5 579#define IEEE80211_IOC_WEPTXKEY 6 580#define IEEE80211_IOC_AUTHMODE 7 581#define IEEE80211_IOC_STATIONNAME 8 582#define IEEE80211_IOC_CHANNEL 9 583#define IEEE80211_IOC_POWERSAVE 10 584#define IEEE80211_POWERSAVE_NOSUP -1 585#define IEEE80211_POWERSAVE_OFF 0 586#define IEEE80211_POWERSAVE_CAM 1 587#define IEEE80211_POWERSAVE_PSP 2 588#define IEEE80211_POWERSAVE_PSP_CAM 3 589#define IEEE80211_POWERSAVE_ON IEEE80211_POWERSAVE_CAM 590#define IEEE80211_IOC_POWERSAVESLEEP 11 591#define IEEE80211_IOC_RTSTHRESHOLD 12 592#define IEEE80211_IOC_PROTMODE 13 593#define IEEE80211_PROTMODE_OFF 0 594#define IEEE80211_PROTMODE_CTS 1 595#define IEEE80211_PROTMODE_RTSCTS 2 596#define IEEE80211_IOC_TXPOWER 14 /* global tx power limit */ 597#define IEEE80211_IOC_BSSID 15 598#define IEEE80211_IOC_ROAMING 16 /* roaming mode */ 599#define IEEE80211_IOC_PRIVACY 17 /* privacy invoked */ 600#define IEEE80211_IOC_DROPUNENCRYPTED 18 /* discard unencrypted frames */ 601#define IEEE80211_IOC_WPAKEY 19 602#define IEEE80211_IOC_DELKEY 20 603#define IEEE80211_IOC_MLME 21 604/* 22 was IEEE80211_IOC_OPTIE, replaced by IEEE80211_IOC_APPIE */ 605/* 23 was IEEE80211_IOC_SCAN_REQ */ 606/* 24 was IEEE80211_IOC_SCAN_RESULTS */ 607#define IEEE80211_IOC_COUNTERMEASURES 25 /* WPA/TKIP countermeasures */ 608#define IEEE80211_IOC_WPA 26 /* WPA mode (0,1,2) */ 609#define IEEE80211_IOC_CHANLIST 27 /* channel list */ 610#define IEEE80211_IOC_WME 28 /* WME mode (on, off) */ 611#define IEEE80211_IOC_HIDESSID 29 /* hide SSID mode (on, off) */ 612#define IEEE80211_IOC_APBRIDGE 30 /* AP inter-sta bridging */ 613/* 31-35,37-38 were for WPA authenticator settings */ 614/* 36 was IEEE80211_IOC_DRIVER_CAPS */ 615#define IEEE80211_IOC_WPAIE 39 /* WPA information element */ 616#define IEEE80211_IOC_STA_STATS 40 /* per-station statistics */ 617#define IEEE80211_IOC_MACCMD 41 /* MAC ACL operation */ 618#define IEEE80211_IOC_CHANINFO 42 /* channel info list */ 619#define IEEE80211_IOC_TXPOWMAX 43 /* max tx power for channel */ 620#define IEEE80211_IOC_STA_TXPOW 44 /* per-station tx power limit */ 621/* 45 was IEEE80211_IOC_STA_INFO */ 622#define IEEE80211_IOC_WME_CWMIN 46 /* WME: ECWmin */ 623#define IEEE80211_IOC_WME_CWMAX 47 /* WME: ECWmax */ 624#define IEEE80211_IOC_WME_AIFS 48 /* WME: AIFSN */ 625#define IEEE80211_IOC_WME_TXOPLIMIT 49 /* WME: txops limit */ 626#define IEEE80211_IOC_WME_ACM 50 /* WME: ACM (bss only) */ 627#define IEEE80211_IOC_WME_ACKPOLICY 51 /* WME: ACK policy (!bss only)*/ 628#define IEEE80211_IOC_DTIM_PERIOD 52 /* DTIM period (beacons) */ 629#define IEEE80211_IOC_BEACON_INTERVAL 53 /* beacon interval (ms) */ 630#define IEEE80211_IOC_ADDMAC 54 /* add sta to MAC ACL table */ 631#define IEEE80211_IOC_DELMAC 55 /* del sta from MAC ACL table */ 632#define IEEE80211_IOC_PUREG 56 /* pure 11g (no 11b stations) */ 633#define IEEE80211_IOC_FF 57 /* ATH fast frames (on, off) */ 634#define IEEE80211_IOC_TURBOP 58 /* ATH turbo' (on, off) */ 635#define IEEE80211_IOC_BGSCAN 59 /* bg scanning (on, off) */ 636#define IEEE80211_IOC_BGSCAN_IDLE 60 /* bg scan idle threshold */ 637#define IEEE80211_IOC_BGSCAN_INTERVAL 61 /* bg scan interval */ 638#define IEEE80211_IOC_SCANVALID 65 /* scan cache valid threshold */ 639/* 66-72 were IEEE80211_IOC_ROAM_* and IEEE80211_IOC_MCAST_RATE */ 640#define IEEE80211_IOC_FRAGTHRESHOLD 73 /* tx fragmentation threshold */ 641#define IEEE80211_IOC_BURST 75 /* packet bursting */ 642#define IEEE80211_IOC_SCAN_RESULTS 76 /* get scan results */ 643#define IEEE80211_IOC_BMISSTHRESHOLD 77 /* beacon miss threshold */ 644#define IEEE80211_IOC_STA_INFO 78 /* station/neighbor info */ 645#define IEEE80211_IOC_WPAIE2 79 /* WPA+RSN info elements */ 646#define IEEE80211_IOC_CURCHAN 80 /* current channel */ 647#define IEEE80211_IOC_SHORTGI 81 /* 802.11n half GI */ 648#define IEEE80211_IOC_AMPDU 82 /* 802.11n A-MPDU (on, off) */ 649#define IEEE80211_IOC_AMPDU_LIMIT 83 /* A-MPDU length limit */ 650#define IEEE80211_IOC_AMPDU_DENSITY 84 /* A-MPDU density */ 651#define IEEE80211_IOC_AMSDU 85 /* 802.11n A-MSDU (on, off) */ 652#define IEEE80211_IOC_AMSDU_LIMIT 86 /* A-MSDU length limit */ 653#define IEEE80211_IOC_PUREN 87 /* pure 11n (no legacy sta's) */ 654#define IEEE80211_IOC_DOTH 88 /* 802.11h (on, off) */ 655/* 89-91 were regulatory items */ 656#define IEEE80211_IOC_HTCOMPAT 92 /* support pre-D1.10 HT ie's */ 657#define IEEE80211_IOC_DWDS 93 /* DWDS/4-address handling */ 658#define IEEE80211_IOC_INACTIVITY 94 /* sta inactivity handling */ 659#define IEEE80211_IOC_APPIE 95 /* application IE's */ 660#define IEEE80211_IOC_WPS 96 /* WPS operation */ 661#define IEEE80211_IOC_TSN 97 /* TSN operation */ 662#define IEEE80211_IOC_DEVCAPS 98 /* driver+device capabilities */ 663#define IEEE80211_IOC_CHANSWITCH 99 /* start 11h channel switch */ 664#define IEEE80211_IOC_DFS 100 /* DFS (on, off) */ 665#define IEEE80211_IOC_DOTD 101 /* 802.11d (on, off) */ 666#define IEEE80211_IOC_HTPROTMODE 102 /* HT protection (off, rts) */ 667#define IEEE80211_IOC_SCAN_REQ 103 /* scan w/ specified params */ 668#define IEEE80211_IOC_SCAN_CANCEL 104 /* cancel ongoing scan */ 669#define IEEE80211_IOC_HTCONF 105 /* HT config (off, HT20, HT40)*/ 670#define IEEE80211_IOC_REGDOMAIN 106 /* regulatory domain info */ 671#define IEEE80211_IOC_ROAM 107 /* roaming params en masse */ 672#define IEEE80211_IOC_TXPARAMS 108 /* tx parameters */ 673#define IEEE80211_IOC_STA_VLAN 109 /* per-station vlan tag */ 674#define IEEE80211_IOC_SMPS 110 /* MIMO power save */ 675#define IEEE80211_IOC_RIFS 111 /* RIFS config (on, off) */ 676#define IEEE80211_IOC_GREENFIELD 112 /* Greenfield (on, off) */ 677#define IEEE80211_IOC_STBC 113 /* STBC Tx/RX (on, off) */ 678 679#define IEEE80211_IOC_MESH_ID 170 /* mesh identifier */ 680#define IEEE80211_IOC_MESH_AP 171 /* accepting peerings */ 681#define IEEE80211_IOC_MESH_FWRD 172 /* forward frames */ 682#define IEEE80211_IOC_MESH_PROTO 173 /* mesh protocols */ 683#define IEEE80211_IOC_MESH_TTL 174 /* mesh TTL */ 684#define IEEE80211_IOC_MESH_RTCMD 175 /* mesh routing table commands*/ 685#define IEEE80211_IOC_MESH_PR_METRIC 176 /* mesh metric protocol */ 686#define IEEE80211_IOC_MESH_PR_PATH 177 /* mesh path protocol */ 687#define IEEE80211_IOC_MESH_PR_SIG 178 /* mesh sig protocol */ 688#define IEEE80211_IOC_MESH_PR_CC 179 /* mesh congestion protocol */ 689#define IEEE80211_IOC_MESH_PR_AUTH 180 /* mesh auth protocol */ 690 691#define IEEE80211_IOC_HWMP_ROOTMODE 190 /* HWMP root mode */ 692#define IEEE80211_IOC_HWMP_MAXHOPS 191 /* number of hops before drop */ 693#define IEEE80211_IOC_HWMP_TTL 192 /* HWMP TTL */ 694 695#define IEEE80211_IOC_TDMA_SLOT 201 /* TDMA: assigned slot */ 696#define IEEE80211_IOC_TDMA_SLOTCNT 202 /* TDMA: slots in bss */ 697#define IEEE80211_IOC_TDMA_SLOTLEN 203 /* TDMA: slot length (usecs) */ 698#define IEEE80211_IOC_TDMA_BINTERVAL 204 /* TDMA: beacon intvl (slots) */ 699 700/* 701 * Parameters for controlling a scan requested with 702 * IEEE80211_IOC_SCAN_REQ. 703 * 704 * Active scans cause ProbeRequest frames to be issued for each 705 * specified ssid and, by default, a broadcast ProbeRequest frame. 706 * The set of ssid's is specified in the request. 707 * 708 * By default the scan will cause a BSS to be joined (in station/adhoc 709 * mode) or a channel to be selected for operation (hostap mode). 710 * To disable that specify IEEE80211_IOC_SCAN_NOPICK and if the 711 * 712 * If the station is currently associated to an AP then a scan request 713 * will cause the station to leave the current channel and potentially 714 * miss frames from the AP. Alternatively the station may notify the 715 * AP that it is going into power save mode before it leaves the channel. 716 * This ensures frames for the station are buffered by the AP. This is 717 * termed a ``bg scan'' and is requested with the IEEE80211_IOC_SCAN_BGSCAN 718 * flag. Background scans may take longer than foreground scans and may 719 * be preempted by traffic. If a station is not associated to an AP 720 * then a request for a background scan is automatically done in the 721 * foreground. 722 * 723 * The results of the scan request are cached by the system. This 724 * information is aged out and/or invalidated based on events like not 725 * being able to associated to an AP. To flush the current cache 726 * contents before doing a scan the IEEE80211_IOC_SCAN_FLUSH flag may 727 * be specified. 728 * 729 * By default the scan will be done until a suitable AP is located 730 * or a channel is found for use. A scan can also be constrained 731 * to be done once (IEEE80211_IOC_SCAN_ONCE) or to last for no more 732 * than a specified duration. 733 */ 734struct ieee80211_scan_req { 735 int sr_flags; 736#define IEEE80211_IOC_SCAN_NOPICK 0x00001 /* scan only, no selection */ 737#define IEEE80211_IOC_SCAN_ACTIVE 0x00002 /* active scan (probe req) */ 738#define IEEE80211_IOC_SCAN_PICK1ST 0x00004 /* ``hey sailor'' mode */ 739#define IEEE80211_IOC_SCAN_BGSCAN 0x00008 /* bg scan, exit ps at end */ 740#define IEEE80211_IOC_SCAN_ONCE 0x00010 /* do one complete pass */ 741#define IEEE80211_IOC_SCAN_NOBCAST 0x00020 /* don't send bcast probe req */ 742#define IEEE80211_IOC_SCAN_NOJOIN 0x00040 /* no auto-sequencing */ 743#define IEEE80211_IOC_SCAN_FLUSH 0x10000 /* flush scan cache first */ 744#define IEEE80211_IOC_SCAN_CHECK 0x20000 /* check scan cache first */ 745 u_int sr_duration; /* duration (ms) */ 746#define IEEE80211_IOC_SCAN_DURATION_MIN 1 747#define IEEE80211_IOC_SCAN_DURATION_MAX 0x7fffffff 748#define IEEE80211_IOC_SCAN_FOREVER IEEE80211_IOC_SCAN_DURATION_MAX 749 u_int sr_mindwell; /* min channel dwelltime (ms) */ 750 u_int sr_maxdwell; /* max channel dwelltime (ms) */ 751 int sr_nssid; 752#define IEEE80211_IOC_SCAN_MAX_SSID 3 753 struct { 754 int len; /* length in bytes */ 755 uint8_t ssid[IEEE80211_NWID_LEN]; /* ssid contents */ 756 } sr_ssid[IEEE80211_IOC_SCAN_MAX_SSID]; 757}; 758 759/* 760 * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS. 761 * Each result is a fixed size structure followed by a variable 762 * length SSID and one or more variable length information elements. 763 * The size of each variable length item is found in the fixed 764 * size structure and the entire length of the record is specified 765 * in isr_len. Result records are rounded to a multiple of 4 bytes. 766 */ 767struct ieee80211req_scan_result { 768 uint16_t isr_len; /* total length (mult of 4) */ 769 uint16_t isr_ie_off; /* offset to SSID+IE data */ 770 uint16_t isr_ie_len; /* IE length */ 771 uint16_t isr_freq; /* MHz */ 772 uint16_t isr_flags; /* channel flags */ 773 int8_t isr_noise; 774 int8_t isr_rssi; 775 uint8_t isr_intval; /* beacon interval */ 776 uint8_t isr_capinfo; /* capabilities */ 777 uint8_t isr_erp; /* ERP element */ 778 uint8_t isr_bssid[IEEE80211_ADDR_LEN]; 779 uint8_t isr_nrates; 780 uint8_t isr_rates[IEEE80211_RATE_MAXSIZE]; 781 uint8_t isr_ssid_len; /* SSID length */ 782 uint8_t isr_meshid_len; /* MESH ID length */ 783 /* variable length SSID, followed by variable length MESH ID, 784 followed by IE data */ 785}; 786 787/* 788 * Virtual AP cloning parameters. The parent device must 789 * be a vap-capable device. All parameters specified with 790 * the clone request are fixed for the lifetime of the vap. 791 * 792 * There are two flavors of WDS vaps: legacy and dynamic. 793 * Legacy WDS operation implements a static binding between 794 * two stations encapsulating traffic in 4-address frames. 795 * Dynamic WDS vaps are created when a station associates to 796 * an AP and sends a 4-address frame. If the AP vap is 797 * configured to support WDS then this will generate an 798 * event to user programs listening on the routing socket 799 * and a Dynamic WDS vap will be created to handle traffic 800 * to/from that station. In both cases the bssid of the 801 * peer must be specified when creating the vap. 802 * 803 * By default a vap will inherit the mac address/bssid of 804 * the underlying device. To request a unique address the 805 * IEEE80211_CLONE_BSSID flag should be supplied. This is 806 * meaningless for WDS vaps as they share the bssid of an 807 * AP vap that must otherwise exist. Note that some devices 808 * may not be able to support multiple addresses. 809 * 810 * Station mode vap's normally depend on the device to notice 811 * when the AP stops sending beacon frames. If IEEE80211_CLONE_NOBEACONS 812 * is specified the net80211 layer will do this in s/w. This 813 * is mostly useful when setting up a WDS repeater/extender where 814 * an AP vap is combined with a sta vap and the device isn't able 815 * to track beacon frames in hardware. 816 */ 817struct ieee80211_clone_params { 818 char icp_parent[IFNAMSIZ]; /* parent device */ 819 uint16_t icp_opmode; /* operating mode */ 820 uint16_t icp_flags; /* see below */ 821 uint8_t icp_bssid[IEEE80211_ADDR_LEN]; /* for WDS links */ 822 uint8_t icp_macaddr[IEEE80211_ADDR_LEN];/* local address */ 823}; 824#define IEEE80211_CLONE_BSSID 0x0001 /* allocate unique mac/bssid */ 825#define IEEE80211_CLONE_NOBEACONS 0x0002 /* don't setup beacon timers */ 826#define IEEE80211_CLONE_WDSLEGACY 0x0004 /* legacy WDS processing */ 827#define IEEE80211_CLONE_MACADDR 0x0008 /* use specified mac addr */ 828#define IEEE80211_CLONE_TDMA 0x0010 /* operate in TDMA mode */ 829#endif /* __FreeBSD__ */ 830 831#endif /* _NET80211_IEEE80211_IOCTL_H_ */ 832