132176cfdSRui Paulo /*- 2f186073cSJoerg Sonnenberger * Copyright (c) 2001 Atsushi Onoe 332176cfdSRui Paulo * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting 4f186073cSJoerg Sonnenberger * All rights reserved. 5f186073cSJoerg Sonnenberger * 6f186073cSJoerg Sonnenberger * Redistribution and use in source and binary forms, with or without 7f186073cSJoerg Sonnenberger * modification, are permitted provided that the following conditions 8f186073cSJoerg Sonnenberger * are met: 9f186073cSJoerg Sonnenberger * 1. Redistributions of source code must retain the above copyright 10f186073cSJoerg Sonnenberger * notice, this list of conditions and the following disclaimer. 11f186073cSJoerg Sonnenberger * 2. Redistributions in binary form must reproduce the above copyright 12f186073cSJoerg Sonnenberger * notice, this list of conditions and the following disclaimer in the 13f186073cSJoerg Sonnenberger * documentation and/or other materials provided with the distribution. 14f186073cSJoerg Sonnenberger * 15f186073cSJoerg Sonnenberger * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16f186073cSJoerg Sonnenberger * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17f186073cSJoerg Sonnenberger * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18f186073cSJoerg Sonnenberger * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19f186073cSJoerg Sonnenberger * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20f186073cSJoerg Sonnenberger * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21f186073cSJoerg Sonnenberger * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22f186073cSJoerg Sonnenberger * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23f186073cSJoerg Sonnenberger * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24f186073cSJoerg Sonnenberger * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25f186073cSJoerg Sonnenberger * 26085ff963SMatthew Dillon * $FreeBSD$ 27f186073cSJoerg Sonnenberger */ 28841ab66cSSepherosa Ziehau #ifndef _NET80211_IEEE80211_IOCTL_H_ 29841ab66cSSepherosa Ziehau #define _NET80211_IEEE80211_IOCTL_H_ 30f186073cSJoerg Sonnenberger 31f186073cSJoerg Sonnenberger /* 32f186073cSJoerg Sonnenberger * IEEE 802.11 ioctls. 33f186073cSJoerg Sonnenberger */ 34841ab66cSSepherosa Ziehau #include <netproto/802_11/_ieee80211.h> 35841ab66cSSepherosa Ziehau #include <netproto/802_11/ieee80211.h> 36841ab66cSSepherosa Ziehau #include <netproto/802_11/ieee80211_crypto.h> 37f186073cSJoerg Sonnenberger 38841ab66cSSepherosa Ziehau /* 390d17a301SSepherosa Ziehau * Per/node (station) statistics. 40841ab66cSSepherosa Ziehau */ 41841ab66cSSepherosa Ziehau struct ieee80211_nodestats { 42841ab66cSSepherosa Ziehau uint32_t ns_rx_data; /* rx data frames */ 43841ab66cSSepherosa Ziehau uint32_t ns_rx_mgmt; /* rx management frames */ 44841ab66cSSepherosa Ziehau uint32_t ns_rx_ctrl; /* rx control frames */ 45841ab66cSSepherosa Ziehau uint32_t ns_rx_ucast; /* rx unicast frames */ 46841ab66cSSepherosa Ziehau uint32_t ns_rx_mcast; /* rx multi/broadcast frames */ 47841ab66cSSepherosa Ziehau uint64_t ns_rx_bytes; /* rx data count (bytes) */ 48841ab66cSSepherosa Ziehau uint64_t ns_rx_beacons; /* rx beacon frames */ 49841ab66cSSepherosa Ziehau uint32_t ns_rx_proberesp; /* rx probe response frames */ 50841ab66cSSepherosa Ziehau 51841ab66cSSepherosa Ziehau uint32_t ns_rx_dup; /* rx discard 'cuz dup */ 52841ab66cSSepherosa Ziehau uint32_t ns_rx_noprivacy; /* rx w/ wep but privacy off */ 53841ab66cSSepherosa Ziehau uint32_t ns_rx_wepfail; /* rx wep processing failed */ 54841ab66cSSepherosa Ziehau uint32_t ns_rx_demicfail; /* rx demic failed */ 55841ab66cSSepherosa Ziehau uint32_t ns_rx_decap; /* rx decapsulation failed */ 56841ab66cSSepherosa Ziehau uint32_t ns_rx_defrag; /* rx defragmentation failed */ 57841ab66cSSepherosa Ziehau uint32_t ns_rx_disassoc; /* rx disassociation */ 58841ab66cSSepherosa Ziehau uint32_t ns_rx_deauth; /* rx deauthentication */ 5932176cfdSRui Paulo uint32_t ns_rx_action; /* rx action */ 60841ab66cSSepherosa Ziehau uint32_t ns_rx_decryptcrc; /* rx decrypt failed on crc */ 61841ab66cSSepherosa Ziehau uint32_t ns_rx_unauth; /* rx on unauthorized port */ 62841ab66cSSepherosa Ziehau uint32_t ns_rx_unencrypted; /* rx unecrypted w/ privacy */ 6332176cfdSRui Paulo uint32_t ns_rx_drop; /* rx discard other reason */ 64841ab66cSSepherosa Ziehau 65841ab66cSSepherosa Ziehau uint32_t ns_tx_data; /* tx data frames */ 66841ab66cSSepherosa Ziehau uint32_t ns_tx_mgmt; /* tx management frames */ 6732176cfdSRui Paulo uint32_t ns_tx_ctrl; /* tx control frames */ 68841ab66cSSepherosa Ziehau uint32_t ns_tx_ucast; /* tx unicast frames */ 69841ab66cSSepherosa Ziehau uint32_t ns_tx_mcast; /* tx multi/broadcast frames */ 70841ab66cSSepherosa Ziehau uint64_t ns_tx_bytes; /* tx data count (bytes) */ 71841ab66cSSepherosa Ziehau uint32_t ns_tx_probereq; /* tx probe request frames */ 72841ab66cSSepherosa Ziehau 73841ab66cSSepherosa Ziehau uint32_t ns_tx_novlantag; /* tx discard 'cuz no tag */ 74841ab66cSSepherosa Ziehau uint32_t ns_tx_vlanmismatch; /* tx discard 'cuz bad tag */ 75841ab66cSSepherosa Ziehau 76841ab66cSSepherosa Ziehau uint32_t ns_ps_discard; /* ps discard 'cuz of age */ 77841ab66cSSepherosa Ziehau 78841ab66cSSepherosa Ziehau /* MIB-related state */ 79841ab66cSSepherosa Ziehau uint32_t ns_tx_assoc; /* [re]associations */ 80841ab66cSSepherosa Ziehau uint32_t ns_tx_assoc_fail; /* [re]association failures */ 81841ab66cSSepherosa Ziehau uint32_t ns_tx_auth; /* [re]authentications */ 82841ab66cSSepherosa Ziehau uint32_t ns_tx_auth_fail; /* [re]authentication failures*/ 83841ab66cSSepherosa Ziehau uint32_t ns_tx_deauth; /* deauthentications */ 84841ab66cSSepherosa Ziehau uint32_t ns_tx_deauth_code; /* last deauth reason */ 85841ab66cSSepherosa Ziehau uint32_t ns_tx_disassoc; /* disassociations */ 86841ab66cSSepherosa Ziehau uint32_t ns_tx_disassoc_code; /* last disassociation reason */ 8732176cfdSRui Paulo uint32_t ns_spare[8]; 88841ab66cSSepherosa Ziehau }; 89841ab66cSSepherosa Ziehau 90841ab66cSSepherosa Ziehau /* 91841ab66cSSepherosa Ziehau * Summary statistics. 92841ab66cSSepherosa Ziehau */ 93f186073cSJoerg Sonnenberger struct ieee80211_stats { 94f186073cSJoerg Sonnenberger uint32_t is_rx_badversion; /* rx frame with bad version */ 95f186073cSJoerg Sonnenberger uint32_t is_rx_tooshort; /* rx frame too short */ 96f186073cSJoerg Sonnenberger uint32_t is_rx_wrongbss; /* rx from wrong bssid */ 97f186073cSJoerg Sonnenberger uint32_t is_rx_dup; /* rx discard 'cuz dup */ 98f186073cSJoerg Sonnenberger uint32_t is_rx_wrongdir; /* rx w/ wrong direction */ 99f186073cSJoerg Sonnenberger uint32_t is_rx_mcastecho; /* rx discard 'cuz mcast echo */ 100f186073cSJoerg Sonnenberger uint32_t is_rx_notassoc; /* rx discard 'cuz sta !assoc */ 101841ab66cSSepherosa Ziehau uint32_t is_rx_noprivacy; /* rx w/ wep but privacy off */ 102841ab66cSSepherosa Ziehau uint32_t is_rx_unencrypted; /* rx w/o wep and privacy on */ 103f186073cSJoerg Sonnenberger uint32_t is_rx_wepfail; /* rx wep processing failed */ 104f186073cSJoerg Sonnenberger uint32_t is_rx_decap; /* rx decapsulation failed */ 105f186073cSJoerg Sonnenberger uint32_t is_rx_mgtdiscard; /* rx discard mgt frames */ 10632176cfdSRui Paulo uint32_t is_rx_ctl; /* rx ctrl frames */ 107841ab66cSSepherosa Ziehau uint32_t is_rx_beacon; /* rx beacon frames */ 108f186073cSJoerg Sonnenberger uint32_t is_rx_rstoobig; /* rx rate set truncated */ 109f186073cSJoerg Sonnenberger uint32_t is_rx_elem_missing; /* rx required element missing*/ 110f186073cSJoerg Sonnenberger uint32_t is_rx_elem_toobig; /* rx element too big */ 111f186073cSJoerg Sonnenberger uint32_t is_rx_elem_toosmall; /* rx element too small */ 112f186073cSJoerg Sonnenberger uint32_t is_rx_elem_unknown; /* rx element unknown */ 113f186073cSJoerg Sonnenberger uint32_t is_rx_badchan; /* rx frame w/ invalid chan */ 114f186073cSJoerg Sonnenberger uint32_t is_rx_chanmismatch; /* rx frame chan mismatch */ 115f186073cSJoerg Sonnenberger uint32_t is_rx_nodealloc; /* rx frame dropped */ 116f186073cSJoerg Sonnenberger uint32_t is_rx_ssidmismatch; /* rx frame ssid mismatch */ 117f186073cSJoerg Sonnenberger uint32_t is_rx_auth_unsupported; /* rx w/ unsupported auth alg */ 118f186073cSJoerg Sonnenberger uint32_t is_rx_auth_fail; /* rx sta auth failure */ 119841ab66cSSepherosa Ziehau uint32_t is_rx_auth_countermeasures;/* rx auth discard 'cuz CM */ 120f186073cSJoerg Sonnenberger uint32_t is_rx_assoc_bss; /* rx assoc from wrong bssid */ 121f186073cSJoerg Sonnenberger uint32_t is_rx_assoc_notauth; /* rx assoc w/o auth */ 122f186073cSJoerg Sonnenberger uint32_t is_rx_assoc_capmismatch;/* rx assoc w/ cap mismatch */ 123f186073cSJoerg Sonnenberger uint32_t is_rx_assoc_norate; /* rx assoc w/ no rate match */ 124841ab66cSSepherosa Ziehau uint32_t is_rx_assoc_badwpaie; /* rx assoc w/ bad WPA IE */ 125f186073cSJoerg Sonnenberger uint32_t is_rx_deauth; /* rx deauthentication */ 126f186073cSJoerg Sonnenberger uint32_t is_rx_disassoc; /* rx disassociation */ 127f186073cSJoerg Sonnenberger uint32_t is_rx_badsubtype; /* rx frame w/ unknown subtype*/ 128841ab66cSSepherosa Ziehau uint32_t is_rx_nobuf; /* rx failed for lack of buf */ 129f186073cSJoerg Sonnenberger uint32_t is_rx_decryptcrc; /* rx decrypt failed on crc */ 130f186073cSJoerg Sonnenberger uint32_t is_rx_ahdemo_mgt; /* rx discard ahdemo mgt frame*/ 131f186073cSJoerg Sonnenberger uint32_t is_rx_bad_auth; /* rx bad auth request */ 132841ab66cSSepherosa Ziehau uint32_t is_rx_unauth; /* rx on unauthorized port */ 133841ab66cSSepherosa Ziehau uint32_t is_rx_badkeyid; /* rx w/ incorrect keyid */ 134841ab66cSSepherosa Ziehau uint32_t is_rx_ccmpreplay; /* rx seq# violation (CCMP) */ 135841ab66cSSepherosa Ziehau uint32_t is_rx_ccmpformat; /* rx format bad (CCMP) */ 136841ab66cSSepherosa Ziehau uint32_t is_rx_ccmpmic; /* rx MIC check failed (CCMP) */ 137841ab66cSSepherosa Ziehau uint32_t is_rx_tkipreplay; /* rx seq# violation (TKIP) */ 138841ab66cSSepherosa Ziehau uint32_t is_rx_tkipformat; /* rx format bad (TKIP) */ 139841ab66cSSepherosa Ziehau uint32_t is_rx_tkipmic; /* rx MIC check failed (TKIP) */ 140841ab66cSSepherosa Ziehau uint32_t is_rx_tkipicv; /* rx ICV check failed (TKIP) */ 141841ab66cSSepherosa Ziehau uint32_t is_rx_badcipher; /* rx failed 'cuz key type */ 142841ab66cSSepherosa Ziehau uint32_t is_rx_nocipherctx; /* rx failed 'cuz key !setup */ 143841ab66cSSepherosa Ziehau uint32_t is_rx_acl; /* rx discard 'cuz acl policy */ 144841ab66cSSepherosa Ziehau uint32_t is_tx_nobuf; /* tx failed for lack of buf */ 145f186073cSJoerg Sonnenberger uint32_t is_tx_nonode; /* tx failed for no node */ 146f186073cSJoerg Sonnenberger uint32_t is_tx_unknownmgt; /* tx of unknown mgt frame */ 147841ab66cSSepherosa Ziehau uint32_t is_tx_badcipher; /* tx failed 'cuz key type */ 148841ab66cSSepherosa Ziehau uint32_t is_tx_nodefkey; /* tx failed 'cuz no defkey */ 149841ab66cSSepherosa Ziehau uint32_t is_tx_noheadroom; /* tx failed 'cuz no space */ 150841ab66cSSepherosa Ziehau uint32_t is_tx_fragframes; /* tx frames fragmented */ 151841ab66cSSepherosa Ziehau uint32_t is_tx_frags; /* tx fragments created */ 152f186073cSJoerg Sonnenberger uint32_t is_scan_active; /* active scans started */ 153f186073cSJoerg Sonnenberger uint32_t is_scan_passive; /* passive scans started */ 154f186073cSJoerg Sonnenberger uint32_t is_node_timeout; /* nodes timed out inactivity */ 155f186073cSJoerg Sonnenberger uint32_t is_crypto_nomem; /* no memory for crypto ctx */ 156841ab66cSSepherosa Ziehau uint32_t is_crypto_tkip; /* tkip crypto done in s/w */ 157841ab66cSSepherosa Ziehau uint32_t is_crypto_tkipenmic; /* tkip en-MIC done in s/w */ 158841ab66cSSepherosa Ziehau uint32_t is_crypto_tkipdemic; /* tkip de-MIC done in s/w */ 159841ab66cSSepherosa Ziehau uint32_t is_crypto_tkipcm; /* tkip counter measures */ 160841ab66cSSepherosa Ziehau uint32_t is_crypto_ccmp; /* ccmp crypto done in s/w */ 161841ab66cSSepherosa Ziehau uint32_t is_crypto_wep; /* wep crypto done in s/w */ 162841ab66cSSepherosa Ziehau uint32_t is_crypto_setkey_cipher;/* cipher rejected key */ 163841ab66cSSepherosa Ziehau uint32_t is_crypto_setkey_nokey; /* no key index for setkey */ 164841ab66cSSepherosa Ziehau uint32_t is_crypto_delkey; /* driver key delete failed */ 165841ab66cSSepherosa Ziehau uint32_t is_crypto_badcipher; /* unknown cipher */ 166841ab66cSSepherosa Ziehau uint32_t is_crypto_nocipher; /* cipher not available */ 167841ab66cSSepherosa Ziehau uint32_t is_crypto_attachfail; /* cipher attach failed */ 168841ab66cSSepherosa Ziehau uint32_t is_crypto_swfallback; /* cipher fallback to s/w */ 169841ab66cSSepherosa Ziehau uint32_t is_crypto_keyfail; /* driver key alloc failed */ 170841ab66cSSepherosa Ziehau uint32_t is_crypto_enmicfail; /* en-MIC failed */ 171841ab66cSSepherosa Ziehau uint32_t is_ibss_capmismatch; /* merge failed-cap mismatch */ 172841ab66cSSepherosa Ziehau uint32_t is_ibss_norate; /* merge failed-rate mismatch */ 173841ab66cSSepherosa Ziehau uint32_t is_ps_unassoc; /* ps-poll for unassoc. sta */ 174841ab66cSSepherosa Ziehau uint32_t is_ps_badaid; /* ps-poll w/ incorrect aid */ 175841ab66cSSepherosa Ziehau uint32_t is_ps_qempty; /* ps-poll w/ nothing to send */ 176841ab66cSSepherosa Ziehau uint32_t is_ff_badhdr; /* fast frame rx'd w/ bad hdr */ 177841ab66cSSepherosa Ziehau uint32_t is_ff_tooshort; /* fast frame rx decap error */ 178841ab66cSSepherosa Ziehau uint32_t is_ff_split; /* fast frame rx split error */ 179841ab66cSSepherosa Ziehau uint32_t is_ff_decap; /* fast frames decap'd */ 180841ab66cSSepherosa Ziehau uint32_t is_ff_encap; /* fast frames encap'd for tx */ 181841ab66cSSepherosa Ziehau uint32_t is_rx_badbintval; /* rx frame w/ bogus bintval */ 182ffd45d58SSepherosa Ziehau uint32_t is_rx_demicfail; /* rx demic failed */ 183ffd45d58SSepherosa Ziehau uint32_t is_rx_defrag; /* rx defragmentation failed */ 184ffd45d58SSepherosa Ziehau uint32_t is_rx_mgmt; /* rx management frames */ 18532176cfdSRui Paulo uint32_t is_rx_action; /* rx action mgt frames */ 18632176cfdSRui Paulo uint32_t is_amsdu_tooshort; /* A-MSDU rx decap error */ 18732176cfdSRui Paulo uint32_t is_amsdu_split; /* A-MSDU rx split error */ 18832176cfdSRui Paulo uint32_t is_amsdu_decap; /* A-MSDU decap'd */ 18932176cfdSRui Paulo uint32_t is_amsdu_encap; /* A-MSDU encap'd for tx */ 19032176cfdSRui Paulo uint32_t is_ampdu_bar_bad; /* A-MPDU BAR out of window */ 19132176cfdSRui Paulo uint32_t is_ampdu_bar_oow; /* A-MPDU BAR before ADDBA */ 19232176cfdSRui Paulo uint32_t is_ampdu_bar_move; /* A-MPDU BAR moved window */ 19332176cfdSRui Paulo uint32_t is_ampdu_bar_rx; /* A-MPDU BAR frames handled */ 19432176cfdSRui Paulo uint32_t is_ampdu_rx_flush; /* A-MPDU frames flushed */ 19532176cfdSRui Paulo uint32_t is_ampdu_rx_oor; /* A-MPDU frames out-of-order */ 19632176cfdSRui Paulo uint32_t is_ampdu_rx_copy; /* A-MPDU frames copied down */ 19732176cfdSRui Paulo uint32_t is_ampdu_rx_drop; /* A-MPDU frames dropped */ 19832176cfdSRui Paulo uint32_t is_tx_badstate; /* tx discard state != RUN */ 19932176cfdSRui Paulo uint32_t is_tx_notassoc; /* tx failed, sta not assoc */ 20032176cfdSRui Paulo uint32_t is_tx_classify; /* tx classification failed */ 20132176cfdSRui Paulo uint32_t is_dwds_mcast; /* discard mcast over dwds */ 20232176cfdSRui Paulo uint32_t is_dwds_qdrop; /* dwds pending frame q full */ 20332176cfdSRui Paulo uint32_t is_ht_assoc_nohtcap; /* non-HT sta rejected */ 20432176cfdSRui Paulo uint32_t is_ht_assoc_downgrade; /* HT sta forced to legacy */ 20532176cfdSRui Paulo uint32_t is_ht_assoc_norate; /* HT assoc w/ rate mismatch */ 20632176cfdSRui Paulo uint32_t is_ampdu_rx_age; /* A-MPDU sent up 'cuz of age */ 20732176cfdSRui Paulo uint32_t is_ampdu_rx_move; /* A-MPDU MSDU moved window */ 20832176cfdSRui Paulo uint32_t is_addba_reject; /* ADDBA reject 'cuz disabled */ 20932176cfdSRui Paulo uint32_t is_addba_norequest; /* ADDBA response w/o ADDBA */ 21032176cfdSRui Paulo uint32_t is_addba_badtoken; /* ADDBA response w/ wrong 21132176cfdSRui Paulo dialogtoken */ 21232176cfdSRui Paulo uint32_t is_addba_badpolicy; /* ADDBA resp w/ wrong policy */ 21332176cfdSRui Paulo uint32_t is_ampdu_stop; /* A-MPDU stream stopped */ 21432176cfdSRui Paulo uint32_t is_ampdu_stop_failed; /* A-MPDU stream not running */ 21532176cfdSRui Paulo uint32_t is_ampdu_rx_reorder; /* A-MPDU held for rx reorder */ 21632176cfdSRui Paulo uint32_t is_scan_bg; /* background scans started */ 21732176cfdSRui Paulo uint8_t is_rx_deauth_code; /* last rx'd deauth reason */ 21832176cfdSRui Paulo uint8_t is_rx_disassoc_code; /* last rx'd disassoc reason */ 21932176cfdSRui Paulo uint8_t is_rx_authfail_code; /* last rx'd auth fail reason */ 22032176cfdSRui Paulo uint32_t is_beacon_miss; /* beacon miss notification */ 22132176cfdSRui Paulo uint32_t is_rx_badstate; /* rx discard state != RUN */ 22232176cfdSRui Paulo uint32_t is_ff_flush; /* ff's flush'd from stageq */ 22332176cfdSRui Paulo uint32_t is_tx_ctl; /* tx ctrl frames */ 22432176cfdSRui Paulo uint32_t is_ampdu_rexmt; /* A-MPDU frames rexmt ok */ 22532176cfdSRui Paulo uint32_t is_ampdu_rexmt_fail; /* A-MPDU frames rexmt fail */ 22632176cfdSRui Paulo 22732176cfdSRui Paulo uint32_t is_mesh_wrongmesh; /* dropped 'cuz not mesh sta*/ 22832176cfdSRui Paulo uint32_t is_mesh_nolink; /* dropped 'cuz link not estab*/ 22932176cfdSRui Paulo uint32_t is_mesh_fwd_ttl; /* mesh not fwd'd 'cuz ttl 0 */ 23032176cfdSRui Paulo uint32_t is_mesh_fwd_nobuf; /* mesh not fwd'd 'cuz no mbuf*/ 23132176cfdSRui Paulo uint32_t is_mesh_fwd_tooshort; /* mesh not fwd'd 'cuz no hdr */ 23232176cfdSRui Paulo uint32_t is_mesh_fwd_disabled; /* mesh not fwd'd 'cuz disabled */ 23332176cfdSRui Paulo uint32_t is_mesh_fwd_nopath; /* mesh not fwd'd 'cuz path unknown */ 23432176cfdSRui Paulo 23532176cfdSRui Paulo uint32_t is_hwmp_wrongseq; /* wrong hwmp seq no. */ 23632176cfdSRui Paulo uint32_t is_hwmp_rootreqs; /* root PREQs sent */ 23732176cfdSRui Paulo uint32_t is_hwmp_rootrann; /* root RANNs sent */ 23832176cfdSRui Paulo 23932176cfdSRui Paulo uint32_t is_mesh_badae; /* dropped 'cuz invalid AE */ 24032176cfdSRui Paulo uint32_t is_mesh_rtaddfailed; /* route add failed */ 24132176cfdSRui Paulo uint32_t is_mesh_notproxy; /* dropped 'cuz not proxying */ 24232176cfdSRui Paulo uint32_t is_rx_badalign; /* dropped 'cuz misaligned */ 24332176cfdSRui Paulo uint32_t is_hwmp_proxy; /* PREP for proxy route */ 244085ff963SMatthew Dillon uint32_t is_beacon_bad; /* Number of bad beacons */ 245085ff963SMatthew Dillon uint32_t is_ampdu_bar_tx; /* A-MPDU BAR frames TXed */ 246085ff963SMatthew Dillon uint32_t is_ampdu_bar_tx_retry; /* A-MPDU BAR frames TX rtry */ 247085ff963SMatthew Dillon uint32_t is_ampdu_bar_tx_fail; /* A-MPDU BAR frames TX fail */ 24832176cfdSRui Paulo 249*4f655ef5SMatthew Dillon uint32_t is_ff_encapfail; /* failed FF encap */ 250*4f655ef5SMatthew Dillon uint32_t is_amsdu_encapfail; /* failed A-MSDU encap */ 251*4f655ef5SMatthew Dillon 252*4f655ef5SMatthew Dillon uint32_t is_spare[5]; 253f186073cSJoerg Sonnenberger }; 254f186073cSJoerg Sonnenberger 255f186073cSJoerg Sonnenberger /* 256841ab66cSSepherosa Ziehau * Max size of optional information elements. We artificially 257841ab66cSSepherosa Ziehau * constrain this; it's limited only by the max frame size (and 258841ab66cSSepherosa Ziehau * the max parameter size of the wireless extensions). 259841ab66cSSepherosa Ziehau */ 260841ab66cSSepherosa Ziehau #define IEEE80211_MAX_OPT_IE 256 261841ab66cSSepherosa Ziehau 262841ab66cSSepherosa Ziehau /* 263841ab66cSSepherosa Ziehau * WPA/RSN get/set key request. Specify the key/cipher 264841ab66cSSepherosa Ziehau * type and whether the key is to be used for sending and/or 265841ab66cSSepherosa Ziehau * receiving. The key index should be set only when working 266841ab66cSSepherosa Ziehau * with global keys (use IEEE80211_KEYIX_NONE for ``no index''). 267841ab66cSSepherosa Ziehau * Otherwise a unicast/pairwise key is specified by the bssid 268841ab66cSSepherosa Ziehau * (on a station) or mac address (on an ap). They key length 269841ab66cSSepherosa Ziehau * must include any MIC key data; otherwise it should be no 27032176cfdSRui Paulo * more than IEEE80211_KEYBUF_SIZE. 271841ab66cSSepherosa Ziehau */ 272841ab66cSSepherosa Ziehau struct ieee80211req_key { 273841ab66cSSepherosa Ziehau uint8_t ik_type; /* key/cipher type */ 274841ab66cSSepherosa Ziehau uint8_t ik_pad; 275841ab66cSSepherosa Ziehau uint16_t ik_keyix; /* key index */ 276841ab66cSSepherosa Ziehau uint8_t ik_keylen; /* key length in bytes */ 277841ab66cSSepherosa Ziehau uint8_t ik_flags; 278841ab66cSSepherosa Ziehau /* NB: IEEE80211_KEY_XMIT and IEEE80211_KEY_RECV defined elsewhere */ 279841ab66cSSepherosa Ziehau #define IEEE80211_KEY_DEFAULT 0x80 /* default xmit key */ 280841ab66cSSepherosa Ziehau uint8_t ik_macaddr[IEEE80211_ADDR_LEN]; 281841ab66cSSepherosa Ziehau uint64_t ik_keyrsc; /* key receive sequence counter */ 282841ab66cSSepherosa Ziehau uint64_t ik_keytsc; /* key transmit sequence counter */ 283841ab66cSSepherosa Ziehau uint8_t ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE]; 284841ab66cSSepherosa Ziehau }; 285841ab66cSSepherosa Ziehau 286841ab66cSSepherosa Ziehau /* 287841ab66cSSepherosa Ziehau * Delete a key either by index or address. Set the index 288841ab66cSSepherosa Ziehau * to IEEE80211_KEYIX_NONE when deleting a unicast key. 289841ab66cSSepherosa Ziehau */ 290841ab66cSSepherosa Ziehau struct ieee80211req_del_key { 291841ab66cSSepherosa Ziehau uint8_t idk_keyix; /* key index */ 292841ab66cSSepherosa Ziehau uint8_t idk_macaddr[IEEE80211_ADDR_LEN]; 293841ab66cSSepherosa Ziehau }; 294841ab66cSSepherosa Ziehau 295841ab66cSSepherosa Ziehau /* 296841ab66cSSepherosa Ziehau * MLME state manipulation request. IEEE80211_MLME_ASSOC 297841ab66cSSepherosa Ziehau * only makes sense when operating as a station. The other 298841ab66cSSepherosa Ziehau * requests can be used when operating as a station or an 299841ab66cSSepherosa Ziehau * ap (to effect a station). 300841ab66cSSepherosa Ziehau */ 301841ab66cSSepherosa Ziehau struct ieee80211req_mlme { 302841ab66cSSepherosa Ziehau uint8_t im_op; /* operation to perform */ 303841ab66cSSepherosa Ziehau #define IEEE80211_MLME_ASSOC 1 /* associate station */ 304841ab66cSSepherosa Ziehau #define IEEE80211_MLME_DISASSOC 2 /* disassociate station */ 305841ab66cSSepherosa Ziehau #define IEEE80211_MLME_DEAUTH 3 /* deauthenticate station */ 306841ab66cSSepherosa Ziehau #define IEEE80211_MLME_AUTHORIZE 4 /* authorize station */ 307841ab66cSSepherosa Ziehau #define IEEE80211_MLME_UNAUTHORIZE 5 /* unauthorize station */ 30832176cfdSRui Paulo #define IEEE80211_MLME_AUTH 6 /* authenticate station */ 309841ab66cSSepherosa Ziehau uint8_t im_ssid_len; /* length of optional ssid */ 310841ab66cSSepherosa Ziehau uint16_t im_reason; /* 802.11 reason code */ 311841ab66cSSepherosa Ziehau uint8_t im_macaddr[IEEE80211_ADDR_LEN]; 312841ab66cSSepherosa Ziehau uint8_t im_ssid[IEEE80211_NWID_LEN]; 313841ab66cSSepherosa Ziehau }; 314841ab66cSSepherosa Ziehau 315841ab66cSSepherosa Ziehau /* 316841ab66cSSepherosa Ziehau * MAC ACL operations. 317841ab66cSSepherosa Ziehau */ 318841ab66cSSepherosa Ziehau enum { 319841ab66cSSepherosa Ziehau IEEE80211_MACCMD_POLICY_OPEN = 0, /* set policy: no ACL's */ 320841ab66cSSepherosa Ziehau IEEE80211_MACCMD_POLICY_ALLOW = 1, /* set policy: allow traffic */ 321841ab66cSSepherosa Ziehau IEEE80211_MACCMD_POLICY_DENY = 2, /* set policy: deny traffic */ 322841ab66cSSepherosa Ziehau IEEE80211_MACCMD_FLUSH = 3, /* flush ACL database */ 323841ab66cSSepherosa Ziehau IEEE80211_MACCMD_DETACH = 4, /* detach ACL policy */ 324841ab66cSSepherosa Ziehau IEEE80211_MACCMD_POLICY = 5, /* get ACL policy */ 325841ab66cSSepherosa Ziehau IEEE80211_MACCMD_LIST = 6, /* get ACL database */ 32632176cfdSRui Paulo IEEE80211_MACCMD_POLICY_RADIUS = 7, /* set policy: RADIUS managed */ 327841ab66cSSepherosa Ziehau }; 328841ab66cSSepherosa Ziehau 329841ab66cSSepherosa Ziehau struct ieee80211req_maclist { 330841ab66cSSepherosa Ziehau uint8_t ml_macaddr[IEEE80211_ADDR_LEN]; 33132176cfdSRui Paulo } __packed; 33232176cfdSRui Paulo 33332176cfdSRui Paulo /* 33432176cfdSRui Paulo * Mesh Routing Table Operations. 33532176cfdSRui Paulo */ 33632176cfdSRui Paulo enum { 33732176cfdSRui Paulo IEEE80211_MESH_RTCMD_LIST = 0, /* list HWMP routing table */ 33832176cfdSRui Paulo IEEE80211_MESH_RTCMD_FLUSH = 1, /* flush HWMP routing table */ 33932176cfdSRui Paulo IEEE80211_MESH_RTCMD_ADD = 2, /* add entry to the table */ 34032176cfdSRui Paulo IEEE80211_MESH_RTCMD_DELETE = 3, /* delete an entry from the table */ 34132176cfdSRui Paulo }; 34232176cfdSRui Paulo 34332176cfdSRui Paulo struct ieee80211req_mesh_route { 34432176cfdSRui Paulo uint8_t imr_flags; 345085ff963SMatthew Dillon #define IEEE80211_MESHRT_FLAGS_DISCOVER 0x01 346085ff963SMatthew Dillon #define IEEE80211_MESHRT_FLAGS_VALID 0x02 347085ff963SMatthew Dillon #define IEEE80211_MESHRT_FLAGS_PROXY 0x04 348085ff963SMatthew Dillon #define IEEE80211_MESHRT_FLAGS_GATE 0x08 34932176cfdSRui Paulo uint8_t imr_dest[IEEE80211_ADDR_LEN]; 35032176cfdSRui Paulo uint8_t imr_nexthop[IEEE80211_ADDR_LEN]; 35132176cfdSRui Paulo uint16_t imr_nhops; 35232176cfdSRui Paulo uint8_t imr_pad; 35332176cfdSRui Paulo uint32_t imr_metric; 35432176cfdSRui Paulo uint32_t imr_lifetime; 35532176cfdSRui Paulo uint32_t imr_lastmseq; 356841ab66cSSepherosa Ziehau }; 357841ab66cSSepherosa Ziehau 358841ab66cSSepherosa Ziehau /* 35932176cfdSRui Paulo * HWMP root modes 36032176cfdSRui Paulo */ 36132176cfdSRui Paulo enum { 36232176cfdSRui Paulo IEEE80211_HWMP_ROOTMODE_DISABLED = 0, /* disabled */ 36332176cfdSRui Paulo IEEE80211_HWMP_ROOTMODE_NORMAL = 1, /* normal PREPs */ 36432176cfdSRui Paulo IEEE80211_HWMP_ROOTMODE_PROACTIVE = 2, /* proactive PREPS */ 36532176cfdSRui Paulo IEEE80211_HWMP_ROOTMODE_RANN = 3, /* use RANN elemid */ 36632176cfdSRui Paulo }; 36732176cfdSRui Paulo 36832176cfdSRui Paulo 36932176cfdSRui Paulo /* 37032176cfdSRui Paulo * Set the active channel list by IEEE channel #: each channel 37132176cfdSRui Paulo * to be marked active is set in a bit vector. Note this list is 37232176cfdSRui Paulo * intersected with the available channel list in calculating 37332176cfdSRui Paulo * the set of channels actually used in scanning. 374841ab66cSSepherosa Ziehau */ 375841ab66cSSepherosa Ziehau struct ieee80211req_chanlist { 37632176cfdSRui Paulo uint8_t ic_channels[32]; /* NB: can be variable length */ 377841ab66cSSepherosa Ziehau }; 378841ab66cSSepherosa Ziehau 379841ab66cSSepherosa Ziehau /* 380841ab66cSSepherosa Ziehau * Get the active channel list info. 381841ab66cSSepherosa Ziehau */ 382841ab66cSSepherosa Ziehau struct ieee80211req_chaninfo { 383841ab66cSSepherosa Ziehau u_int ic_nchans; 38432176cfdSRui Paulo struct ieee80211_channel ic_chans[1]; /* NB: variable length */ 385841ab66cSSepherosa Ziehau }; 38632176cfdSRui Paulo #define IEEE80211_CHANINFO_SIZE(_nchan) \ 38732176cfdSRui Paulo (sizeof(struct ieee80211req_chaninfo) + \ 38832176cfdSRui Paulo (((_nchan)-1) * sizeof(struct ieee80211_channel))) 38932176cfdSRui Paulo #define IEEE80211_CHANINFO_SPACE(_ci) \ 39032176cfdSRui Paulo IEEE80211_CHANINFO_SIZE((_ci)->ic_nchans) 391841ab66cSSepherosa Ziehau 392841ab66cSSepherosa Ziehau /* 393841ab66cSSepherosa Ziehau * Retrieve the WPA/RSN information element for an associated station. 394841ab66cSSepherosa Ziehau */ 39532176cfdSRui Paulo struct ieee80211req_wpaie { /* old version w/ only one ie */ 396841ab66cSSepherosa Ziehau uint8_t wpa_macaddr[IEEE80211_ADDR_LEN]; 397841ab66cSSepherosa Ziehau uint8_t wpa_ie[IEEE80211_MAX_OPT_IE]; 398841ab66cSSepherosa Ziehau }; 39932176cfdSRui Paulo struct ieee80211req_wpaie2 { 40032176cfdSRui Paulo uint8_t wpa_macaddr[IEEE80211_ADDR_LEN]; 40132176cfdSRui Paulo uint8_t wpa_ie[IEEE80211_MAX_OPT_IE]; 40232176cfdSRui Paulo uint8_t rsn_ie[IEEE80211_MAX_OPT_IE]; 40332176cfdSRui Paulo }; 404841ab66cSSepherosa Ziehau 405841ab66cSSepherosa Ziehau /* 406841ab66cSSepherosa Ziehau * Retrieve per-node statistics. 407841ab66cSSepherosa Ziehau */ 408841ab66cSSepherosa Ziehau struct ieee80211req_sta_stats { 409841ab66cSSepherosa Ziehau union { 410841ab66cSSepherosa Ziehau /* NB: explicitly force 64-bit alignment */ 411841ab66cSSepherosa Ziehau uint8_t macaddr[IEEE80211_ADDR_LEN]; 412841ab66cSSepherosa Ziehau uint64_t pad; 413841ab66cSSepherosa Ziehau } is_u; 414841ab66cSSepherosa Ziehau struct ieee80211_nodestats is_stats; 415841ab66cSSepherosa Ziehau }; 416841ab66cSSepherosa Ziehau 417841ab66cSSepherosa Ziehau /* 418841ab66cSSepherosa Ziehau * Station information block; the mac address is used 419841ab66cSSepherosa Ziehau * to retrieve other data like stats, unicast key, etc. 420841ab66cSSepherosa Ziehau */ 421841ab66cSSepherosa Ziehau struct ieee80211req_sta_info { 42232176cfdSRui Paulo uint16_t isi_len; /* total length (mult of 4) */ 42332176cfdSRui Paulo uint16_t isi_ie_off; /* offset to IE data */ 42432176cfdSRui Paulo uint16_t isi_ie_len; /* IE length */ 425841ab66cSSepherosa Ziehau uint16_t isi_freq; /* MHz */ 42632176cfdSRui Paulo uint32_t isi_flags; /* channel flags */ 42732176cfdSRui Paulo uint32_t isi_state; /* state flags */ 428841ab66cSSepherosa Ziehau uint8_t isi_authmode; /* authentication algorithm */ 42932176cfdSRui Paulo int8_t isi_rssi; /* receive signal strength */ 43032176cfdSRui Paulo int8_t isi_noise; /* noise floor */ 43132176cfdSRui Paulo uint8_t isi_capinfo; /* capabilities */ 432841ab66cSSepherosa Ziehau uint8_t isi_erp; /* ERP element */ 433841ab66cSSepherosa Ziehau uint8_t isi_macaddr[IEEE80211_ADDR_LEN]; 434841ab66cSSepherosa Ziehau uint8_t isi_nrates; 435841ab66cSSepherosa Ziehau /* negotiated rates */ 436841ab66cSSepherosa Ziehau uint8_t isi_rates[IEEE80211_RATE_MAXSIZE]; 43732176cfdSRui Paulo uint8_t isi_txrate; /* legacy/IEEE rate or MCS */ 438841ab66cSSepherosa Ziehau uint16_t isi_associd; /* assoc response */ 439841ab66cSSepherosa Ziehau uint16_t isi_txpower; /* current tx power */ 440841ab66cSSepherosa Ziehau uint16_t isi_vlan; /* vlan tag */ 44132176cfdSRui Paulo /* NB: [IEEE80211_NONQOS_TID] holds seq#'s for non-QoS stations */ 44232176cfdSRui Paulo uint16_t isi_txseqs[IEEE80211_TID_SIZE];/* tx seq #/TID */ 44332176cfdSRui Paulo uint16_t isi_rxseqs[IEEE80211_TID_SIZE];/* rx seq#/TID */ 444841ab66cSSepherosa Ziehau uint16_t isi_inact; /* inactivity timer */ 44532176cfdSRui Paulo uint16_t isi_txmbps; /* current tx rate in .5 Mb/s */ 44632176cfdSRui Paulo uint16_t isi_pad; 44732176cfdSRui Paulo uint32_t isi_jointime; /* time of assoc/join */ 44832176cfdSRui Paulo struct ieee80211_mimo_info isi_mimo; /* MIMO info for 11n sta's */ 44932176cfdSRui Paulo /* 11s info */ 45032176cfdSRui Paulo uint16_t isi_peerid; 45132176cfdSRui Paulo uint16_t isi_localid; 45232176cfdSRui Paulo uint8_t isi_peerstate; 453841ab66cSSepherosa Ziehau /* XXX frag state? */ 454841ab66cSSepherosa Ziehau /* variable length IE data */ 455841ab66cSSepherosa Ziehau }; 456841ab66cSSepherosa Ziehau 457841ab66cSSepherosa Ziehau /* 458841ab66cSSepherosa Ziehau * Retrieve per-station information; to retrieve all 459841ab66cSSepherosa Ziehau * specify a mac address of ff:ff:ff:ff:ff:ff. 460841ab66cSSepherosa Ziehau */ 461841ab66cSSepherosa Ziehau struct ieee80211req_sta_req { 462841ab66cSSepherosa Ziehau union { 463841ab66cSSepherosa Ziehau /* NB: explicitly force 64-bit alignment */ 464841ab66cSSepherosa Ziehau uint8_t macaddr[IEEE80211_ADDR_LEN]; 465841ab66cSSepherosa Ziehau uint64_t pad; 466841ab66cSSepherosa Ziehau } is_u; 467841ab66cSSepherosa Ziehau struct ieee80211req_sta_info info[1]; /* variable length */ 468841ab66cSSepherosa Ziehau }; 469841ab66cSSepherosa Ziehau 470841ab66cSSepherosa Ziehau /* 471841ab66cSSepherosa Ziehau * Get/set per-station tx power cap. 472841ab66cSSepherosa Ziehau */ 473841ab66cSSepherosa Ziehau struct ieee80211req_sta_txpow { 474841ab66cSSepherosa Ziehau uint8_t it_macaddr[IEEE80211_ADDR_LEN]; 475841ab66cSSepherosa Ziehau uint8_t it_txpow; 476841ab66cSSepherosa Ziehau }; 477841ab66cSSepherosa Ziehau 478841ab66cSSepherosa Ziehau /* 47932176cfdSRui Paulo * WME parameters manipulated with IEEE80211_IOC_WME_CWMIN 48032176cfdSRui Paulo * through IEEE80211_IOC_WME_ACKPOLICY are set and return 48132176cfdSRui Paulo * using i_val and i_len. i_val holds the value itself. 48232176cfdSRui Paulo * i_len specifies the AC and, as appropriate, then high bit 48332176cfdSRui Paulo * specifies whether the operation is to be applied to the 48432176cfdSRui Paulo * BSS or ourself. 485841ab66cSSepherosa Ziehau */ 486841ab66cSSepherosa Ziehau #define IEEE80211_WMEPARAM_SELF 0x0000 /* parameter applies to self */ 487841ab66cSSepherosa Ziehau #define IEEE80211_WMEPARAM_BSS 0x8000 /* parameter applies to BSS */ 488841ab66cSSepherosa Ziehau #define IEEE80211_WMEPARAM_VAL 0x7fff /* parameter value */ 489841ab66cSSepherosa Ziehau 490841ab66cSSepherosa Ziehau /* 49132176cfdSRui Paulo * Application Information Elements can be appended to a variety 49232176cfdSRui Paulo * of frames with the IEE80211_IOC_APPIE request. This request 49332176cfdSRui Paulo * piggybacks on a normal ieee80211req; the frame type is passed 49432176cfdSRui Paulo * in i_val as the 802.11 FC0 bytes and the length of the IE data 49532176cfdSRui Paulo * is passed in i_len. The data is referenced in i_data. If i_len 49632176cfdSRui Paulo * is zero then any previously configured IE data is removed. At 49732176cfdSRui Paulo * most IEEE80211_MAX_APPIE data be appened. Note that multiple 49832176cfdSRui Paulo * IE's can be supplied; the data is treated opaquely. 49932176cfdSRui Paulo */ 50032176cfdSRui Paulo #define IEEE80211_MAX_APPIE 1024 /* max app IE data */ 50132176cfdSRui Paulo /* 50232176cfdSRui Paulo * Hack: the WPA authenticator uses this mechanism to specify WPA 50332176cfdSRui Paulo * ie's that are used instead of the ones normally constructed using 50432176cfdSRui Paulo * the cipher state setup with separate ioctls. This avoids issues 50532176cfdSRui Paulo * like the authenticator ordering ie data differently than the 50632176cfdSRui Paulo * net80211 layer and needing to keep separate state for WPA and RSN. 50732176cfdSRui Paulo */ 50832176cfdSRui Paulo #define IEEE80211_APPIE_WPA \ 50932176cfdSRui Paulo (IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_BEACON | \ 51032176cfdSRui Paulo IEEE80211_FC0_SUBTYPE_PROBE_RESP) 51132176cfdSRui Paulo 51232176cfdSRui Paulo /* 51332176cfdSRui Paulo * Station mode roaming parameters. These are maintained 51432176cfdSRui Paulo * per band/mode and control the roaming algorithm. 51532176cfdSRui Paulo */ 51632176cfdSRui Paulo struct ieee80211_roamparams_req { 51732176cfdSRui Paulo struct ieee80211_roamparam params[IEEE80211_MODE_MAX]; 51832176cfdSRui Paulo }; 51932176cfdSRui Paulo 52032176cfdSRui Paulo /* 52132176cfdSRui Paulo * Transmit parameters. These can be used to set fixed transmit 52232176cfdSRui Paulo * rate for each operating mode when operating as client or on a 52332176cfdSRui Paulo * per-client basis according to the capabilities of the client 52432176cfdSRui Paulo * (e.g. an 11b client associated to an 11g ap) when operating as 52532176cfdSRui Paulo * an ap. 52632176cfdSRui Paulo * 52732176cfdSRui Paulo * MCS are distinguished from legacy rates by or'ing in 0x80. 52832176cfdSRui Paulo */ 52932176cfdSRui Paulo struct ieee80211_txparams_req { 53032176cfdSRui Paulo struct ieee80211_txparam params[IEEE80211_MODE_MAX]; 53132176cfdSRui Paulo }; 53232176cfdSRui Paulo 53332176cfdSRui Paulo /* 53432176cfdSRui Paulo * Set regulatory domain state with IEEE80211_IOC_REGDOMAIN. 53532176cfdSRui Paulo * Note this is both the regulatory description and the channel 53632176cfdSRui Paulo * list. The get request for IEEE80211_IOC_REGDOMAIN returns 53732176cfdSRui Paulo * only the regdomain info; the channel list is obtained 53832176cfdSRui Paulo * separately with IEEE80211_IOC_CHANINFO. 53932176cfdSRui Paulo */ 54032176cfdSRui Paulo struct ieee80211_regdomain_req { 54132176cfdSRui Paulo struct ieee80211_regdomain rd; 54232176cfdSRui Paulo struct ieee80211req_chaninfo chaninfo; 54332176cfdSRui Paulo }; 54432176cfdSRui Paulo #define IEEE80211_REGDOMAIN_SIZE(_nchan) \ 54532176cfdSRui Paulo (sizeof(struct ieee80211_regdomain_req) + \ 54632176cfdSRui Paulo (((_nchan)-1) * sizeof(struct ieee80211_channel))) 54732176cfdSRui Paulo #define IEEE80211_REGDOMAIN_SPACE(_req) \ 54832176cfdSRui Paulo IEEE80211_REGDOMAIN_SIZE((_req)->chaninfo.ic_nchans) 54932176cfdSRui Paulo 55032176cfdSRui Paulo /* 55132176cfdSRui Paulo * Get driver capabilities. Driver, hardware crypto, and 55232176cfdSRui Paulo * HT/802.11n capabilities, and a table that describes what 55332176cfdSRui Paulo * the radio can do. 55432176cfdSRui Paulo */ 55532176cfdSRui Paulo struct ieee80211_devcaps_req { 55632176cfdSRui Paulo uint32_t dc_drivercaps; /* general driver caps */ 55732176cfdSRui Paulo uint32_t dc_cryptocaps; /* hardware crypto support */ 55832176cfdSRui Paulo uint32_t dc_htcaps; /* HT/802.11n support */ 55932176cfdSRui Paulo struct ieee80211req_chaninfo dc_chaninfo; 56032176cfdSRui Paulo }; 56132176cfdSRui Paulo #define IEEE80211_DEVCAPS_SIZE(_nchan) \ 56232176cfdSRui Paulo (sizeof(struct ieee80211_devcaps_req) + \ 56332176cfdSRui Paulo (((_nchan)-1) * sizeof(struct ieee80211_channel))) 56432176cfdSRui Paulo #define IEEE80211_DEVCAPS_SPACE(_dc) \ 56532176cfdSRui Paulo IEEE80211_DEVCAPS_SIZE((_dc)->dc_chaninfo.ic_nchans) 56632176cfdSRui Paulo 56732176cfdSRui Paulo struct ieee80211_chanswitch_req { 56832176cfdSRui Paulo struct ieee80211_channel csa_chan; /* new channel */ 56932176cfdSRui Paulo int csa_mode; /* CSA mode */ 57032176cfdSRui Paulo int csa_count; /* beacon count to switch */ 57132176cfdSRui Paulo }; 57232176cfdSRui Paulo 57332176cfdSRui Paulo /* 57432176cfdSRui Paulo * Get/set per-station vlan tag. 57532176cfdSRui Paulo */ 57632176cfdSRui Paulo struct ieee80211req_sta_vlan { 57732176cfdSRui Paulo uint8_t sv_macaddr[IEEE80211_ADDR_LEN]; 57832176cfdSRui Paulo uint16_t sv_vlan; 57932176cfdSRui Paulo }; 58032176cfdSRui Paulo 581085ff963SMatthew Dillon #if defined(__FreeBSD__) || defined(__DragonFly__) 58232176cfdSRui Paulo /* 583085ff963SMatthew Dillon * FreeBSD-style ioctls. 584f186073cSJoerg Sonnenberger */ 585f186073cSJoerg Sonnenberger /* the first member must be matched with struct ifreq */ 586f186073cSJoerg Sonnenberger struct ieee80211req { 587f186073cSJoerg Sonnenberger char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */ 588f186073cSJoerg Sonnenberger uint16_t i_type; /* req type */ 589f186073cSJoerg Sonnenberger int16_t i_val; /* Index or simple value */ 590085ff963SMatthew Dillon uint16_t i_len; /* Index or simple value */ 591f186073cSJoerg Sonnenberger void *i_data; /* Extra data */ 592f186073cSJoerg Sonnenberger }; 593f186073cSJoerg Sonnenberger #define SIOCS80211 _IOW('i', 234, struct ieee80211req) 594f186073cSJoerg Sonnenberger #define SIOCG80211 _IOWR('i', 235, struct ieee80211req) 59532176cfdSRui Paulo #define SIOCG80211STATS _IOWR('i', 236, struct ifreq) 596f186073cSJoerg Sonnenberger 597f186073cSJoerg Sonnenberger #define IEEE80211_IOC_SSID 1 598f186073cSJoerg Sonnenberger #define IEEE80211_IOC_NUMSSIDS 2 599f186073cSJoerg Sonnenberger #define IEEE80211_IOC_WEP 3 600f186073cSJoerg Sonnenberger #define IEEE80211_WEP_NOSUP -1 601f186073cSJoerg Sonnenberger #define IEEE80211_WEP_OFF 0 602f186073cSJoerg Sonnenberger #define IEEE80211_WEP_ON 1 603f186073cSJoerg Sonnenberger #define IEEE80211_WEP_MIXED 2 604f186073cSJoerg Sonnenberger #define IEEE80211_IOC_WEPKEY 4 605f186073cSJoerg Sonnenberger #define IEEE80211_IOC_NUMWEPKEYS 5 606f186073cSJoerg Sonnenberger #define IEEE80211_IOC_WEPTXKEY 6 607f186073cSJoerg Sonnenberger #define IEEE80211_IOC_AUTHMODE 7 608f186073cSJoerg Sonnenberger #define IEEE80211_IOC_STATIONNAME 8 609f186073cSJoerg Sonnenberger #define IEEE80211_IOC_CHANNEL 9 610f186073cSJoerg Sonnenberger #define IEEE80211_IOC_POWERSAVE 10 611f186073cSJoerg Sonnenberger #define IEEE80211_POWERSAVE_NOSUP -1 612f186073cSJoerg Sonnenberger #define IEEE80211_POWERSAVE_OFF 0 613f186073cSJoerg Sonnenberger #define IEEE80211_POWERSAVE_CAM 1 614f186073cSJoerg Sonnenberger #define IEEE80211_POWERSAVE_PSP 2 615f186073cSJoerg Sonnenberger #define IEEE80211_POWERSAVE_PSP_CAM 3 616f186073cSJoerg Sonnenberger #define IEEE80211_POWERSAVE_ON IEEE80211_POWERSAVE_CAM 617f186073cSJoerg Sonnenberger #define IEEE80211_IOC_POWERSAVESLEEP 11 618f186073cSJoerg Sonnenberger #define IEEE80211_IOC_RTSTHRESHOLD 12 619f186073cSJoerg Sonnenberger #define IEEE80211_IOC_PROTMODE 13 620f186073cSJoerg Sonnenberger #define IEEE80211_PROTMODE_OFF 0 621f186073cSJoerg Sonnenberger #define IEEE80211_PROTMODE_CTS 1 622f186073cSJoerg Sonnenberger #define IEEE80211_PROTMODE_RTSCTS 2 623841ab66cSSepherosa Ziehau #define IEEE80211_IOC_TXPOWER 14 /* global tx power limit */ 624841ab66cSSepherosa Ziehau #define IEEE80211_IOC_BSSID 15 625841ab66cSSepherosa Ziehau #define IEEE80211_IOC_ROAMING 16 /* roaming mode */ 626841ab66cSSepherosa Ziehau #define IEEE80211_IOC_PRIVACY 17 /* privacy invoked */ 627841ab66cSSepherosa Ziehau #define IEEE80211_IOC_DROPUNENCRYPTED 18 /* discard unencrypted frames */ 628841ab66cSSepherosa Ziehau #define IEEE80211_IOC_WPAKEY 19 629841ab66cSSepherosa Ziehau #define IEEE80211_IOC_DELKEY 20 630841ab66cSSepherosa Ziehau #define IEEE80211_IOC_MLME 21 63132176cfdSRui Paulo /* 22 was IEEE80211_IOC_OPTIE, replaced by IEEE80211_IOC_APPIE */ 63232176cfdSRui Paulo /* 23 was IEEE80211_IOC_SCAN_REQ */ 63332176cfdSRui Paulo /* 24 was IEEE80211_IOC_SCAN_RESULTS */ 634841ab66cSSepherosa Ziehau #define IEEE80211_IOC_COUNTERMEASURES 25 /* WPA/TKIP countermeasures */ 635841ab66cSSepherosa Ziehau #define IEEE80211_IOC_WPA 26 /* WPA mode (0,1,2) */ 636841ab66cSSepherosa Ziehau #define IEEE80211_IOC_CHANLIST 27 /* channel list */ 637841ab66cSSepherosa Ziehau #define IEEE80211_IOC_WME 28 /* WME mode (on, off) */ 638841ab66cSSepherosa Ziehau #define IEEE80211_IOC_HIDESSID 29 /* hide SSID mode (on, off) */ 639841ab66cSSepherosa Ziehau #define IEEE80211_IOC_APBRIDGE 30 /* AP inter-sta bridging */ 64032176cfdSRui Paulo /* 31-35,37-38 were for WPA authenticator settings */ 64132176cfdSRui Paulo /* 36 was IEEE80211_IOC_DRIVER_CAPS */ 642841ab66cSSepherosa Ziehau #define IEEE80211_IOC_WPAIE 39 /* WPA information element */ 643841ab66cSSepherosa Ziehau #define IEEE80211_IOC_STA_STATS 40 /* per-station statistics */ 644841ab66cSSepherosa Ziehau #define IEEE80211_IOC_MACCMD 41 /* MAC ACL operation */ 645841ab66cSSepherosa Ziehau #define IEEE80211_IOC_CHANINFO 42 /* channel info list */ 646841ab66cSSepherosa Ziehau #define IEEE80211_IOC_TXPOWMAX 43 /* max tx power for channel */ 647841ab66cSSepherosa Ziehau #define IEEE80211_IOC_STA_TXPOW 44 /* per-station tx power limit */ 64832176cfdSRui Paulo /* 45 was IEEE80211_IOC_STA_INFO */ 649841ab66cSSepherosa Ziehau #define IEEE80211_IOC_WME_CWMIN 46 /* WME: ECWmin */ 650841ab66cSSepherosa Ziehau #define IEEE80211_IOC_WME_CWMAX 47 /* WME: ECWmax */ 651841ab66cSSepherosa Ziehau #define IEEE80211_IOC_WME_AIFS 48 /* WME: AIFSN */ 652841ab66cSSepherosa Ziehau #define IEEE80211_IOC_WME_TXOPLIMIT 49 /* WME: txops limit */ 653841ab66cSSepherosa Ziehau #define IEEE80211_IOC_WME_ACM 50 /* WME: ACM (bss only) */ 654841ab66cSSepherosa Ziehau #define IEEE80211_IOC_WME_ACKPOLICY 51 /* WME: ACK policy (!bss only)*/ 655841ab66cSSepherosa Ziehau #define IEEE80211_IOC_DTIM_PERIOD 52 /* DTIM period (beacons) */ 656841ab66cSSepherosa Ziehau #define IEEE80211_IOC_BEACON_INTERVAL 53 /* beacon interval (ms) */ 657841ab66cSSepherosa Ziehau #define IEEE80211_IOC_ADDMAC 54 /* add sta to MAC ACL table */ 658841ab66cSSepherosa Ziehau #define IEEE80211_IOC_DELMAC 55 /* del sta from MAC ACL table */ 659841ab66cSSepherosa Ziehau #define IEEE80211_IOC_PUREG 56 /* pure 11g (no 11b stations) */ 66032176cfdSRui Paulo #define IEEE80211_IOC_FF 57 /* ATH fast frames (on, off) */ 66132176cfdSRui Paulo #define IEEE80211_IOC_TURBOP 58 /* ATH turbo' (on, off) */ 66232176cfdSRui Paulo #define IEEE80211_IOC_BGSCAN 59 /* bg scanning (on, off) */ 66332176cfdSRui Paulo #define IEEE80211_IOC_BGSCAN_IDLE 60 /* bg scan idle threshold */ 66432176cfdSRui Paulo #define IEEE80211_IOC_BGSCAN_INTERVAL 61 /* bg scan interval */ 66532176cfdSRui Paulo #define IEEE80211_IOC_SCANVALID 65 /* scan cache valid threshold */ 66632176cfdSRui Paulo /* 66-72 were IEEE80211_IOC_ROAM_* and IEEE80211_IOC_MCAST_RATE */ 667841ab66cSSepherosa Ziehau #define IEEE80211_IOC_FRAGTHRESHOLD 73 /* tx fragmentation threshold */ 668841ab66cSSepherosa Ziehau #define IEEE80211_IOC_BURST 75 /* packet bursting */ 66932176cfdSRui Paulo #define IEEE80211_IOC_SCAN_RESULTS 76 /* get scan results */ 670c36e937bSSepherosa Ziehau #define IEEE80211_IOC_BMISSTHRESHOLD 77 /* beacon miss threshold */ 6710d17a301SSepherosa Ziehau #define IEEE80211_IOC_STA_INFO 78 /* station/neighbor info */ 67232176cfdSRui Paulo #define IEEE80211_IOC_WPAIE2 79 /* WPA+RSN info elements */ 67332176cfdSRui Paulo #define IEEE80211_IOC_CURCHAN 80 /* current channel */ 67432176cfdSRui Paulo #define IEEE80211_IOC_SHORTGI 81 /* 802.11n half GI */ 67532176cfdSRui Paulo #define IEEE80211_IOC_AMPDU 82 /* 802.11n A-MPDU (on, off) */ 67632176cfdSRui Paulo #define IEEE80211_IOC_AMPDU_LIMIT 83 /* A-MPDU length limit */ 67732176cfdSRui Paulo #define IEEE80211_IOC_AMPDU_DENSITY 84 /* A-MPDU density */ 67832176cfdSRui Paulo #define IEEE80211_IOC_AMSDU 85 /* 802.11n A-MSDU (on, off) */ 67932176cfdSRui Paulo #define IEEE80211_IOC_AMSDU_LIMIT 86 /* A-MSDU length limit */ 68032176cfdSRui Paulo #define IEEE80211_IOC_PUREN 87 /* pure 11n (no legacy sta's) */ 68132176cfdSRui Paulo #define IEEE80211_IOC_DOTH 88 /* 802.11h (on, off) */ 68232176cfdSRui Paulo /* 89-91 were regulatory items */ 68332176cfdSRui Paulo #define IEEE80211_IOC_HTCOMPAT 92 /* support pre-D1.10 HT ie's */ 68432176cfdSRui Paulo #define IEEE80211_IOC_DWDS 93 /* DWDS/4-address handling */ 68532176cfdSRui Paulo #define IEEE80211_IOC_INACTIVITY 94 /* sta inactivity handling */ 68632176cfdSRui Paulo #define IEEE80211_IOC_APPIE 95 /* application IE's */ 68732176cfdSRui Paulo #define IEEE80211_IOC_WPS 96 /* WPS operation */ 68832176cfdSRui Paulo #define IEEE80211_IOC_TSN 97 /* TSN operation */ 68932176cfdSRui Paulo #define IEEE80211_IOC_DEVCAPS 98 /* driver+device capabilities */ 69032176cfdSRui Paulo #define IEEE80211_IOC_CHANSWITCH 99 /* start 11h channel switch */ 69132176cfdSRui Paulo #define IEEE80211_IOC_DFS 100 /* DFS (on, off) */ 69232176cfdSRui Paulo #define IEEE80211_IOC_DOTD 101 /* 802.11d (on, off) */ 69332176cfdSRui Paulo #define IEEE80211_IOC_HTPROTMODE 102 /* HT protection (off, rts) */ 69432176cfdSRui Paulo #define IEEE80211_IOC_SCAN_REQ 103 /* scan w/ specified params */ 69532176cfdSRui Paulo #define IEEE80211_IOC_SCAN_CANCEL 104 /* cancel ongoing scan */ 69632176cfdSRui Paulo #define IEEE80211_IOC_HTCONF 105 /* HT config (off, HT20, HT40)*/ 69732176cfdSRui Paulo #define IEEE80211_IOC_REGDOMAIN 106 /* regulatory domain info */ 69832176cfdSRui Paulo #define IEEE80211_IOC_ROAM 107 /* roaming params en masse */ 69932176cfdSRui Paulo #define IEEE80211_IOC_TXPARAMS 108 /* tx parameters */ 70032176cfdSRui Paulo #define IEEE80211_IOC_STA_VLAN 109 /* per-station vlan tag */ 70132176cfdSRui Paulo #define IEEE80211_IOC_SMPS 110 /* MIMO power save */ 70232176cfdSRui Paulo #define IEEE80211_IOC_RIFS 111 /* RIFS config (on, off) */ 70332176cfdSRui Paulo #define IEEE80211_IOC_GREENFIELD 112 /* Greenfield (on, off) */ 70432176cfdSRui Paulo #define IEEE80211_IOC_STBC 113 /* STBC Tx/RX (on, off) */ 705*4f655ef5SMatthew Dillon #define IEEE80211_IOC_LDPC 114 /* LDPC Tx/RX (on, off) */ 70632176cfdSRui Paulo 70732176cfdSRui Paulo #define IEEE80211_IOC_MESH_ID 170 /* mesh identifier */ 70832176cfdSRui Paulo #define IEEE80211_IOC_MESH_AP 171 /* accepting peerings */ 70932176cfdSRui Paulo #define IEEE80211_IOC_MESH_FWRD 172 /* forward frames */ 71032176cfdSRui Paulo #define IEEE80211_IOC_MESH_PROTO 173 /* mesh protocols */ 71132176cfdSRui Paulo #define IEEE80211_IOC_MESH_TTL 174 /* mesh TTL */ 71232176cfdSRui Paulo #define IEEE80211_IOC_MESH_RTCMD 175 /* mesh routing table commands*/ 71332176cfdSRui Paulo #define IEEE80211_IOC_MESH_PR_METRIC 176 /* mesh metric protocol */ 71432176cfdSRui Paulo #define IEEE80211_IOC_MESH_PR_PATH 177 /* mesh path protocol */ 71532176cfdSRui Paulo #define IEEE80211_IOC_MESH_PR_SIG 178 /* mesh sig protocol */ 71632176cfdSRui Paulo #define IEEE80211_IOC_MESH_PR_CC 179 /* mesh congestion protocol */ 71732176cfdSRui Paulo #define IEEE80211_IOC_MESH_PR_AUTH 180 /* mesh auth protocol */ 718085ff963SMatthew Dillon #define IEEE80211_IOC_MESH_GATE 181 /* mesh gate XXX: 173? */ 71932176cfdSRui Paulo 72032176cfdSRui Paulo #define IEEE80211_IOC_HWMP_ROOTMODE 190 /* HWMP root mode */ 72132176cfdSRui Paulo #define IEEE80211_IOC_HWMP_MAXHOPS 191 /* number of hops before drop */ 72232176cfdSRui Paulo #define IEEE80211_IOC_HWMP_TTL 192 /* HWMP TTL */ 72332176cfdSRui Paulo 72432176cfdSRui Paulo #define IEEE80211_IOC_TDMA_SLOT 201 /* TDMA: assigned slot */ 72532176cfdSRui Paulo #define IEEE80211_IOC_TDMA_SLOTCNT 202 /* TDMA: slots in bss */ 72632176cfdSRui Paulo #define IEEE80211_IOC_TDMA_SLOTLEN 203 /* TDMA: slot length (usecs) */ 72732176cfdSRui Paulo #define IEEE80211_IOC_TDMA_BINTERVAL 204 /* TDMA: beacon intvl (slots) */ 72832176cfdSRui Paulo 729085ff963SMatthew Dillon #define IEEE80211_IOC_QUIET 205 /* Quiet Enable/Disable */ 730085ff963SMatthew Dillon #define IEEE80211_IOC_QUIET_PERIOD 206 /* Quiet Period */ 731085ff963SMatthew Dillon #define IEEE80211_IOC_QUIET_OFFSET 207 /* Quiet Offset */ 732085ff963SMatthew Dillon #define IEEE80211_IOC_QUIET_DUR 208 /* Quiet Duration */ 733085ff963SMatthew Dillon #define IEEE80211_IOC_QUIET_COUNT 209 /* Quiet Count */ 73432176cfdSRui Paulo /* 73532176cfdSRui Paulo * Parameters for controlling a scan requested with 73632176cfdSRui Paulo * IEEE80211_IOC_SCAN_REQ. 73732176cfdSRui Paulo * 73832176cfdSRui Paulo * Active scans cause ProbeRequest frames to be issued for each 73932176cfdSRui Paulo * specified ssid and, by default, a broadcast ProbeRequest frame. 74032176cfdSRui Paulo * The set of ssid's is specified in the request. 74132176cfdSRui Paulo * 74232176cfdSRui Paulo * By default the scan will cause a BSS to be joined (in station/adhoc 74332176cfdSRui Paulo * mode) or a channel to be selected for operation (hostap mode). 74432176cfdSRui Paulo * To disable that specify IEEE80211_IOC_SCAN_NOPICK and if the 74532176cfdSRui Paulo * 74632176cfdSRui Paulo * If the station is currently associated to an AP then a scan request 74732176cfdSRui Paulo * will cause the station to leave the current channel and potentially 74832176cfdSRui Paulo * miss frames from the AP. Alternatively the station may notify the 74932176cfdSRui Paulo * AP that it is going into power save mode before it leaves the channel. 75032176cfdSRui Paulo * This ensures frames for the station are buffered by the AP. This is 75132176cfdSRui Paulo * termed a ``bg scan'' and is requested with the IEEE80211_IOC_SCAN_BGSCAN 75232176cfdSRui Paulo * flag. Background scans may take longer than foreground scans and may 75332176cfdSRui Paulo * be preempted by traffic. If a station is not associated to an AP 75432176cfdSRui Paulo * then a request for a background scan is automatically done in the 75532176cfdSRui Paulo * foreground. 75632176cfdSRui Paulo * 75732176cfdSRui Paulo * The results of the scan request are cached by the system. This 75832176cfdSRui Paulo * information is aged out and/or invalidated based on events like not 75932176cfdSRui Paulo * being able to associated to an AP. To flush the current cache 76032176cfdSRui Paulo * contents before doing a scan the IEEE80211_IOC_SCAN_FLUSH flag may 76132176cfdSRui Paulo * be specified. 76232176cfdSRui Paulo * 76332176cfdSRui Paulo * By default the scan will be done until a suitable AP is located 76432176cfdSRui Paulo * or a channel is found for use. A scan can also be constrained 76532176cfdSRui Paulo * to be done once (IEEE80211_IOC_SCAN_ONCE) or to last for no more 76632176cfdSRui Paulo * than a specified duration. 76732176cfdSRui Paulo */ 76832176cfdSRui Paulo struct ieee80211_scan_req { 76932176cfdSRui Paulo int sr_flags; 77032176cfdSRui Paulo #define IEEE80211_IOC_SCAN_NOPICK 0x00001 /* scan only, no selection */ 77132176cfdSRui Paulo #define IEEE80211_IOC_SCAN_ACTIVE 0x00002 /* active scan (probe req) */ 77232176cfdSRui Paulo #define IEEE80211_IOC_SCAN_PICK1ST 0x00004 /* ``hey sailor'' mode */ 77332176cfdSRui Paulo #define IEEE80211_IOC_SCAN_BGSCAN 0x00008 /* bg scan, exit ps at end */ 77432176cfdSRui Paulo #define IEEE80211_IOC_SCAN_ONCE 0x00010 /* do one complete pass */ 77532176cfdSRui Paulo #define IEEE80211_IOC_SCAN_NOBCAST 0x00020 /* don't send bcast probe req */ 77632176cfdSRui Paulo #define IEEE80211_IOC_SCAN_NOJOIN 0x00040 /* no auto-sequencing */ 77732176cfdSRui Paulo #define IEEE80211_IOC_SCAN_FLUSH 0x10000 /* flush scan cache first */ 77832176cfdSRui Paulo #define IEEE80211_IOC_SCAN_CHECK 0x20000 /* check scan cache first */ 77932176cfdSRui Paulo u_int sr_duration; /* duration (ms) */ 78032176cfdSRui Paulo #define IEEE80211_IOC_SCAN_DURATION_MIN 1 78132176cfdSRui Paulo #define IEEE80211_IOC_SCAN_DURATION_MAX 0x7fffffff 78232176cfdSRui Paulo #define IEEE80211_IOC_SCAN_FOREVER IEEE80211_IOC_SCAN_DURATION_MAX 78332176cfdSRui Paulo u_int sr_mindwell; /* min channel dwelltime (ms) */ 78432176cfdSRui Paulo u_int sr_maxdwell; /* max channel dwelltime (ms) */ 78532176cfdSRui Paulo int sr_nssid; 78632176cfdSRui Paulo #define IEEE80211_IOC_SCAN_MAX_SSID 3 78732176cfdSRui Paulo struct { 78832176cfdSRui Paulo int len; /* length in bytes */ 78932176cfdSRui Paulo uint8_t ssid[IEEE80211_NWID_LEN]; /* ssid contents */ 79032176cfdSRui Paulo } sr_ssid[IEEE80211_IOC_SCAN_MAX_SSID]; 79132176cfdSRui Paulo }; 792f186073cSJoerg Sonnenberger 793841ab66cSSepherosa Ziehau /* 794841ab66cSSepherosa Ziehau * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS. 79532176cfdSRui Paulo * Each result is a fixed size structure followed by a variable 79632176cfdSRui Paulo * length SSID and one or more variable length information elements. 79732176cfdSRui Paulo * The size of each variable length item is found in the fixed 79832176cfdSRui Paulo * size structure and the entire length of the record is specified 79932176cfdSRui Paulo * in isr_len. Result records are rounded to a multiple of 4 bytes. 800841ab66cSSepherosa Ziehau */ 801841ab66cSSepherosa Ziehau struct ieee80211req_scan_result { 80232176cfdSRui Paulo uint16_t isr_len; /* total length (mult of 4) */ 80332176cfdSRui Paulo uint16_t isr_ie_off; /* offset to SSID+IE data */ 80432176cfdSRui Paulo uint16_t isr_ie_len; /* IE length */ 805841ab66cSSepherosa Ziehau uint16_t isr_freq; /* MHz */ 806841ab66cSSepherosa Ziehau uint16_t isr_flags; /* channel flags */ 80732176cfdSRui Paulo int8_t isr_noise; 80832176cfdSRui Paulo int8_t isr_rssi; 80932176cfdSRui Paulo uint16_t isr_intval; /* beacon interval */ 81032176cfdSRui Paulo uint8_t isr_capinfo; /* capabilities */ 811841ab66cSSepherosa Ziehau uint8_t isr_erp; /* ERP element */ 812841ab66cSSepherosa Ziehau uint8_t isr_bssid[IEEE80211_ADDR_LEN]; 813841ab66cSSepherosa Ziehau uint8_t isr_nrates; 814841ab66cSSepherosa Ziehau uint8_t isr_rates[IEEE80211_RATE_MAXSIZE]; 815841ab66cSSepherosa Ziehau uint8_t isr_ssid_len; /* SSID length */ 81632176cfdSRui Paulo uint8_t isr_meshid_len; /* MESH ID length */ 81732176cfdSRui Paulo /* variable length SSID, followed by variable length MESH ID, 81832176cfdSRui Paulo followed by IE data */ 819841ab66cSSepherosa Ziehau }; 820f186073cSJoerg Sonnenberger 82132176cfdSRui Paulo /* 82232176cfdSRui Paulo * Virtual AP cloning parameters. The parent device must 82332176cfdSRui Paulo * be a vap-capable device. All parameters specified with 82432176cfdSRui Paulo * the clone request are fixed for the lifetime of the vap. 82532176cfdSRui Paulo * 82632176cfdSRui Paulo * There are two flavors of WDS vaps: legacy and dynamic. 82732176cfdSRui Paulo * Legacy WDS operation implements a static binding between 82832176cfdSRui Paulo * two stations encapsulating traffic in 4-address frames. 82932176cfdSRui Paulo * Dynamic WDS vaps are created when a station associates to 83032176cfdSRui Paulo * an AP and sends a 4-address frame. If the AP vap is 83132176cfdSRui Paulo * configured to support WDS then this will generate an 83232176cfdSRui Paulo * event to user programs listening on the routing socket 83332176cfdSRui Paulo * and a Dynamic WDS vap will be created to handle traffic 83432176cfdSRui Paulo * to/from that station. In both cases the bssid of the 83532176cfdSRui Paulo * peer must be specified when creating the vap. 83632176cfdSRui Paulo * 83732176cfdSRui Paulo * By default a vap will inherit the mac address/bssid of 83832176cfdSRui Paulo * the underlying device. To request a unique address the 83932176cfdSRui Paulo * IEEE80211_CLONE_BSSID flag should be supplied. This is 84032176cfdSRui Paulo * meaningless for WDS vaps as they share the bssid of an 84132176cfdSRui Paulo * AP vap that must otherwise exist. Note that some devices 84232176cfdSRui Paulo * may not be able to support multiple addresses. 84332176cfdSRui Paulo * 84432176cfdSRui Paulo * Station mode vap's normally depend on the device to notice 84532176cfdSRui Paulo * when the AP stops sending beacon frames. If IEEE80211_CLONE_NOBEACONS 84632176cfdSRui Paulo * is specified the net80211 layer will do this in s/w. This 84732176cfdSRui Paulo * is mostly useful when setting up a WDS repeater/extender where 84832176cfdSRui Paulo * an AP vap is combined with a sta vap and the device isn't able 84932176cfdSRui Paulo * to track beacon frames in hardware. 85032176cfdSRui Paulo */ 85132176cfdSRui Paulo struct ieee80211_clone_params { 85232176cfdSRui Paulo char icp_parent[IFNAMSIZ]; /* parent device */ 85332176cfdSRui Paulo uint16_t icp_opmode; /* operating mode */ 85432176cfdSRui Paulo uint16_t icp_flags; /* see below */ 85532176cfdSRui Paulo uint8_t icp_bssid[IEEE80211_ADDR_LEN]; /* for WDS links */ 85632176cfdSRui Paulo uint8_t icp_macaddr[IEEE80211_ADDR_LEN];/* local address */ 85732176cfdSRui Paulo }; 85832176cfdSRui Paulo #define IEEE80211_CLONE_BSSID 0x0001 /* allocate unique mac/bssid */ 85932176cfdSRui Paulo #define IEEE80211_CLONE_NOBEACONS 0x0002 /* don't setup beacon timers */ 86032176cfdSRui Paulo #define IEEE80211_CLONE_WDSLEGACY 0x0004 /* legacy WDS processing */ 86132176cfdSRui Paulo #define IEEE80211_CLONE_MACADDR 0x0008 /* use specified mac addr */ 86232176cfdSRui Paulo #define IEEE80211_CLONE_TDMA 0x0010 /* operate in TDMA mode */ 863085ff963SMatthew Dillon #endif /* __FreeBSD__ */ 864f186073cSJoerg Sonnenberger 865841ab66cSSepherosa Ziehau #endif /* _NET80211_IEEE80211_IOCTL_H_ */ 866