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 */ 1520677adcdSSam Leffler u_int32_t is_tx_fragframes; /* tx frames fragmented */ 1530677adcdSSam Leffler u_int32_t is_tx_frags; /* tx fragments created */ 1541be50176SSam Leffler u_int32_t is_scan_active; /* active scans started */ 1551be50176SSam Leffler u_int32_t is_scan_passive; /* passive scans started */ 1561be50176SSam Leffler u_int32_t is_node_timeout; /* nodes timed out inactivity */ 1571be50176SSam Leffler u_int32_t is_crypto_nomem; /* no memory for crypto ctx */ 1588a1b9b6aSSam Leffler u_int32_t is_crypto_tkip; /* tkip crypto done in s/w */ 1598a1b9b6aSSam Leffler u_int32_t is_crypto_tkipenmic; /* tkip en-MIC done in s/w */ 1608a1b9b6aSSam Leffler u_int32_t is_crypto_tkipdemic; /* tkip de-MIC done in s/w */ 1618a1b9b6aSSam Leffler u_int32_t is_crypto_tkipcm; /* tkip counter measures */ 1628a1b9b6aSSam Leffler u_int32_t is_crypto_ccmp; /* ccmp crypto done in s/w */ 1638a1b9b6aSSam Leffler u_int32_t is_crypto_wep; /* wep crypto done in s/w */ 1648a1b9b6aSSam Leffler u_int32_t is_crypto_setkey_cipher;/* cipher rejected key */ 1658a1b9b6aSSam Leffler u_int32_t is_crypto_setkey_nokey; /* no key index for setkey */ 1668a1b9b6aSSam Leffler u_int32_t is_crypto_delkey; /* driver key delete failed */ 1678a1b9b6aSSam Leffler u_int32_t is_crypto_badcipher; /* unknown cipher */ 1688a1b9b6aSSam Leffler u_int32_t is_crypto_nocipher; /* cipher not available */ 1698a1b9b6aSSam Leffler u_int32_t is_crypto_attachfail; /* cipher attach failed */ 1708a1b9b6aSSam Leffler u_int32_t is_crypto_swfallback; /* cipher fallback to s/w */ 1718a1b9b6aSSam Leffler u_int32_t is_crypto_keyfail; /* driver key alloc failed */ 1725e923d2eSSam Leffler u_int32_t is_crypto_enmicfail; /* en-MIC failed */ 1738a1b9b6aSSam Leffler u_int32_t is_ibss_capmismatch; /* merge failed-cap mismatch */ 1748a1b9b6aSSam Leffler u_int32_t is_ibss_norate; /* merge failed-rate mismatch */ 1758a1b9b6aSSam Leffler u_int32_t is_ps_unassoc; /* ps-poll for unassoc. sta */ 1768a1b9b6aSSam Leffler u_int32_t is_ps_badaid; /* ps-poll w/ incorrect aid */ 1778a1b9b6aSSam Leffler u_int32_t is_ps_qempty; /* ps-poll w/ nothing to send */ 1780677adcdSSam Leffler u_int32_t is_ff_badhdr; /* fast frame rx'd w/ bad hdr */ 1790677adcdSSam Leffler u_int32_t is_ff_tooshort; /* fast frame rx decap error */ 1800677adcdSSam Leffler u_int32_t is_ff_split; /* fast frame rx split error */ 1810677adcdSSam Leffler u_int32_t is_ff_decap; /* fast frames decap'd */ 1820677adcdSSam Leffler u_int32_t is_ff_encap; /* fast frames encap'd for tx */ 183d365f9c7SSam Leffler u_int32_t is_rx_badbintval; /* rx frame w/ bogus bintval */ 184d365f9c7SSam Leffler u_int32_t is_spare[9]; 1851be50176SSam Leffler }; 1861be50176SSam Leffler 1878a1b9b6aSSam Leffler /* 1888a1b9b6aSSam Leffler * Max size of optional information elements. We artificially 1898a1b9b6aSSam Leffler * constrain this; it's limited only by the max frame size (and 1908a1b9b6aSSam Leffler * the max parameter size of the wireless extensions). 1918a1b9b6aSSam Leffler */ 1928a1b9b6aSSam Leffler #define IEEE80211_MAX_OPT_IE 256 1938a1b9b6aSSam Leffler 1948a1b9b6aSSam Leffler /* 1958a1b9b6aSSam Leffler * WPA/RSN get/set key request. Specify the key/cipher 1968a1b9b6aSSam Leffler * type and whether the key is to be used for sending and/or 1978a1b9b6aSSam Leffler * receiving. The key index should be set only when working 1988a1b9b6aSSam Leffler * with global keys (use IEEE80211_KEYIX_NONE for ``no index''). 1998a1b9b6aSSam Leffler * Otherwise a unicast/pairwise key is specified by the bssid 2008a1b9b6aSSam Leffler * (on a station) or mac address (on an ap). They key length 2018a1b9b6aSSam Leffler * must include any MIC key data; otherwise it should be no 2028a1b9b6aSSam Leffler more than IEEE80211_KEYBUF_SIZE. 2038a1b9b6aSSam Leffler */ 2048a1b9b6aSSam Leffler struct ieee80211req_key { 2058a1b9b6aSSam Leffler u_int8_t ik_type; /* key/cipher type */ 2068a1b9b6aSSam Leffler u_int8_t ik_pad; 2078a1b9b6aSSam Leffler u_int16_t ik_keyix; /* key index */ 2088a1b9b6aSSam Leffler u_int8_t ik_keylen; /* key length in bytes */ 2098a1b9b6aSSam Leffler u_int8_t ik_flags; 2108a1b9b6aSSam Leffler /* NB: IEEE80211_KEY_XMIT and IEEE80211_KEY_RECV defined elsewhere */ 2118a1b9b6aSSam Leffler #define IEEE80211_KEY_DEFAULT 0x80 /* default xmit key */ 2128a1b9b6aSSam Leffler u_int8_t ik_macaddr[IEEE80211_ADDR_LEN]; 2138a1b9b6aSSam Leffler u_int64_t ik_keyrsc; /* key receive sequence counter */ 2148a1b9b6aSSam Leffler u_int64_t ik_keytsc; /* key transmit sequence counter */ 2158a1b9b6aSSam Leffler u_int8_t ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE]; 2168a1b9b6aSSam Leffler }; 2178a1b9b6aSSam Leffler 2188a1b9b6aSSam Leffler /* 2198a1b9b6aSSam Leffler * Delete a key either by index or address. Set the index 2208a1b9b6aSSam Leffler * to IEEE80211_KEYIX_NONE when deleting a unicast key. 2218a1b9b6aSSam Leffler */ 2228a1b9b6aSSam Leffler struct ieee80211req_del_key { 2238a1b9b6aSSam Leffler u_int8_t idk_keyix; /* key index */ 2248a1b9b6aSSam Leffler u_int8_t idk_macaddr[IEEE80211_ADDR_LEN]; 2258a1b9b6aSSam Leffler }; 2268a1b9b6aSSam Leffler 2278a1b9b6aSSam Leffler /* 2288a1b9b6aSSam Leffler * MLME state manipulation request. IEEE80211_MLME_ASSOC 2298a1b9b6aSSam Leffler * only makes sense when operating as a station. The other 2308a1b9b6aSSam Leffler * requests can be used when operating as a station or an 2318a1b9b6aSSam Leffler * ap (to effect a station). 2328a1b9b6aSSam Leffler */ 2338a1b9b6aSSam Leffler struct ieee80211req_mlme { 2348a1b9b6aSSam Leffler u_int8_t im_op; /* operation to perform */ 2358a1b9b6aSSam Leffler #define IEEE80211_MLME_ASSOC 1 /* associate station */ 2368a1b9b6aSSam Leffler #define IEEE80211_MLME_DISASSOC 2 /* disassociate station */ 2378a1b9b6aSSam Leffler #define IEEE80211_MLME_DEAUTH 3 /* deauthenticate station */ 2388a1b9b6aSSam Leffler #define IEEE80211_MLME_AUTHORIZE 4 /* authorize station */ 2398a1b9b6aSSam Leffler #define IEEE80211_MLME_UNAUTHORIZE 5 /* unauthorize station */ 240f02a0bd2SSam Leffler u_int8_t im_ssid_len; /* length of optional ssid */ 2418a1b9b6aSSam Leffler u_int16_t im_reason; /* 802.11 reason code */ 2428a1b9b6aSSam Leffler u_int8_t im_macaddr[IEEE80211_ADDR_LEN]; 243f02a0bd2SSam Leffler u_int8_t im_ssid[IEEE80211_NWID_LEN]; 2448a1b9b6aSSam Leffler }; 2458a1b9b6aSSam Leffler 2468a1b9b6aSSam Leffler /* 2478a1b9b6aSSam Leffler * MAC ACL operations. 2488a1b9b6aSSam Leffler */ 2498a1b9b6aSSam Leffler enum { 2508a1b9b6aSSam Leffler IEEE80211_MACCMD_POLICY_OPEN = 0, /* set policy: no ACL's */ 2518a1b9b6aSSam Leffler IEEE80211_MACCMD_POLICY_ALLOW = 1, /* set policy: allow traffic */ 2528a1b9b6aSSam Leffler IEEE80211_MACCMD_POLICY_DENY = 2, /* set policy: deny traffic */ 2538a1b9b6aSSam Leffler IEEE80211_MACCMD_FLUSH = 3, /* flush ACL database */ 2548a1b9b6aSSam Leffler IEEE80211_MACCMD_DETACH = 4, /* detach ACL policy */ 255188757f5SSam Leffler IEEE80211_MACCMD_POLICY = 5, /* get ACL policy */ 256188757f5SSam Leffler IEEE80211_MACCMD_LIST = 6, /* get ACL database */ 257188757f5SSam Leffler }; 258188757f5SSam Leffler 259188757f5SSam Leffler struct ieee80211req_maclist { 260188757f5SSam Leffler u_int8_t ml_macaddr[IEEE80211_ADDR_LEN]; 2618a1b9b6aSSam Leffler }; 2628a1b9b6aSSam Leffler 2638a1b9b6aSSam Leffler /* 2648a1b9b6aSSam Leffler * Set the active channel list. Note this list is 2658a1b9b6aSSam Leffler * intersected with the available channel list in 2668a1b9b6aSSam Leffler * calculating the set of channels actually used in 2678a1b9b6aSSam Leffler * scanning. 2688a1b9b6aSSam Leffler */ 2698a1b9b6aSSam Leffler struct ieee80211req_chanlist { 2708a1b9b6aSSam Leffler u_int8_t ic_channels[IEEE80211_CHAN_BYTES]; 2718a1b9b6aSSam Leffler }; 2728a1b9b6aSSam Leffler 2738a1b9b6aSSam Leffler /* 2748a1b9b6aSSam Leffler * Get the active channel list info. 2758a1b9b6aSSam Leffler */ 2768a1b9b6aSSam Leffler struct ieee80211req_chaninfo { 2778a1b9b6aSSam Leffler u_int ic_nchans; 2788a1b9b6aSSam Leffler struct ieee80211_channel ic_chans[IEEE80211_CHAN_MAX]; 2798a1b9b6aSSam Leffler }; 2808a1b9b6aSSam Leffler 2818a1b9b6aSSam Leffler /* 2828a1b9b6aSSam Leffler * Retrieve the WPA/RSN information element for an associated station. 2838a1b9b6aSSam Leffler */ 2848a1b9b6aSSam Leffler struct ieee80211req_wpaie { 2858a1b9b6aSSam Leffler u_int8_t wpa_macaddr[IEEE80211_ADDR_LEN]; 2868a1b9b6aSSam Leffler u_int8_t wpa_ie[IEEE80211_MAX_OPT_IE]; 2878a1b9b6aSSam Leffler }; 2888a1b9b6aSSam Leffler 2898a1b9b6aSSam Leffler /* 2908a1b9b6aSSam Leffler * Retrieve per-node statistics. 2918a1b9b6aSSam Leffler */ 2928a1b9b6aSSam Leffler struct ieee80211req_sta_stats { 2938a1b9b6aSSam Leffler union { 2948a1b9b6aSSam Leffler /* NB: explicitly force 64-bit alignment */ 2958a1b9b6aSSam Leffler u_int8_t macaddr[IEEE80211_ADDR_LEN]; 2968a1b9b6aSSam Leffler u_int64_t pad; 2978a1b9b6aSSam Leffler } is_u; 2988a1b9b6aSSam Leffler struct ieee80211_nodestats is_stats; 2998a1b9b6aSSam Leffler }; 3008a1b9b6aSSam Leffler 3018a1b9b6aSSam Leffler /* 3028a1b9b6aSSam Leffler * Station information block; the mac address is used 3038a1b9b6aSSam Leffler * to retrieve other data like stats, unicast key, etc. 3048a1b9b6aSSam Leffler */ 3058a1b9b6aSSam Leffler struct ieee80211req_sta_info { 3068a1b9b6aSSam Leffler u_int16_t isi_len; /* length (mult of 4) */ 3078a1b9b6aSSam Leffler u_int16_t isi_freq; /* MHz */ 3088a1b9b6aSSam Leffler u_int16_t isi_flags; /* channel flags */ 3098a1b9b6aSSam Leffler u_int16_t isi_state; /* state flags */ 3108a1b9b6aSSam Leffler u_int8_t isi_authmode; /* authentication algorithm */ 3118a1b9b6aSSam Leffler u_int8_t isi_rssi; 3128a1b9b6aSSam Leffler u_int8_t isi_capinfo; /* capabilities */ 3138a1b9b6aSSam Leffler u_int8_t isi_erp; /* ERP element */ 3148a1b9b6aSSam Leffler u_int8_t isi_macaddr[IEEE80211_ADDR_LEN]; 3158a1b9b6aSSam Leffler u_int8_t isi_nrates; 3168a1b9b6aSSam Leffler /* negotiated rates */ 3178a1b9b6aSSam Leffler u_int8_t isi_rates[IEEE80211_RATE_MAXSIZE]; 3188a1b9b6aSSam Leffler u_int8_t isi_txrate; /* index to isi_rates[] */ 3198a1b9b6aSSam Leffler u_int16_t isi_ie_len; /* IE length */ 3208a1b9b6aSSam Leffler u_int16_t isi_associd; /* assoc response */ 3218a1b9b6aSSam Leffler u_int16_t isi_txpower; /* current tx power */ 3228a1b9b6aSSam Leffler u_int16_t isi_vlan; /* vlan tag */ 3238a1b9b6aSSam Leffler u_int16_t isi_txseqs[17]; /* seq to be transmitted */ 3248a1b9b6aSSam Leffler u_int16_t isi_rxseqs[17]; /* seq previous for qos frames*/ 3258a1b9b6aSSam Leffler u_int16_t isi_inact; /* inactivity timer */ 3268a1b9b6aSSam Leffler /* XXX frag state? */ 3278a1b9b6aSSam Leffler /* variable length IE data */ 3288a1b9b6aSSam Leffler }; 3298a1b9b6aSSam Leffler 3308a1b9b6aSSam Leffler /* 3318a1b9b6aSSam Leffler * Retrieve per-station information; to retrieve all 3328a1b9b6aSSam Leffler * specify a mac address of ff:ff:ff:ff:ff:ff. 3338a1b9b6aSSam Leffler */ 3348a1b9b6aSSam Leffler struct ieee80211req_sta_req { 3358a1b9b6aSSam Leffler union { 3368a1b9b6aSSam Leffler /* NB: explicitly force 64-bit alignment */ 3378a1b9b6aSSam Leffler u_int8_t macaddr[IEEE80211_ADDR_LEN]; 3388a1b9b6aSSam Leffler u_int64_t pad; 3398a1b9b6aSSam Leffler } is_u; 3408a1b9b6aSSam Leffler struct ieee80211req_sta_info info[1]; /* variable length */ 3418a1b9b6aSSam Leffler }; 3428a1b9b6aSSam Leffler 3438a1b9b6aSSam Leffler /* 3448a1b9b6aSSam Leffler * Get/set per-station tx power cap. 3458a1b9b6aSSam Leffler */ 3468a1b9b6aSSam Leffler struct ieee80211req_sta_txpow { 3478a1b9b6aSSam Leffler u_int8_t it_macaddr[IEEE80211_ADDR_LEN]; 3488a1b9b6aSSam Leffler u_int8_t it_txpow; 3498a1b9b6aSSam Leffler }; 3508a1b9b6aSSam Leffler 3518a1b9b6aSSam Leffler /* 3528a1b9b6aSSam Leffler * WME parameters are set and return using i_val and i_len. 3538a1b9b6aSSam Leffler * i_val holds the value itself. i_len specifies the AC 3548a1b9b6aSSam Leffler * and, as appropriate, then high bit specifies whether the 3558a1b9b6aSSam Leffler * operation is to be applied to the BSS or ourself. 3568a1b9b6aSSam Leffler */ 3578a1b9b6aSSam Leffler #define IEEE80211_WMEPARAM_SELF 0x0000 /* parameter applies to self */ 3588a1b9b6aSSam Leffler #define IEEE80211_WMEPARAM_BSS 0x8000 /* parameter applies to BSS */ 3598a1b9b6aSSam Leffler #define IEEE80211_WMEPARAM_VAL 0x7fff /* parameter value */ 3608a1b9b6aSSam Leffler 3611a1e1d21SSam Leffler #ifdef __FreeBSD__ 3621a1e1d21SSam Leffler /* 3631a1e1d21SSam Leffler * FreeBSD-style ioctls. 3641a1e1d21SSam Leffler */ 3651a1e1d21SSam Leffler /* the first member must be matched with struct ifreq */ 3661a1e1d21SSam Leffler struct ieee80211req { 3671a1e1d21SSam Leffler char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */ 3681a1e1d21SSam Leffler u_int16_t i_type; /* req type */ 3691a1e1d21SSam Leffler int16_t i_val; /* Index or simple value */ 3701a1e1d21SSam Leffler int16_t i_len; /* Index or simple value */ 3711a1e1d21SSam Leffler void *i_data; /* Extra data */ 3721a1e1d21SSam Leffler }; 3731a1e1d21SSam Leffler #define SIOCS80211 _IOW('i', 234, struct ieee80211req) 3741a1e1d21SSam Leffler #define SIOCG80211 _IOWR('i', 235, struct ieee80211req) 3751a1e1d21SSam Leffler 3761a1e1d21SSam Leffler #define IEEE80211_IOC_SSID 1 3771a1e1d21SSam Leffler #define IEEE80211_IOC_NUMSSIDS 2 3781a1e1d21SSam Leffler #define IEEE80211_IOC_WEP 3 3791a1e1d21SSam Leffler #define IEEE80211_WEP_NOSUP -1 3801a1e1d21SSam Leffler #define IEEE80211_WEP_OFF 0 3811a1e1d21SSam Leffler #define IEEE80211_WEP_ON 1 3821a1e1d21SSam Leffler #define IEEE80211_WEP_MIXED 2 3831a1e1d21SSam Leffler #define IEEE80211_IOC_WEPKEY 4 3841a1e1d21SSam Leffler #define IEEE80211_IOC_NUMWEPKEYS 5 3851a1e1d21SSam Leffler #define IEEE80211_IOC_WEPTXKEY 6 3861a1e1d21SSam Leffler #define IEEE80211_IOC_AUTHMODE 7 3871a1e1d21SSam Leffler #define IEEE80211_IOC_STATIONNAME 8 3881a1e1d21SSam Leffler #define IEEE80211_IOC_CHANNEL 9 3891a1e1d21SSam Leffler #define IEEE80211_IOC_POWERSAVE 10 3901a1e1d21SSam Leffler #define IEEE80211_POWERSAVE_NOSUP -1 3911a1e1d21SSam Leffler #define IEEE80211_POWERSAVE_OFF 0 3921a1e1d21SSam Leffler #define IEEE80211_POWERSAVE_CAM 1 3931a1e1d21SSam Leffler #define IEEE80211_POWERSAVE_PSP 2 3941a1e1d21SSam Leffler #define IEEE80211_POWERSAVE_PSP_CAM 3 3951a1e1d21SSam Leffler #define IEEE80211_POWERSAVE_ON IEEE80211_POWERSAVE_CAM 3961a1e1d21SSam Leffler #define IEEE80211_IOC_POWERSAVESLEEP 11 39713604e6bSSam Leffler #define IEEE80211_IOC_RTSTHRESHOLD 12 3982e79ca97SSam Leffler #define IEEE80211_IOC_PROTMODE 13 3992e79ca97SSam Leffler #define IEEE80211_PROTMODE_OFF 0 4002e79ca97SSam Leffler #define IEEE80211_PROTMODE_CTS 1 4012e79ca97SSam Leffler #define IEEE80211_PROTMODE_RTSCTS 2 4028a1b9b6aSSam Leffler #define IEEE80211_IOC_TXPOWER 14 /* global tx power limit */ 4038a1b9b6aSSam Leffler #define IEEE80211_IOC_BSSID 15 4048a1b9b6aSSam Leffler #define IEEE80211_IOC_ROAMING 16 /* roaming mode */ 4058a1b9b6aSSam Leffler #define IEEE80211_IOC_PRIVACY 17 /* privacy invoked */ 4068a1b9b6aSSam Leffler #define IEEE80211_IOC_DROPUNENCRYPTED 18 /* discard unencrypted frames */ 4078a1b9b6aSSam Leffler #define IEEE80211_IOC_WPAKEY 19 4088a1b9b6aSSam Leffler #define IEEE80211_IOC_DELKEY 20 4098a1b9b6aSSam Leffler #define IEEE80211_IOC_MLME 21 4108a1b9b6aSSam Leffler #define IEEE80211_IOC_OPTIE 22 /* optional info. element */ 4118a1b9b6aSSam Leffler #define IEEE80211_IOC_SCAN_REQ 23 4128a1b9b6aSSam Leffler #define IEEE80211_IOC_SCAN_RESULTS 24 4138a1b9b6aSSam Leffler #define IEEE80211_IOC_COUNTERMEASURES 25 /* WPA/TKIP countermeasures */ 4148a1b9b6aSSam Leffler #define IEEE80211_IOC_WPA 26 /* WPA mode (0,1,2) */ 4158a1b9b6aSSam Leffler #define IEEE80211_IOC_CHANLIST 27 /* channel list */ 4168a1b9b6aSSam Leffler #define IEEE80211_IOC_WME 28 /* WME mode (on, off) */ 4178a1b9b6aSSam Leffler #define IEEE80211_IOC_HIDESSID 29 /* hide SSID mode (on, off) */ 4188a1b9b6aSSam Leffler #define IEEE80211_IOC_APBRIDGE 30 /* AP inter-sta bridging */ 4198a1b9b6aSSam Leffler #define IEEE80211_IOC_MCASTCIPHER 31 /* multicast/default cipher */ 4208a1b9b6aSSam Leffler #define IEEE80211_IOC_MCASTKEYLEN 32 /* multicast key length */ 4218a1b9b6aSSam Leffler #define IEEE80211_IOC_UCASTCIPHERS 33 /* unicast cipher suites */ 4228a1b9b6aSSam Leffler #define IEEE80211_IOC_UCASTCIPHER 34 /* unicast cipher */ 4238a1b9b6aSSam Leffler #define IEEE80211_IOC_UCASTKEYLEN 35 /* unicast key length */ 4248a1b9b6aSSam Leffler #define IEEE80211_IOC_DRIVER_CAPS 36 /* driver capabilities */ 4258a1b9b6aSSam Leffler #define IEEE80211_IOC_KEYMGTALGS 37 /* key management algorithms */ 4268a1b9b6aSSam Leffler #define IEEE80211_IOC_RSNCAPS 38 /* RSN capabilities */ 4278a1b9b6aSSam Leffler #define IEEE80211_IOC_WPAIE 39 /* WPA information element */ 4288a1b9b6aSSam Leffler #define IEEE80211_IOC_STA_STATS 40 /* per-station statistics */ 4298a1b9b6aSSam Leffler #define IEEE80211_IOC_MACCMD 41 /* MAC ACL operation */ 4308a1b9b6aSSam Leffler #define IEEE80211_IOC_CHANINFO 42 /* channel info list */ 4318a1b9b6aSSam Leffler #define IEEE80211_IOC_TXPOWMAX 43 /* max tx power for channel */ 4328a1b9b6aSSam Leffler #define IEEE80211_IOC_STA_TXPOW 44 /* per-station tx power limit */ 4338a1b9b6aSSam Leffler #define IEEE80211_IOC_STA_INFO 45 /* station/neighbor info */ 4348a1b9b6aSSam Leffler #define IEEE80211_IOC_WME_CWMIN 46 /* WME: ECWmin */ 4358a1b9b6aSSam Leffler #define IEEE80211_IOC_WME_CWMAX 47 /* WME: ECWmax */ 4368a1b9b6aSSam Leffler #define IEEE80211_IOC_WME_AIFS 48 /* WME: AIFSN */ 4378a1b9b6aSSam Leffler #define IEEE80211_IOC_WME_TXOPLIMIT 49 /* WME: txops limit */ 4388a1b9b6aSSam Leffler #define IEEE80211_IOC_WME_ACM 50 /* WME: ACM (bss only) */ 4398a1b9b6aSSam Leffler #define IEEE80211_IOC_WME_ACKPOLICY 51 /* WME: ACK policy (!bss only)*/ 4408a1b9b6aSSam Leffler #define IEEE80211_IOC_DTIM_PERIOD 52 /* DTIM period (beacons) */ 4418a1b9b6aSSam Leffler #define IEEE80211_IOC_BEACON_INTERVAL 53 /* beacon interval (ms) */ 4428a1b9b6aSSam Leffler #define IEEE80211_IOC_ADDMAC 54 /* add sta to MAC ACL table */ 4438a1b9b6aSSam Leffler #define IEEE80211_IOC_DELMAC 55 /* del sta from MAC ACL table */ 444c4f040c3SSam Leffler #define IEEE80211_IOC_PUREG 56 /* pure 11g (no 11b stations) */ 44570231e3dSSam Leffler #define IEEE80211_IOC_FRAGTHRESHOLD 73 /* tx fragmentation threshold */ 4461a1e1d21SSam Leffler 4478a1b9b6aSSam Leffler /* 4488a1b9b6aSSam Leffler * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS. 4498a1b9b6aSSam Leffler */ 4508a1b9b6aSSam Leffler struct ieee80211req_scan_result { 4518a1b9b6aSSam Leffler u_int16_t isr_len; /* length (mult of 4) */ 4528a1b9b6aSSam Leffler u_int16_t isr_freq; /* MHz */ 4538a1b9b6aSSam Leffler u_int16_t isr_flags; /* channel flags */ 4548a1b9b6aSSam Leffler u_int8_t isr_noise; 4558a1b9b6aSSam Leffler u_int8_t isr_rssi; 4568a1b9b6aSSam Leffler u_int8_t isr_intval; /* beacon interval */ 4578a1b9b6aSSam Leffler u_int8_t isr_capinfo; /* capabilities */ 4588a1b9b6aSSam Leffler u_int8_t isr_erp; /* ERP element */ 4598a1b9b6aSSam Leffler u_int8_t isr_bssid[IEEE80211_ADDR_LEN]; 4608a1b9b6aSSam Leffler u_int8_t isr_nrates; 4618a1b9b6aSSam Leffler u_int8_t isr_rates[IEEE80211_RATE_MAXSIZE]; 4628a1b9b6aSSam Leffler u_int8_t isr_ssid_len; /* SSID length */ 4638a1b9b6aSSam Leffler u_int8_t isr_ie_len; /* IE length */ 4648a1b9b6aSSam Leffler u_int8_t isr_pad[5]; 4658a1b9b6aSSam Leffler /* variable length SSID followed by IE data */ 4668a1b9b6aSSam Leffler }; 4671be50176SSam Leffler 4681be50176SSam Leffler #define SIOCG80211STATS _IOWR('i', 236, struct ifreq) 4691a1e1d21SSam Leffler #endif /* __FreeBSD__ */ 4701a1e1d21SSam Leffler 4711a1e1d21SSam Leffler #endif /* _NET80211_IEEE80211_IOCTL_H_ */ 472