11a1e1d21SSam Leffler /*- 27535e66aSSam Leffler * Copyright (c) 2001 Atsushi Onoe 31f1d7810SSam Leffler * Copyright (c) 2002-2005 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 * 3. The name of the author may not be used to endorse or promote products 157535e66aSSam Leffler * derived from this software without specific prior written permission. 161a1e1d21SSam Leffler * 177535e66aSSam Leffler * Alternatively, this software may be distributed under the terms of the 187535e66aSSam Leffler * GNU General Public License ("GPL") version 2 as published by the Free 197535e66aSSam Leffler * Software Foundation. 207535e66aSSam Leffler * 217535e66aSSam Leffler * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 227535e66aSSam Leffler * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 237535e66aSSam Leffler * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 247535e66aSSam Leffler * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 257535e66aSSam Leffler * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 267535e66aSSam Leffler * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 277535e66aSSam Leffler * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 287535e66aSSam Leffler * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 297535e66aSSam Leffler * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 307535e66aSSam Leffler * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 311a1e1d21SSam Leffler * 321a1e1d21SSam Leffler * $FreeBSD$ 331a1e1d21SSam Leffler */ 341a1e1d21SSam Leffler #ifndef _NET80211_IEEE80211_IOCTL_H_ 351a1e1d21SSam Leffler #define _NET80211_IEEE80211_IOCTL_H_ 361a1e1d21SSam Leffler 371a1e1d21SSam Leffler /* 381a1e1d21SSam Leffler * IEEE 802.11 ioctls. 391a1e1d21SSam Leffler */ 408a1b9b6aSSam Leffler #include <net80211/_ieee80211.h> 418a1b9b6aSSam Leffler #include <net80211/ieee80211.h> 428a1b9b6aSSam Leffler #include <net80211/ieee80211_crypto.h> 431a1e1d21SSam Leffler 448a1b9b6aSSam Leffler /* 458a1b9b6aSSam Leffler * Per/node (station) statistics available when operating as an AP. 468a1b9b6aSSam Leffler */ 478a1b9b6aSSam Leffler struct ieee80211_nodestats { 488a1b9b6aSSam Leffler u_int32_t ns_rx_data; /* rx data frames */ 498a1b9b6aSSam Leffler u_int32_t ns_rx_mgmt; /* rx management frames */ 508a1b9b6aSSam Leffler u_int32_t ns_rx_ctrl; /* rx control frames */ 518a1b9b6aSSam Leffler u_int32_t ns_rx_ucast; /* rx unicast frames */ 528a1b9b6aSSam Leffler u_int32_t ns_rx_mcast; /* rx multi/broadcast frames */ 538a1b9b6aSSam Leffler u_int64_t ns_rx_bytes; /* rx data count (bytes) */ 548a1b9b6aSSam Leffler u_int64_t ns_rx_beacons; /* rx beacon frames */ 558a1b9b6aSSam Leffler u_int32_t ns_rx_proberesp; /* rx probe response frames */ 568a1b9b6aSSam Leffler 578a1b9b6aSSam Leffler u_int32_t ns_rx_dup; /* rx discard 'cuz dup */ 588a1b9b6aSSam Leffler u_int32_t ns_rx_noprivacy; /* rx w/ wep but privacy off */ 598a1b9b6aSSam Leffler u_int32_t ns_rx_wepfail; /* rx wep processing failed */ 608a1b9b6aSSam Leffler u_int32_t ns_rx_demicfail; /* rx demic failed */ 618a1b9b6aSSam Leffler u_int32_t ns_rx_decap; /* rx decapsulation failed */ 628a1b9b6aSSam Leffler u_int32_t ns_rx_defrag; /* rx defragmentation failed */ 638a1b9b6aSSam Leffler u_int32_t ns_rx_disassoc; /* rx disassociation */ 648a1b9b6aSSam Leffler u_int32_t ns_rx_deauth; /* rx deauthentication */ 658a1b9b6aSSam Leffler u_int32_t ns_rx_decryptcrc; /* rx decrypt failed on crc */ 668a1b9b6aSSam Leffler u_int32_t ns_rx_unauth; /* rx on unauthorized port */ 678a1b9b6aSSam Leffler u_int32_t ns_rx_unencrypted; /* rx unecrypted w/ privacy */ 688a1b9b6aSSam Leffler 698a1b9b6aSSam Leffler u_int32_t ns_tx_data; /* tx data frames */ 708a1b9b6aSSam Leffler u_int32_t ns_tx_mgmt; /* tx management frames */ 718a1b9b6aSSam Leffler u_int32_t ns_tx_ucast; /* tx unicast frames */ 728a1b9b6aSSam Leffler u_int32_t ns_tx_mcast; /* tx multi/broadcast frames */ 738a1b9b6aSSam Leffler u_int64_t ns_tx_bytes; /* tx data count (bytes) */ 748a1b9b6aSSam Leffler u_int32_t ns_tx_probereq; /* tx probe request frames */ 758a1b9b6aSSam Leffler 768a1b9b6aSSam Leffler u_int32_t ns_tx_novlantag; /* tx discard 'cuz no tag */ 778a1b9b6aSSam Leffler u_int32_t ns_tx_vlanmismatch; /* tx discard 'cuz bad tag */ 788a1b9b6aSSam Leffler 798a1b9b6aSSam Leffler u_int32_t ns_ps_discard; /* ps discard 'cuz of age */ 808a1b9b6aSSam Leffler 818a1b9b6aSSam Leffler /* MIB-related state */ 828a1b9b6aSSam Leffler u_int32_t ns_tx_assoc; /* [re]associations */ 838a1b9b6aSSam Leffler u_int32_t ns_tx_assoc_fail; /* [re]association failures */ 848a1b9b6aSSam Leffler u_int32_t ns_tx_auth; /* [re]authentications */ 858a1b9b6aSSam Leffler u_int32_t ns_tx_auth_fail; /* [re]authentication failures*/ 868a1b9b6aSSam Leffler u_int32_t ns_tx_deauth; /* deauthentications */ 878a1b9b6aSSam Leffler u_int32_t ns_tx_deauth_code; /* last deauth reason */ 888a1b9b6aSSam Leffler u_int32_t ns_tx_disassoc; /* disassociations */ 898a1b9b6aSSam Leffler u_int32_t ns_tx_disassoc_code; /* last disassociation reason */ 908a1b9b6aSSam Leffler }; 918a1b9b6aSSam Leffler 928a1b9b6aSSam Leffler /* 938a1b9b6aSSam Leffler * Summary statistics. 948a1b9b6aSSam Leffler */ 951be50176SSam Leffler struct ieee80211_stats { 961be50176SSam Leffler u_int32_t is_rx_badversion; /* rx frame with bad version */ 971be50176SSam Leffler u_int32_t is_rx_tooshort; /* rx frame too short */ 981be50176SSam Leffler u_int32_t is_rx_wrongbss; /* rx from wrong bssid */ 991be50176SSam Leffler u_int32_t is_rx_dup; /* rx discard 'cuz dup */ 1001be50176SSam Leffler u_int32_t is_rx_wrongdir; /* rx w/ wrong direction */ 1011be50176SSam Leffler u_int32_t is_rx_mcastecho; /* rx discard 'cuz mcast echo */ 1021be50176SSam Leffler u_int32_t is_rx_notassoc; /* rx discard 'cuz sta !assoc */ 1038a1b9b6aSSam Leffler u_int32_t is_rx_noprivacy; /* rx w/ wep but privacy off */ 1048a1b9b6aSSam Leffler u_int32_t is_rx_unencrypted; /* rx w/o wep and privacy on */ 1051be50176SSam Leffler u_int32_t is_rx_wepfail; /* rx wep processing failed */ 1061be50176SSam Leffler u_int32_t is_rx_decap; /* rx decapsulation failed */ 1071be50176SSam Leffler u_int32_t is_rx_mgtdiscard; /* rx discard mgt frames */ 1081be50176SSam Leffler u_int32_t is_rx_ctl; /* rx discard ctrl frames */ 1098a1b9b6aSSam Leffler u_int32_t is_rx_beacon; /* rx beacon frames */ 1101be50176SSam Leffler u_int32_t is_rx_rstoobig; /* rx rate set truncated */ 1111be50176SSam Leffler u_int32_t is_rx_elem_missing; /* rx required element missing*/ 1121be50176SSam Leffler u_int32_t is_rx_elem_toobig; /* rx element too big */ 1131be50176SSam Leffler u_int32_t is_rx_elem_toosmall; /* rx element too small */ 1141be50176SSam Leffler u_int32_t is_rx_elem_unknown; /* rx element unknown */ 1151be50176SSam Leffler u_int32_t is_rx_badchan; /* rx frame w/ invalid chan */ 1161be50176SSam Leffler u_int32_t is_rx_chanmismatch; /* rx frame chan mismatch */ 1171be50176SSam Leffler u_int32_t is_rx_nodealloc; /* rx frame dropped */ 1181be50176SSam Leffler u_int32_t is_rx_ssidmismatch; /* rx frame ssid mismatch */ 1191be50176SSam Leffler u_int32_t is_rx_auth_unsupported; /* rx w/ unsupported auth alg */ 1201be50176SSam Leffler u_int32_t is_rx_auth_fail; /* rx sta auth failure */ 1218a1b9b6aSSam Leffler u_int32_t is_rx_auth_countermeasures;/* rx auth discard 'cuz CM */ 1221be50176SSam Leffler u_int32_t is_rx_assoc_bss; /* rx assoc from wrong bssid */ 1231be50176SSam Leffler u_int32_t is_rx_assoc_notauth; /* rx assoc w/o auth */ 1241be50176SSam Leffler u_int32_t is_rx_assoc_capmismatch;/* rx assoc w/ cap mismatch */ 1251be50176SSam Leffler u_int32_t is_rx_assoc_norate; /* rx assoc w/ no rate match */ 1268a1b9b6aSSam Leffler u_int32_t is_rx_assoc_badwpaie; /* rx assoc w/ bad WPA IE */ 1271be50176SSam Leffler u_int32_t is_rx_deauth; /* rx deauthentication */ 1281be50176SSam Leffler u_int32_t is_rx_disassoc; /* rx disassociation */ 1291be50176SSam Leffler u_int32_t is_rx_badsubtype; /* rx frame w/ unknown subtype*/ 1308a1b9b6aSSam Leffler u_int32_t is_rx_nobuf; /* rx failed for lack of buf */ 1311be50176SSam Leffler u_int32_t is_rx_decryptcrc; /* rx decrypt failed on crc */ 1321be50176SSam Leffler u_int32_t is_rx_ahdemo_mgt; /* rx discard ahdemo mgt frame*/ 1331be50176SSam Leffler u_int32_t is_rx_bad_auth; /* rx bad auth request */ 1348a1b9b6aSSam Leffler u_int32_t is_rx_unauth; /* rx on unauthorized port */ 1358a1b9b6aSSam Leffler u_int32_t is_rx_badkeyid; /* rx w/ incorrect keyid */ 1368a1b9b6aSSam Leffler u_int32_t is_rx_ccmpreplay; /* rx seq# violation (CCMP) */ 1378a1b9b6aSSam Leffler u_int32_t is_rx_ccmpformat; /* rx format bad (CCMP) */ 1388a1b9b6aSSam Leffler u_int32_t is_rx_ccmpmic; /* rx MIC check failed (CCMP) */ 1398a1b9b6aSSam Leffler u_int32_t is_rx_tkipreplay; /* rx seq# violation (TKIP) */ 1408a1b9b6aSSam Leffler u_int32_t is_rx_tkipformat; /* rx format bad (TKIP) */ 1418a1b9b6aSSam Leffler u_int32_t is_rx_tkipmic; /* rx MIC check failed (TKIP) */ 1428a1b9b6aSSam Leffler u_int32_t is_rx_tkipicv; /* rx ICV check failed (TKIP) */ 1438a1b9b6aSSam Leffler u_int32_t is_rx_badcipher; /* rx failed 'cuz key type */ 1448a1b9b6aSSam Leffler u_int32_t is_rx_nocipherctx; /* rx failed 'cuz key !setup */ 1458a1b9b6aSSam Leffler u_int32_t is_rx_acl; /* rx discard 'cuz acl policy */ 1468a1b9b6aSSam Leffler u_int32_t is_tx_nobuf; /* tx failed for lack of buf */ 1471be50176SSam Leffler u_int32_t is_tx_nonode; /* tx failed for no node */ 1481be50176SSam Leffler u_int32_t is_tx_unknownmgt; /* tx of unknown mgt frame */ 1498a1b9b6aSSam Leffler u_int32_t is_tx_badcipher; /* tx failed 'cuz key type */ 1508a1b9b6aSSam Leffler u_int32_t is_tx_nodefkey; /* tx failed 'cuz no defkey */ 1518a1b9b6aSSam Leffler u_int32_t is_tx_noheadroom; /* tx failed 'cuz no space */ 1521be50176SSam Leffler u_int32_t is_scan_active; /* active scans started */ 1531be50176SSam Leffler u_int32_t is_scan_passive; /* passive scans started */ 1541be50176SSam Leffler u_int32_t is_node_timeout; /* nodes timed out inactivity */ 1551be50176SSam Leffler u_int32_t is_crypto_nomem; /* no memory for crypto ctx */ 1568a1b9b6aSSam Leffler u_int32_t is_crypto_tkip; /* tkip crypto done in s/w */ 1578a1b9b6aSSam Leffler u_int32_t is_crypto_tkipenmic; /* tkip en-MIC done in s/w */ 1588a1b9b6aSSam Leffler u_int32_t is_crypto_tkipdemic; /* tkip de-MIC done in s/w */ 1598a1b9b6aSSam Leffler u_int32_t is_crypto_tkipcm; /* tkip counter measures */ 1608a1b9b6aSSam Leffler u_int32_t is_crypto_ccmp; /* ccmp crypto done in s/w */ 1618a1b9b6aSSam Leffler u_int32_t is_crypto_wep; /* wep crypto done in s/w */ 1628a1b9b6aSSam Leffler u_int32_t is_crypto_setkey_cipher;/* cipher rejected key */ 1638a1b9b6aSSam Leffler u_int32_t is_crypto_setkey_nokey; /* no key index for setkey */ 1648a1b9b6aSSam Leffler u_int32_t is_crypto_delkey; /* driver key delete failed */ 1658a1b9b6aSSam Leffler u_int32_t is_crypto_badcipher; /* unknown cipher */ 1668a1b9b6aSSam Leffler u_int32_t is_crypto_nocipher; /* cipher not available */ 1678a1b9b6aSSam Leffler u_int32_t is_crypto_attachfail; /* cipher attach failed */ 1688a1b9b6aSSam Leffler u_int32_t is_crypto_swfallback; /* cipher fallback to s/w */ 1698a1b9b6aSSam Leffler u_int32_t is_crypto_keyfail; /* driver key alloc failed */ 1705e923d2eSSam Leffler u_int32_t is_crypto_enmicfail; /* en-MIC failed */ 1718a1b9b6aSSam Leffler u_int32_t is_ibss_capmismatch; /* merge failed-cap mismatch */ 1728a1b9b6aSSam Leffler u_int32_t is_ibss_norate; /* merge failed-rate mismatch */ 1738a1b9b6aSSam Leffler u_int32_t is_ps_unassoc; /* ps-poll for unassoc. sta */ 1748a1b9b6aSSam Leffler u_int32_t is_ps_badaid; /* ps-poll w/ incorrect aid */ 1758a1b9b6aSSam Leffler u_int32_t is_ps_qempty; /* ps-poll w/ nothing to send */ 1761be50176SSam Leffler }; 1771be50176SSam Leffler 1788a1b9b6aSSam Leffler /* 1798a1b9b6aSSam Leffler * Max size of optional information elements. We artificially 1808a1b9b6aSSam Leffler * constrain this; it's limited only by the max frame size (and 1818a1b9b6aSSam Leffler * the max parameter size of the wireless extensions). 1828a1b9b6aSSam Leffler */ 1838a1b9b6aSSam Leffler #define IEEE80211_MAX_OPT_IE 256 1848a1b9b6aSSam Leffler 1858a1b9b6aSSam Leffler /* 1868a1b9b6aSSam Leffler * WPA/RSN get/set key request. Specify the key/cipher 1878a1b9b6aSSam Leffler * type and whether the key is to be used for sending and/or 1888a1b9b6aSSam Leffler * receiving. The key index should be set only when working 1898a1b9b6aSSam Leffler * with global keys (use IEEE80211_KEYIX_NONE for ``no index''). 1908a1b9b6aSSam Leffler * Otherwise a unicast/pairwise key is specified by the bssid 1918a1b9b6aSSam Leffler * (on a station) or mac address (on an ap). They key length 1928a1b9b6aSSam Leffler * must include any MIC key data; otherwise it should be no 1938a1b9b6aSSam Leffler more than IEEE80211_KEYBUF_SIZE. 1948a1b9b6aSSam Leffler */ 1958a1b9b6aSSam Leffler struct ieee80211req_key { 1968a1b9b6aSSam Leffler u_int8_t ik_type; /* key/cipher type */ 1978a1b9b6aSSam Leffler u_int8_t ik_pad; 1988a1b9b6aSSam Leffler u_int16_t ik_keyix; /* key index */ 1998a1b9b6aSSam Leffler u_int8_t ik_keylen; /* key length in bytes */ 2008a1b9b6aSSam Leffler u_int8_t ik_flags; 2018a1b9b6aSSam Leffler /* NB: IEEE80211_KEY_XMIT and IEEE80211_KEY_RECV defined elsewhere */ 2028a1b9b6aSSam Leffler #define IEEE80211_KEY_DEFAULT 0x80 /* default xmit key */ 2038a1b9b6aSSam Leffler u_int8_t ik_macaddr[IEEE80211_ADDR_LEN]; 2048a1b9b6aSSam Leffler u_int64_t ik_keyrsc; /* key receive sequence counter */ 2058a1b9b6aSSam Leffler u_int64_t ik_keytsc; /* key transmit sequence counter */ 2068a1b9b6aSSam Leffler u_int8_t ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE]; 2078a1b9b6aSSam Leffler }; 2088a1b9b6aSSam Leffler 2098a1b9b6aSSam Leffler /* 2108a1b9b6aSSam Leffler * Delete a key either by index or address. Set the index 2118a1b9b6aSSam Leffler * to IEEE80211_KEYIX_NONE when deleting a unicast key. 2128a1b9b6aSSam Leffler */ 2138a1b9b6aSSam Leffler struct ieee80211req_del_key { 2148a1b9b6aSSam Leffler u_int8_t idk_keyix; /* key index */ 2158a1b9b6aSSam Leffler u_int8_t idk_macaddr[IEEE80211_ADDR_LEN]; 2168a1b9b6aSSam Leffler }; 2178a1b9b6aSSam Leffler 2188a1b9b6aSSam Leffler /* 2198a1b9b6aSSam Leffler * MLME state manipulation request. IEEE80211_MLME_ASSOC 2208a1b9b6aSSam Leffler * only makes sense when operating as a station. The other 2218a1b9b6aSSam Leffler * requests can be used when operating as a station or an 2228a1b9b6aSSam Leffler * ap (to effect a station). 2238a1b9b6aSSam Leffler */ 2248a1b9b6aSSam Leffler struct ieee80211req_mlme { 2258a1b9b6aSSam Leffler u_int8_t im_op; /* operation to perform */ 2268a1b9b6aSSam Leffler #define IEEE80211_MLME_ASSOC 1 /* associate station */ 2278a1b9b6aSSam Leffler #define IEEE80211_MLME_DISASSOC 2 /* disassociate station */ 2288a1b9b6aSSam Leffler #define IEEE80211_MLME_DEAUTH 3 /* deauthenticate station */ 2298a1b9b6aSSam Leffler #define IEEE80211_MLME_AUTHORIZE 4 /* authorize station */ 2308a1b9b6aSSam Leffler #define IEEE80211_MLME_UNAUTHORIZE 5 /* unauthorize station */ 231f02a0bd2SSam Leffler u_int8_t im_ssid_len; /* length of optional ssid */ 2328a1b9b6aSSam Leffler u_int16_t im_reason; /* 802.11 reason code */ 2338a1b9b6aSSam Leffler u_int8_t im_macaddr[IEEE80211_ADDR_LEN]; 234f02a0bd2SSam Leffler u_int8_t im_ssid[IEEE80211_NWID_LEN]; 2358a1b9b6aSSam Leffler }; 2368a1b9b6aSSam Leffler 2378a1b9b6aSSam Leffler /* 2388a1b9b6aSSam Leffler * MAC ACL operations. 2398a1b9b6aSSam Leffler */ 2408a1b9b6aSSam Leffler enum { 2418a1b9b6aSSam Leffler IEEE80211_MACCMD_POLICY_OPEN = 0, /* set policy: no ACL's */ 2428a1b9b6aSSam Leffler IEEE80211_MACCMD_POLICY_ALLOW = 1, /* set policy: allow traffic */ 2438a1b9b6aSSam Leffler IEEE80211_MACCMD_POLICY_DENY = 2, /* set policy: deny traffic */ 2448a1b9b6aSSam Leffler IEEE80211_MACCMD_FLUSH = 3, /* flush ACL database */ 2458a1b9b6aSSam Leffler IEEE80211_MACCMD_DETACH = 4, /* detach ACL policy */ 2468a1b9b6aSSam Leffler }; 2478a1b9b6aSSam Leffler 2488a1b9b6aSSam Leffler /* 2498a1b9b6aSSam Leffler * Set the active channel list. Note this list is 2508a1b9b6aSSam Leffler * intersected with the available channel list in 2518a1b9b6aSSam Leffler * calculating the set of channels actually used in 2528a1b9b6aSSam Leffler * scanning. 2538a1b9b6aSSam Leffler */ 2548a1b9b6aSSam Leffler struct ieee80211req_chanlist { 2558a1b9b6aSSam Leffler u_int8_t ic_channels[IEEE80211_CHAN_BYTES]; 2568a1b9b6aSSam Leffler }; 2578a1b9b6aSSam Leffler 2588a1b9b6aSSam Leffler /* 2598a1b9b6aSSam Leffler * Get the active channel list info. 2608a1b9b6aSSam Leffler */ 2618a1b9b6aSSam Leffler struct ieee80211req_chaninfo { 2628a1b9b6aSSam Leffler u_int ic_nchans; 2638a1b9b6aSSam Leffler struct ieee80211_channel ic_chans[IEEE80211_CHAN_MAX]; 2648a1b9b6aSSam Leffler }; 2658a1b9b6aSSam Leffler 2668a1b9b6aSSam Leffler /* 2678a1b9b6aSSam Leffler * Retrieve the WPA/RSN information element for an associated station. 2688a1b9b6aSSam Leffler */ 2698a1b9b6aSSam Leffler struct ieee80211req_wpaie { 2708a1b9b6aSSam Leffler u_int8_t wpa_macaddr[IEEE80211_ADDR_LEN]; 2718a1b9b6aSSam Leffler u_int8_t wpa_ie[IEEE80211_MAX_OPT_IE]; 2728a1b9b6aSSam Leffler }; 2738a1b9b6aSSam Leffler 2748a1b9b6aSSam Leffler /* 2758a1b9b6aSSam Leffler * Retrieve per-node statistics. 2768a1b9b6aSSam Leffler */ 2778a1b9b6aSSam Leffler struct ieee80211req_sta_stats { 2788a1b9b6aSSam Leffler union { 2798a1b9b6aSSam Leffler /* NB: explicitly force 64-bit alignment */ 2808a1b9b6aSSam Leffler u_int8_t macaddr[IEEE80211_ADDR_LEN]; 2818a1b9b6aSSam Leffler u_int64_t pad; 2828a1b9b6aSSam Leffler } is_u; 2838a1b9b6aSSam Leffler struct ieee80211_nodestats is_stats; 2848a1b9b6aSSam Leffler }; 2858a1b9b6aSSam Leffler 2868a1b9b6aSSam Leffler /* 2878a1b9b6aSSam Leffler * Station information block; the mac address is used 2888a1b9b6aSSam Leffler * to retrieve other data like stats, unicast key, etc. 2898a1b9b6aSSam Leffler */ 2908a1b9b6aSSam Leffler struct ieee80211req_sta_info { 2918a1b9b6aSSam Leffler u_int16_t isi_len; /* length (mult of 4) */ 2928a1b9b6aSSam Leffler u_int16_t isi_freq; /* MHz */ 2938a1b9b6aSSam Leffler u_int16_t isi_flags; /* channel flags */ 2948a1b9b6aSSam Leffler u_int16_t isi_state; /* state flags */ 2958a1b9b6aSSam Leffler u_int8_t isi_authmode; /* authentication algorithm */ 2968a1b9b6aSSam Leffler u_int8_t isi_rssi; 2978a1b9b6aSSam Leffler u_int8_t isi_capinfo; /* capabilities */ 2988a1b9b6aSSam Leffler u_int8_t isi_erp; /* ERP element */ 2998a1b9b6aSSam Leffler u_int8_t isi_macaddr[IEEE80211_ADDR_LEN]; 3008a1b9b6aSSam Leffler u_int8_t isi_nrates; 3018a1b9b6aSSam Leffler /* negotiated rates */ 3028a1b9b6aSSam Leffler u_int8_t isi_rates[IEEE80211_RATE_MAXSIZE]; 3038a1b9b6aSSam Leffler u_int8_t isi_txrate; /* index to isi_rates[] */ 3048a1b9b6aSSam Leffler u_int16_t isi_ie_len; /* IE length */ 3058a1b9b6aSSam Leffler u_int16_t isi_associd; /* assoc response */ 3068a1b9b6aSSam Leffler u_int16_t isi_txpower; /* current tx power */ 3078a1b9b6aSSam Leffler u_int16_t isi_vlan; /* vlan tag */ 3088a1b9b6aSSam Leffler u_int16_t isi_txseqs[17]; /* seq to be transmitted */ 3098a1b9b6aSSam Leffler u_int16_t isi_rxseqs[17]; /* seq previous for qos frames*/ 3108a1b9b6aSSam Leffler u_int16_t isi_inact; /* inactivity timer */ 3118a1b9b6aSSam Leffler /* XXX frag state? */ 3128a1b9b6aSSam Leffler /* variable length IE data */ 3138a1b9b6aSSam Leffler }; 3148a1b9b6aSSam Leffler 3158a1b9b6aSSam Leffler /* 3168a1b9b6aSSam Leffler * Retrieve per-station information; to retrieve all 3178a1b9b6aSSam Leffler * specify a mac address of ff:ff:ff:ff:ff:ff. 3188a1b9b6aSSam Leffler */ 3198a1b9b6aSSam Leffler struct ieee80211req_sta_req { 3208a1b9b6aSSam Leffler union { 3218a1b9b6aSSam Leffler /* NB: explicitly force 64-bit alignment */ 3228a1b9b6aSSam Leffler u_int8_t macaddr[IEEE80211_ADDR_LEN]; 3238a1b9b6aSSam Leffler u_int64_t pad; 3248a1b9b6aSSam Leffler } is_u; 3258a1b9b6aSSam Leffler struct ieee80211req_sta_info info[1]; /* variable length */ 3268a1b9b6aSSam Leffler }; 3278a1b9b6aSSam Leffler 3288a1b9b6aSSam Leffler /* 3298a1b9b6aSSam Leffler * Get/set per-station tx power cap. 3308a1b9b6aSSam Leffler */ 3318a1b9b6aSSam Leffler struct ieee80211req_sta_txpow { 3328a1b9b6aSSam Leffler u_int8_t it_macaddr[IEEE80211_ADDR_LEN]; 3338a1b9b6aSSam Leffler u_int8_t it_txpow; 3348a1b9b6aSSam Leffler }; 3358a1b9b6aSSam Leffler 3368a1b9b6aSSam Leffler /* 3378a1b9b6aSSam Leffler * WME parameters are set and return using i_val and i_len. 3388a1b9b6aSSam Leffler * i_val holds the value itself. i_len specifies the AC 3398a1b9b6aSSam Leffler * and, as appropriate, then high bit specifies whether the 3408a1b9b6aSSam Leffler * operation is to be applied to the BSS or ourself. 3418a1b9b6aSSam Leffler */ 3428a1b9b6aSSam Leffler #define IEEE80211_WMEPARAM_SELF 0x0000 /* parameter applies to self */ 3438a1b9b6aSSam Leffler #define IEEE80211_WMEPARAM_BSS 0x8000 /* parameter applies to BSS */ 3448a1b9b6aSSam Leffler #define IEEE80211_WMEPARAM_VAL 0x7fff /* parameter value */ 3458a1b9b6aSSam Leffler 3461a1e1d21SSam Leffler #ifdef __FreeBSD__ 3471a1e1d21SSam Leffler /* 3481a1e1d21SSam Leffler * FreeBSD-style ioctls. 3491a1e1d21SSam Leffler */ 3501a1e1d21SSam Leffler /* the first member must be matched with struct ifreq */ 3511a1e1d21SSam Leffler struct ieee80211req { 3521a1e1d21SSam Leffler char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */ 3531a1e1d21SSam Leffler u_int16_t i_type; /* req type */ 3541a1e1d21SSam Leffler int16_t i_val; /* Index or simple value */ 3551a1e1d21SSam Leffler int16_t i_len; /* Index or simple value */ 3561a1e1d21SSam Leffler void *i_data; /* Extra data */ 3571a1e1d21SSam Leffler }; 3581a1e1d21SSam Leffler #define SIOCS80211 _IOW('i', 234, struct ieee80211req) 3591a1e1d21SSam Leffler #define SIOCG80211 _IOWR('i', 235, struct ieee80211req) 3601a1e1d21SSam Leffler 3611a1e1d21SSam Leffler #define IEEE80211_IOC_SSID 1 3621a1e1d21SSam Leffler #define IEEE80211_IOC_NUMSSIDS 2 3631a1e1d21SSam Leffler #define IEEE80211_IOC_WEP 3 3641a1e1d21SSam Leffler #define IEEE80211_WEP_NOSUP -1 3651a1e1d21SSam Leffler #define IEEE80211_WEP_OFF 0 3661a1e1d21SSam Leffler #define IEEE80211_WEP_ON 1 3671a1e1d21SSam Leffler #define IEEE80211_WEP_MIXED 2 3681a1e1d21SSam Leffler #define IEEE80211_IOC_WEPKEY 4 3691a1e1d21SSam Leffler #define IEEE80211_IOC_NUMWEPKEYS 5 3701a1e1d21SSam Leffler #define IEEE80211_IOC_WEPTXKEY 6 3711a1e1d21SSam Leffler #define IEEE80211_IOC_AUTHMODE 7 3721a1e1d21SSam Leffler #define IEEE80211_IOC_STATIONNAME 8 3731a1e1d21SSam Leffler #define IEEE80211_IOC_CHANNEL 9 3741a1e1d21SSam Leffler #define IEEE80211_IOC_POWERSAVE 10 3751a1e1d21SSam Leffler #define IEEE80211_POWERSAVE_NOSUP -1 3761a1e1d21SSam Leffler #define IEEE80211_POWERSAVE_OFF 0 3771a1e1d21SSam Leffler #define IEEE80211_POWERSAVE_CAM 1 3781a1e1d21SSam Leffler #define IEEE80211_POWERSAVE_PSP 2 3791a1e1d21SSam Leffler #define IEEE80211_POWERSAVE_PSP_CAM 3 3801a1e1d21SSam Leffler #define IEEE80211_POWERSAVE_ON IEEE80211_POWERSAVE_CAM 3811a1e1d21SSam Leffler #define IEEE80211_IOC_POWERSAVESLEEP 11 38213604e6bSSam Leffler #define IEEE80211_IOC_RTSTHRESHOLD 12 3832e79ca97SSam Leffler #define IEEE80211_IOC_PROTMODE 13 3842e79ca97SSam Leffler #define IEEE80211_PROTMODE_OFF 0 3852e79ca97SSam Leffler #define IEEE80211_PROTMODE_CTS 1 3862e79ca97SSam Leffler #define IEEE80211_PROTMODE_RTSCTS 2 3878a1b9b6aSSam Leffler #define IEEE80211_IOC_TXPOWER 14 /* global tx power limit */ 3888a1b9b6aSSam Leffler #define IEEE80211_IOC_BSSID 15 3898a1b9b6aSSam Leffler #define IEEE80211_IOC_ROAMING 16 /* roaming mode */ 3908a1b9b6aSSam Leffler #define IEEE80211_IOC_PRIVACY 17 /* privacy invoked */ 3918a1b9b6aSSam Leffler #define IEEE80211_IOC_DROPUNENCRYPTED 18 /* discard unencrypted frames */ 3928a1b9b6aSSam Leffler #define IEEE80211_IOC_WPAKEY 19 3938a1b9b6aSSam Leffler #define IEEE80211_IOC_DELKEY 20 3948a1b9b6aSSam Leffler #define IEEE80211_IOC_MLME 21 3958a1b9b6aSSam Leffler #define IEEE80211_IOC_OPTIE 22 /* optional info. element */ 3968a1b9b6aSSam Leffler #define IEEE80211_IOC_SCAN_REQ 23 3978a1b9b6aSSam Leffler #define IEEE80211_IOC_SCAN_RESULTS 24 3988a1b9b6aSSam Leffler #define IEEE80211_IOC_COUNTERMEASURES 25 /* WPA/TKIP countermeasures */ 3998a1b9b6aSSam Leffler #define IEEE80211_IOC_WPA 26 /* WPA mode (0,1,2) */ 4008a1b9b6aSSam Leffler #define IEEE80211_IOC_CHANLIST 27 /* channel list */ 4018a1b9b6aSSam Leffler #define IEEE80211_IOC_WME 28 /* WME mode (on, off) */ 4028a1b9b6aSSam Leffler #define IEEE80211_IOC_HIDESSID 29 /* hide SSID mode (on, off) */ 4038a1b9b6aSSam Leffler #define IEEE80211_IOC_APBRIDGE 30 /* AP inter-sta bridging */ 4048a1b9b6aSSam Leffler #define IEEE80211_IOC_MCASTCIPHER 31 /* multicast/default cipher */ 4058a1b9b6aSSam Leffler #define IEEE80211_IOC_MCASTKEYLEN 32 /* multicast key length */ 4068a1b9b6aSSam Leffler #define IEEE80211_IOC_UCASTCIPHERS 33 /* unicast cipher suites */ 4078a1b9b6aSSam Leffler #define IEEE80211_IOC_UCASTCIPHER 34 /* unicast cipher */ 4088a1b9b6aSSam Leffler #define IEEE80211_IOC_UCASTKEYLEN 35 /* unicast key length */ 4098a1b9b6aSSam Leffler #define IEEE80211_IOC_DRIVER_CAPS 36 /* driver capabilities */ 4108a1b9b6aSSam Leffler #define IEEE80211_IOC_KEYMGTALGS 37 /* key management algorithms */ 4118a1b9b6aSSam Leffler #define IEEE80211_IOC_RSNCAPS 38 /* RSN capabilities */ 4128a1b9b6aSSam Leffler #define IEEE80211_IOC_WPAIE 39 /* WPA information element */ 4138a1b9b6aSSam Leffler #define IEEE80211_IOC_STA_STATS 40 /* per-station statistics */ 4148a1b9b6aSSam Leffler #define IEEE80211_IOC_MACCMD 41 /* MAC ACL operation */ 4158a1b9b6aSSam Leffler #define IEEE80211_IOC_CHANINFO 42 /* channel info list */ 4168a1b9b6aSSam Leffler #define IEEE80211_IOC_TXPOWMAX 43 /* max tx power for channel */ 4178a1b9b6aSSam Leffler #define IEEE80211_IOC_STA_TXPOW 44 /* per-station tx power limit */ 4188a1b9b6aSSam Leffler #define IEEE80211_IOC_STA_INFO 45 /* station/neighbor info */ 4198a1b9b6aSSam Leffler #define IEEE80211_IOC_WME_CWMIN 46 /* WME: ECWmin */ 4208a1b9b6aSSam Leffler #define IEEE80211_IOC_WME_CWMAX 47 /* WME: ECWmax */ 4218a1b9b6aSSam Leffler #define IEEE80211_IOC_WME_AIFS 48 /* WME: AIFSN */ 4228a1b9b6aSSam Leffler #define IEEE80211_IOC_WME_TXOPLIMIT 49 /* WME: txops limit */ 4238a1b9b6aSSam Leffler #define IEEE80211_IOC_WME_ACM 50 /* WME: ACM (bss only) */ 4248a1b9b6aSSam Leffler #define IEEE80211_IOC_WME_ACKPOLICY 51 /* WME: ACK policy (!bss only)*/ 4258a1b9b6aSSam Leffler #define IEEE80211_IOC_DTIM_PERIOD 52 /* DTIM period (beacons) */ 4268a1b9b6aSSam Leffler #define IEEE80211_IOC_BEACON_INTERVAL 53 /* beacon interval (ms) */ 4278a1b9b6aSSam Leffler #define IEEE80211_IOC_ADDMAC 54 /* add sta to MAC ACL table */ 4288a1b9b6aSSam Leffler #define IEEE80211_IOC_DELMAC 55 /* del sta from MAC ACL table */ 4291a1e1d21SSam Leffler 4308a1b9b6aSSam Leffler /* 4318a1b9b6aSSam Leffler * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS. 4328a1b9b6aSSam Leffler */ 4338a1b9b6aSSam Leffler struct ieee80211req_scan_result { 4348a1b9b6aSSam Leffler u_int16_t isr_len; /* length (mult of 4) */ 4358a1b9b6aSSam Leffler u_int16_t isr_freq; /* MHz */ 4368a1b9b6aSSam Leffler u_int16_t isr_flags; /* channel flags */ 4378a1b9b6aSSam Leffler u_int8_t isr_noise; 4388a1b9b6aSSam Leffler u_int8_t isr_rssi; 4398a1b9b6aSSam Leffler u_int8_t isr_intval; /* beacon interval */ 4408a1b9b6aSSam Leffler u_int8_t isr_capinfo; /* capabilities */ 4418a1b9b6aSSam Leffler u_int8_t isr_erp; /* ERP element */ 4428a1b9b6aSSam Leffler u_int8_t isr_bssid[IEEE80211_ADDR_LEN]; 4438a1b9b6aSSam Leffler u_int8_t isr_nrates; 4448a1b9b6aSSam Leffler u_int8_t isr_rates[IEEE80211_RATE_MAXSIZE]; 4458a1b9b6aSSam Leffler u_int8_t isr_ssid_len; /* SSID length */ 4468a1b9b6aSSam Leffler u_int8_t isr_ie_len; /* IE length */ 4478a1b9b6aSSam Leffler u_int8_t isr_pad[5]; 4488a1b9b6aSSam Leffler /* variable length SSID followed by IE data */ 4498a1b9b6aSSam Leffler }; 4501be50176SSam Leffler 4511be50176SSam Leffler #define SIOCG80211STATS _IOWR('i', 236, struct ifreq) 4521a1e1d21SSam Leffler #endif /* __FreeBSD__ */ 4531a1e1d21SSam Leffler 4541a1e1d21SSam Leffler #endif /* _NET80211_IEEE80211_IOCTL_H_ */ 455