xref: /freebsd/sys/net80211/ieee80211_ioctl.h (revision eaff8e2689cee4d77c65e332a5796d2ac4a894da)
11a1e1d21SSam Leffler /*-
27535e66aSSam Leffler  * Copyright (c) 2001 Atsushi Onoe
3b032f27cSSam Leffler  * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
41a1e1d21SSam Leffler  * All rights reserved.
51a1e1d21SSam Leffler  *
61a1e1d21SSam Leffler  * Redistribution and use in source and binary forms, with or without
71a1e1d21SSam Leffler  * modification, are permitted provided that the following conditions
81a1e1d21SSam Leffler  * are met:
91a1e1d21SSam Leffler  * 1. Redistributions of source code must retain the above copyright
101a1e1d21SSam Leffler  *    notice, this list of conditions and the following disclaimer.
111a1e1d21SSam Leffler  * 2. Redistributions in binary form must reproduce the above copyright
121a1e1d21SSam Leffler  *    notice, this list of conditions and the following disclaimer in the
131a1e1d21SSam Leffler  *    documentation and/or other materials provided with the distribution.
147535e66aSSam Leffler  *
157535e66aSSam Leffler  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
167535e66aSSam Leffler  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
177535e66aSSam Leffler  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
187535e66aSSam Leffler  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
197535e66aSSam Leffler  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
207535e66aSSam Leffler  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
217535e66aSSam Leffler  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
227535e66aSSam Leffler  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
237535e66aSSam Leffler  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
247535e66aSSam Leffler  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
251a1e1d21SSam Leffler  *
261a1e1d21SSam Leffler  * $FreeBSD$
271a1e1d21SSam Leffler  */
281a1e1d21SSam Leffler #ifndef _NET80211_IEEE80211_IOCTL_H_
291a1e1d21SSam Leffler #define _NET80211_IEEE80211_IOCTL_H_
301a1e1d21SSam Leffler 
311a1e1d21SSam Leffler /*
321a1e1d21SSam Leffler  * IEEE 802.11 ioctls.
331a1e1d21SSam Leffler  */
348a1b9b6aSSam Leffler #include <net80211/_ieee80211.h>
358a1b9b6aSSam Leffler #include <net80211/ieee80211.h>
368a1b9b6aSSam Leffler #include <net80211/ieee80211_crypto.h>
371a1e1d21SSam Leffler 
388a1b9b6aSSam Leffler /*
39d1c85daeSSam Leffler  * Per/node (station) statistics.
408a1b9b6aSSam Leffler  */
418a1b9b6aSSam Leffler struct ieee80211_nodestats {
4268e8e04eSSam Leffler 	uint32_t	ns_rx_data;		/* rx data frames */
4368e8e04eSSam Leffler 	uint32_t	ns_rx_mgmt;		/* rx management frames */
4468e8e04eSSam Leffler 	uint32_t	ns_rx_ctrl;		/* rx control frames */
4568e8e04eSSam Leffler 	uint32_t	ns_rx_ucast;		/* rx unicast frames */
4668e8e04eSSam Leffler 	uint32_t	ns_rx_mcast;		/* rx multi/broadcast frames */
4768e8e04eSSam Leffler 	uint64_t	ns_rx_bytes;		/* rx data count (bytes) */
4868e8e04eSSam Leffler 	uint64_t	ns_rx_beacons;		/* rx beacon frames */
4968e8e04eSSam Leffler 	uint32_t	ns_rx_proberesp;	/* rx probe response frames */
508a1b9b6aSSam Leffler 
5168e8e04eSSam Leffler 	uint32_t	ns_rx_dup;		/* rx discard 'cuz dup */
5268e8e04eSSam Leffler 	uint32_t	ns_rx_noprivacy;	/* rx w/ wep but privacy off */
5368e8e04eSSam Leffler 	uint32_t	ns_rx_wepfail;		/* rx wep processing failed */
5468e8e04eSSam Leffler 	uint32_t	ns_rx_demicfail;	/* rx demic failed */
5568e8e04eSSam Leffler 	uint32_t	ns_rx_decap;		/* rx decapsulation failed */
5668e8e04eSSam Leffler 	uint32_t	ns_rx_defrag;		/* rx defragmentation failed */
5768e8e04eSSam Leffler 	uint32_t	ns_rx_disassoc;		/* rx disassociation */
5868e8e04eSSam Leffler 	uint32_t	ns_rx_deauth;		/* rx deauthentication */
5968e8e04eSSam Leffler 	uint32_t	ns_rx_action;		/* rx action */
6068e8e04eSSam Leffler 	uint32_t	ns_rx_decryptcrc;	/* rx decrypt failed on crc */
6168e8e04eSSam Leffler 	uint32_t	ns_rx_unauth;		/* rx on unauthorized port */
6268e8e04eSSam Leffler 	uint32_t	ns_rx_unencrypted;	/* rx unecrypted w/ privacy */
631b6167d2SSam Leffler 	uint32_t	ns_rx_drop;		/* rx discard other reason */
648a1b9b6aSSam Leffler 
6568e8e04eSSam Leffler 	uint32_t	ns_tx_data;		/* tx data frames */
6668e8e04eSSam Leffler 	uint32_t	ns_tx_mgmt;		/* tx management frames */
6768e8e04eSSam Leffler 	uint32_t	ns_tx_ucast;		/* tx unicast frames */
6868e8e04eSSam Leffler 	uint32_t	ns_tx_mcast;		/* tx multi/broadcast frames */
6968e8e04eSSam Leffler 	uint64_t	ns_tx_bytes;		/* tx data count (bytes) */
7068e8e04eSSam Leffler 	uint32_t	ns_tx_probereq;		/* tx probe request frames */
718a1b9b6aSSam Leffler 
7268e8e04eSSam Leffler 	uint32_t	ns_tx_novlantag;	/* tx discard 'cuz no tag */
7368e8e04eSSam Leffler 	uint32_t	ns_tx_vlanmismatch;	/* tx discard 'cuz bad tag */
748a1b9b6aSSam Leffler 
7568e8e04eSSam Leffler 	uint32_t	ns_ps_discard;		/* ps discard 'cuz of age */
768a1b9b6aSSam Leffler 
778a1b9b6aSSam Leffler 	/* MIB-related state */
7868e8e04eSSam Leffler 	uint32_t	ns_tx_assoc;		/* [re]associations */
7968e8e04eSSam Leffler 	uint32_t	ns_tx_assoc_fail;	/* [re]association failures */
8068e8e04eSSam Leffler 	uint32_t	ns_tx_auth;		/* [re]authentications */
8168e8e04eSSam Leffler 	uint32_t	ns_tx_auth_fail;	/* [re]authentication failures*/
8268e8e04eSSam Leffler 	uint32_t	ns_tx_deauth;		/* deauthentications */
8368e8e04eSSam Leffler 	uint32_t	ns_tx_deauth_code;	/* last deauth reason */
8468e8e04eSSam Leffler 	uint32_t	ns_tx_disassoc;		/* disassociations */
8568e8e04eSSam Leffler 	uint32_t	ns_tx_disassoc_code;	/* last disassociation reason */
868a1b9b6aSSam Leffler };
878a1b9b6aSSam Leffler 
888a1b9b6aSSam Leffler /*
898a1b9b6aSSam Leffler  * Summary statistics.
908a1b9b6aSSam Leffler  */
911be50176SSam Leffler struct ieee80211_stats {
9268e8e04eSSam Leffler 	uint32_t	is_rx_badversion;	/* rx frame with bad version */
9368e8e04eSSam Leffler 	uint32_t	is_rx_tooshort;		/* rx frame too short */
9468e8e04eSSam Leffler 	uint32_t	is_rx_wrongbss;		/* rx from wrong bssid */
9568e8e04eSSam Leffler 	uint32_t	is_rx_dup;		/* rx discard 'cuz dup */
9668e8e04eSSam Leffler 	uint32_t	is_rx_wrongdir;		/* rx w/ wrong direction */
9768e8e04eSSam Leffler 	uint32_t	is_rx_mcastecho;	/* rx discard 'cuz mcast echo */
9868e8e04eSSam Leffler 	uint32_t	is_rx_notassoc;		/* rx discard 'cuz sta !assoc */
9968e8e04eSSam Leffler 	uint32_t	is_rx_noprivacy;	/* rx w/ wep but privacy off */
10068e8e04eSSam Leffler 	uint32_t	is_rx_unencrypted;	/* rx w/o wep and privacy on */
10168e8e04eSSam Leffler 	uint32_t	is_rx_wepfail;		/* rx wep processing failed */
10268e8e04eSSam Leffler 	uint32_t	is_rx_decap;		/* rx decapsulation failed */
10368e8e04eSSam Leffler 	uint32_t	is_rx_mgtdiscard;	/* rx discard mgt frames */
10468e8e04eSSam Leffler 	uint32_t	is_rx_ctl;		/* rx discard ctrl frames */
10568e8e04eSSam Leffler 	uint32_t	is_rx_beacon;		/* rx beacon frames */
10668e8e04eSSam Leffler 	uint32_t	is_rx_rstoobig;		/* rx rate set truncated */
10768e8e04eSSam Leffler 	uint32_t	is_rx_elem_missing;	/* rx required element missing*/
10868e8e04eSSam Leffler 	uint32_t	is_rx_elem_toobig;	/* rx element too big */
10968e8e04eSSam Leffler 	uint32_t	is_rx_elem_toosmall;	/* rx element too small */
11068e8e04eSSam Leffler 	uint32_t	is_rx_elem_unknown;	/* rx element unknown */
11168e8e04eSSam Leffler 	uint32_t	is_rx_badchan;		/* rx frame w/ invalid chan */
11268e8e04eSSam Leffler 	uint32_t	is_rx_chanmismatch;	/* rx frame chan mismatch */
11368e8e04eSSam Leffler 	uint32_t	is_rx_nodealloc;	/* rx frame dropped */
11468e8e04eSSam Leffler 	uint32_t	is_rx_ssidmismatch;	/* rx frame ssid mismatch  */
11568e8e04eSSam Leffler 	uint32_t	is_rx_auth_unsupported;	/* rx w/ unsupported auth alg */
11668e8e04eSSam Leffler 	uint32_t	is_rx_auth_fail;	/* rx sta auth failure */
11768e8e04eSSam Leffler 	uint32_t	is_rx_auth_countermeasures;/* rx auth discard 'cuz CM */
11868e8e04eSSam Leffler 	uint32_t	is_rx_assoc_bss;	/* rx assoc from wrong bssid */
11968e8e04eSSam Leffler 	uint32_t	is_rx_assoc_notauth;	/* rx assoc w/o auth */
12068e8e04eSSam Leffler 	uint32_t	is_rx_assoc_capmismatch;/* rx assoc w/ cap mismatch */
12168e8e04eSSam Leffler 	uint32_t	is_rx_assoc_norate;	/* rx assoc w/ no rate match */
12268e8e04eSSam Leffler 	uint32_t	is_rx_assoc_badwpaie;	/* rx assoc w/ bad WPA IE */
12368e8e04eSSam Leffler 	uint32_t	is_rx_deauth;		/* rx deauthentication */
12468e8e04eSSam Leffler 	uint32_t	is_rx_disassoc;		/* rx disassociation */
12568e8e04eSSam Leffler 	uint32_t	is_rx_badsubtype;	/* rx frame w/ unknown subtype*/
12668e8e04eSSam Leffler 	uint32_t	is_rx_nobuf;		/* rx failed for lack of buf */
12768e8e04eSSam Leffler 	uint32_t	is_rx_decryptcrc;	/* rx decrypt failed on crc */
12868e8e04eSSam Leffler 	uint32_t	is_rx_ahdemo_mgt;	/* rx discard ahdemo mgt frame*/
12968e8e04eSSam Leffler 	uint32_t	is_rx_bad_auth;		/* rx bad auth request */
13068e8e04eSSam Leffler 	uint32_t	is_rx_unauth;		/* rx on unauthorized port */
13168e8e04eSSam Leffler 	uint32_t	is_rx_badkeyid;		/* rx w/ incorrect keyid */
13268e8e04eSSam Leffler 	uint32_t	is_rx_ccmpreplay;	/* rx seq# violation (CCMP) */
13368e8e04eSSam Leffler 	uint32_t	is_rx_ccmpformat;	/* rx format bad (CCMP) */
13468e8e04eSSam Leffler 	uint32_t	is_rx_ccmpmic;		/* rx MIC check failed (CCMP) */
13568e8e04eSSam Leffler 	uint32_t	is_rx_tkipreplay;	/* rx seq# violation (TKIP) */
13668e8e04eSSam Leffler 	uint32_t	is_rx_tkipformat;	/* rx format bad (TKIP) */
13768e8e04eSSam Leffler 	uint32_t	is_rx_tkipmic;		/* rx MIC check failed (TKIP) */
13868e8e04eSSam Leffler 	uint32_t	is_rx_tkipicv;		/* rx ICV check failed (TKIP) */
13968e8e04eSSam Leffler 	uint32_t	is_rx_badcipher;	/* rx failed 'cuz key type */
14068e8e04eSSam Leffler 	uint32_t	is_rx_nocipherctx;	/* rx failed 'cuz key !setup */
14168e8e04eSSam Leffler 	uint32_t	is_rx_acl;		/* rx discard 'cuz acl policy */
14268e8e04eSSam Leffler 	uint32_t	is_tx_nobuf;		/* tx failed for lack of buf */
14368e8e04eSSam Leffler 	uint32_t	is_tx_nonode;		/* tx failed for no node */
14468e8e04eSSam Leffler 	uint32_t	is_tx_unknownmgt;	/* tx of unknown mgt frame */
14568e8e04eSSam Leffler 	uint32_t	is_tx_badcipher;	/* tx failed 'cuz key type */
14668e8e04eSSam Leffler 	uint32_t	is_tx_nodefkey;		/* tx failed 'cuz no defkey */
14768e8e04eSSam Leffler 	uint32_t	is_tx_noheadroom;	/* tx failed 'cuz no space */
14868e8e04eSSam Leffler 	uint32_t	is_tx_fragframes;	/* tx frames fragmented */
14968e8e04eSSam Leffler 	uint32_t	is_tx_frags;		/* tx fragments created */
15068e8e04eSSam Leffler 	uint32_t	is_scan_active;		/* active scans started */
15168e8e04eSSam Leffler 	uint32_t	is_scan_passive;	/* passive scans started */
15268e8e04eSSam Leffler 	uint32_t	is_node_timeout;	/* nodes timed out inactivity */
15368e8e04eSSam Leffler 	uint32_t	is_crypto_nomem;	/* no memory for crypto ctx */
15468e8e04eSSam Leffler 	uint32_t	is_crypto_tkip;		/* tkip crypto done in s/w */
15568e8e04eSSam Leffler 	uint32_t	is_crypto_tkipenmic;	/* tkip en-MIC done in s/w */
15668e8e04eSSam Leffler 	uint32_t	is_crypto_tkipdemic;	/* tkip de-MIC done in s/w */
15768e8e04eSSam Leffler 	uint32_t	is_crypto_tkipcm;	/* tkip counter measures */
15868e8e04eSSam Leffler 	uint32_t	is_crypto_ccmp;		/* ccmp crypto done in s/w */
15968e8e04eSSam Leffler 	uint32_t	is_crypto_wep;		/* wep crypto done in s/w */
16068e8e04eSSam Leffler 	uint32_t	is_crypto_setkey_cipher;/* cipher rejected key */
16168e8e04eSSam Leffler 	uint32_t	is_crypto_setkey_nokey;	/* no key index for setkey */
16268e8e04eSSam Leffler 	uint32_t	is_crypto_delkey;	/* driver key delete failed */
16368e8e04eSSam Leffler 	uint32_t	is_crypto_badcipher;	/* unknown cipher */
16468e8e04eSSam Leffler 	uint32_t	is_crypto_nocipher;	/* cipher not available */
16568e8e04eSSam Leffler 	uint32_t	is_crypto_attachfail;	/* cipher attach failed */
16668e8e04eSSam Leffler 	uint32_t	is_crypto_swfallback;	/* cipher fallback to s/w */
16768e8e04eSSam Leffler 	uint32_t	is_crypto_keyfail;	/* driver key alloc failed */
16868e8e04eSSam Leffler 	uint32_t	is_crypto_enmicfail;	/* en-MIC failed */
16968e8e04eSSam Leffler 	uint32_t	is_ibss_capmismatch;	/* merge failed-cap mismatch */
17068e8e04eSSam Leffler 	uint32_t	is_ibss_norate;		/* merge failed-rate mismatch */
17168e8e04eSSam Leffler 	uint32_t	is_ps_unassoc;		/* ps-poll for unassoc. sta */
17268e8e04eSSam Leffler 	uint32_t	is_ps_badaid;		/* ps-poll w/ incorrect aid */
17368e8e04eSSam Leffler 	uint32_t	is_ps_qempty;		/* ps-poll w/ nothing to send */
17468e8e04eSSam Leffler 	uint32_t	is_ff_badhdr;		/* fast frame rx'd w/ bad hdr */
17568e8e04eSSam Leffler 	uint32_t	is_ff_tooshort;		/* fast frame rx decap error */
17668e8e04eSSam Leffler 	uint32_t	is_ff_split;		/* fast frame rx split error */
17768e8e04eSSam Leffler 	uint32_t	is_ff_decap;		/* fast frames decap'd */
17868e8e04eSSam Leffler 	uint32_t	is_ff_encap;		/* fast frames encap'd for tx */
17968e8e04eSSam Leffler 	uint32_t	is_rx_badbintval;	/* rx frame w/ bogus bintval */
18068e8e04eSSam Leffler 	uint32_t	is_rx_demicfail;	/* rx demic failed */
18168e8e04eSSam Leffler 	uint32_t	is_rx_defrag;		/* rx defragmentation failed */
18268e8e04eSSam Leffler 	uint32_t	is_rx_mgmt;		/* rx management frames */
18368e8e04eSSam Leffler 	uint32_t	is_rx_action;		/* rx action mgt frames */
18468e8e04eSSam Leffler 	uint32_t	is_amsdu_tooshort;	/* A-MSDU rx decap error */
18568e8e04eSSam Leffler 	uint32_t	is_amsdu_split;		/* A-MSDU rx split error */
18668e8e04eSSam Leffler 	uint32_t	is_amsdu_decap;		/* A-MSDU decap'd */
18768e8e04eSSam Leffler 	uint32_t	is_amsdu_encap;		/* A-MSDU encap'd for tx */
18868e8e04eSSam Leffler 	uint32_t	is_ampdu_bar_bad;	/* A-MPDU BAR out of window */
18968e8e04eSSam Leffler 	uint32_t	is_ampdu_bar_oow;	/* A-MPDU BAR before ADDBA */
1901b6167d2SSam Leffler 	uint32_t	is_ampdu_bar_move;	/* A-MPDU BAR moved window */
19168e8e04eSSam Leffler 	uint32_t	is_ampdu_bar_rx;	/* A-MPDU BAR frames handled */
19268e8e04eSSam Leffler 	uint32_t	is_ampdu_rx_flush;	/* A-MPDU frames flushed */
19368e8e04eSSam Leffler 	uint32_t	is_ampdu_rx_oor;	/* A-MPDU frames out-of-order */
19468e8e04eSSam Leffler 	uint32_t	is_ampdu_rx_copy;	/* A-MPDU frames copied down */
1951b6167d2SSam Leffler 	uint32_t	is_ampdu_rx_drop;	/* A-MPDU frames dropped */
1961b6167d2SSam Leffler 	uint32_t	is_tx_badstate;		/* tx discard state != RUN */
1971b6167d2SSam Leffler 	uint32_t	is_tx_notassoc;		/* tx failed, sta not assoc */
1981b6167d2SSam Leffler 	uint32_t	is_tx_classify;		/* tx classification failed */
199b032f27cSSam Leffler 	uint32_t	is_dwds_mcast;		/* discard mcast over dwds */
200b032f27cSSam Leffler 	uint32_t	is_dwds_qdrop;		/* dwds pending frame q full */
2011b6167d2SSam Leffler 	uint32_t	is_ht_assoc_nohtcap;	/* non-HT sta rejected */
2021b6167d2SSam Leffler 	uint32_t	is_ht_assoc_downgrade;	/* HT sta forced to legacy */
2031b6167d2SSam Leffler 	uint32_t	is_ht_assoc_norate;	/* HT assoc w/ rate mismatch */
2041b6167d2SSam Leffler 	uint32_t	is_ampdu_rx_age;	/* A-MPDU sent up 'cuz of age */
2051b6167d2SSam Leffler 	uint32_t	is_ampdu_rx_move;	/* A-MPDU MSDU moved window */
2061b6167d2SSam Leffler 	uint32_t	is_addba_reject;	/* ADDBA reject 'cuz disabled */
2071b6167d2SSam Leffler 	uint32_t	is_addba_norequest;	/* ADDBA response w/o ADDBA */
2081b6167d2SSam Leffler 	uint32_t	is_addba_badtoken;	/* ADDBA response w/ wrong
2091b6167d2SSam Leffler 						   dialogtoken */
210eaff8e26SSam Leffler 	uint32_t	is_addba_badpolicy;	/* ADDBA resp w/ wrong policy */
2111b6167d2SSam Leffler 	uint32_t	is_ampdu_stop;		/* A-MPDU stream stopped */
2121b6167d2SSam Leffler 	uint32_t	is_ampdu_stop_failed;	/* A-MPDU stream not running */
2131b6167d2SSam Leffler 	uint32_t	is_ampdu_rx_reorder;	/* A-MPDU held for rx reorder */
214b032f27cSSam Leffler 	uint32_t	is_scan_bg;		/* background scans started */
215b032f27cSSam Leffler 	uint8_t		is_rx_deauth_code;	/* last rx'd deauth reason */
216b032f27cSSam Leffler 	uint8_t		is_rx_disassoc_code;	/* last rx'd disassoc reason */
217b032f27cSSam Leffler 	uint8_t		is_rx_authfail_code;	/* last rx'd auth fail reason */
218b032f27cSSam Leffler 	uint32_t	is_beacon_miss;		/* beacon miss notification */
219eaff8e26SSam Leffler 	uint32_t	is_spare[13];
2201be50176SSam Leffler };
2211be50176SSam Leffler 
2228a1b9b6aSSam Leffler /*
2238a1b9b6aSSam Leffler  * Max size of optional information elements.  We artificially
2248a1b9b6aSSam Leffler  * constrain this; it's limited only by the max frame size (and
2258a1b9b6aSSam Leffler  * the max parameter size of the wireless extensions).
2268a1b9b6aSSam Leffler  */
2278a1b9b6aSSam Leffler #define	IEEE80211_MAX_OPT_IE	256
2288a1b9b6aSSam Leffler 
2298a1b9b6aSSam Leffler /*
2308a1b9b6aSSam Leffler  * WPA/RSN get/set key request.  Specify the key/cipher
2318a1b9b6aSSam Leffler  * type and whether the key is to be used for sending and/or
2328a1b9b6aSSam Leffler  * receiving.  The key index should be set only when working
2338a1b9b6aSSam Leffler  * with global keys (use IEEE80211_KEYIX_NONE for ``no index'').
2348a1b9b6aSSam Leffler  * Otherwise a unicast/pairwise key is specified by the bssid
2358a1b9b6aSSam Leffler  * (on a station) or mac address (on an ap).  They key length
2368a1b9b6aSSam Leffler  * must include any MIC key data; otherwise it should be no
2371b6167d2SSam Leffler  * more than IEEE80211_KEYBUF_SIZE.
2388a1b9b6aSSam Leffler  */
2398a1b9b6aSSam Leffler struct ieee80211req_key {
24068e8e04eSSam Leffler 	uint8_t		ik_type;	/* key/cipher type */
24168e8e04eSSam Leffler 	uint8_t		ik_pad;
24268e8e04eSSam Leffler 	uint16_t	ik_keyix;	/* key index */
24368e8e04eSSam Leffler 	uint8_t		ik_keylen;	/* key length in bytes */
24468e8e04eSSam Leffler 	uint8_t		ik_flags;
2458a1b9b6aSSam Leffler /* NB: IEEE80211_KEY_XMIT and IEEE80211_KEY_RECV defined elsewhere */
2468a1b9b6aSSam Leffler #define	IEEE80211_KEY_DEFAULT	0x80	/* default xmit key */
24768e8e04eSSam Leffler 	uint8_t		ik_macaddr[IEEE80211_ADDR_LEN];
24868e8e04eSSam Leffler 	uint64_t	ik_keyrsc;	/* key receive sequence counter */
24968e8e04eSSam Leffler 	uint64_t	ik_keytsc;	/* key transmit sequence counter */
25068e8e04eSSam Leffler 	uint8_t		ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];
2518a1b9b6aSSam Leffler };
2528a1b9b6aSSam Leffler 
2538a1b9b6aSSam Leffler /*
2548a1b9b6aSSam Leffler  * Delete a key either by index or address.  Set the index
2558a1b9b6aSSam Leffler  * to IEEE80211_KEYIX_NONE when deleting a unicast key.
2568a1b9b6aSSam Leffler  */
2578a1b9b6aSSam Leffler struct ieee80211req_del_key {
25868e8e04eSSam Leffler 	uint8_t		idk_keyix;	/* key index */
25968e8e04eSSam Leffler 	uint8_t		idk_macaddr[IEEE80211_ADDR_LEN];
2608a1b9b6aSSam Leffler };
2618a1b9b6aSSam Leffler 
2628a1b9b6aSSam Leffler /*
2638a1b9b6aSSam Leffler  * MLME state manipulation request.  IEEE80211_MLME_ASSOC
2648a1b9b6aSSam Leffler  * only makes sense when operating as a station.  The other
2658a1b9b6aSSam Leffler  * requests can be used when operating as a station or an
2668a1b9b6aSSam Leffler  * ap (to effect a station).
2678a1b9b6aSSam Leffler  */
2688a1b9b6aSSam Leffler struct ieee80211req_mlme {
26968e8e04eSSam Leffler 	uint8_t		im_op;		/* operation to perform */
2708a1b9b6aSSam Leffler #define	IEEE80211_MLME_ASSOC		1	/* associate station */
2718a1b9b6aSSam Leffler #define	IEEE80211_MLME_DISASSOC		2	/* disassociate station */
2728a1b9b6aSSam Leffler #define	IEEE80211_MLME_DEAUTH		3	/* deauthenticate station */
2738a1b9b6aSSam Leffler #define	IEEE80211_MLME_AUTHORIZE	4	/* authorize station */
2748a1b9b6aSSam Leffler #define	IEEE80211_MLME_UNAUTHORIZE	5	/* unauthorize station */
275b032f27cSSam Leffler #define	IEEE80211_MLME_AUTH		6	/* authenticate station */
27668e8e04eSSam Leffler 	uint8_t		im_ssid_len;	/* length of optional ssid */
27768e8e04eSSam Leffler 	uint16_t	im_reason;	/* 802.11 reason code */
27868e8e04eSSam Leffler 	uint8_t		im_macaddr[IEEE80211_ADDR_LEN];
27968e8e04eSSam Leffler 	uint8_t		im_ssid[IEEE80211_NWID_LEN];
2808a1b9b6aSSam Leffler };
2818a1b9b6aSSam Leffler 
2828a1b9b6aSSam Leffler /*
2838a1b9b6aSSam Leffler  * MAC ACL operations.
2848a1b9b6aSSam Leffler  */
2858a1b9b6aSSam Leffler enum {
2868a1b9b6aSSam Leffler 	IEEE80211_MACCMD_POLICY_OPEN	= 0,	/* set policy: no ACL's */
2878a1b9b6aSSam Leffler 	IEEE80211_MACCMD_POLICY_ALLOW	= 1,	/* set policy: allow traffic */
2888a1b9b6aSSam Leffler 	IEEE80211_MACCMD_POLICY_DENY	= 2,	/* set policy: deny traffic */
2898a1b9b6aSSam Leffler 	IEEE80211_MACCMD_FLUSH		= 3,	/* flush ACL database */
2908a1b9b6aSSam Leffler 	IEEE80211_MACCMD_DETACH		= 4,	/* detach ACL policy */
291188757f5SSam Leffler 	IEEE80211_MACCMD_POLICY		= 5,	/* get ACL policy */
292188757f5SSam Leffler 	IEEE80211_MACCMD_LIST		= 6,	/* get ACL database */
293b032f27cSSam Leffler 	IEEE80211_MACCMD_POLICY_RADIUS	= 7,	/* set policy: RADIUS managed */
294188757f5SSam Leffler };
295188757f5SSam Leffler 
296188757f5SSam Leffler struct ieee80211req_maclist {
29768e8e04eSSam Leffler 	uint8_t		ml_macaddr[IEEE80211_ADDR_LEN];
2988a1b9b6aSSam Leffler };
2998a1b9b6aSSam Leffler 
3008a1b9b6aSSam Leffler /*
3018a1b9b6aSSam Leffler  * Set the active channel list.  Note this list is
3028a1b9b6aSSam Leffler  * intersected with the available channel list in
3038a1b9b6aSSam Leffler  * calculating the set of channels actually used in
3048a1b9b6aSSam Leffler  * scanning.
3058a1b9b6aSSam Leffler  */
3068a1b9b6aSSam Leffler struct ieee80211req_chanlist {
30768e8e04eSSam Leffler 	uint8_t		ic_channels[IEEE80211_CHAN_BYTES];
3088a1b9b6aSSam Leffler };
3098a1b9b6aSSam Leffler 
3108a1b9b6aSSam Leffler /*
3118a1b9b6aSSam Leffler  * Get the active channel list info.
3128a1b9b6aSSam Leffler  */
3138a1b9b6aSSam Leffler struct ieee80211req_chaninfo {
3148a1b9b6aSSam Leffler 	u_int	ic_nchans;
3158a1b9b6aSSam Leffler 	struct ieee80211_channel ic_chans[IEEE80211_CHAN_MAX];
3168a1b9b6aSSam Leffler };
3178a1b9b6aSSam Leffler 
3188a1b9b6aSSam Leffler /*
3198a1b9b6aSSam Leffler  * Retrieve the WPA/RSN information element for an associated station.
3208a1b9b6aSSam Leffler  */
32168e8e04eSSam Leffler struct ieee80211req_wpaie {	/* old version w/ only one ie */
32268e8e04eSSam Leffler 	uint8_t		wpa_macaddr[IEEE80211_ADDR_LEN];
32368e8e04eSSam Leffler 	uint8_t		wpa_ie[IEEE80211_MAX_OPT_IE];
32468e8e04eSSam Leffler };
32568e8e04eSSam Leffler struct ieee80211req_wpaie2 {
32668e8e04eSSam Leffler 	uint8_t		wpa_macaddr[IEEE80211_ADDR_LEN];
32768e8e04eSSam Leffler 	uint8_t		wpa_ie[IEEE80211_MAX_OPT_IE];
32868e8e04eSSam Leffler 	uint8_t		rsn_ie[IEEE80211_MAX_OPT_IE];
3298a1b9b6aSSam Leffler };
3308a1b9b6aSSam Leffler 
3318a1b9b6aSSam Leffler /*
3328a1b9b6aSSam Leffler  * Retrieve per-node statistics.
3338a1b9b6aSSam Leffler  */
3348a1b9b6aSSam Leffler struct ieee80211req_sta_stats {
3358a1b9b6aSSam Leffler 	union {
3368a1b9b6aSSam Leffler 		/* NB: explicitly force 64-bit alignment */
33768e8e04eSSam Leffler 		uint8_t		macaddr[IEEE80211_ADDR_LEN];
33868e8e04eSSam Leffler 		uint64_t	pad;
3398a1b9b6aSSam Leffler 	} is_u;
3408a1b9b6aSSam Leffler 	struct ieee80211_nodestats is_stats;
3418a1b9b6aSSam Leffler };
3428a1b9b6aSSam Leffler 
3438a1b9b6aSSam Leffler /*
3448a1b9b6aSSam Leffler  * Station information block; the mac address is used
3458a1b9b6aSSam Leffler  * to retrieve other data like stats, unicast key, etc.
3468a1b9b6aSSam Leffler  */
3478a1b9b6aSSam Leffler struct ieee80211req_sta_info {
348b032f27cSSam Leffler 	uint16_t	isi_len;		/* total length (mult of 4) */
34968e8e04eSSam Leffler 	uint16_t	isi_ie_off;		/* offset to IE data */
35068e8e04eSSam Leffler 	uint16_t	isi_ie_len;		/* IE length */
35168e8e04eSSam Leffler 	uint16_t	isi_freq;		/* MHz */
352cd9a2dabSSam Leffler 	uint32_t	isi_flags;		/* channel flags */
35368e8e04eSSam Leffler 	uint16_t	isi_state;		/* state flags */
35468e8e04eSSam Leffler 	uint8_t		isi_authmode;		/* authentication algorithm */
355d1c85daeSSam Leffler 	int8_t		isi_rssi;		/* receive signal strength */
356d1c85daeSSam Leffler 	int8_t		isi_noise;		/* noise floor */
35768e8e04eSSam Leffler 	uint8_t		isi_capinfo;		/* capabilities */
35868e8e04eSSam Leffler 	uint8_t		isi_erp;		/* ERP element */
35968e8e04eSSam Leffler 	uint8_t		isi_macaddr[IEEE80211_ADDR_LEN];
36068e8e04eSSam Leffler 	uint8_t		isi_nrates;
36168e8e04eSSam Leffler 						/* negotiated rates */
36268e8e04eSSam Leffler 	uint8_t		isi_rates[IEEE80211_RATE_MAXSIZE];
363b032f27cSSam Leffler 	uint8_t		isi_txrate;		/* legacy/IEEE rate or MCS */
36468e8e04eSSam Leffler 	uint16_t	isi_associd;		/* assoc response */
36568e8e04eSSam Leffler 	uint16_t	isi_txpower;		/* current tx power */
36668e8e04eSSam Leffler 	uint16_t	isi_vlan;		/* vlan tag */
367b337fbc4SSam Leffler 	/* NB: [IEEE80211_NONQOS_TID] holds seq#'s for non-QoS stations */
368b337fbc4SSam Leffler 	uint16_t	isi_txseqs[IEEE80211_TID_SIZE];/* tx seq #/TID */
369b337fbc4SSam Leffler 	uint16_t	isi_rxseqs[IEEE80211_TID_SIZE];/* rx seq#/TID */
37068e8e04eSSam Leffler 	uint16_t	isi_inact;		/* inactivity timer */
371b032f27cSSam Leffler 	uint16_t	isi_txmbps;		/* current tx rate in .5 Mb/s */
372b032f27cSSam Leffler 	uint32_t	isi_jointime;		/* time of assoc/join */
373b032f27cSSam Leffler 	struct ieee80211_mimo_info isi_mimo;	/* MIMO info for 11n sta's */
3748a1b9b6aSSam Leffler 	/* XXX frag state? */
3758a1b9b6aSSam Leffler 	/* variable length IE data */
3768a1b9b6aSSam Leffler };
3778a1b9b6aSSam Leffler 
3788a1b9b6aSSam Leffler /*
3798a1b9b6aSSam Leffler  * Retrieve per-station information; to retrieve all
3808a1b9b6aSSam Leffler  * specify a mac address of ff:ff:ff:ff:ff:ff.
3818a1b9b6aSSam Leffler  */
3828a1b9b6aSSam Leffler struct ieee80211req_sta_req {
3838a1b9b6aSSam Leffler 	union {
3848a1b9b6aSSam Leffler 		/* NB: explicitly force 64-bit alignment */
38568e8e04eSSam Leffler 		uint8_t		macaddr[IEEE80211_ADDR_LEN];
38668e8e04eSSam Leffler 		uint64_t	pad;
3878a1b9b6aSSam Leffler 	} is_u;
3888a1b9b6aSSam Leffler 	struct ieee80211req_sta_info info[1];	/* variable length */
3898a1b9b6aSSam Leffler };
3908a1b9b6aSSam Leffler 
3918a1b9b6aSSam Leffler /*
3928a1b9b6aSSam Leffler  * Get/set per-station tx power cap.
3938a1b9b6aSSam Leffler  */
3948a1b9b6aSSam Leffler struct ieee80211req_sta_txpow {
39568e8e04eSSam Leffler 	uint8_t		it_macaddr[IEEE80211_ADDR_LEN];
39668e8e04eSSam Leffler 	uint8_t		it_txpow;
3978a1b9b6aSSam Leffler };
3988a1b9b6aSSam Leffler 
3998a1b9b6aSSam Leffler /*
400b032f27cSSam Leffler  * WME parameters manipulated with IEEE80211_IOC_WME_CWMIN
401b032f27cSSam Leffler  * through IEEE80211_IOC_WME_ACKPOLICY are set and return
402b032f27cSSam Leffler  * using i_val and i_len.  i_val holds the value itself.
403b032f27cSSam Leffler  * i_len specifies the AC and, as appropriate, then high bit
404b032f27cSSam Leffler  * specifies whether the operation is to be applied to the
405b032f27cSSam Leffler  * BSS or ourself.
4068a1b9b6aSSam Leffler  */
4078a1b9b6aSSam Leffler #define	IEEE80211_WMEPARAM_SELF	0x0000		/* parameter applies to self */
4088a1b9b6aSSam Leffler #define	IEEE80211_WMEPARAM_BSS	0x8000		/* parameter applies to BSS */
4098a1b9b6aSSam Leffler #define	IEEE80211_WMEPARAM_VAL	0x7fff		/* parameter value */
4108a1b9b6aSSam Leffler 
411b032f27cSSam Leffler /*
412b032f27cSSam Leffler  * Application Information Elements can be appended to a variety
413b032f27cSSam Leffler  * of frames with the IEE80211_IOC_APPIE request.  This request
414b032f27cSSam Leffler  * piggybacks on a normal ieee80211req; the frame type is passed
415b032f27cSSam Leffler  * in i_val as the 802.11 FC0 bytes and the length of the IE data
416b032f27cSSam Leffler  * is passed in i_len.  The data is referenced in i_data.  If i_len
417b032f27cSSam Leffler  * is zero then any previously configured IE data is removed.  At
418b032f27cSSam Leffler  * most IEEE80211_MAX_APPIE data be appened.  Note that multiple
419b032f27cSSam Leffler  * IE's can be supplied; the data is treated opaquely.
420b032f27cSSam Leffler  */
421b032f27cSSam Leffler #define	IEEE80211_MAX_APPIE	1024		/* max app IE data */
422b032f27cSSam Leffler /*
423b032f27cSSam Leffler  * Hack: the WPA authenticator uses this mechanism to specify WPA
424b032f27cSSam Leffler  * ie's that are used instead of the ones normally constructed using
425b032f27cSSam Leffler  * the cipher state setup with separate ioctls.  This avoids issues
426b032f27cSSam Leffler  * like the authenticator ordering ie data differently than the
427b032f27cSSam Leffler  * net80211 layer and needing to keep separate state for WPA and RSN.
428b032f27cSSam Leffler  */
429b032f27cSSam Leffler #define	IEEE80211_APPIE_WPA \
430b032f27cSSam Leffler 	(IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_BEACON | \
431b032f27cSSam Leffler 	 IEEE80211_FC0_SUBTYPE_PROBE_RESP)
432b032f27cSSam Leffler 
433b032f27cSSam Leffler /*
434b032f27cSSam Leffler  * Station mode roaming parameters.  These are maintained
435b032f27cSSam Leffler  * per band/mode and control the roaming algorithm.
436b032f27cSSam Leffler  */
437b032f27cSSam Leffler struct ieee80211_roamparams_req {
438b032f27cSSam Leffler 	struct ieee80211_roamparam params[IEEE80211_MODE_MAX];
439b032f27cSSam Leffler };
440b032f27cSSam Leffler 
441b032f27cSSam Leffler /*
442b032f27cSSam Leffler  * Transmit parameters.  These can be used to set fixed transmit
443b032f27cSSam Leffler  * rate for each operating mode when operating as client or on a
444b032f27cSSam Leffler  * per-client basis according to the capabilities of the client
445b032f27cSSam Leffler  * (e.g. an 11b client associated to an 11g ap) when operating as
446b032f27cSSam Leffler  * an ap.
447b032f27cSSam Leffler  *
448b032f27cSSam Leffler  * MCS are distinguished from legacy rates by or'ing in 0x80.
449b032f27cSSam Leffler  */
450b032f27cSSam Leffler struct ieee80211_txparams_req {
451b032f27cSSam Leffler 	struct ieee80211_txparam params[IEEE80211_MODE_MAX];
452b032f27cSSam Leffler };
453b032f27cSSam Leffler 
454b032f27cSSam Leffler /*
455b032f27cSSam Leffler  * Set regulatory domain state with IEEE80211_IOC_REGDOMAIN.
456b032f27cSSam Leffler  * Note this is both the regulatory description and the channel
457b032f27cSSam Leffler  * list.  The get request for IEEE80211_IOC_REGDOMAIN returns
458b032f27cSSam Leffler  * only the regdomain info; the channel list is obtained
459b032f27cSSam Leffler  * separately with IEEE80211_IOC_CHANINFO.
460b032f27cSSam Leffler  */
461b032f27cSSam Leffler struct ieee80211_regdomain_req {
462b032f27cSSam Leffler 	struct ieee80211_regdomain	rd;
463b032f27cSSam Leffler 	struct ieee80211req_chaninfo	chaninfo;
464b032f27cSSam Leffler };
465b032f27cSSam Leffler 
466b032f27cSSam Leffler /*
467b032f27cSSam Leffler  * Get driver capabilities.  Driver, hardware crypto, and
468b032f27cSSam Leffler  * HT/802.11n capabilities, and a table that describes what
469b032f27cSSam Leffler  * the radio can do.
470b032f27cSSam Leffler  */
471b032f27cSSam Leffler struct ieee80211_devcaps_req {
472b032f27cSSam Leffler 	uint32_t	dc_drivercaps;		/* general driver caps */
473b032f27cSSam Leffler 	uint32_t	dc_cryptocaps;		/* hardware crypto support */
474b032f27cSSam Leffler 	uint32_t	dc_htcaps;		/* HT/802.11n support */
475b032f27cSSam Leffler 	struct ieee80211req_chaninfo dc_chaninfo;
476b032f27cSSam Leffler };
477b032f27cSSam Leffler 
478b032f27cSSam Leffler struct ieee80211_chanswitch_req {
479b032f27cSSam Leffler 	struct ieee80211_channel csa_chan;	/* new channel */
480b032f27cSSam Leffler 	int		csa_mode;		/* CSA mode */
481b032f27cSSam Leffler 	int		csa_count;		/* beacon count to switch */
482b032f27cSSam Leffler };
483b032f27cSSam Leffler 
484b032f27cSSam Leffler /*
485b032f27cSSam Leffler  * Get/set per-station vlan tag.
486b032f27cSSam Leffler  */
487b032f27cSSam Leffler struct ieee80211req_sta_vlan {
488b032f27cSSam Leffler 	uint8_t		sv_macaddr[IEEE80211_ADDR_LEN];
489b032f27cSSam Leffler 	uint16_t	sv_vlan;
490b032f27cSSam Leffler };
491b032f27cSSam Leffler 
4921a1e1d21SSam Leffler #ifdef __FreeBSD__
4931a1e1d21SSam Leffler /*
4941a1e1d21SSam Leffler  * FreeBSD-style ioctls.
4951a1e1d21SSam Leffler  */
4961a1e1d21SSam Leffler /* the first member must be matched with struct ifreq */
4971a1e1d21SSam Leffler struct ieee80211req {
4981a1e1d21SSam Leffler 	char		i_name[IFNAMSIZ];	/* if_name, e.g. "wi0" */
49968e8e04eSSam Leffler 	uint16_t	i_type;			/* req type */
5001a1e1d21SSam Leffler 	int16_t		i_val;			/* Index or simple value */
5011a1e1d21SSam Leffler 	int16_t		i_len;			/* Index or simple value */
5021a1e1d21SSam Leffler 	void		*i_data;		/* Extra data */
5031a1e1d21SSam Leffler };
5041a1e1d21SSam Leffler #define	SIOCS80211		 _IOW('i', 234, struct ieee80211req)
5051a1e1d21SSam Leffler #define	SIOCG80211		_IOWR('i', 235, struct ieee80211req)
50668e8e04eSSam Leffler #define	SIOCG80211STATS		_IOWR('i', 236, struct ifreq)
5071a1e1d21SSam Leffler 
5081a1e1d21SSam Leffler #define IEEE80211_IOC_SSID		1
5091a1e1d21SSam Leffler #define IEEE80211_IOC_NUMSSIDS		2
5101a1e1d21SSam Leffler #define IEEE80211_IOC_WEP		3
5111a1e1d21SSam Leffler #define 	IEEE80211_WEP_NOSUP	-1
5121a1e1d21SSam Leffler #define 	IEEE80211_WEP_OFF	0
5131a1e1d21SSam Leffler #define 	IEEE80211_WEP_ON	1
5141a1e1d21SSam Leffler #define 	IEEE80211_WEP_MIXED	2
5151a1e1d21SSam Leffler #define IEEE80211_IOC_WEPKEY		4
5161a1e1d21SSam Leffler #define IEEE80211_IOC_NUMWEPKEYS	5
5171a1e1d21SSam Leffler #define IEEE80211_IOC_WEPTXKEY		6
5181a1e1d21SSam Leffler #define IEEE80211_IOC_AUTHMODE		7
5191a1e1d21SSam Leffler #define IEEE80211_IOC_STATIONNAME	8
5201a1e1d21SSam Leffler #define IEEE80211_IOC_CHANNEL		9
5211a1e1d21SSam Leffler #define IEEE80211_IOC_POWERSAVE		10
5221a1e1d21SSam Leffler #define 	IEEE80211_POWERSAVE_NOSUP	-1
5231a1e1d21SSam Leffler #define 	IEEE80211_POWERSAVE_OFF		0
5241a1e1d21SSam Leffler #define 	IEEE80211_POWERSAVE_CAM		1
5251a1e1d21SSam Leffler #define 	IEEE80211_POWERSAVE_PSP		2
5261a1e1d21SSam Leffler #define 	IEEE80211_POWERSAVE_PSP_CAM	3
5271a1e1d21SSam Leffler #define 	IEEE80211_POWERSAVE_ON		IEEE80211_POWERSAVE_CAM
5281a1e1d21SSam Leffler #define IEEE80211_IOC_POWERSAVESLEEP	11
52913604e6bSSam Leffler #define	IEEE80211_IOC_RTSTHRESHOLD	12
5302e79ca97SSam Leffler #define IEEE80211_IOC_PROTMODE		13
5312e79ca97SSam Leffler #define 	IEEE80211_PROTMODE_OFF		0
5322e79ca97SSam Leffler #define 	IEEE80211_PROTMODE_CTS		1
5332e79ca97SSam Leffler #define 	IEEE80211_PROTMODE_RTSCTS	2
5348a1b9b6aSSam Leffler #define	IEEE80211_IOC_TXPOWER		14	/* global tx power limit */
5358a1b9b6aSSam Leffler #define	IEEE80211_IOC_BSSID		15
5368a1b9b6aSSam Leffler #define	IEEE80211_IOC_ROAMING		16	/* roaming mode */
5378a1b9b6aSSam Leffler #define	IEEE80211_IOC_PRIVACY		17	/* privacy invoked */
5388a1b9b6aSSam Leffler #define	IEEE80211_IOC_DROPUNENCRYPTED	18	/* discard unencrypted frames */
5398a1b9b6aSSam Leffler #define	IEEE80211_IOC_WPAKEY		19
5408a1b9b6aSSam Leffler #define	IEEE80211_IOC_DELKEY		20
5418a1b9b6aSSam Leffler #define	IEEE80211_IOC_MLME		21
542b032f27cSSam Leffler /* 22 was IEEE80211_IOC_OPTIE, replaced by IEEE80211_IOC_APPIE */
543b032f27cSSam Leffler /* 23 was IEEE80211_IOC_SCAN_REQ */
544239cc3b6SSam Leffler /* 24 was IEEE80211_IOC_SCAN_RESULTS */
5458a1b9b6aSSam Leffler #define	IEEE80211_IOC_COUNTERMEASURES	25	/* WPA/TKIP countermeasures */
5468a1b9b6aSSam Leffler #define	IEEE80211_IOC_WPA		26	/* WPA mode (0,1,2) */
5478a1b9b6aSSam Leffler #define	IEEE80211_IOC_CHANLIST		27	/* channel list */
5488a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME		28	/* WME mode (on, off) */
5498a1b9b6aSSam Leffler #define	IEEE80211_IOC_HIDESSID		29	/* hide SSID mode (on, off) */
5508a1b9b6aSSam Leffler #define	IEEE80211_IOC_APBRIDGE		30	/* AP inter-sta bridging */
551b032f27cSSam Leffler /* 31-35,37-38 were for WPA authenticator settings */
552b032f27cSSam Leffler /* 36 was IEEE80211_IOC_DRIVER_CAPS */
5538a1b9b6aSSam Leffler #define	IEEE80211_IOC_WPAIE		39	/* WPA information element */
5548a1b9b6aSSam Leffler #define	IEEE80211_IOC_STA_STATS		40	/* per-station statistics */
5558a1b9b6aSSam Leffler #define	IEEE80211_IOC_MACCMD		41	/* MAC ACL operation */
5568a1b9b6aSSam Leffler #define	IEEE80211_IOC_CHANINFO		42	/* channel info list */
5578a1b9b6aSSam Leffler #define	IEEE80211_IOC_TXPOWMAX		43	/* max tx power for channel */
5588a1b9b6aSSam Leffler #define	IEEE80211_IOC_STA_TXPOW		44	/* per-station tx power limit */
559d1c85daeSSam Leffler /* 45 was IEEE80211_IOC_STA_INFO */
5608a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME_CWMIN		46	/* WME: ECWmin */
5618a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME_CWMAX		47	/* WME: ECWmax */
5628a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME_AIFS		48	/* WME: AIFSN */
5638a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME_TXOPLIMIT	49	/* WME: txops limit */
5648a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME_ACM		50	/* WME: ACM (bss only) */
5658a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME_ACKPOLICY	51	/* WME: ACK policy (!bss only)*/
5668a1b9b6aSSam Leffler #define	IEEE80211_IOC_DTIM_PERIOD	52	/* DTIM period (beacons) */
5678a1b9b6aSSam Leffler #define	IEEE80211_IOC_BEACON_INTERVAL	53	/* beacon interval (ms) */
5688a1b9b6aSSam Leffler #define	IEEE80211_IOC_ADDMAC		54	/* add sta to MAC ACL table */
5698a1b9b6aSSam Leffler #define	IEEE80211_IOC_DELMAC		55	/* del sta from MAC ACL table */
570c4f040c3SSam Leffler #define	IEEE80211_IOC_PUREG		56	/* pure 11g (no 11b stations) */
57168e8e04eSSam Leffler #define	IEEE80211_IOC_FF		57	/* ATH fast frames (on, off) */
57268e8e04eSSam Leffler #define	IEEE80211_IOC_TURBOP		58	/* ATH turbo' (on, off) */
57368e8e04eSSam Leffler #define	IEEE80211_IOC_BGSCAN		59	/* bg scanning (on, off) */
57468e8e04eSSam Leffler #define	IEEE80211_IOC_BGSCAN_IDLE	60	/* bg scan idle threshold */
57568e8e04eSSam Leffler #define	IEEE80211_IOC_BGSCAN_INTERVAL	61	/* bg scan interval */
57668e8e04eSSam Leffler #define	IEEE80211_IOC_SCANVALID		65	/* scan cache valid threshold */
577b032f27cSSam Leffler /* 66-72 were IEEE80211_IOC_ROAM_* and IEEE80211_IOC_MCAST_RATE */
57870231e3dSSam Leffler #define	IEEE80211_IOC_FRAGTHRESHOLD	73	/* tx fragmentation threshold */
579c27e4e31SSam Leffler #define	IEEE80211_IOC_BURST		75	/* packet bursting */
580239cc3b6SSam Leffler #define	IEEE80211_IOC_SCAN_RESULTS	76	/* get scan results */
581546786c9SSam Leffler #define	IEEE80211_IOC_BMISSTHRESHOLD	77	/* beacon miss threshold */
582d1c85daeSSam Leffler #define	IEEE80211_IOC_STA_INFO		78	/* station/neighbor info */
58368e8e04eSSam Leffler #define	IEEE80211_IOC_WPAIE2		79	/* WPA+RSN info elements */
58468e8e04eSSam Leffler #define	IEEE80211_IOC_CURCHAN		80	/* current channel */
58568e8e04eSSam Leffler #define	IEEE80211_IOC_SHORTGI		81	/* 802.11n half GI */
58668e8e04eSSam Leffler #define	IEEE80211_IOC_AMPDU		82	/* 802.11n A-MPDU (on, off) */
58768e8e04eSSam Leffler #define	IEEE80211_IOC_AMPDU_LIMIT	83	/* A-MPDU length limit */
58868e8e04eSSam Leffler #define	IEEE80211_IOC_AMPDU_DENSITY	84	/* A-MPDU density */
58968e8e04eSSam Leffler #define	IEEE80211_IOC_AMSDU		85	/* 802.11n A-MSDU (on, off) */
59068e8e04eSSam Leffler #define	IEEE80211_IOC_AMSDU_LIMIT	86	/* A-MSDU length limit */
59168e8e04eSSam Leffler #define	IEEE80211_IOC_PUREN		87	/* pure 11n (no legacy sta's) */
59268e8e04eSSam Leffler #define	IEEE80211_IOC_DOTH		88	/* 802.11h (on, off) */
593b032f27cSSam Leffler /* 89-91 were regulatory items */
59468e8e04eSSam Leffler #define	IEEE80211_IOC_HTCOMPAT		92	/* support pre-D1.10 HT ie's */
595b032f27cSSam Leffler #define	IEEE80211_IOC_DWDS		93	/* DWDS/4-address handling */
596c066143cSSam Leffler #define	IEEE80211_IOC_INACTIVITY	94	/* sta inactivity handling */
597b032f27cSSam Leffler #define	IEEE80211_IOC_APPIE		95	/* application IE's */
598b032f27cSSam Leffler #define	IEEE80211_IOC_WPS		96	/* WPS operation */
599b032f27cSSam Leffler #define	IEEE80211_IOC_TSN		97	/* TSN operation */
600b032f27cSSam Leffler #define	IEEE80211_IOC_DEVCAPS		98	/* driver+device capabilities */
601b032f27cSSam Leffler #define	IEEE80211_IOC_CHANSWITCH	99	/* start 11h channel switch */
602b032f27cSSam Leffler #define	IEEE80211_IOC_DFS		100	/* DFS (on, off) */
603b032f27cSSam Leffler #define	IEEE80211_IOC_DOTD		101	/* 802.11d (on, off) */
6041b6167d2SSam Leffler #define IEEE80211_IOC_HTPROTMODE	102	/* HT protection (off, rts) */
605b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_REQ		103	/* scan w/ specified params */
606b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_CANCEL	104	/* cancel ongoing scan */
6071b6167d2SSam Leffler #define	IEEE80211_IOC_HTCONF		105	/* HT config (off, HT20, HT40)*/
608b032f27cSSam Leffler #define	IEEE80211_IOC_REGDOMAIN		106	/* regulatory domain info */
609b032f27cSSam Leffler #define	IEEE80211_IOC_ROAM		107	/* roaming params en masse */
610b032f27cSSam Leffler #define	IEEE80211_IOC_TXPARAMS		108	/* tx parameters */
611b032f27cSSam Leffler #define	IEEE80211_IOC_STA_VLAN		109	/* per-station vlan tag */
612b032f27cSSam Leffler 
613b032f27cSSam Leffler /*
614b032f27cSSam Leffler  * Parameters for controlling a scan requested with
615b032f27cSSam Leffler  * IEEE80211_IOC_SCAN_REQ.
616b032f27cSSam Leffler  *
617b032f27cSSam Leffler  * Active scans cause ProbeRequest frames to be issued for each
618b032f27cSSam Leffler  * specified ssid and, by default, a broadcast ProbeRequest frame.
619b032f27cSSam Leffler  * The set of ssid's is specified in the request.
620b032f27cSSam Leffler  *
621b032f27cSSam Leffler  * By default the scan will cause a BSS to be joined (in station/adhoc
622b032f27cSSam Leffler  * mode) or a channel to be selected for operation (hostap mode).
623b032f27cSSam Leffler  * To disable that specify IEEE80211_IOC_SCAN_NOPICK and if the
624b032f27cSSam Leffler  *
625b032f27cSSam Leffler  * If the station is currently associated to an AP then a scan request
626b032f27cSSam Leffler  * will cause the station to leave the current channel and potentially
627b032f27cSSam Leffler  * miss frames from the AP.  Alternatively the station may notify the
628b032f27cSSam Leffler  * AP that it is going into power save mode before it leaves the channel.
629b032f27cSSam Leffler  * This ensures frames for the station are buffered by the AP.  This is
630b032f27cSSam Leffler  * termed a ``bg scan'' and is requested with the IEEE80211_IOC_SCAN_BGSCAN
631b032f27cSSam Leffler  * flag.  Background scans may take longer than foreground scans and may
632b032f27cSSam Leffler  * be preempted by traffic.  If a station is not associated to an AP
633b032f27cSSam Leffler  * then a request for a background scan is automatically done in the
634b032f27cSSam Leffler  * foreground.
635b032f27cSSam Leffler  *
636b032f27cSSam Leffler  * The results of the scan request are cached by the system.  This
637b032f27cSSam Leffler  * information is aged out and/or invalidated based on events like not
638b032f27cSSam Leffler  * being able to associated to an AP.  To flush the current cache
639b032f27cSSam Leffler  * contents before doing a scan the IEEE80211_IOC_SCAN_FLUSH flag may
640b032f27cSSam Leffler  * be specified.
641b032f27cSSam Leffler  *
642b032f27cSSam Leffler  * By default the scan will be done until a suitable AP is located
643b032f27cSSam Leffler  * or a channel is found for use.  A scan can also be constrained
644b032f27cSSam Leffler  * to be done once (IEEE80211_IOC_SCAN_ONCE) or to last for no more
645b032f27cSSam Leffler  * than a specified duration.
646b032f27cSSam Leffler  */
647b032f27cSSam Leffler struct ieee80211_scan_req {
648b032f27cSSam Leffler 	int		sr_flags;
649b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_NOPICK	0x00001	/* scan only, no selection */
650b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_ACTIVE	0x00002	/* active scan (probe req) */
651b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_PICK1ST	0x00004	/* ``hey sailor'' mode */
652b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_BGSCAN	0x00008	/* bg scan, exit ps at end */
653b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_ONCE		0x00010	/* do one complete pass */
654b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_NOBCAST	0x00020	/* don't send bcast probe req */
655b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_NOJOIN	0x00040	/* no auto-sequencing */
656b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_FLUSH	0x10000	/* flush scan cache first */
657b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_CHECK	0x20000	/* check scan cache first */
658b032f27cSSam Leffler 	u_int		sr_duration;		/* duration (ms) */
659b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_DURATION_MIN	1
660b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_DURATION_MAX	0x7fffffff
661b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_FOREVER	IEEE80211_IOC_SCAN_DURATION_MAX
662b032f27cSSam Leffler 	u_int		sr_mindwell;		/* min channel dwelltime (ms) */
663b032f27cSSam Leffler 	u_int		sr_maxdwell;		/* max channel dwelltime (ms) */
664b032f27cSSam Leffler 	int		sr_nssid;
665b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_MAX_SSID	3
666b032f27cSSam Leffler 	struct {
667b032f27cSSam Leffler 		int	 len;				/* length in bytes */
668b032f27cSSam Leffler 		uint8_t ssid[IEEE80211_NWID_LEN];	/* ssid contents */
669b032f27cSSam Leffler 	} sr_ssid[IEEE80211_IOC_SCAN_MAX_SSID];
670b032f27cSSam Leffler };
6711a1e1d21SSam Leffler 
6728a1b9b6aSSam Leffler /*
6738a1b9b6aSSam Leffler  * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS.
674239cc3b6SSam Leffler  * Each result is a fixed size structure followed by a variable
675239cc3b6SSam Leffler  * length SSID and one or more variable length information elements.
676239cc3b6SSam Leffler  * The size of each variable length item is found in the fixed
677239cc3b6SSam Leffler  * size structure and the entire length of the record is specified
678239cc3b6SSam Leffler  * in isr_len.  Result records are rounded to a multiple of 4 bytes.
6798a1b9b6aSSam Leffler  */
6808a1b9b6aSSam Leffler struct ieee80211req_scan_result {
681b032f27cSSam Leffler 	uint16_t	isr_len;		/* total length (mult of 4) */
682b032f27cSSam Leffler 	uint16_t	isr_ie_off;		/* offset to SSID+IE data */
68368e8e04eSSam Leffler 	uint16_t	isr_ie_len;		/* IE length */
68468e8e04eSSam Leffler 	uint16_t	isr_freq;		/* MHz */
68568e8e04eSSam Leffler 	uint16_t	isr_flags;		/* channel flags */
686239cc3b6SSam Leffler 	int8_t		isr_noise;
687239cc3b6SSam Leffler 	int8_t		isr_rssi;
68868e8e04eSSam Leffler 	uint8_t		isr_intval;		/* beacon interval */
68968e8e04eSSam Leffler 	uint8_t		isr_capinfo;		/* capabilities */
69068e8e04eSSam Leffler 	uint8_t		isr_erp;		/* ERP element */
69168e8e04eSSam Leffler 	uint8_t		isr_bssid[IEEE80211_ADDR_LEN];
69268e8e04eSSam Leffler 	uint8_t		isr_nrates;
69368e8e04eSSam Leffler 	uint8_t		isr_rates[IEEE80211_RATE_MAXSIZE];
69468e8e04eSSam Leffler 	uint8_t		isr_ssid_len;		/* SSID length */
6958a1b9b6aSSam Leffler 	/* variable length SSID followed by IE data */
6968a1b9b6aSSam Leffler };
6971be50176SSam Leffler 
698b032f27cSSam Leffler /*
699b032f27cSSam Leffler  * Virtual AP cloning parameters.  The parent device must
700b032f27cSSam Leffler  * be a vap-capable device.  All parameters specified with
701b032f27cSSam Leffler  * the clone request are fixed for the lifetime of the vap.
702b032f27cSSam Leffler  *
703b032f27cSSam Leffler  * There are two flavors of WDS vaps: legacy and dynamic.
704b032f27cSSam Leffler  * Legacy WDS operation implements a static binding between
705b032f27cSSam Leffler  * two stations encapsulating traffic in 4-address frames.
706b032f27cSSam Leffler  * Dynamic WDS vaps are created when a station associates to
707b032f27cSSam Leffler  * an AP and sends a 4-address frame.  If the AP vap is
708b032f27cSSam Leffler  * configured to support WDS then this will generate an
709b032f27cSSam Leffler  * event to user programs listening on the routing socket
710b032f27cSSam Leffler  * and a Dynamic WDS vap will be created to handle traffic
711b032f27cSSam Leffler  * to/from that station.  In both cases the bssid of the
712b032f27cSSam Leffler  * peer must be specified when creating the vap.
713b032f27cSSam Leffler  *
714b032f27cSSam Leffler  * By default a vap will inherit the mac address/bssid of
715b032f27cSSam Leffler  * the underlying device.  To request a unique address the
716b032f27cSSam Leffler  * IEEE80211_CLONE_BSSID flag should be supplied.  This is
717b032f27cSSam Leffler  * meaningless for WDS vaps as they share the bssid of an
718b032f27cSSam Leffler  * AP vap that must otherwise exist.  Note that some devices
719b032f27cSSam Leffler  * may not be able to support multiple addresses.
720b032f27cSSam Leffler  *
721b032f27cSSam Leffler  * Station mode vap's normally depend on the device to notice
722b032f27cSSam Leffler  * when the AP stops sending beacon frames.  If IEEE80211_CLONE_NOBEACONS
723b032f27cSSam Leffler  * is specified the net80211 layer will do this in s/w.  This
724b032f27cSSam Leffler  * is mostly useful when setting up a WDS repeater/extender where
725b032f27cSSam Leffler  * an AP vap is combined with a sta vap and the device isn't able
726b032f27cSSam Leffler  * to track beacon frames in hardware.
727b032f27cSSam Leffler  */
72868e8e04eSSam Leffler struct ieee80211_clone_params {
72968e8e04eSSam Leffler 	char	icp_parent[IFNAMSIZ];		/* parent device */
730b032f27cSSam Leffler 	uint16_t icp_opmode;			/* operating mode */
731b032f27cSSam Leffler 	uint16_t icp_flags;			/* see below */
732b032f27cSSam Leffler 	uint8_t	icp_bssid[IEEE80211_ADDR_LEN];	/* for WDS links */
733b032f27cSSam Leffler 	uint8_t	icp_macaddr[IEEE80211_ADDR_LEN];/* local address */
73468e8e04eSSam Leffler };
735b032f27cSSam Leffler #define	IEEE80211_CLONE_BSSID		0x0001	/* allocate unique mac/bssid */
736b032f27cSSam Leffler #define	IEEE80211_CLONE_NOBEACONS	0x0002	/* don't setup beacon timers */
737b032f27cSSam Leffler #define	IEEE80211_CLONE_WDSLEGACY	0x0004	/* legacy WDS processing */
738b032f27cSSam Leffler #define	IEEE80211_CLONE_MACADDR		0x0008	/* use specified mac addr */
7391a1e1d21SSam Leffler #endif /* __FreeBSD__ */
7401a1e1d21SSam Leffler 
7411a1e1d21SSam Leffler #endif /* _NET80211_IEEE80211_IOCTL_H_ */
742