xref: /freebsd/sys/net80211/ieee80211_ioctl.h (revision 519f677aff17ce417e74f2f2727313b5b3fed687)
11a1e1d21SSam Leffler /*-
27535e66aSSam Leffler  * Copyright (c) 2001 Atsushi Onoe
310ad9a77SSam Leffler  * Copyright (c) 2002-2009 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 */
67a43cee70SSam Leffler 	uint32_t	ns_tx_ctrl;		/* tx control frames */
6868e8e04eSSam Leffler 	uint32_t	ns_tx_ucast;		/* tx unicast frames */
6968e8e04eSSam Leffler 	uint32_t	ns_tx_mcast;		/* tx multi/broadcast frames */
7068e8e04eSSam Leffler 	uint64_t	ns_tx_bytes;		/* tx data count (bytes) */
7168e8e04eSSam Leffler 	uint32_t	ns_tx_probereq;		/* tx probe request frames */
728a1b9b6aSSam Leffler 
7368e8e04eSSam Leffler 	uint32_t	ns_tx_novlantag;	/* tx discard 'cuz no tag */
7468e8e04eSSam Leffler 	uint32_t	ns_tx_vlanmismatch;	/* tx discard 'cuz bad tag */
758a1b9b6aSSam Leffler 
7668e8e04eSSam Leffler 	uint32_t	ns_ps_discard;		/* ps discard 'cuz of age */
778a1b9b6aSSam Leffler 
788a1b9b6aSSam Leffler 	/* MIB-related state */
7968e8e04eSSam Leffler 	uint32_t	ns_tx_assoc;		/* [re]associations */
8068e8e04eSSam Leffler 	uint32_t	ns_tx_assoc_fail;	/* [re]association failures */
8168e8e04eSSam Leffler 	uint32_t	ns_tx_auth;		/* [re]authentications */
8268e8e04eSSam Leffler 	uint32_t	ns_tx_auth_fail;	/* [re]authentication failures*/
8368e8e04eSSam Leffler 	uint32_t	ns_tx_deauth;		/* deauthentications */
8468e8e04eSSam Leffler 	uint32_t	ns_tx_deauth_code;	/* last deauth reason */
8568e8e04eSSam Leffler 	uint32_t	ns_tx_disassoc;		/* disassociations */
8668e8e04eSSam Leffler 	uint32_t	ns_tx_disassoc_code;	/* last disassociation reason */
87a43cee70SSam Leffler 	uint32_t	ns_spare[8];
888a1b9b6aSSam Leffler };
898a1b9b6aSSam Leffler 
908a1b9b6aSSam Leffler /*
918a1b9b6aSSam Leffler  * Summary statistics.
928a1b9b6aSSam Leffler  */
931be50176SSam Leffler struct ieee80211_stats {
9468e8e04eSSam Leffler 	uint32_t	is_rx_badversion;	/* rx frame with bad version */
9568e8e04eSSam Leffler 	uint32_t	is_rx_tooshort;		/* rx frame too short */
9668e8e04eSSam Leffler 	uint32_t	is_rx_wrongbss;		/* rx from wrong bssid */
9768e8e04eSSam Leffler 	uint32_t	is_rx_dup;		/* rx discard 'cuz dup */
9868e8e04eSSam Leffler 	uint32_t	is_rx_wrongdir;		/* rx w/ wrong direction */
9968e8e04eSSam Leffler 	uint32_t	is_rx_mcastecho;	/* rx discard 'cuz mcast echo */
10068e8e04eSSam Leffler 	uint32_t	is_rx_notassoc;		/* rx discard 'cuz sta !assoc */
10168e8e04eSSam Leffler 	uint32_t	is_rx_noprivacy;	/* rx w/ wep but privacy off */
10268e8e04eSSam Leffler 	uint32_t	is_rx_unencrypted;	/* rx w/o wep and privacy on */
10368e8e04eSSam Leffler 	uint32_t	is_rx_wepfail;		/* rx wep processing failed */
10468e8e04eSSam Leffler 	uint32_t	is_rx_decap;		/* rx decapsulation failed */
10568e8e04eSSam Leffler 	uint32_t	is_rx_mgtdiscard;	/* rx discard mgt frames */
106a43cee70SSam Leffler 	uint32_t	is_rx_ctl;		/* rx ctrl frames */
10768e8e04eSSam Leffler 	uint32_t	is_rx_beacon;		/* rx beacon frames */
10868e8e04eSSam Leffler 	uint32_t	is_rx_rstoobig;		/* rx rate set truncated */
10968e8e04eSSam Leffler 	uint32_t	is_rx_elem_missing;	/* rx required element missing*/
11068e8e04eSSam Leffler 	uint32_t	is_rx_elem_toobig;	/* rx element too big */
11168e8e04eSSam Leffler 	uint32_t	is_rx_elem_toosmall;	/* rx element too small */
11268e8e04eSSam Leffler 	uint32_t	is_rx_elem_unknown;	/* rx element unknown */
11368e8e04eSSam Leffler 	uint32_t	is_rx_badchan;		/* rx frame w/ invalid chan */
11468e8e04eSSam Leffler 	uint32_t	is_rx_chanmismatch;	/* rx frame chan mismatch */
11568e8e04eSSam Leffler 	uint32_t	is_rx_nodealloc;	/* rx frame dropped */
11668e8e04eSSam Leffler 	uint32_t	is_rx_ssidmismatch;	/* rx frame ssid mismatch  */
11768e8e04eSSam Leffler 	uint32_t	is_rx_auth_unsupported;	/* rx w/ unsupported auth alg */
11868e8e04eSSam Leffler 	uint32_t	is_rx_auth_fail;	/* rx sta auth failure */
11968e8e04eSSam Leffler 	uint32_t	is_rx_auth_countermeasures;/* rx auth discard 'cuz CM */
12068e8e04eSSam Leffler 	uint32_t	is_rx_assoc_bss;	/* rx assoc from wrong bssid */
12168e8e04eSSam Leffler 	uint32_t	is_rx_assoc_notauth;	/* rx assoc w/o auth */
12268e8e04eSSam Leffler 	uint32_t	is_rx_assoc_capmismatch;/* rx assoc w/ cap mismatch */
12368e8e04eSSam Leffler 	uint32_t	is_rx_assoc_norate;	/* rx assoc w/ no rate match */
12468e8e04eSSam Leffler 	uint32_t	is_rx_assoc_badwpaie;	/* rx assoc w/ bad WPA IE */
12568e8e04eSSam Leffler 	uint32_t	is_rx_deauth;		/* rx deauthentication */
12668e8e04eSSam Leffler 	uint32_t	is_rx_disassoc;		/* rx disassociation */
12768e8e04eSSam Leffler 	uint32_t	is_rx_badsubtype;	/* rx frame w/ unknown subtype*/
12868e8e04eSSam Leffler 	uint32_t	is_rx_nobuf;		/* rx failed for lack of buf */
12968e8e04eSSam Leffler 	uint32_t	is_rx_decryptcrc;	/* rx decrypt failed on crc */
13068e8e04eSSam Leffler 	uint32_t	is_rx_ahdemo_mgt;	/* rx discard ahdemo mgt frame*/
13168e8e04eSSam Leffler 	uint32_t	is_rx_bad_auth;		/* rx bad auth request */
13268e8e04eSSam Leffler 	uint32_t	is_rx_unauth;		/* rx on unauthorized port */
13368e8e04eSSam Leffler 	uint32_t	is_rx_badkeyid;		/* rx w/ incorrect keyid */
13468e8e04eSSam Leffler 	uint32_t	is_rx_ccmpreplay;	/* rx seq# violation (CCMP) */
13568e8e04eSSam Leffler 	uint32_t	is_rx_ccmpformat;	/* rx format bad (CCMP) */
13668e8e04eSSam Leffler 	uint32_t	is_rx_ccmpmic;		/* rx MIC check failed (CCMP) */
13768e8e04eSSam Leffler 	uint32_t	is_rx_tkipreplay;	/* rx seq# violation (TKIP) */
13868e8e04eSSam Leffler 	uint32_t	is_rx_tkipformat;	/* rx format bad (TKIP) */
13968e8e04eSSam Leffler 	uint32_t	is_rx_tkipmic;		/* rx MIC check failed (TKIP) */
14068e8e04eSSam Leffler 	uint32_t	is_rx_tkipicv;		/* rx ICV check failed (TKIP) */
14168e8e04eSSam Leffler 	uint32_t	is_rx_badcipher;	/* rx failed 'cuz key type */
14268e8e04eSSam Leffler 	uint32_t	is_rx_nocipherctx;	/* rx failed 'cuz key !setup */
14368e8e04eSSam Leffler 	uint32_t	is_rx_acl;		/* rx discard 'cuz acl policy */
14468e8e04eSSam Leffler 	uint32_t	is_tx_nobuf;		/* tx failed for lack of buf */
14568e8e04eSSam Leffler 	uint32_t	is_tx_nonode;		/* tx failed for no node */
14668e8e04eSSam Leffler 	uint32_t	is_tx_unknownmgt;	/* tx of unknown mgt frame */
14768e8e04eSSam Leffler 	uint32_t	is_tx_badcipher;	/* tx failed 'cuz key type */
14868e8e04eSSam Leffler 	uint32_t	is_tx_nodefkey;		/* tx failed 'cuz no defkey */
14968e8e04eSSam Leffler 	uint32_t	is_tx_noheadroom;	/* tx failed 'cuz no space */
15068e8e04eSSam Leffler 	uint32_t	is_tx_fragframes;	/* tx frames fragmented */
15168e8e04eSSam Leffler 	uint32_t	is_tx_frags;		/* tx fragments created */
15268e8e04eSSam Leffler 	uint32_t	is_scan_active;		/* active scans started */
15368e8e04eSSam Leffler 	uint32_t	is_scan_passive;	/* passive scans started */
15468e8e04eSSam Leffler 	uint32_t	is_node_timeout;	/* nodes timed out inactivity */
15568e8e04eSSam Leffler 	uint32_t	is_crypto_nomem;	/* no memory for crypto ctx */
15668e8e04eSSam Leffler 	uint32_t	is_crypto_tkip;		/* tkip crypto done in s/w */
15768e8e04eSSam Leffler 	uint32_t	is_crypto_tkipenmic;	/* tkip en-MIC done in s/w */
15868e8e04eSSam Leffler 	uint32_t	is_crypto_tkipdemic;	/* tkip de-MIC done in s/w */
15968e8e04eSSam Leffler 	uint32_t	is_crypto_tkipcm;	/* tkip counter measures */
16068e8e04eSSam Leffler 	uint32_t	is_crypto_ccmp;		/* ccmp crypto done in s/w */
16168e8e04eSSam Leffler 	uint32_t	is_crypto_wep;		/* wep crypto done in s/w */
16268e8e04eSSam Leffler 	uint32_t	is_crypto_setkey_cipher;/* cipher rejected key */
16368e8e04eSSam Leffler 	uint32_t	is_crypto_setkey_nokey;	/* no key index for setkey */
16468e8e04eSSam Leffler 	uint32_t	is_crypto_delkey;	/* driver key delete failed */
16568e8e04eSSam Leffler 	uint32_t	is_crypto_badcipher;	/* unknown cipher */
16668e8e04eSSam Leffler 	uint32_t	is_crypto_nocipher;	/* cipher not available */
16768e8e04eSSam Leffler 	uint32_t	is_crypto_attachfail;	/* cipher attach failed */
16868e8e04eSSam Leffler 	uint32_t	is_crypto_swfallback;	/* cipher fallback to s/w */
16968e8e04eSSam Leffler 	uint32_t	is_crypto_keyfail;	/* driver key alloc failed */
17068e8e04eSSam Leffler 	uint32_t	is_crypto_enmicfail;	/* en-MIC failed */
17168e8e04eSSam Leffler 	uint32_t	is_ibss_capmismatch;	/* merge failed-cap mismatch */
17268e8e04eSSam Leffler 	uint32_t	is_ibss_norate;		/* merge failed-rate mismatch */
17368e8e04eSSam Leffler 	uint32_t	is_ps_unassoc;		/* ps-poll for unassoc. sta */
17468e8e04eSSam Leffler 	uint32_t	is_ps_badaid;		/* ps-poll w/ incorrect aid */
17568e8e04eSSam Leffler 	uint32_t	is_ps_qempty;		/* ps-poll w/ nothing to send */
17668e8e04eSSam Leffler 	uint32_t	is_ff_badhdr;		/* fast frame rx'd w/ bad hdr */
17768e8e04eSSam Leffler 	uint32_t	is_ff_tooshort;		/* fast frame rx decap error */
17868e8e04eSSam Leffler 	uint32_t	is_ff_split;		/* fast frame rx split error */
17968e8e04eSSam Leffler 	uint32_t	is_ff_decap;		/* fast frames decap'd */
18068e8e04eSSam Leffler 	uint32_t	is_ff_encap;		/* fast frames encap'd for tx */
18168e8e04eSSam Leffler 	uint32_t	is_rx_badbintval;	/* rx frame w/ bogus bintval */
18268e8e04eSSam Leffler 	uint32_t	is_rx_demicfail;	/* rx demic failed */
18368e8e04eSSam Leffler 	uint32_t	is_rx_defrag;		/* rx defragmentation failed */
18468e8e04eSSam Leffler 	uint32_t	is_rx_mgmt;		/* rx management frames */
18568e8e04eSSam Leffler 	uint32_t	is_rx_action;		/* rx action mgt frames */
18668e8e04eSSam Leffler 	uint32_t	is_amsdu_tooshort;	/* A-MSDU rx decap error */
18768e8e04eSSam Leffler 	uint32_t	is_amsdu_split;		/* A-MSDU rx split error */
18868e8e04eSSam Leffler 	uint32_t	is_amsdu_decap;		/* A-MSDU decap'd */
18968e8e04eSSam Leffler 	uint32_t	is_amsdu_encap;		/* A-MSDU encap'd for tx */
19068e8e04eSSam Leffler 	uint32_t	is_ampdu_bar_bad;	/* A-MPDU BAR out of window */
19168e8e04eSSam Leffler 	uint32_t	is_ampdu_bar_oow;	/* A-MPDU BAR before ADDBA */
1921b6167d2SSam Leffler 	uint32_t	is_ampdu_bar_move;	/* A-MPDU BAR moved window */
19368e8e04eSSam Leffler 	uint32_t	is_ampdu_bar_rx;	/* A-MPDU BAR frames handled */
19468e8e04eSSam Leffler 	uint32_t	is_ampdu_rx_flush;	/* A-MPDU frames flushed */
19568e8e04eSSam Leffler 	uint32_t	is_ampdu_rx_oor;	/* A-MPDU frames out-of-order */
19668e8e04eSSam Leffler 	uint32_t	is_ampdu_rx_copy;	/* A-MPDU frames copied down */
1971b6167d2SSam Leffler 	uint32_t	is_ampdu_rx_drop;	/* A-MPDU frames dropped */
1981b6167d2SSam Leffler 	uint32_t	is_tx_badstate;		/* tx discard state != RUN */
1991b6167d2SSam Leffler 	uint32_t	is_tx_notassoc;		/* tx failed, sta not assoc */
2001b6167d2SSam Leffler 	uint32_t	is_tx_classify;		/* tx classification failed */
201b032f27cSSam Leffler 	uint32_t	is_dwds_mcast;		/* discard mcast over dwds */
202b032f27cSSam Leffler 	uint32_t	is_dwds_qdrop;		/* dwds pending frame q full */
2031b6167d2SSam Leffler 	uint32_t	is_ht_assoc_nohtcap;	/* non-HT sta rejected */
2041b6167d2SSam Leffler 	uint32_t	is_ht_assoc_downgrade;	/* HT sta forced to legacy */
2051b6167d2SSam Leffler 	uint32_t	is_ht_assoc_norate;	/* HT assoc w/ rate mismatch */
2061b6167d2SSam Leffler 	uint32_t	is_ampdu_rx_age;	/* A-MPDU sent up 'cuz of age */
2071b6167d2SSam Leffler 	uint32_t	is_ampdu_rx_move;	/* A-MPDU MSDU moved window */
2081b6167d2SSam Leffler 	uint32_t	is_addba_reject;	/* ADDBA reject 'cuz disabled */
2091b6167d2SSam Leffler 	uint32_t	is_addba_norequest;	/* ADDBA response w/o ADDBA */
2101b6167d2SSam Leffler 	uint32_t	is_addba_badtoken;	/* ADDBA response w/ wrong
2111b6167d2SSam Leffler 						   dialogtoken */
212eaff8e26SSam Leffler 	uint32_t	is_addba_badpolicy;	/* ADDBA resp w/ wrong policy */
2131b6167d2SSam Leffler 	uint32_t	is_ampdu_stop;		/* A-MPDU stream stopped */
2141b6167d2SSam Leffler 	uint32_t	is_ampdu_stop_failed;	/* A-MPDU stream not running */
2151b6167d2SSam Leffler 	uint32_t	is_ampdu_rx_reorder;	/* A-MPDU held for rx reorder */
216b032f27cSSam Leffler 	uint32_t	is_scan_bg;		/* background scans started */
217b032f27cSSam Leffler 	uint8_t		is_rx_deauth_code;	/* last rx'd deauth reason */
218b032f27cSSam Leffler 	uint8_t		is_rx_disassoc_code;	/* last rx'd disassoc reason */
219b032f27cSSam Leffler 	uint8_t		is_rx_authfail_code;	/* last rx'd auth fail reason */
220b032f27cSSam Leffler 	uint32_t	is_beacon_miss;		/* beacon miss notification */
22110ad9a77SSam Leffler 	uint32_t	is_rx_badstate;		/* rx discard state != RUN */
222339ccfb3SSam Leffler 	uint32_t	is_ff_flush;		/* ff's flush'd from stageq */
223a43cee70SSam Leffler 	uint32_t	is_tx_ctl;		/* tx ctrl frames */
224a43cee70SSam Leffler 	uint32_t	is_ampdu_rexmt;		/* A-MPDU frames rexmt ok */
225a43cee70SSam Leffler 	uint32_t	is_ampdu_rexmt_fail;	/* A-MPDU frames rexmt fail */
22659aa14a9SRui Paulo 
22759aa14a9SRui Paulo 	uint32_t	is_mesh_wrongmesh;	/* dropped 'cuz not mesh sta*/
22859aa14a9SRui Paulo 	uint32_t	is_mesh_nolink;		/* dropped 'cuz link not estab*/
22959aa14a9SRui Paulo 	uint32_t	is_mesh_fwd_ttl;	/* mesh not fwd'd 'cuz ttl 0 */
23059aa14a9SRui Paulo 	uint32_t	is_mesh_fwd_nobuf;	/* mesh not fwd'd 'cuz no mbuf*/
23159aa14a9SRui Paulo 	uint32_t	is_mesh_fwd_tooshort;	/* mesh not fwd'd 'cuz no hdr */
23259aa14a9SRui Paulo 	uint32_t	is_mesh_fwd_disabled;	/* mesh not fwd'd 'cuz disabled */
23359aa14a9SRui Paulo 	uint32_t	is_mesh_fwd_nopath;	/* mesh not fwd'd 'cuz path unknown */
23459aa14a9SRui Paulo 
23559aa14a9SRui Paulo 	uint32_t	is_hwmp_wrongseq;	/* wrong hwmp seq no. */
23659aa14a9SRui Paulo 	uint32_t	is_hwmp_rootreqs;	/* root PREQs sent */
23759aa14a9SRui Paulo 	uint32_t	is_hwmp_rootrann;	/* root RANNs sent */
238519f677aSSam Leffler 	uint32_t	is_rx_badalign;		/* dropped 'cuz misaligned */
23959aa14a9SRui Paulo 
240519f677aSSam Leffler 	uint32_t	is_spare[15];
2411be50176SSam Leffler };
2421be50176SSam Leffler 
2438a1b9b6aSSam Leffler /*
2448a1b9b6aSSam Leffler  * Max size of optional information elements.  We artificially
2458a1b9b6aSSam Leffler  * constrain this; it's limited only by the max frame size (and
2468a1b9b6aSSam Leffler  * the max parameter size of the wireless extensions).
2478a1b9b6aSSam Leffler  */
2488a1b9b6aSSam Leffler #define	IEEE80211_MAX_OPT_IE	256
2498a1b9b6aSSam Leffler 
2508a1b9b6aSSam Leffler /*
2518a1b9b6aSSam Leffler  * WPA/RSN get/set key request.  Specify the key/cipher
2528a1b9b6aSSam Leffler  * type and whether the key is to be used for sending and/or
2538a1b9b6aSSam Leffler  * receiving.  The key index should be set only when working
2548a1b9b6aSSam Leffler  * with global keys (use IEEE80211_KEYIX_NONE for ``no index'').
2558a1b9b6aSSam Leffler  * Otherwise a unicast/pairwise key is specified by the bssid
2568a1b9b6aSSam Leffler  * (on a station) or mac address (on an ap).  They key length
2578a1b9b6aSSam Leffler  * must include any MIC key data; otherwise it should be no
2581b6167d2SSam Leffler  * more than IEEE80211_KEYBUF_SIZE.
2598a1b9b6aSSam Leffler  */
2608a1b9b6aSSam Leffler struct ieee80211req_key {
26168e8e04eSSam Leffler 	uint8_t		ik_type;	/* key/cipher type */
26268e8e04eSSam Leffler 	uint8_t		ik_pad;
26368e8e04eSSam Leffler 	uint16_t	ik_keyix;	/* key index */
26468e8e04eSSam Leffler 	uint8_t		ik_keylen;	/* key length in bytes */
26568e8e04eSSam Leffler 	uint8_t		ik_flags;
2668a1b9b6aSSam Leffler /* NB: IEEE80211_KEY_XMIT and IEEE80211_KEY_RECV defined elsewhere */
2678a1b9b6aSSam Leffler #define	IEEE80211_KEY_DEFAULT	0x80	/* default xmit key */
26868e8e04eSSam Leffler 	uint8_t		ik_macaddr[IEEE80211_ADDR_LEN];
26968e8e04eSSam Leffler 	uint64_t	ik_keyrsc;	/* key receive sequence counter */
27068e8e04eSSam Leffler 	uint64_t	ik_keytsc;	/* key transmit sequence counter */
27168e8e04eSSam Leffler 	uint8_t		ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];
2728a1b9b6aSSam Leffler };
2738a1b9b6aSSam Leffler 
2748a1b9b6aSSam Leffler /*
2758a1b9b6aSSam Leffler  * Delete a key either by index or address.  Set the index
2768a1b9b6aSSam Leffler  * to IEEE80211_KEYIX_NONE when deleting a unicast key.
2778a1b9b6aSSam Leffler  */
2788a1b9b6aSSam Leffler struct ieee80211req_del_key {
27968e8e04eSSam Leffler 	uint8_t		idk_keyix;	/* key index */
28068e8e04eSSam Leffler 	uint8_t		idk_macaddr[IEEE80211_ADDR_LEN];
2818a1b9b6aSSam Leffler };
2828a1b9b6aSSam Leffler 
2838a1b9b6aSSam Leffler /*
2848a1b9b6aSSam Leffler  * MLME state manipulation request.  IEEE80211_MLME_ASSOC
2858a1b9b6aSSam Leffler  * only makes sense when operating as a station.  The other
2868a1b9b6aSSam Leffler  * requests can be used when operating as a station or an
2878a1b9b6aSSam Leffler  * ap (to effect a station).
2888a1b9b6aSSam Leffler  */
2898a1b9b6aSSam Leffler struct ieee80211req_mlme {
29068e8e04eSSam Leffler 	uint8_t		im_op;		/* operation to perform */
2918a1b9b6aSSam Leffler #define	IEEE80211_MLME_ASSOC		1	/* associate station */
2928a1b9b6aSSam Leffler #define	IEEE80211_MLME_DISASSOC		2	/* disassociate station */
2938a1b9b6aSSam Leffler #define	IEEE80211_MLME_DEAUTH		3	/* deauthenticate station */
2948a1b9b6aSSam Leffler #define	IEEE80211_MLME_AUTHORIZE	4	/* authorize station */
2958a1b9b6aSSam Leffler #define	IEEE80211_MLME_UNAUTHORIZE	5	/* unauthorize station */
296b032f27cSSam Leffler #define	IEEE80211_MLME_AUTH		6	/* authenticate station */
29768e8e04eSSam Leffler 	uint8_t		im_ssid_len;	/* length of optional ssid */
29868e8e04eSSam Leffler 	uint16_t	im_reason;	/* 802.11 reason code */
29968e8e04eSSam Leffler 	uint8_t		im_macaddr[IEEE80211_ADDR_LEN];
30068e8e04eSSam Leffler 	uint8_t		im_ssid[IEEE80211_NWID_LEN];
3018a1b9b6aSSam Leffler };
3028a1b9b6aSSam Leffler 
3038a1b9b6aSSam Leffler /*
3048a1b9b6aSSam Leffler  * MAC ACL operations.
3058a1b9b6aSSam Leffler  */
3068a1b9b6aSSam Leffler enum {
3078a1b9b6aSSam Leffler 	IEEE80211_MACCMD_POLICY_OPEN	= 0,	/* set policy: no ACL's */
3088a1b9b6aSSam Leffler 	IEEE80211_MACCMD_POLICY_ALLOW	= 1,	/* set policy: allow traffic */
3098a1b9b6aSSam Leffler 	IEEE80211_MACCMD_POLICY_DENY	= 2,	/* set policy: deny traffic */
3108a1b9b6aSSam Leffler 	IEEE80211_MACCMD_FLUSH		= 3,	/* flush ACL database */
3118a1b9b6aSSam Leffler 	IEEE80211_MACCMD_DETACH		= 4,	/* detach ACL policy */
312188757f5SSam Leffler 	IEEE80211_MACCMD_POLICY		= 5,	/* get ACL policy */
313188757f5SSam Leffler 	IEEE80211_MACCMD_LIST		= 6,	/* get ACL database */
314b032f27cSSam Leffler 	IEEE80211_MACCMD_POLICY_RADIUS	= 7,	/* set policy: RADIUS managed */
315188757f5SSam Leffler };
316188757f5SSam Leffler 
317188757f5SSam Leffler struct ieee80211req_maclist {
31868e8e04eSSam Leffler 	uint8_t		ml_macaddr[IEEE80211_ADDR_LEN];
3198b10ecb6SSam Leffler } __packed;
3208a1b9b6aSSam Leffler 
3218a1b9b6aSSam Leffler /*
32259aa14a9SRui Paulo  * Mesh Routing Table Operations.
32359aa14a9SRui Paulo  */
32459aa14a9SRui Paulo enum {
32559aa14a9SRui Paulo 	IEEE80211_MESH_RTCMD_LIST   = 0, /* list HWMP routing table */
32659aa14a9SRui Paulo 	IEEE80211_MESH_RTCMD_FLUSH  = 1, /* flush HWMP routing table */
32759aa14a9SRui Paulo 	IEEE80211_MESH_RTCMD_ADD    = 2, /* add entry to the table */
32859aa14a9SRui Paulo 	IEEE80211_MESH_RTCMD_DELETE = 3, /* delete an entry from the table */
32959aa14a9SRui Paulo };
33059aa14a9SRui Paulo 
33159aa14a9SRui Paulo /*
33259aa14a9SRui Paulo  * HWMP root modes
33359aa14a9SRui Paulo  */
33459aa14a9SRui Paulo enum {
33559aa14a9SRui Paulo 	IEEE80211_HWMP_ROOTMODE_DISABLED	= 0, 	/* disabled */
33659aa14a9SRui Paulo 	IEEE80211_HWMP_ROOTMODE_NORMAL		= 1,	/* normal PREPs */
33759aa14a9SRui Paulo 	IEEE80211_HWMP_ROOTMODE_PROACTIVE	= 2,	/* proactive PREPS */
33859aa14a9SRui Paulo 	IEEE80211_HWMP_ROOTMODE_RANN		= 3,	/* use RANN elemid */
33959aa14a9SRui Paulo };
34059aa14a9SRui Paulo 
34159aa14a9SRui Paulo 
34259aa14a9SRui Paulo /*
3438658b18bSSam Leffler  * Set the active channel list by IEEE channel #: each channel
3448658b18bSSam Leffler  * to be marked active is set in a bit vector.  Note this list is
3458658b18bSSam Leffler  * intersected with the available channel list in calculating
3468658b18bSSam Leffler  * the set of channels actually used in scanning.
3478a1b9b6aSSam Leffler  */
3488a1b9b6aSSam Leffler struct ieee80211req_chanlist {
3498658b18bSSam Leffler 	uint8_t		ic_channels[32];	/* NB: can be variable length */
3508a1b9b6aSSam Leffler };
3518a1b9b6aSSam Leffler 
3528a1b9b6aSSam Leffler /*
3538a1b9b6aSSam Leffler  * Get the active channel list info.
3548a1b9b6aSSam Leffler  */
3558a1b9b6aSSam Leffler struct ieee80211req_chaninfo {
3568a1b9b6aSSam Leffler 	u_int	ic_nchans;
3578658b18bSSam Leffler 	struct ieee80211_channel ic_chans[1];	/* NB: variable length */
3588a1b9b6aSSam Leffler };
3598658b18bSSam Leffler #define	IEEE80211_CHANINFO_SIZE(_nchan) \
3608658b18bSSam Leffler 	(sizeof(struct ieee80211req_chaninfo) + \
3618658b18bSSam Leffler 	 (((_nchan)-1) * sizeof(struct ieee80211_channel)))
3628658b18bSSam Leffler #define	IEEE80211_CHANINFO_SPACE(_ci) \
3638658b18bSSam Leffler 	IEEE80211_CHANINFO_SIZE((_ci)->ic_nchans)
3648a1b9b6aSSam Leffler 
3658a1b9b6aSSam Leffler /*
3668a1b9b6aSSam Leffler  * Retrieve the WPA/RSN information element for an associated station.
3678a1b9b6aSSam Leffler  */
36868e8e04eSSam Leffler struct ieee80211req_wpaie {	/* old version w/ only one ie */
36968e8e04eSSam Leffler 	uint8_t		wpa_macaddr[IEEE80211_ADDR_LEN];
37068e8e04eSSam Leffler 	uint8_t		wpa_ie[IEEE80211_MAX_OPT_IE];
37168e8e04eSSam Leffler };
37268e8e04eSSam Leffler struct ieee80211req_wpaie2 {
37368e8e04eSSam Leffler 	uint8_t		wpa_macaddr[IEEE80211_ADDR_LEN];
37468e8e04eSSam Leffler 	uint8_t		wpa_ie[IEEE80211_MAX_OPT_IE];
37568e8e04eSSam Leffler 	uint8_t		rsn_ie[IEEE80211_MAX_OPT_IE];
3768a1b9b6aSSam Leffler };
3778a1b9b6aSSam Leffler 
3788a1b9b6aSSam Leffler /*
3798a1b9b6aSSam Leffler  * Retrieve per-node statistics.
3808a1b9b6aSSam Leffler  */
3818a1b9b6aSSam Leffler struct ieee80211req_sta_stats {
3828a1b9b6aSSam Leffler 	union {
3838a1b9b6aSSam Leffler 		/* NB: explicitly force 64-bit alignment */
38468e8e04eSSam Leffler 		uint8_t		macaddr[IEEE80211_ADDR_LEN];
38568e8e04eSSam Leffler 		uint64_t	pad;
3868a1b9b6aSSam Leffler 	} is_u;
3878a1b9b6aSSam Leffler 	struct ieee80211_nodestats is_stats;
3888a1b9b6aSSam Leffler };
3898a1b9b6aSSam Leffler 
3908a1b9b6aSSam Leffler /*
3918a1b9b6aSSam Leffler  * Station information block; the mac address is used
3928a1b9b6aSSam Leffler  * to retrieve other data like stats, unicast key, etc.
3938a1b9b6aSSam Leffler  */
3948a1b9b6aSSam Leffler struct ieee80211req_sta_info {
395b032f27cSSam Leffler 	uint16_t	isi_len;		/* total length (mult of 4) */
39668e8e04eSSam Leffler 	uint16_t	isi_ie_off;		/* offset to IE data */
39768e8e04eSSam Leffler 	uint16_t	isi_ie_len;		/* IE length */
39868e8e04eSSam Leffler 	uint16_t	isi_freq;		/* MHz */
399cd9a2dabSSam Leffler 	uint32_t	isi_flags;		/* channel flags */
4004fbdba95SSam Leffler 	uint32_t	isi_state;		/* state flags */
40168e8e04eSSam Leffler 	uint8_t		isi_authmode;		/* authentication algorithm */
402d1c85daeSSam Leffler 	int8_t		isi_rssi;		/* receive signal strength */
403d1c85daeSSam Leffler 	int8_t		isi_noise;		/* noise floor */
40468e8e04eSSam Leffler 	uint8_t		isi_capinfo;		/* capabilities */
40568e8e04eSSam Leffler 	uint8_t		isi_erp;		/* ERP element */
40668e8e04eSSam Leffler 	uint8_t		isi_macaddr[IEEE80211_ADDR_LEN];
40768e8e04eSSam Leffler 	uint8_t		isi_nrates;
40868e8e04eSSam Leffler 						/* negotiated rates */
40968e8e04eSSam Leffler 	uint8_t		isi_rates[IEEE80211_RATE_MAXSIZE];
410b032f27cSSam Leffler 	uint8_t		isi_txrate;		/* legacy/IEEE rate or MCS */
41168e8e04eSSam Leffler 	uint16_t	isi_associd;		/* assoc response */
41268e8e04eSSam Leffler 	uint16_t	isi_txpower;		/* current tx power */
41368e8e04eSSam Leffler 	uint16_t	isi_vlan;		/* vlan tag */
414b337fbc4SSam Leffler 	/* NB: [IEEE80211_NONQOS_TID] holds seq#'s for non-QoS stations */
415b337fbc4SSam Leffler 	uint16_t	isi_txseqs[IEEE80211_TID_SIZE];/* tx seq #/TID */
416b337fbc4SSam Leffler 	uint16_t	isi_rxseqs[IEEE80211_TID_SIZE];/* rx seq#/TID */
41768e8e04eSSam Leffler 	uint16_t	isi_inact;		/* inactivity timer */
418b032f27cSSam Leffler 	uint16_t	isi_txmbps;		/* current tx rate in .5 Mb/s */
4194fbdba95SSam Leffler 	uint16_t	isi_pad;
420b032f27cSSam Leffler 	uint32_t	isi_jointime;		/* time of assoc/join */
421b032f27cSSam Leffler 	struct ieee80211_mimo_info isi_mimo;	/* MIMO info for 11n sta's */
42259aa14a9SRui Paulo 	/* 11s info */
42359aa14a9SRui Paulo 	uint16_t	isi_peerid;
42459aa14a9SRui Paulo 	uint16_t	isi_localid;
42559aa14a9SRui Paulo 	uint8_t		isi_peerstate;
4268a1b9b6aSSam Leffler 	/* XXX frag state? */
4278a1b9b6aSSam Leffler 	/* variable length IE data */
4288a1b9b6aSSam Leffler };
4298a1b9b6aSSam Leffler 
4308a1b9b6aSSam Leffler /*
4318a1b9b6aSSam Leffler  * Retrieve per-station information; to retrieve all
4328a1b9b6aSSam Leffler  * specify a mac address of ff:ff:ff:ff:ff:ff.
4338a1b9b6aSSam Leffler  */
4348a1b9b6aSSam Leffler struct ieee80211req_sta_req {
4358a1b9b6aSSam Leffler 	union {
4368a1b9b6aSSam Leffler 		/* NB: explicitly force 64-bit alignment */
43768e8e04eSSam Leffler 		uint8_t		macaddr[IEEE80211_ADDR_LEN];
43868e8e04eSSam Leffler 		uint64_t	pad;
4398a1b9b6aSSam Leffler 	} is_u;
4408a1b9b6aSSam Leffler 	struct ieee80211req_sta_info info[1];	/* variable length */
4418a1b9b6aSSam Leffler };
4428a1b9b6aSSam Leffler 
4438a1b9b6aSSam Leffler /*
4448a1b9b6aSSam Leffler  * Get/set per-station tx power cap.
4458a1b9b6aSSam Leffler  */
4468a1b9b6aSSam Leffler struct ieee80211req_sta_txpow {
44768e8e04eSSam Leffler 	uint8_t		it_macaddr[IEEE80211_ADDR_LEN];
44868e8e04eSSam Leffler 	uint8_t		it_txpow;
4498a1b9b6aSSam Leffler };
4508a1b9b6aSSam Leffler 
4518a1b9b6aSSam Leffler /*
452b032f27cSSam Leffler  * WME parameters manipulated with IEEE80211_IOC_WME_CWMIN
453b032f27cSSam Leffler  * through IEEE80211_IOC_WME_ACKPOLICY are set and return
454b032f27cSSam Leffler  * using i_val and i_len.  i_val holds the value itself.
455b032f27cSSam Leffler  * i_len specifies the AC and, as appropriate, then high bit
456b032f27cSSam Leffler  * specifies whether the operation is to be applied to the
457b032f27cSSam Leffler  * BSS or ourself.
4588a1b9b6aSSam Leffler  */
4598a1b9b6aSSam Leffler #define	IEEE80211_WMEPARAM_SELF	0x0000		/* parameter applies to self */
4608a1b9b6aSSam Leffler #define	IEEE80211_WMEPARAM_BSS	0x8000		/* parameter applies to BSS */
4618a1b9b6aSSam Leffler #define	IEEE80211_WMEPARAM_VAL	0x7fff		/* parameter value */
4628a1b9b6aSSam Leffler 
463b032f27cSSam Leffler /*
464b032f27cSSam Leffler  * Application Information Elements can be appended to a variety
465b032f27cSSam Leffler  * of frames with the IEE80211_IOC_APPIE request.  This request
466b032f27cSSam Leffler  * piggybacks on a normal ieee80211req; the frame type is passed
467b032f27cSSam Leffler  * in i_val as the 802.11 FC0 bytes and the length of the IE data
468b032f27cSSam Leffler  * is passed in i_len.  The data is referenced in i_data.  If i_len
469b032f27cSSam Leffler  * is zero then any previously configured IE data is removed.  At
470b032f27cSSam Leffler  * most IEEE80211_MAX_APPIE data be appened.  Note that multiple
471b032f27cSSam Leffler  * IE's can be supplied; the data is treated opaquely.
472b032f27cSSam Leffler  */
473b032f27cSSam Leffler #define	IEEE80211_MAX_APPIE	1024		/* max app IE data */
474b032f27cSSam Leffler /*
475b032f27cSSam Leffler  * Hack: the WPA authenticator uses this mechanism to specify WPA
476b032f27cSSam Leffler  * ie's that are used instead of the ones normally constructed using
477b032f27cSSam Leffler  * the cipher state setup with separate ioctls.  This avoids issues
478b032f27cSSam Leffler  * like the authenticator ordering ie data differently than the
479b032f27cSSam Leffler  * net80211 layer and needing to keep separate state for WPA and RSN.
480b032f27cSSam Leffler  */
481b032f27cSSam Leffler #define	IEEE80211_APPIE_WPA \
482b032f27cSSam Leffler 	(IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_BEACON | \
483b032f27cSSam Leffler 	 IEEE80211_FC0_SUBTYPE_PROBE_RESP)
484b032f27cSSam Leffler 
485b032f27cSSam Leffler /*
486b032f27cSSam Leffler  * Station mode roaming parameters.  These are maintained
487b032f27cSSam Leffler  * per band/mode and control the roaming algorithm.
488b032f27cSSam Leffler  */
489b032f27cSSam Leffler struct ieee80211_roamparams_req {
490b032f27cSSam Leffler 	struct ieee80211_roamparam params[IEEE80211_MODE_MAX];
491b032f27cSSam Leffler };
492b032f27cSSam Leffler 
493b032f27cSSam Leffler /*
494b032f27cSSam Leffler  * Transmit parameters.  These can be used to set fixed transmit
495b032f27cSSam Leffler  * rate for each operating mode when operating as client or on a
496b032f27cSSam Leffler  * per-client basis according to the capabilities of the client
497b032f27cSSam Leffler  * (e.g. an 11b client associated to an 11g ap) when operating as
498b032f27cSSam Leffler  * an ap.
499b032f27cSSam Leffler  *
500b032f27cSSam Leffler  * MCS are distinguished from legacy rates by or'ing in 0x80.
501b032f27cSSam Leffler  */
502b032f27cSSam Leffler struct ieee80211_txparams_req {
503b032f27cSSam Leffler 	struct ieee80211_txparam params[IEEE80211_MODE_MAX];
504b032f27cSSam Leffler };
505b032f27cSSam Leffler 
506b032f27cSSam Leffler /*
507b032f27cSSam Leffler  * Set regulatory domain state with IEEE80211_IOC_REGDOMAIN.
508b032f27cSSam Leffler  * Note this is both the regulatory description and the channel
509b032f27cSSam Leffler  * list.  The get request for IEEE80211_IOC_REGDOMAIN returns
510b032f27cSSam Leffler  * only the regdomain info; the channel list is obtained
511b032f27cSSam Leffler  * separately with IEEE80211_IOC_CHANINFO.
512b032f27cSSam Leffler  */
513b032f27cSSam Leffler struct ieee80211_regdomain_req {
514b032f27cSSam Leffler 	struct ieee80211_regdomain	rd;
515b032f27cSSam Leffler 	struct ieee80211req_chaninfo	chaninfo;
516b032f27cSSam Leffler };
5178658b18bSSam Leffler #define	IEEE80211_REGDOMAIN_SIZE(_nchan) \
5188658b18bSSam Leffler 	(sizeof(struct ieee80211_regdomain_req) + \
5198658b18bSSam Leffler 	 (((_nchan)-1) * sizeof(struct ieee80211_channel)))
5208658b18bSSam Leffler #define	IEEE80211_REGDOMAIN_SPACE(_req) \
5218658b18bSSam Leffler 	IEEE80211_REGDOMAIN_SIZE((_req)->chaninfo.ic_nchans)
522b032f27cSSam Leffler 
523b032f27cSSam Leffler /*
524b032f27cSSam Leffler  * Get driver capabilities.  Driver, hardware crypto, and
525b032f27cSSam Leffler  * HT/802.11n capabilities, and a table that describes what
526b032f27cSSam Leffler  * the radio can do.
527b032f27cSSam Leffler  */
528b032f27cSSam Leffler struct ieee80211_devcaps_req {
529b032f27cSSam Leffler 	uint32_t	dc_drivercaps;		/* general driver caps */
530b032f27cSSam Leffler 	uint32_t	dc_cryptocaps;		/* hardware crypto support */
531b032f27cSSam Leffler 	uint32_t	dc_htcaps;		/* HT/802.11n support */
532b032f27cSSam Leffler 	struct ieee80211req_chaninfo dc_chaninfo;
533b032f27cSSam Leffler };
5348658b18bSSam Leffler #define	IEEE80211_DEVCAPS_SIZE(_nchan) \
5358658b18bSSam Leffler 	(sizeof(struct ieee80211_devcaps_req) + \
5368658b18bSSam Leffler 	 (((_nchan)-1) * sizeof(struct ieee80211_channel)))
5378658b18bSSam Leffler #define	IEEE80211_DEVCAPS_SPACE(_dc) \
5388658b18bSSam Leffler 	IEEE80211_DEVCAPS_SIZE((_dc)->dc_chaninfo.ic_nchans)
539b032f27cSSam Leffler 
540b032f27cSSam Leffler struct ieee80211_chanswitch_req {
541b032f27cSSam Leffler 	struct ieee80211_channel csa_chan;	/* new channel */
542b032f27cSSam Leffler 	int		csa_mode;		/* CSA mode */
543b032f27cSSam Leffler 	int		csa_count;		/* beacon count to switch */
544b032f27cSSam Leffler };
545b032f27cSSam Leffler 
546b032f27cSSam Leffler /*
547b032f27cSSam Leffler  * Get/set per-station vlan tag.
548b032f27cSSam Leffler  */
549b032f27cSSam Leffler struct ieee80211req_sta_vlan {
550b032f27cSSam Leffler 	uint8_t		sv_macaddr[IEEE80211_ADDR_LEN];
551b032f27cSSam Leffler 	uint16_t	sv_vlan;
552b032f27cSSam Leffler };
553b032f27cSSam Leffler 
5541a1e1d21SSam Leffler #ifdef __FreeBSD__
5551a1e1d21SSam Leffler /*
5561a1e1d21SSam Leffler  * FreeBSD-style ioctls.
5571a1e1d21SSam Leffler  */
5581a1e1d21SSam Leffler /* the first member must be matched with struct ifreq */
5591a1e1d21SSam Leffler struct ieee80211req {
5601a1e1d21SSam Leffler 	char		i_name[IFNAMSIZ];	/* if_name, e.g. "wi0" */
56168e8e04eSSam Leffler 	uint16_t	i_type;			/* req type */
5621a1e1d21SSam Leffler 	int16_t		i_val;			/* Index or simple value */
5631a1e1d21SSam Leffler 	int16_t		i_len;			/* Index or simple value */
5641a1e1d21SSam Leffler 	void		*i_data;		/* Extra data */
5651a1e1d21SSam Leffler };
5661a1e1d21SSam Leffler #define	SIOCS80211		 _IOW('i', 234, struct ieee80211req)
5671a1e1d21SSam Leffler #define	SIOCG80211		_IOWR('i', 235, struct ieee80211req)
56868e8e04eSSam Leffler #define	SIOCG80211STATS		_IOWR('i', 236, struct ifreq)
5691a1e1d21SSam Leffler 
5701a1e1d21SSam Leffler #define IEEE80211_IOC_SSID		1
5711a1e1d21SSam Leffler #define IEEE80211_IOC_NUMSSIDS		2
5721a1e1d21SSam Leffler #define IEEE80211_IOC_WEP		3
5731a1e1d21SSam Leffler #define 	IEEE80211_WEP_NOSUP	-1
5741a1e1d21SSam Leffler #define 	IEEE80211_WEP_OFF	0
5751a1e1d21SSam Leffler #define 	IEEE80211_WEP_ON	1
5761a1e1d21SSam Leffler #define 	IEEE80211_WEP_MIXED	2
5771a1e1d21SSam Leffler #define IEEE80211_IOC_WEPKEY		4
5781a1e1d21SSam Leffler #define IEEE80211_IOC_NUMWEPKEYS	5
5791a1e1d21SSam Leffler #define IEEE80211_IOC_WEPTXKEY		6
5801a1e1d21SSam Leffler #define IEEE80211_IOC_AUTHMODE		7
5811a1e1d21SSam Leffler #define IEEE80211_IOC_STATIONNAME	8
5821a1e1d21SSam Leffler #define IEEE80211_IOC_CHANNEL		9
5831a1e1d21SSam Leffler #define IEEE80211_IOC_POWERSAVE		10
5841a1e1d21SSam Leffler #define 	IEEE80211_POWERSAVE_NOSUP	-1
5851a1e1d21SSam Leffler #define 	IEEE80211_POWERSAVE_OFF		0
5861a1e1d21SSam Leffler #define 	IEEE80211_POWERSAVE_CAM		1
5871a1e1d21SSam Leffler #define 	IEEE80211_POWERSAVE_PSP		2
5881a1e1d21SSam Leffler #define 	IEEE80211_POWERSAVE_PSP_CAM	3
5891a1e1d21SSam Leffler #define 	IEEE80211_POWERSAVE_ON		IEEE80211_POWERSAVE_CAM
5901a1e1d21SSam Leffler #define IEEE80211_IOC_POWERSAVESLEEP	11
59113604e6bSSam Leffler #define	IEEE80211_IOC_RTSTHRESHOLD	12
5922e79ca97SSam Leffler #define IEEE80211_IOC_PROTMODE		13
5932e79ca97SSam Leffler #define 	IEEE80211_PROTMODE_OFF		0
5942e79ca97SSam Leffler #define 	IEEE80211_PROTMODE_CTS		1
5952e79ca97SSam Leffler #define 	IEEE80211_PROTMODE_RTSCTS	2
5968a1b9b6aSSam Leffler #define	IEEE80211_IOC_TXPOWER		14	/* global tx power limit */
5978a1b9b6aSSam Leffler #define	IEEE80211_IOC_BSSID		15
5988a1b9b6aSSam Leffler #define	IEEE80211_IOC_ROAMING		16	/* roaming mode */
5998a1b9b6aSSam Leffler #define	IEEE80211_IOC_PRIVACY		17	/* privacy invoked */
6008a1b9b6aSSam Leffler #define	IEEE80211_IOC_DROPUNENCRYPTED	18	/* discard unencrypted frames */
6018a1b9b6aSSam Leffler #define	IEEE80211_IOC_WPAKEY		19
6028a1b9b6aSSam Leffler #define	IEEE80211_IOC_DELKEY		20
6038a1b9b6aSSam Leffler #define	IEEE80211_IOC_MLME		21
604b032f27cSSam Leffler /* 22 was IEEE80211_IOC_OPTIE, replaced by IEEE80211_IOC_APPIE */
605b032f27cSSam Leffler /* 23 was IEEE80211_IOC_SCAN_REQ */
606239cc3b6SSam Leffler /* 24 was IEEE80211_IOC_SCAN_RESULTS */
6078a1b9b6aSSam Leffler #define	IEEE80211_IOC_COUNTERMEASURES	25	/* WPA/TKIP countermeasures */
6088a1b9b6aSSam Leffler #define	IEEE80211_IOC_WPA		26	/* WPA mode (0,1,2) */
6098a1b9b6aSSam Leffler #define	IEEE80211_IOC_CHANLIST		27	/* channel list */
6108a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME		28	/* WME mode (on, off) */
6118a1b9b6aSSam Leffler #define	IEEE80211_IOC_HIDESSID		29	/* hide SSID mode (on, off) */
6128a1b9b6aSSam Leffler #define	IEEE80211_IOC_APBRIDGE		30	/* AP inter-sta bridging */
613b032f27cSSam Leffler /* 31-35,37-38 were for WPA authenticator settings */
614b032f27cSSam Leffler /* 36 was IEEE80211_IOC_DRIVER_CAPS */
6158a1b9b6aSSam Leffler #define	IEEE80211_IOC_WPAIE		39	/* WPA information element */
6168a1b9b6aSSam Leffler #define	IEEE80211_IOC_STA_STATS		40	/* per-station statistics */
6178a1b9b6aSSam Leffler #define	IEEE80211_IOC_MACCMD		41	/* MAC ACL operation */
6188a1b9b6aSSam Leffler #define	IEEE80211_IOC_CHANINFO		42	/* channel info list */
6198a1b9b6aSSam Leffler #define	IEEE80211_IOC_TXPOWMAX		43	/* max tx power for channel */
6208a1b9b6aSSam Leffler #define	IEEE80211_IOC_STA_TXPOW		44	/* per-station tx power limit */
621d1c85daeSSam Leffler /* 45 was IEEE80211_IOC_STA_INFO */
6228a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME_CWMIN		46	/* WME: ECWmin */
6238a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME_CWMAX		47	/* WME: ECWmax */
6248a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME_AIFS		48	/* WME: AIFSN */
6258a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME_TXOPLIMIT	49	/* WME: txops limit */
6268a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME_ACM		50	/* WME: ACM (bss only) */
6278a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME_ACKPOLICY	51	/* WME: ACK policy (!bss only)*/
6288a1b9b6aSSam Leffler #define	IEEE80211_IOC_DTIM_PERIOD	52	/* DTIM period (beacons) */
6298a1b9b6aSSam Leffler #define	IEEE80211_IOC_BEACON_INTERVAL	53	/* beacon interval (ms) */
6308a1b9b6aSSam Leffler #define	IEEE80211_IOC_ADDMAC		54	/* add sta to MAC ACL table */
6318a1b9b6aSSam Leffler #define	IEEE80211_IOC_DELMAC		55	/* del sta from MAC ACL table */
632c4f040c3SSam Leffler #define	IEEE80211_IOC_PUREG		56	/* pure 11g (no 11b stations) */
63368e8e04eSSam Leffler #define	IEEE80211_IOC_FF		57	/* ATH fast frames (on, off) */
63468e8e04eSSam Leffler #define	IEEE80211_IOC_TURBOP		58	/* ATH turbo' (on, off) */
63568e8e04eSSam Leffler #define	IEEE80211_IOC_BGSCAN		59	/* bg scanning (on, off) */
63668e8e04eSSam Leffler #define	IEEE80211_IOC_BGSCAN_IDLE	60	/* bg scan idle threshold */
63768e8e04eSSam Leffler #define	IEEE80211_IOC_BGSCAN_INTERVAL	61	/* bg scan interval */
63868e8e04eSSam Leffler #define	IEEE80211_IOC_SCANVALID		65	/* scan cache valid threshold */
639b032f27cSSam Leffler /* 66-72 were IEEE80211_IOC_ROAM_* and IEEE80211_IOC_MCAST_RATE */
64070231e3dSSam Leffler #define	IEEE80211_IOC_FRAGTHRESHOLD	73	/* tx fragmentation threshold */
641c27e4e31SSam Leffler #define	IEEE80211_IOC_BURST		75	/* packet bursting */
642239cc3b6SSam Leffler #define	IEEE80211_IOC_SCAN_RESULTS	76	/* get scan results */
643546786c9SSam Leffler #define	IEEE80211_IOC_BMISSTHRESHOLD	77	/* beacon miss threshold */
644d1c85daeSSam Leffler #define	IEEE80211_IOC_STA_INFO		78	/* station/neighbor info */
64568e8e04eSSam Leffler #define	IEEE80211_IOC_WPAIE2		79	/* WPA+RSN info elements */
64668e8e04eSSam Leffler #define	IEEE80211_IOC_CURCHAN		80	/* current channel */
64768e8e04eSSam Leffler #define	IEEE80211_IOC_SHORTGI		81	/* 802.11n half GI */
64868e8e04eSSam Leffler #define	IEEE80211_IOC_AMPDU		82	/* 802.11n A-MPDU (on, off) */
64968e8e04eSSam Leffler #define	IEEE80211_IOC_AMPDU_LIMIT	83	/* A-MPDU length limit */
65068e8e04eSSam Leffler #define	IEEE80211_IOC_AMPDU_DENSITY	84	/* A-MPDU density */
65168e8e04eSSam Leffler #define	IEEE80211_IOC_AMSDU		85	/* 802.11n A-MSDU (on, off) */
65268e8e04eSSam Leffler #define	IEEE80211_IOC_AMSDU_LIMIT	86	/* A-MSDU length limit */
65368e8e04eSSam Leffler #define	IEEE80211_IOC_PUREN		87	/* pure 11n (no legacy sta's) */
65468e8e04eSSam Leffler #define	IEEE80211_IOC_DOTH		88	/* 802.11h (on, off) */
655b032f27cSSam Leffler /* 89-91 were regulatory items */
65668e8e04eSSam Leffler #define	IEEE80211_IOC_HTCOMPAT		92	/* support pre-D1.10 HT ie's */
657b032f27cSSam Leffler #define	IEEE80211_IOC_DWDS		93	/* DWDS/4-address handling */
658c066143cSSam Leffler #define	IEEE80211_IOC_INACTIVITY	94	/* sta inactivity handling */
659b032f27cSSam Leffler #define	IEEE80211_IOC_APPIE		95	/* application IE's */
660b032f27cSSam Leffler #define	IEEE80211_IOC_WPS		96	/* WPS operation */
661b032f27cSSam Leffler #define	IEEE80211_IOC_TSN		97	/* TSN operation */
662b032f27cSSam Leffler #define	IEEE80211_IOC_DEVCAPS		98	/* driver+device capabilities */
663b032f27cSSam Leffler #define	IEEE80211_IOC_CHANSWITCH	99	/* start 11h channel switch */
664b032f27cSSam Leffler #define	IEEE80211_IOC_DFS		100	/* DFS (on, off) */
665b032f27cSSam Leffler #define	IEEE80211_IOC_DOTD		101	/* 802.11d (on, off) */
6661b6167d2SSam Leffler #define IEEE80211_IOC_HTPROTMODE	102	/* HT protection (off, rts) */
667b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_REQ		103	/* scan w/ specified params */
668b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_CANCEL	104	/* cancel ongoing scan */
6691b6167d2SSam Leffler #define	IEEE80211_IOC_HTCONF		105	/* HT config (off, HT20, HT40)*/
670b032f27cSSam Leffler #define	IEEE80211_IOC_REGDOMAIN		106	/* regulatory domain info */
671b032f27cSSam Leffler #define	IEEE80211_IOC_ROAM		107	/* roaming params en masse */
672b032f27cSSam Leffler #define	IEEE80211_IOC_TXPARAMS		108	/* tx parameters */
673b032f27cSSam Leffler #define	IEEE80211_IOC_STA_VLAN		109	/* per-station vlan tag */
6748c070d69SSam Leffler #define	IEEE80211_IOC_SMPS		110	/* MIMO power save */
67544f7a6edSSam Leffler #define	IEEE80211_IOC_RIFS		111	/* RIFS config (on, off) */
676da6e1ed3SSam Leffler #define	IEEE80211_IOC_GREENFIELD	112	/* Greenfield (on, off) */
677da6e1ed3SSam Leffler #define	IEEE80211_IOC_STBC		113	/* STBC Tx/RX (on, off) */
678b032f27cSSam Leffler 
67959aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_ID		170	/* mesh identifier */
68059aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_AP		171	/* accepting peerings */
68159aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_FWRD		172	/* forward frames */
68259aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_PROTO	173	/* mesh protocols */
68359aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_TTL		174	/* mesh TTL */
68459aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_RTCMD	175	/* mesh routing table commands*/
68559aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_PR_METRIC	176	/* mesh metric protocol */
68659aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_PR_PATH	177	/* mesh path protocol */
68759aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_PR_SIG	178	/* mesh sig protocol */
68859aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_PR_CC	179	/* mesh congestion protocol */
68959aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_PR_AUTH	180	/* mesh auth protocol */
69059aa14a9SRui Paulo 
69159aa14a9SRui Paulo #define	IEEE80211_IOC_HWMP_ROOTMODE	190	/* HWMP root mode */
69259aa14a9SRui Paulo #define	IEEE80211_IOC_HWMP_MAXHOPS	191	/* number of hops before drop */
69359aa14a9SRui Paulo #define	IEEE80211_IOC_HWMP_TTL		192	/* HWMP TTL */
69459aa14a9SRui Paulo 
69510ad9a77SSam Leffler #define	IEEE80211_IOC_TDMA_SLOT		201	/* TDMA: assigned slot */
69610ad9a77SSam Leffler #define	IEEE80211_IOC_TDMA_SLOTCNT	202	/* TDMA: slots in bss */
69710ad9a77SSam Leffler #define	IEEE80211_IOC_TDMA_SLOTLEN	203	/* TDMA: slot length (usecs) */
69810ad9a77SSam Leffler #define	IEEE80211_IOC_TDMA_BINTERVAL	204	/* TDMA: beacon intvl (slots) */
69910ad9a77SSam Leffler 
700b032f27cSSam Leffler /*
701b032f27cSSam Leffler  * Parameters for controlling a scan requested with
702b032f27cSSam Leffler  * IEEE80211_IOC_SCAN_REQ.
703b032f27cSSam Leffler  *
704b032f27cSSam Leffler  * Active scans cause ProbeRequest frames to be issued for each
705b032f27cSSam Leffler  * specified ssid and, by default, a broadcast ProbeRequest frame.
706b032f27cSSam Leffler  * The set of ssid's is specified in the request.
707b032f27cSSam Leffler  *
708b032f27cSSam Leffler  * By default the scan will cause a BSS to be joined (in station/adhoc
709b032f27cSSam Leffler  * mode) or a channel to be selected for operation (hostap mode).
710b032f27cSSam Leffler  * To disable that specify IEEE80211_IOC_SCAN_NOPICK and if the
711b032f27cSSam Leffler  *
712b032f27cSSam Leffler  * If the station is currently associated to an AP then a scan request
713b032f27cSSam Leffler  * will cause the station to leave the current channel and potentially
714b032f27cSSam Leffler  * miss frames from the AP.  Alternatively the station may notify the
715b032f27cSSam Leffler  * AP that it is going into power save mode before it leaves the channel.
716b032f27cSSam Leffler  * This ensures frames for the station are buffered by the AP.  This is
717b032f27cSSam Leffler  * termed a ``bg scan'' and is requested with the IEEE80211_IOC_SCAN_BGSCAN
718b032f27cSSam Leffler  * flag.  Background scans may take longer than foreground scans and may
719b032f27cSSam Leffler  * be preempted by traffic.  If a station is not associated to an AP
720b032f27cSSam Leffler  * then a request for a background scan is automatically done in the
721b032f27cSSam Leffler  * foreground.
722b032f27cSSam Leffler  *
723b032f27cSSam Leffler  * The results of the scan request are cached by the system.  This
724b032f27cSSam Leffler  * information is aged out and/or invalidated based on events like not
725b032f27cSSam Leffler  * being able to associated to an AP.  To flush the current cache
726b032f27cSSam Leffler  * contents before doing a scan the IEEE80211_IOC_SCAN_FLUSH flag may
727b032f27cSSam Leffler  * be specified.
728b032f27cSSam Leffler  *
729b032f27cSSam Leffler  * By default the scan will be done until a suitable AP is located
730b032f27cSSam Leffler  * or a channel is found for use.  A scan can also be constrained
731b032f27cSSam Leffler  * to be done once (IEEE80211_IOC_SCAN_ONCE) or to last for no more
732b032f27cSSam Leffler  * than a specified duration.
733b032f27cSSam Leffler  */
734b032f27cSSam Leffler struct ieee80211_scan_req {
735b032f27cSSam Leffler 	int		sr_flags;
736b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_NOPICK	0x00001	/* scan only, no selection */
737b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_ACTIVE	0x00002	/* active scan (probe req) */
738b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_PICK1ST	0x00004	/* ``hey sailor'' mode */
739b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_BGSCAN	0x00008	/* bg scan, exit ps at end */
740b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_ONCE		0x00010	/* do one complete pass */
741b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_NOBCAST	0x00020	/* don't send bcast probe req */
742b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_NOJOIN	0x00040	/* no auto-sequencing */
743b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_FLUSH	0x10000	/* flush scan cache first */
744b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_CHECK	0x20000	/* check scan cache first */
745b032f27cSSam Leffler 	u_int		sr_duration;		/* duration (ms) */
746b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_DURATION_MIN	1
747b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_DURATION_MAX	0x7fffffff
748b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_FOREVER	IEEE80211_IOC_SCAN_DURATION_MAX
749b032f27cSSam Leffler 	u_int		sr_mindwell;		/* min channel dwelltime (ms) */
750b032f27cSSam Leffler 	u_int		sr_maxdwell;		/* max channel dwelltime (ms) */
751b032f27cSSam Leffler 	int		sr_nssid;
752b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_MAX_SSID	3
753b032f27cSSam Leffler 	struct {
754b032f27cSSam Leffler 		int	 len;				/* length in bytes */
755b032f27cSSam Leffler 		uint8_t ssid[IEEE80211_NWID_LEN];	/* ssid contents */
756b032f27cSSam Leffler 	} sr_ssid[IEEE80211_IOC_SCAN_MAX_SSID];
757b032f27cSSam Leffler };
7581a1e1d21SSam Leffler 
7598a1b9b6aSSam Leffler /*
7608a1b9b6aSSam Leffler  * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS.
761239cc3b6SSam Leffler  * Each result is a fixed size structure followed by a variable
762239cc3b6SSam Leffler  * length SSID and one or more variable length information elements.
763239cc3b6SSam Leffler  * The size of each variable length item is found in the fixed
764239cc3b6SSam Leffler  * size structure and the entire length of the record is specified
765239cc3b6SSam Leffler  * in isr_len.  Result records are rounded to a multiple of 4 bytes.
7668a1b9b6aSSam Leffler  */
7678a1b9b6aSSam Leffler struct ieee80211req_scan_result {
768b032f27cSSam Leffler 	uint16_t	isr_len;		/* total length (mult of 4) */
769b032f27cSSam Leffler 	uint16_t	isr_ie_off;		/* offset to SSID+IE data */
77068e8e04eSSam Leffler 	uint16_t	isr_ie_len;		/* IE length */
77168e8e04eSSam Leffler 	uint16_t	isr_freq;		/* MHz */
77268e8e04eSSam Leffler 	uint16_t	isr_flags;		/* channel flags */
773239cc3b6SSam Leffler 	int8_t		isr_noise;
774239cc3b6SSam Leffler 	int8_t		isr_rssi;
77568e8e04eSSam Leffler 	uint8_t		isr_intval;		/* beacon interval */
77668e8e04eSSam Leffler 	uint8_t		isr_capinfo;		/* capabilities */
77768e8e04eSSam Leffler 	uint8_t		isr_erp;		/* ERP element */
77868e8e04eSSam Leffler 	uint8_t		isr_bssid[IEEE80211_ADDR_LEN];
77968e8e04eSSam Leffler 	uint8_t		isr_nrates;
78068e8e04eSSam Leffler 	uint8_t		isr_rates[IEEE80211_RATE_MAXSIZE];
78168e8e04eSSam Leffler 	uint8_t		isr_ssid_len;		/* SSID length */
78259aa14a9SRui Paulo 	uint8_t		isr_meshid_len;		/* MESH ID length */
78359aa14a9SRui Paulo 	/* variable length SSID, followed by variable length MESH ID,
78459aa14a9SRui Paulo 	  followed by IE data */
7858a1b9b6aSSam Leffler };
7861be50176SSam Leffler 
787b032f27cSSam Leffler /*
788b032f27cSSam Leffler  * Virtual AP cloning parameters.  The parent device must
789b032f27cSSam Leffler  * be a vap-capable device.  All parameters specified with
790b032f27cSSam Leffler  * the clone request are fixed for the lifetime of the vap.
791b032f27cSSam Leffler  *
792b032f27cSSam Leffler  * There are two flavors of WDS vaps: legacy and dynamic.
793b032f27cSSam Leffler  * Legacy WDS operation implements a static binding between
794b032f27cSSam Leffler  * two stations encapsulating traffic in 4-address frames.
795b032f27cSSam Leffler  * Dynamic WDS vaps are created when a station associates to
796b032f27cSSam Leffler  * an AP and sends a 4-address frame.  If the AP vap is
797b032f27cSSam Leffler  * configured to support WDS then this will generate an
798b032f27cSSam Leffler  * event to user programs listening on the routing socket
799b032f27cSSam Leffler  * and a Dynamic WDS vap will be created to handle traffic
800b032f27cSSam Leffler  * to/from that station.  In both cases the bssid of the
801b032f27cSSam Leffler  * peer must be specified when creating the vap.
802b032f27cSSam Leffler  *
803b032f27cSSam Leffler  * By default a vap will inherit the mac address/bssid of
804b032f27cSSam Leffler  * the underlying device.  To request a unique address the
805b032f27cSSam Leffler  * IEEE80211_CLONE_BSSID flag should be supplied.  This is
806b032f27cSSam Leffler  * meaningless for WDS vaps as they share the bssid of an
807b032f27cSSam Leffler  * AP vap that must otherwise exist.  Note that some devices
808b032f27cSSam Leffler  * may not be able to support multiple addresses.
809b032f27cSSam Leffler  *
810b032f27cSSam Leffler  * Station mode vap's normally depend on the device to notice
811b032f27cSSam Leffler  * when the AP stops sending beacon frames.  If IEEE80211_CLONE_NOBEACONS
812b032f27cSSam Leffler  * is specified the net80211 layer will do this in s/w.  This
813b032f27cSSam Leffler  * is mostly useful when setting up a WDS repeater/extender where
814b032f27cSSam Leffler  * an AP vap is combined with a sta vap and the device isn't able
815b032f27cSSam Leffler  * to track beacon frames in hardware.
816b032f27cSSam Leffler  */
81768e8e04eSSam Leffler struct ieee80211_clone_params {
81868e8e04eSSam Leffler 	char	icp_parent[IFNAMSIZ];		/* parent device */
819b032f27cSSam Leffler 	uint16_t icp_opmode;			/* operating mode */
820b032f27cSSam Leffler 	uint16_t icp_flags;			/* see below */
821b032f27cSSam Leffler 	uint8_t	icp_bssid[IEEE80211_ADDR_LEN];	/* for WDS links */
822b032f27cSSam Leffler 	uint8_t	icp_macaddr[IEEE80211_ADDR_LEN];/* local address */
82368e8e04eSSam Leffler };
824b032f27cSSam Leffler #define	IEEE80211_CLONE_BSSID		0x0001	/* allocate unique mac/bssid */
825b032f27cSSam Leffler #define	IEEE80211_CLONE_NOBEACONS	0x0002	/* don't setup beacon timers */
826b032f27cSSam Leffler #define	IEEE80211_CLONE_WDSLEGACY	0x0004	/* legacy WDS processing */
827b032f27cSSam Leffler #define	IEEE80211_CLONE_MACADDR		0x0008	/* use specified mac addr */
82810ad9a77SSam Leffler #define	IEEE80211_CLONE_TDMA		0x0010	/* operate in TDMA mode */
8291a1e1d21SSam Leffler #endif /* __FreeBSD__ */
8301a1e1d21SSam Leffler 
8311a1e1d21SSam Leffler #endif /* _NET80211_IEEE80211_IOCTL_H_ */
832