xref: /freebsd/sys/net80211/ieee80211_ioctl.h (revision 2b80a3409ec7b5b8fbfa4ed2f55f8dcfee33fcd9)
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 */
238c104cff2SRui Paulo 
239c104cff2SRui Paulo 	uint32_t	is_mesh_badae;		/* dropped 'cuz invalid AE */
240c104cff2SRui Paulo 	uint32_t	is_mesh_rtaddfailed;	/* route add failed */
241c104cff2SRui Paulo 	uint32_t	is_mesh_notproxy;	/* dropped 'cuz not proxying */
242519f677aSSam Leffler 	uint32_t	is_rx_badalign;		/* dropped 'cuz misaligned */
2433ca80f0dSRui Paulo 	uint32_t	is_hwmp_proxy;		/* PREP for proxy route */
24459aa14a9SRui Paulo 
2453ca80f0dSRui Paulo 	uint32_t	is_spare[11];
2461be50176SSam Leffler };
2471be50176SSam Leffler 
2488a1b9b6aSSam Leffler /*
2498a1b9b6aSSam Leffler  * Max size of optional information elements.  We artificially
2508a1b9b6aSSam Leffler  * constrain this; it's limited only by the max frame size (and
2518a1b9b6aSSam Leffler  * the max parameter size of the wireless extensions).
2528a1b9b6aSSam Leffler  */
2538a1b9b6aSSam Leffler #define	IEEE80211_MAX_OPT_IE	256
2548a1b9b6aSSam Leffler 
2558a1b9b6aSSam Leffler /*
2568a1b9b6aSSam Leffler  * WPA/RSN get/set key request.  Specify the key/cipher
2578a1b9b6aSSam Leffler  * type and whether the key is to be used for sending and/or
2588a1b9b6aSSam Leffler  * receiving.  The key index should be set only when working
2598a1b9b6aSSam Leffler  * with global keys (use IEEE80211_KEYIX_NONE for ``no index'').
2608a1b9b6aSSam Leffler  * Otherwise a unicast/pairwise key is specified by the bssid
2618a1b9b6aSSam Leffler  * (on a station) or mac address (on an ap).  They key length
2628a1b9b6aSSam Leffler  * must include any MIC key data; otherwise it should be no
2631b6167d2SSam Leffler  * more than IEEE80211_KEYBUF_SIZE.
2648a1b9b6aSSam Leffler  */
2658a1b9b6aSSam Leffler struct ieee80211req_key {
26668e8e04eSSam Leffler 	uint8_t		ik_type;	/* key/cipher type */
26768e8e04eSSam Leffler 	uint8_t		ik_pad;
26868e8e04eSSam Leffler 	uint16_t	ik_keyix;	/* key index */
26968e8e04eSSam Leffler 	uint8_t		ik_keylen;	/* key length in bytes */
27068e8e04eSSam Leffler 	uint8_t		ik_flags;
2718a1b9b6aSSam Leffler /* NB: IEEE80211_KEY_XMIT and IEEE80211_KEY_RECV defined elsewhere */
2728a1b9b6aSSam Leffler #define	IEEE80211_KEY_DEFAULT	0x80	/* default xmit key */
27368e8e04eSSam Leffler 	uint8_t		ik_macaddr[IEEE80211_ADDR_LEN];
27468e8e04eSSam Leffler 	uint64_t	ik_keyrsc;	/* key receive sequence counter */
27568e8e04eSSam Leffler 	uint64_t	ik_keytsc;	/* key transmit sequence counter */
27668e8e04eSSam Leffler 	uint8_t		ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];
2778a1b9b6aSSam Leffler };
2788a1b9b6aSSam Leffler 
2798a1b9b6aSSam Leffler /*
2808a1b9b6aSSam Leffler  * Delete a key either by index or address.  Set the index
2818a1b9b6aSSam Leffler  * to IEEE80211_KEYIX_NONE when deleting a unicast key.
2828a1b9b6aSSam Leffler  */
2838a1b9b6aSSam Leffler struct ieee80211req_del_key {
28468e8e04eSSam Leffler 	uint8_t		idk_keyix;	/* key index */
28568e8e04eSSam Leffler 	uint8_t		idk_macaddr[IEEE80211_ADDR_LEN];
2868a1b9b6aSSam Leffler };
2878a1b9b6aSSam Leffler 
2888a1b9b6aSSam Leffler /*
2898a1b9b6aSSam Leffler  * MLME state manipulation request.  IEEE80211_MLME_ASSOC
2908a1b9b6aSSam Leffler  * only makes sense when operating as a station.  The other
2918a1b9b6aSSam Leffler  * requests can be used when operating as a station or an
2928a1b9b6aSSam Leffler  * ap (to effect a station).
2938a1b9b6aSSam Leffler  */
2948a1b9b6aSSam Leffler struct ieee80211req_mlme {
29568e8e04eSSam Leffler 	uint8_t		im_op;		/* operation to perform */
2968a1b9b6aSSam Leffler #define	IEEE80211_MLME_ASSOC		1	/* associate station */
2978a1b9b6aSSam Leffler #define	IEEE80211_MLME_DISASSOC		2	/* disassociate station */
2988a1b9b6aSSam Leffler #define	IEEE80211_MLME_DEAUTH		3	/* deauthenticate station */
2998a1b9b6aSSam Leffler #define	IEEE80211_MLME_AUTHORIZE	4	/* authorize station */
3008a1b9b6aSSam Leffler #define	IEEE80211_MLME_UNAUTHORIZE	5	/* unauthorize station */
301b032f27cSSam Leffler #define	IEEE80211_MLME_AUTH		6	/* authenticate station */
30268e8e04eSSam Leffler 	uint8_t		im_ssid_len;	/* length of optional ssid */
30368e8e04eSSam Leffler 	uint16_t	im_reason;	/* 802.11 reason code */
30468e8e04eSSam Leffler 	uint8_t		im_macaddr[IEEE80211_ADDR_LEN];
30568e8e04eSSam Leffler 	uint8_t		im_ssid[IEEE80211_NWID_LEN];
3068a1b9b6aSSam Leffler };
3078a1b9b6aSSam Leffler 
3088a1b9b6aSSam Leffler /*
3098a1b9b6aSSam Leffler  * MAC ACL operations.
3108a1b9b6aSSam Leffler  */
3118a1b9b6aSSam Leffler enum {
3128a1b9b6aSSam Leffler 	IEEE80211_MACCMD_POLICY_OPEN	= 0,	/* set policy: no ACL's */
3138a1b9b6aSSam Leffler 	IEEE80211_MACCMD_POLICY_ALLOW	= 1,	/* set policy: allow traffic */
3148a1b9b6aSSam Leffler 	IEEE80211_MACCMD_POLICY_DENY	= 2,	/* set policy: deny traffic */
3158a1b9b6aSSam Leffler 	IEEE80211_MACCMD_FLUSH		= 3,	/* flush ACL database */
3168a1b9b6aSSam Leffler 	IEEE80211_MACCMD_DETACH		= 4,	/* detach ACL policy */
317188757f5SSam Leffler 	IEEE80211_MACCMD_POLICY		= 5,	/* get ACL policy */
318188757f5SSam Leffler 	IEEE80211_MACCMD_LIST		= 6,	/* get ACL database */
319b032f27cSSam Leffler 	IEEE80211_MACCMD_POLICY_RADIUS	= 7,	/* set policy: RADIUS managed */
320188757f5SSam Leffler };
321188757f5SSam Leffler 
322188757f5SSam Leffler struct ieee80211req_maclist {
32368e8e04eSSam Leffler 	uint8_t		ml_macaddr[IEEE80211_ADDR_LEN];
3248b10ecb6SSam Leffler } __packed;
3258a1b9b6aSSam Leffler 
3268a1b9b6aSSam Leffler /*
32759aa14a9SRui Paulo  * Mesh Routing Table Operations.
32859aa14a9SRui Paulo  */
32959aa14a9SRui Paulo enum {
33059aa14a9SRui Paulo 	IEEE80211_MESH_RTCMD_LIST   = 0, /* list HWMP routing table */
33159aa14a9SRui Paulo 	IEEE80211_MESH_RTCMD_FLUSH  = 1, /* flush HWMP routing table */
33259aa14a9SRui Paulo 	IEEE80211_MESH_RTCMD_ADD    = 2, /* add entry to the table */
33359aa14a9SRui Paulo 	IEEE80211_MESH_RTCMD_DELETE = 3, /* delete an entry from the table */
33459aa14a9SRui Paulo };
33559aa14a9SRui Paulo 
336c104cff2SRui Paulo struct ieee80211req_mesh_route {
337c104cff2SRui Paulo 	uint8_t		imr_dest[IEEE80211_ADDR_LEN];
338c104cff2SRui Paulo 	uint8_t		imr_nexthop[IEEE80211_ADDR_LEN];
339c104cff2SRui Paulo 	uint16_t	imr_nhops;
3402b80a340SRui Paulo 	uint8_t		imr_flags;
3412b80a340SRui Paulo #define	IEEE80211_MESHRT_FLAGS_VALID	0x01
3422b80a340SRui Paulo #define	IEEE80211_MESHRT_FLAGS_PROXY	0x02
3433ca80f0dSRui Paulo 	uint8_t		imr_pad;
344c104cff2SRui Paulo 	uint32_t	imr_metric;
345c104cff2SRui Paulo 	uint32_t	imr_lifetime;
346c104cff2SRui Paulo 	uint32_t	imr_lastmseq;
347c104cff2SRui Paulo };
348c104cff2SRui Paulo 
34959aa14a9SRui Paulo /*
35059aa14a9SRui Paulo  * HWMP root modes
35159aa14a9SRui Paulo  */
35259aa14a9SRui Paulo enum {
35359aa14a9SRui Paulo 	IEEE80211_HWMP_ROOTMODE_DISABLED	= 0, 	/* disabled */
35459aa14a9SRui Paulo 	IEEE80211_HWMP_ROOTMODE_NORMAL		= 1,	/* normal PREPs */
35559aa14a9SRui Paulo 	IEEE80211_HWMP_ROOTMODE_PROACTIVE	= 2,	/* proactive PREPS */
35659aa14a9SRui Paulo 	IEEE80211_HWMP_ROOTMODE_RANN		= 3,	/* use RANN elemid */
35759aa14a9SRui Paulo };
35859aa14a9SRui Paulo 
35959aa14a9SRui Paulo 
36059aa14a9SRui Paulo /*
3618658b18bSSam Leffler  * Set the active channel list by IEEE channel #: each channel
3628658b18bSSam Leffler  * to be marked active is set in a bit vector.  Note this list is
3638658b18bSSam Leffler  * intersected with the available channel list in calculating
3648658b18bSSam Leffler  * the set of channels actually used in scanning.
3658a1b9b6aSSam Leffler  */
3668a1b9b6aSSam Leffler struct ieee80211req_chanlist {
3678658b18bSSam Leffler 	uint8_t		ic_channels[32];	/* NB: can be variable length */
3688a1b9b6aSSam Leffler };
3698a1b9b6aSSam Leffler 
3708a1b9b6aSSam Leffler /*
3718a1b9b6aSSam Leffler  * Get the active channel list info.
3728a1b9b6aSSam Leffler  */
3738a1b9b6aSSam Leffler struct ieee80211req_chaninfo {
3748a1b9b6aSSam Leffler 	u_int	ic_nchans;
3758658b18bSSam Leffler 	struct ieee80211_channel ic_chans[1];	/* NB: variable length */
3768a1b9b6aSSam Leffler };
3778658b18bSSam Leffler #define	IEEE80211_CHANINFO_SIZE(_nchan) \
3788658b18bSSam Leffler 	(sizeof(struct ieee80211req_chaninfo) + \
3798658b18bSSam Leffler 	 (((_nchan)-1) * sizeof(struct ieee80211_channel)))
3808658b18bSSam Leffler #define	IEEE80211_CHANINFO_SPACE(_ci) \
3818658b18bSSam Leffler 	IEEE80211_CHANINFO_SIZE((_ci)->ic_nchans)
3828a1b9b6aSSam Leffler 
3838a1b9b6aSSam Leffler /*
3848a1b9b6aSSam Leffler  * Retrieve the WPA/RSN information element for an associated station.
3858a1b9b6aSSam Leffler  */
38668e8e04eSSam Leffler struct ieee80211req_wpaie {	/* old version w/ only one ie */
38768e8e04eSSam Leffler 	uint8_t		wpa_macaddr[IEEE80211_ADDR_LEN];
38868e8e04eSSam Leffler 	uint8_t		wpa_ie[IEEE80211_MAX_OPT_IE];
38968e8e04eSSam Leffler };
39068e8e04eSSam Leffler struct ieee80211req_wpaie2 {
39168e8e04eSSam Leffler 	uint8_t		wpa_macaddr[IEEE80211_ADDR_LEN];
39268e8e04eSSam Leffler 	uint8_t		wpa_ie[IEEE80211_MAX_OPT_IE];
39368e8e04eSSam Leffler 	uint8_t		rsn_ie[IEEE80211_MAX_OPT_IE];
3948a1b9b6aSSam Leffler };
3958a1b9b6aSSam Leffler 
3968a1b9b6aSSam Leffler /*
3978a1b9b6aSSam Leffler  * Retrieve per-node statistics.
3988a1b9b6aSSam Leffler  */
3998a1b9b6aSSam Leffler struct ieee80211req_sta_stats {
4008a1b9b6aSSam Leffler 	union {
4018a1b9b6aSSam Leffler 		/* NB: explicitly force 64-bit alignment */
40268e8e04eSSam Leffler 		uint8_t		macaddr[IEEE80211_ADDR_LEN];
40368e8e04eSSam Leffler 		uint64_t	pad;
4048a1b9b6aSSam Leffler 	} is_u;
4058a1b9b6aSSam Leffler 	struct ieee80211_nodestats is_stats;
4068a1b9b6aSSam Leffler };
4078a1b9b6aSSam Leffler 
4088a1b9b6aSSam Leffler /*
4098a1b9b6aSSam Leffler  * Station information block; the mac address is used
4108a1b9b6aSSam Leffler  * to retrieve other data like stats, unicast key, etc.
4118a1b9b6aSSam Leffler  */
4128a1b9b6aSSam Leffler struct ieee80211req_sta_info {
413b032f27cSSam Leffler 	uint16_t	isi_len;		/* total length (mult of 4) */
41468e8e04eSSam Leffler 	uint16_t	isi_ie_off;		/* offset to IE data */
41568e8e04eSSam Leffler 	uint16_t	isi_ie_len;		/* IE length */
41668e8e04eSSam Leffler 	uint16_t	isi_freq;		/* MHz */
417cd9a2dabSSam Leffler 	uint32_t	isi_flags;		/* channel flags */
4184fbdba95SSam Leffler 	uint32_t	isi_state;		/* state flags */
41968e8e04eSSam Leffler 	uint8_t		isi_authmode;		/* authentication algorithm */
420d1c85daeSSam Leffler 	int8_t		isi_rssi;		/* receive signal strength */
421d1c85daeSSam Leffler 	int8_t		isi_noise;		/* noise floor */
42268e8e04eSSam Leffler 	uint8_t		isi_capinfo;		/* capabilities */
42368e8e04eSSam Leffler 	uint8_t		isi_erp;		/* ERP element */
42468e8e04eSSam Leffler 	uint8_t		isi_macaddr[IEEE80211_ADDR_LEN];
42568e8e04eSSam Leffler 	uint8_t		isi_nrates;
42668e8e04eSSam Leffler 						/* negotiated rates */
42768e8e04eSSam Leffler 	uint8_t		isi_rates[IEEE80211_RATE_MAXSIZE];
428b032f27cSSam Leffler 	uint8_t		isi_txrate;		/* legacy/IEEE rate or MCS */
42968e8e04eSSam Leffler 	uint16_t	isi_associd;		/* assoc response */
43068e8e04eSSam Leffler 	uint16_t	isi_txpower;		/* current tx power */
43168e8e04eSSam Leffler 	uint16_t	isi_vlan;		/* vlan tag */
432b337fbc4SSam Leffler 	/* NB: [IEEE80211_NONQOS_TID] holds seq#'s for non-QoS stations */
433b337fbc4SSam Leffler 	uint16_t	isi_txseqs[IEEE80211_TID_SIZE];/* tx seq #/TID */
434b337fbc4SSam Leffler 	uint16_t	isi_rxseqs[IEEE80211_TID_SIZE];/* rx seq#/TID */
43568e8e04eSSam Leffler 	uint16_t	isi_inact;		/* inactivity timer */
436b032f27cSSam Leffler 	uint16_t	isi_txmbps;		/* current tx rate in .5 Mb/s */
4374fbdba95SSam Leffler 	uint16_t	isi_pad;
438b032f27cSSam Leffler 	uint32_t	isi_jointime;		/* time of assoc/join */
439b032f27cSSam Leffler 	struct ieee80211_mimo_info isi_mimo;	/* MIMO info for 11n sta's */
44059aa14a9SRui Paulo 	/* 11s info */
44159aa14a9SRui Paulo 	uint16_t	isi_peerid;
44259aa14a9SRui Paulo 	uint16_t	isi_localid;
44359aa14a9SRui Paulo 	uint8_t		isi_peerstate;
4448a1b9b6aSSam Leffler 	/* XXX frag state? */
4458a1b9b6aSSam Leffler 	/* variable length IE data */
4468a1b9b6aSSam Leffler };
4478a1b9b6aSSam Leffler 
4488a1b9b6aSSam Leffler /*
4498a1b9b6aSSam Leffler  * Retrieve per-station information; to retrieve all
4508a1b9b6aSSam Leffler  * specify a mac address of ff:ff:ff:ff:ff:ff.
4518a1b9b6aSSam Leffler  */
4528a1b9b6aSSam Leffler struct ieee80211req_sta_req {
4538a1b9b6aSSam Leffler 	union {
4548a1b9b6aSSam Leffler 		/* NB: explicitly force 64-bit alignment */
45568e8e04eSSam Leffler 		uint8_t		macaddr[IEEE80211_ADDR_LEN];
45668e8e04eSSam Leffler 		uint64_t	pad;
4578a1b9b6aSSam Leffler 	} is_u;
4588a1b9b6aSSam Leffler 	struct ieee80211req_sta_info info[1];	/* variable length */
4598a1b9b6aSSam Leffler };
4608a1b9b6aSSam Leffler 
4618a1b9b6aSSam Leffler /*
4628a1b9b6aSSam Leffler  * Get/set per-station tx power cap.
4638a1b9b6aSSam Leffler  */
4648a1b9b6aSSam Leffler struct ieee80211req_sta_txpow {
46568e8e04eSSam Leffler 	uint8_t		it_macaddr[IEEE80211_ADDR_LEN];
46668e8e04eSSam Leffler 	uint8_t		it_txpow;
4678a1b9b6aSSam Leffler };
4688a1b9b6aSSam Leffler 
4698a1b9b6aSSam Leffler /*
470b032f27cSSam Leffler  * WME parameters manipulated with IEEE80211_IOC_WME_CWMIN
471b032f27cSSam Leffler  * through IEEE80211_IOC_WME_ACKPOLICY are set and return
472b032f27cSSam Leffler  * using i_val and i_len.  i_val holds the value itself.
473b032f27cSSam Leffler  * i_len specifies the AC and, as appropriate, then high bit
474b032f27cSSam Leffler  * specifies whether the operation is to be applied to the
475b032f27cSSam Leffler  * BSS or ourself.
4768a1b9b6aSSam Leffler  */
4778a1b9b6aSSam Leffler #define	IEEE80211_WMEPARAM_SELF	0x0000		/* parameter applies to self */
4788a1b9b6aSSam Leffler #define	IEEE80211_WMEPARAM_BSS	0x8000		/* parameter applies to BSS */
4798a1b9b6aSSam Leffler #define	IEEE80211_WMEPARAM_VAL	0x7fff		/* parameter value */
4808a1b9b6aSSam Leffler 
481b032f27cSSam Leffler /*
482b032f27cSSam Leffler  * Application Information Elements can be appended to a variety
483b032f27cSSam Leffler  * of frames with the IEE80211_IOC_APPIE request.  This request
484b032f27cSSam Leffler  * piggybacks on a normal ieee80211req; the frame type is passed
485b032f27cSSam Leffler  * in i_val as the 802.11 FC0 bytes and the length of the IE data
486b032f27cSSam Leffler  * is passed in i_len.  The data is referenced in i_data.  If i_len
487b032f27cSSam Leffler  * is zero then any previously configured IE data is removed.  At
488b032f27cSSam Leffler  * most IEEE80211_MAX_APPIE data be appened.  Note that multiple
489b032f27cSSam Leffler  * IE's can be supplied; the data is treated opaquely.
490b032f27cSSam Leffler  */
491b032f27cSSam Leffler #define	IEEE80211_MAX_APPIE	1024		/* max app IE data */
492b032f27cSSam Leffler /*
493b032f27cSSam Leffler  * Hack: the WPA authenticator uses this mechanism to specify WPA
494b032f27cSSam Leffler  * ie's that are used instead of the ones normally constructed using
495b032f27cSSam Leffler  * the cipher state setup with separate ioctls.  This avoids issues
496b032f27cSSam Leffler  * like the authenticator ordering ie data differently than the
497b032f27cSSam Leffler  * net80211 layer and needing to keep separate state for WPA and RSN.
498b032f27cSSam Leffler  */
499b032f27cSSam Leffler #define	IEEE80211_APPIE_WPA \
500b032f27cSSam Leffler 	(IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_BEACON | \
501b032f27cSSam Leffler 	 IEEE80211_FC0_SUBTYPE_PROBE_RESP)
502b032f27cSSam Leffler 
503b032f27cSSam Leffler /*
504b032f27cSSam Leffler  * Station mode roaming parameters.  These are maintained
505b032f27cSSam Leffler  * per band/mode and control the roaming algorithm.
506b032f27cSSam Leffler  */
507b032f27cSSam Leffler struct ieee80211_roamparams_req {
508b032f27cSSam Leffler 	struct ieee80211_roamparam params[IEEE80211_MODE_MAX];
509b032f27cSSam Leffler };
510b032f27cSSam Leffler 
511b032f27cSSam Leffler /*
512b032f27cSSam Leffler  * Transmit parameters.  These can be used to set fixed transmit
513b032f27cSSam Leffler  * rate for each operating mode when operating as client or on a
514b032f27cSSam Leffler  * per-client basis according to the capabilities of the client
515b032f27cSSam Leffler  * (e.g. an 11b client associated to an 11g ap) when operating as
516b032f27cSSam Leffler  * an ap.
517b032f27cSSam Leffler  *
518b032f27cSSam Leffler  * MCS are distinguished from legacy rates by or'ing in 0x80.
519b032f27cSSam Leffler  */
520b032f27cSSam Leffler struct ieee80211_txparams_req {
521b032f27cSSam Leffler 	struct ieee80211_txparam params[IEEE80211_MODE_MAX];
522b032f27cSSam Leffler };
523b032f27cSSam Leffler 
524b032f27cSSam Leffler /*
525b032f27cSSam Leffler  * Set regulatory domain state with IEEE80211_IOC_REGDOMAIN.
526b032f27cSSam Leffler  * Note this is both the regulatory description and the channel
527b032f27cSSam Leffler  * list.  The get request for IEEE80211_IOC_REGDOMAIN returns
528b032f27cSSam Leffler  * only the regdomain info; the channel list is obtained
529b032f27cSSam Leffler  * separately with IEEE80211_IOC_CHANINFO.
530b032f27cSSam Leffler  */
531b032f27cSSam Leffler struct ieee80211_regdomain_req {
532b032f27cSSam Leffler 	struct ieee80211_regdomain	rd;
533b032f27cSSam Leffler 	struct ieee80211req_chaninfo	chaninfo;
534b032f27cSSam Leffler };
5358658b18bSSam Leffler #define	IEEE80211_REGDOMAIN_SIZE(_nchan) \
5368658b18bSSam Leffler 	(sizeof(struct ieee80211_regdomain_req) + \
5378658b18bSSam Leffler 	 (((_nchan)-1) * sizeof(struct ieee80211_channel)))
5388658b18bSSam Leffler #define	IEEE80211_REGDOMAIN_SPACE(_req) \
5398658b18bSSam Leffler 	IEEE80211_REGDOMAIN_SIZE((_req)->chaninfo.ic_nchans)
540b032f27cSSam Leffler 
541b032f27cSSam Leffler /*
542b032f27cSSam Leffler  * Get driver capabilities.  Driver, hardware crypto, and
543b032f27cSSam Leffler  * HT/802.11n capabilities, and a table that describes what
544b032f27cSSam Leffler  * the radio can do.
545b032f27cSSam Leffler  */
546b032f27cSSam Leffler struct ieee80211_devcaps_req {
547b032f27cSSam Leffler 	uint32_t	dc_drivercaps;		/* general driver caps */
548b032f27cSSam Leffler 	uint32_t	dc_cryptocaps;		/* hardware crypto support */
549b032f27cSSam Leffler 	uint32_t	dc_htcaps;		/* HT/802.11n support */
550b032f27cSSam Leffler 	struct ieee80211req_chaninfo dc_chaninfo;
551b032f27cSSam Leffler };
5528658b18bSSam Leffler #define	IEEE80211_DEVCAPS_SIZE(_nchan) \
5538658b18bSSam Leffler 	(sizeof(struct ieee80211_devcaps_req) + \
5548658b18bSSam Leffler 	 (((_nchan)-1) * sizeof(struct ieee80211_channel)))
5558658b18bSSam Leffler #define	IEEE80211_DEVCAPS_SPACE(_dc) \
5568658b18bSSam Leffler 	IEEE80211_DEVCAPS_SIZE((_dc)->dc_chaninfo.ic_nchans)
557b032f27cSSam Leffler 
558b032f27cSSam Leffler struct ieee80211_chanswitch_req {
559b032f27cSSam Leffler 	struct ieee80211_channel csa_chan;	/* new channel */
560b032f27cSSam Leffler 	int		csa_mode;		/* CSA mode */
561b032f27cSSam Leffler 	int		csa_count;		/* beacon count to switch */
562b032f27cSSam Leffler };
563b032f27cSSam Leffler 
564b032f27cSSam Leffler /*
565b032f27cSSam Leffler  * Get/set per-station vlan tag.
566b032f27cSSam Leffler  */
567b032f27cSSam Leffler struct ieee80211req_sta_vlan {
568b032f27cSSam Leffler 	uint8_t		sv_macaddr[IEEE80211_ADDR_LEN];
569b032f27cSSam Leffler 	uint16_t	sv_vlan;
570b032f27cSSam Leffler };
571b032f27cSSam Leffler 
5721a1e1d21SSam Leffler #ifdef __FreeBSD__
5731a1e1d21SSam Leffler /*
5741a1e1d21SSam Leffler  * FreeBSD-style ioctls.
5751a1e1d21SSam Leffler  */
5761a1e1d21SSam Leffler /* the first member must be matched with struct ifreq */
5771a1e1d21SSam Leffler struct ieee80211req {
5781a1e1d21SSam Leffler 	char		i_name[IFNAMSIZ];	/* if_name, e.g. "wi0" */
57968e8e04eSSam Leffler 	uint16_t	i_type;			/* req type */
5801a1e1d21SSam Leffler 	int16_t		i_val;			/* Index or simple value */
5811a1e1d21SSam Leffler 	int16_t		i_len;			/* Index or simple value */
5821a1e1d21SSam Leffler 	void		*i_data;		/* Extra data */
5831a1e1d21SSam Leffler };
5841a1e1d21SSam Leffler #define	SIOCS80211		 _IOW('i', 234, struct ieee80211req)
5851a1e1d21SSam Leffler #define	SIOCG80211		_IOWR('i', 235, struct ieee80211req)
58668e8e04eSSam Leffler #define	SIOCG80211STATS		_IOWR('i', 236, struct ifreq)
5871a1e1d21SSam Leffler 
5881a1e1d21SSam Leffler #define IEEE80211_IOC_SSID		1
5891a1e1d21SSam Leffler #define IEEE80211_IOC_NUMSSIDS		2
5901a1e1d21SSam Leffler #define IEEE80211_IOC_WEP		3
5911a1e1d21SSam Leffler #define 	IEEE80211_WEP_NOSUP	-1
5921a1e1d21SSam Leffler #define 	IEEE80211_WEP_OFF	0
5931a1e1d21SSam Leffler #define 	IEEE80211_WEP_ON	1
5941a1e1d21SSam Leffler #define 	IEEE80211_WEP_MIXED	2
5951a1e1d21SSam Leffler #define IEEE80211_IOC_WEPKEY		4
5961a1e1d21SSam Leffler #define IEEE80211_IOC_NUMWEPKEYS	5
5971a1e1d21SSam Leffler #define IEEE80211_IOC_WEPTXKEY		6
5981a1e1d21SSam Leffler #define IEEE80211_IOC_AUTHMODE		7
5991a1e1d21SSam Leffler #define IEEE80211_IOC_STATIONNAME	8
6001a1e1d21SSam Leffler #define IEEE80211_IOC_CHANNEL		9
6011a1e1d21SSam Leffler #define IEEE80211_IOC_POWERSAVE		10
6021a1e1d21SSam Leffler #define 	IEEE80211_POWERSAVE_NOSUP	-1
6031a1e1d21SSam Leffler #define 	IEEE80211_POWERSAVE_OFF		0
6041a1e1d21SSam Leffler #define 	IEEE80211_POWERSAVE_CAM		1
6051a1e1d21SSam Leffler #define 	IEEE80211_POWERSAVE_PSP		2
6061a1e1d21SSam Leffler #define 	IEEE80211_POWERSAVE_PSP_CAM	3
6071a1e1d21SSam Leffler #define 	IEEE80211_POWERSAVE_ON		IEEE80211_POWERSAVE_CAM
6081a1e1d21SSam Leffler #define IEEE80211_IOC_POWERSAVESLEEP	11
60913604e6bSSam Leffler #define	IEEE80211_IOC_RTSTHRESHOLD	12
6102e79ca97SSam Leffler #define IEEE80211_IOC_PROTMODE		13
6112e79ca97SSam Leffler #define 	IEEE80211_PROTMODE_OFF		0
6122e79ca97SSam Leffler #define 	IEEE80211_PROTMODE_CTS		1
6132e79ca97SSam Leffler #define 	IEEE80211_PROTMODE_RTSCTS	2
6148a1b9b6aSSam Leffler #define	IEEE80211_IOC_TXPOWER		14	/* global tx power limit */
6158a1b9b6aSSam Leffler #define	IEEE80211_IOC_BSSID		15
6168a1b9b6aSSam Leffler #define	IEEE80211_IOC_ROAMING		16	/* roaming mode */
6178a1b9b6aSSam Leffler #define	IEEE80211_IOC_PRIVACY		17	/* privacy invoked */
6188a1b9b6aSSam Leffler #define	IEEE80211_IOC_DROPUNENCRYPTED	18	/* discard unencrypted frames */
6198a1b9b6aSSam Leffler #define	IEEE80211_IOC_WPAKEY		19
6208a1b9b6aSSam Leffler #define	IEEE80211_IOC_DELKEY		20
6218a1b9b6aSSam Leffler #define	IEEE80211_IOC_MLME		21
622b032f27cSSam Leffler /* 22 was IEEE80211_IOC_OPTIE, replaced by IEEE80211_IOC_APPIE */
623b032f27cSSam Leffler /* 23 was IEEE80211_IOC_SCAN_REQ */
624239cc3b6SSam Leffler /* 24 was IEEE80211_IOC_SCAN_RESULTS */
6258a1b9b6aSSam Leffler #define	IEEE80211_IOC_COUNTERMEASURES	25	/* WPA/TKIP countermeasures */
6268a1b9b6aSSam Leffler #define	IEEE80211_IOC_WPA		26	/* WPA mode (0,1,2) */
6278a1b9b6aSSam Leffler #define	IEEE80211_IOC_CHANLIST		27	/* channel list */
6288a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME		28	/* WME mode (on, off) */
6298a1b9b6aSSam Leffler #define	IEEE80211_IOC_HIDESSID		29	/* hide SSID mode (on, off) */
6308a1b9b6aSSam Leffler #define	IEEE80211_IOC_APBRIDGE		30	/* AP inter-sta bridging */
631b032f27cSSam Leffler /* 31-35,37-38 were for WPA authenticator settings */
632b032f27cSSam Leffler /* 36 was IEEE80211_IOC_DRIVER_CAPS */
6338a1b9b6aSSam Leffler #define	IEEE80211_IOC_WPAIE		39	/* WPA information element */
6348a1b9b6aSSam Leffler #define	IEEE80211_IOC_STA_STATS		40	/* per-station statistics */
6358a1b9b6aSSam Leffler #define	IEEE80211_IOC_MACCMD		41	/* MAC ACL operation */
6368a1b9b6aSSam Leffler #define	IEEE80211_IOC_CHANINFO		42	/* channel info list */
6378a1b9b6aSSam Leffler #define	IEEE80211_IOC_TXPOWMAX		43	/* max tx power for channel */
6388a1b9b6aSSam Leffler #define	IEEE80211_IOC_STA_TXPOW		44	/* per-station tx power limit */
639d1c85daeSSam Leffler /* 45 was IEEE80211_IOC_STA_INFO */
6408a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME_CWMIN		46	/* WME: ECWmin */
6418a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME_CWMAX		47	/* WME: ECWmax */
6428a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME_AIFS		48	/* WME: AIFSN */
6438a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME_TXOPLIMIT	49	/* WME: txops limit */
6448a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME_ACM		50	/* WME: ACM (bss only) */
6458a1b9b6aSSam Leffler #define	IEEE80211_IOC_WME_ACKPOLICY	51	/* WME: ACK policy (!bss only)*/
6468a1b9b6aSSam Leffler #define	IEEE80211_IOC_DTIM_PERIOD	52	/* DTIM period (beacons) */
6478a1b9b6aSSam Leffler #define	IEEE80211_IOC_BEACON_INTERVAL	53	/* beacon interval (ms) */
6488a1b9b6aSSam Leffler #define	IEEE80211_IOC_ADDMAC		54	/* add sta to MAC ACL table */
6498a1b9b6aSSam Leffler #define	IEEE80211_IOC_DELMAC		55	/* del sta from MAC ACL table */
650c4f040c3SSam Leffler #define	IEEE80211_IOC_PUREG		56	/* pure 11g (no 11b stations) */
65168e8e04eSSam Leffler #define	IEEE80211_IOC_FF		57	/* ATH fast frames (on, off) */
65268e8e04eSSam Leffler #define	IEEE80211_IOC_TURBOP		58	/* ATH turbo' (on, off) */
65368e8e04eSSam Leffler #define	IEEE80211_IOC_BGSCAN		59	/* bg scanning (on, off) */
65468e8e04eSSam Leffler #define	IEEE80211_IOC_BGSCAN_IDLE	60	/* bg scan idle threshold */
65568e8e04eSSam Leffler #define	IEEE80211_IOC_BGSCAN_INTERVAL	61	/* bg scan interval */
65668e8e04eSSam Leffler #define	IEEE80211_IOC_SCANVALID		65	/* scan cache valid threshold */
657b032f27cSSam Leffler /* 66-72 were IEEE80211_IOC_ROAM_* and IEEE80211_IOC_MCAST_RATE */
65870231e3dSSam Leffler #define	IEEE80211_IOC_FRAGTHRESHOLD	73	/* tx fragmentation threshold */
659c27e4e31SSam Leffler #define	IEEE80211_IOC_BURST		75	/* packet bursting */
660239cc3b6SSam Leffler #define	IEEE80211_IOC_SCAN_RESULTS	76	/* get scan results */
661546786c9SSam Leffler #define	IEEE80211_IOC_BMISSTHRESHOLD	77	/* beacon miss threshold */
662d1c85daeSSam Leffler #define	IEEE80211_IOC_STA_INFO		78	/* station/neighbor info */
66368e8e04eSSam Leffler #define	IEEE80211_IOC_WPAIE2		79	/* WPA+RSN info elements */
66468e8e04eSSam Leffler #define	IEEE80211_IOC_CURCHAN		80	/* current channel */
66568e8e04eSSam Leffler #define	IEEE80211_IOC_SHORTGI		81	/* 802.11n half GI */
66668e8e04eSSam Leffler #define	IEEE80211_IOC_AMPDU		82	/* 802.11n A-MPDU (on, off) */
66768e8e04eSSam Leffler #define	IEEE80211_IOC_AMPDU_LIMIT	83	/* A-MPDU length limit */
66868e8e04eSSam Leffler #define	IEEE80211_IOC_AMPDU_DENSITY	84	/* A-MPDU density */
66968e8e04eSSam Leffler #define	IEEE80211_IOC_AMSDU		85	/* 802.11n A-MSDU (on, off) */
67068e8e04eSSam Leffler #define	IEEE80211_IOC_AMSDU_LIMIT	86	/* A-MSDU length limit */
67168e8e04eSSam Leffler #define	IEEE80211_IOC_PUREN		87	/* pure 11n (no legacy sta's) */
67268e8e04eSSam Leffler #define	IEEE80211_IOC_DOTH		88	/* 802.11h (on, off) */
673b032f27cSSam Leffler /* 89-91 were regulatory items */
67468e8e04eSSam Leffler #define	IEEE80211_IOC_HTCOMPAT		92	/* support pre-D1.10 HT ie's */
675b032f27cSSam Leffler #define	IEEE80211_IOC_DWDS		93	/* DWDS/4-address handling */
676c066143cSSam Leffler #define	IEEE80211_IOC_INACTIVITY	94	/* sta inactivity handling */
677b032f27cSSam Leffler #define	IEEE80211_IOC_APPIE		95	/* application IE's */
678b032f27cSSam Leffler #define	IEEE80211_IOC_WPS		96	/* WPS operation */
679b032f27cSSam Leffler #define	IEEE80211_IOC_TSN		97	/* TSN operation */
680b032f27cSSam Leffler #define	IEEE80211_IOC_DEVCAPS		98	/* driver+device capabilities */
681b032f27cSSam Leffler #define	IEEE80211_IOC_CHANSWITCH	99	/* start 11h channel switch */
682b032f27cSSam Leffler #define	IEEE80211_IOC_DFS		100	/* DFS (on, off) */
683b032f27cSSam Leffler #define	IEEE80211_IOC_DOTD		101	/* 802.11d (on, off) */
6841b6167d2SSam Leffler #define IEEE80211_IOC_HTPROTMODE	102	/* HT protection (off, rts) */
685b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_REQ		103	/* scan w/ specified params */
686b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_CANCEL	104	/* cancel ongoing scan */
6871b6167d2SSam Leffler #define	IEEE80211_IOC_HTCONF		105	/* HT config (off, HT20, HT40)*/
688b032f27cSSam Leffler #define	IEEE80211_IOC_REGDOMAIN		106	/* regulatory domain info */
689b032f27cSSam Leffler #define	IEEE80211_IOC_ROAM		107	/* roaming params en masse */
690b032f27cSSam Leffler #define	IEEE80211_IOC_TXPARAMS		108	/* tx parameters */
691b032f27cSSam Leffler #define	IEEE80211_IOC_STA_VLAN		109	/* per-station vlan tag */
6928c070d69SSam Leffler #define	IEEE80211_IOC_SMPS		110	/* MIMO power save */
69344f7a6edSSam Leffler #define	IEEE80211_IOC_RIFS		111	/* RIFS config (on, off) */
694da6e1ed3SSam Leffler #define	IEEE80211_IOC_GREENFIELD	112	/* Greenfield (on, off) */
695da6e1ed3SSam Leffler #define	IEEE80211_IOC_STBC		113	/* STBC Tx/RX (on, off) */
696b032f27cSSam Leffler 
69759aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_ID		170	/* mesh identifier */
69859aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_AP		171	/* accepting peerings */
69959aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_FWRD		172	/* forward frames */
70059aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_PROTO	173	/* mesh protocols */
70159aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_TTL		174	/* mesh TTL */
70259aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_RTCMD	175	/* mesh routing table commands*/
70359aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_PR_METRIC	176	/* mesh metric protocol */
70459aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_PR_PATH	177	/* mesh path protocol */
70559aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_PR_SIG	178	/* mesh sig protocol */
70659aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_PR_CC	179	/* mesh congestion protocol */
70759aa14a9SRui Paulo #define	IEEE80211_IOC_MESH_PR_AUTH	180	/* mesh auth protocol */
70859aa14a9SRui Paulo 
70959aa14a9SRui Paulo #define	IEEE80211_IOC_HWMP_ROOTMODE	190	/* HWMP root mode */
71059aa14a9SRui Paulo #define	IEEE80211_IOC_HWMP_MAXHOPS	191	/* number of hops before drop */
71159aa14a9SRui Paulo #define	IEEE80211_IOC_HWMP_TTL		192	/* HWMP TTL */
71259aa14a9SRui Paulo 
71310ad9a77SSam Leffler #define	IEEE80211_IOC_TDMA_SLOT		201	/* TDMA: assigned slot */
71410ad9a77SSam Leffler #define	IEEE80211_IOC_TDMA_SLOTCNT	202	/* TDMA: slots in bss */
71510ad9a77SSam Leffler #define	IEEE80211_IOC_TDMA_SLOTLEN	203	/* TDMA: slot length (usecs) */
71610ad9a77SSam Leffler #define	IEEE80211_IOC_TDMA_BINTERVAL	204	/* TDMA: beacon intvl (slots) */
71710ad9a77SSam Leffler 
718b032f27cSSam Leffler /*
719b032f27cSSam Leffler  * Parameters for controlling a scan requested with
720b032f27cSSam Leffler  * IEEE80211_IOC_SCAN_REQ.
721b032f27cSSam Leffler  *
722b032f27cSSam Leffler  * Active scans cause ProbeRequest frames to be issued for each
723b032f27cSSam Leffler  * specified ssid and, by default, a broadcast ProbeRequest frame.
724b032f27cSSam Leffler  * The set of ssid's is specified in the request.
725b032f27cSSam Leffler  *
726b032f27cSSam Leffler  * By default the scan will cause a BSS to be joined (in station/adhoc
727b032f27cSSam Leffler  * mode) or a channel to be selected for operation (hostap mode).
728b032f27cSSam Leffler  * To disable that specify IEEE80211_IOC_SCAN_NOPICK and if the
729b032f27cSSam Leffler  *
730b032f27cSSam Leffler  * If the station is currently associated to an AP then a scan request
731b032f27cSSam Leffler  * will cause the station to leave the current channel and potentially
732b032f27cSSam Leffler  * miss frames from the AP.  Alternatively the station may notify the
733b032f27cSSam Leffler  * AP that it is going into power save mode before it leaves the channel.
734b032f27cSSam Leffler  * This ensures frames for the station are buffered by the AP.  This is
735b032f27cSSam Leffler  * termed a ``bg scan'' and is requested with the IEEE80211_IOC_SCAN_BGSCAN
736b032f27cSSam Leffler  * flag.  Background scans may take longer than foreground scans and may
737b032f27cSSam Leffler  * be preempted by traffic.  If a station is not associated to an AP
738b032f27cSSam Leffler  * then a request for a background scan is automatically done in the
739b032f27cSSam Leffler  * foreground.
740b032f27cSSam Leffler  *
741b032f27cSSam Leffler  * The results of the scan request are cached by the system.  This
742b032f27cSSam Leffler  * information is aged out and/or invalidated based on events like not
743b032f27cSSam Leffler  * being able to associated to an AP.  To flush the current cache
744b032f27cSSam Leffler  * contents before doing a scan the IEEE80211_IOC_SCAN_FLUSH flag may
745b032f27cSSam Leffler  * be specified.
746b032f27cSSam Leffler  *
747b032f27cSSam Leffler  * By default the scan will be done until a suitable AP is located
748b032f27cSSam Leffler  * or a channel is found for use.  A scan can also be constrained
749b032f27cSSam Leffler  * to be done once (IEEE80211_IOC_SCAN_ONCE) or to last for no more
750b032f27cSSam Leffler  * than a specified duration.
751b032f27cSSam Leffler  */
752b032f27cSSam Leffler struct ieee80211_scan_req {
753b032f27cSSam Leffler 	int		sr_flags;
754b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_NOPICK	0x00001	/* scan only, no selection */
755b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_ACTIVE	0x00002	/* active scan (probe req) */
756b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_PICK1ST	0x00004	/* ``hey sailor'' mode */
757b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_BGSCAN	0x00008	/* bg scan, exit ps at end */
758b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_ONCE		0x00010	/* do one complete pass */
759b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_NOBCAST	0x00020	/* don't send bcast probe req */
760b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_NOJOIN	0x00040	/* no auto-sequencing */
761b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_FLUSH	0x10000	/* flush scan cache first */
762b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_CHECK	0x20000	/* check scan cache first */
763b032f27cSSam Leffler 	u_int		sr_duration;		/* duration (ms) */
764b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_DURATION_MIN	1
765b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_DURATION_MAX	0x7fffffff
766b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_FOREVER	IEEE80211_IOC_SCAN_DURATION_MAX
767b032f27cSSam Leffler 	u_int		sr_mindwell;		/* min channel dwelltime (ms) */
768b032f27cSSam Leffler 	u_int		sr_maxdwell;		/* max channel dwelltime (ms) */
769b032f27cSSam Leffler 	int		sr_nssid;
770b032f27cSSam Leffler #define	IEEE80211_IOC_SCAN_MAX_SSID	3
771b032f27cSSam Leffler 	struct {
772b032f27cSSam Leffler 		int	 len;				/* length in bytes */
773b032f27cSSam Leffler 		uint8_t ssid[IEEE80211_NWID_LEN];	/* ssid contents */
774b032f27cSSam Leffler 	} sr_ssid[IEEE80211_IOC_SCAN_MAX_SSID];
775b032f27cSSam Leffler };
7761a1e1d21SSam Leffler 
7778a1b9b6aSSam Leffler /*
7788a1b9b6aSSam Leffler  * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS.
779239cc3b6SSam Leffler  * Each result is a fixed size structure followed by a variable
780239cc3b6SSam Leffler  * length SSID and one or more variable length information elements.
781239cc3b6SSam Leffler  * The size of each variable length item is found in the fixed
782239cc3b6SSam Leffler  * size structure and the entire length of the record is specified
783239cc3b6SSam Leffler  * in isr_len.  Result records are rounded to a multiple of 4 bytes.
7848a1b9b6aSSam Leffler  */
7858a1b9b6aSSam Leffler struct ieee80211req_scan_result {
786b032f27cSSam Leffler 	uint16_t	isr_len;		/* total length (mult of 4) */
787b032f27cSSam Leffler 	uint16_t	isr_ie_off;		/* offset to SSID+IE data */
78868e8e04eSSam Leffler 	uint16_t	isr_ie_len;		/* IE length */
78968e8e04eSSam Leffler 	uint16_t	isr_freq;		/* MHz */
79068e8e04eSSam Leffler 	uint16_t	isr_flags;		/* channel flags */
791239cc3b6SSam Leffler 	int8_t		isr_noise;
792239cc3b6SSam Leffler 	int8_t		isr_rssi;
793d28e9c14SRui Paulo 	uint16_t	isr_intval;		/* beacon interval */
79468e8e04eSSam Leffler 	uint8_t		isr_capinfo;		/* capabilities */
79568e8e04eSSam Leffler 	uint8_t		isr_erp;		/* ERP element */
79668e8e04eSSam Leffler 	uint8_t		isr_bssid[IEEE80211_ADDR_LEN];
79768e8e04eSSam Leffler 	uint8_t		isr_nrates;
79868e8e04eSSam Leffler 	uint8_t		isr_rates[IEEE80211_RATE_MAXSIZE];
79968e8e04eSSam Leffler 	uint8_t		isr_ssid_len;		/* SSID length */
80059aa14a9SRui Paulo 	uint8_t		isr_meshid_len;		/* MESH ID length */
80159aa14a9SRui Paulo 	/* variable length SSID, followed by variable length MESH ID,
80259aa14a9SRui Paulo 	  followed by IE data */
8038a1b9b6aSSam Leffler };
8041be50176SSam Leffler 
805b032f27cSSam Leffler /*
806b032f27cSSam Leffler  * Virtual AP cloning parameters.  The parent device must
807b032f27cSSam Leffler  * be a vap-capable device.  All parameters specified with
808b032f27cSSam Leffler  * the clone request are fixed for the lifetime of the vap.
809b032f27cSSam Leffler  *
810b032f27cSSam Leffler  * There are two flavors of WDS vaps: legacy and dynamic.
811b032f27cSSam Leffler  * Legacy WDS operation implements a static binding between
812b032f27cSSam Leffler  * two stations encapsulating traffic in 4-address frames.
813b032f27cSSam Leffler  * Dynamic WDS vaps are created when a station associates to
814b032f27cSSam Leffler  * an AP and sends a 4-address frame.  If the AP vap is
815b032f27cSSam Leffler  * configured to support WDS then this will generate an
816b032f27cSSam Leffler  * event to user programs listening on the routing socket
817b032f27cSSam Leffler  * and a Dynamic WDS vap will be created to handle traffic
818b032f27cSSam Leffler  * to/from that station.  In both cases the bssid of the
819b032f27cSSam Leffler  * peer must be specified when creating the vap.
820b032f27cSSam Leffler  *
821b032f27cSSam Leffler  * By default a vap will inherit the mac address/bssid of
822b032f27cSSam Leffler  * the underlying device.  To request a unique address the
823b032f27cSSam Leffler  * IEEE80211_CLONE_BSSID flag should be supplied.  This is
824b032f27cSSam Leffler  * meaningless for WDS vaps as they share the bssid of an
825b032f27cSSam Leffler  * AP vap that must otherwise exist.  Note that some devices
826b032f27cSSam Leffler  * may not be able to support multiple addresses.
827b032f27cSSam Leffler  *
828b032f27cSSam Leffler  * Station mode vap's normally depend on the device to notice
829b032f27cSSam Leffler  * when the AP stops sending beacon frames.  If IEEE80211_CLONE_NOBEACONS
830b032f27cSSam Leffler  * is specified the net80211 layer will do this in s/w.  This
831b032f27cSSam Leffler  * is mostly useful when setting up a WDS repeater/extender where
832b032f27cSSam Leffler  * an AP vap is combined with a sta vap and the device isn't able
833b032f27cSSam Leffler  * to track beacon frames in hardware.
834b032f27cSSam Leffler  */
83568e8e04eSSam Leffler struct ieee80211_clone_params {
83668e8e04eSSam Leffler 	char	icp_parent[IFNAMSIZ];		/* parent device */
837b032f27cSSam Leffler 	uint16_t icp_opmode;			/* operating mode */
838b032f27cSSam Leffler 	uint16_t icp_flags;			/* see below */
839b032f27cSSam Leffler 	uint8_t	icp_bssid[IEEE80211_ADDR_LEN];	/* for WDS links */
840b032f27cSSam Leffler 	uint8_t	icp_macaddr[IEEE80211_ADDR_LEN];/* local address */
84168e8e04eSSam Leffler };
842b032f27cSSam Leffler #define	IEEE80211_CLONE_BSSID		0x0001	/* allocate unique mac/bssid */
843b032f27cSSam Leffler #define	IEEE80211_CLONE_NOBEACONS	0x0002	/* don't setup beacon timers */
844b032f27cSSam Leffler #define	IEEE80211_CLONE_WDSLEGACY	0x0004	/* legacy WDS processing */
845b032f27cSSam Leffler #define	IEEE80211_CLONE_MACADDR		0x0008	/* use specified mac addr */
84610ad9a77SSam Leffler #define	IEEE80211_CLONE_TDMA		0x0010	/* operate in TDMA mode */
8471a1e1d21SSam Leffler #endif /* __FreeBSD__ */
8481a1e1d21SSam Leffler 
8491a1e1d21SSam Leffler #endif /* _NET80211_IEEE80211_IOCTL_H_ */
850