ieee80211_ioctl.h revision 1.24.2.7 1 1.24.2.7 martin /* $NetBSD: ieee80211_ioctl.h,v 1.24.2.7 2020/04/13 08:05:16 martin Exp $ */
2 1.24.2.2 phil
3 1.1 dyoung /*-
4 1.24.2.1 phil * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
5 1.24.2.1 phil *
6 1.1 dyoung * Copyright (c) 2001 Atsushi Onoe
7 1.24.2.1 phil * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
8 1.1 dyoung * All rights reserved.
9 1.1 dyoung *
10 1.1 dyoung * Redistribution and use in source and binary forms, with or without
11 1.1 dyoung * modification, are permitted provided that the following conditions
12 1.1 dyoung * are met:
13 1.1 dyoung * 1. Redistributions of source code must retain the above copyright
14 1.1 dyoung * notice, this list of conditions and the following disclaimer.
15 1.1 dyoung * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 dyoung * notice, this list of conditions and the following disclaimer in the
17 1.1 dyoung * documentation and/or other materials provided with the distribution.
18 1.1 dyoung *
19 1.1 dyoung * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 1.1 dyoung * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 1.1 dyoung * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 1.1 dyoung * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 1.1 dyoung * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 1.1 dyoung * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 1.1 dyoung * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 1.1 dyoung * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 1.1 dyoung * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 1.1 dyoung * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 1.1 dyoung *
30 1.24.2.1 phil * $FreeBSD$
31 1.1 dyoung */
32 1.1 dyoung #ifndef _NET80211_IEEE80211_IOCTL_H_
33 1.1 dyoung #define _NET80211_IEEE80211_IOCTL_H_
34 1.1 dyoung
35 1.1 dyoung /*
36 1.1 dyoung * IEEE 802.11 ioctls.
37 1.1 dyoung */
38 1.24.2.7 martin #include <sys/ioccom.h>
39 1.24.2.7 martin #include <net/if.h>
40 1.9 dyoung #include <net80211/_ieee80211.h>
41 1.9 dyoung #include <net80211/ieee80211.h>
42 1.9 dyoung #include <net80211/ieee80211_crypto.h>
43 1.1 dyoung
44 1.9 dyoung /*
45 1.24.2.1 phil * Per/node (station) statistics.
46 1.9 dyoung */
47 1.9 dyoung struct ieee80211_nodestats {
48 1.24.2.1 phil uint32_t ns_rx_data; /* rx data frames */
49 1.24.2.1 phil uint32_t ns_rx_mgmt; /* rx management frames */
50 1.24.2.1 phil uint32_t ns_rx_ctrl; /* rx control frames */
51 1.24.2.1 phil uint32_t ns_rx_ucast; /* rx unicast frames */
52 1.24.2.1 phil uint32_t ns_rx_mcast; /* rx multi/broadcast frames */
53 1.24.2.1 phil uint64_t ns_rx_bytes; /* rx data count (bytes) */
54 1.24.2.1 phil uint64_t ns_rx_beacons; /* rx beacon frames */
55 1.24.2.1 phil uint32_t ns_rx_proberesp; /* rx probe response frames */
56 1.24.2.1 phil
57 1.24.2.1 phil uint32_t ns_rx_dup; /* rx discard 'cuz dup */
58 1.24.2.1 phil uint32_t ns_rx_noprivacy; /* rx w/ wep but privacy off */
59 1.24.2.1 phil uint32_t ns_rx_wepfail; /* rx wep processing failed */
60 1.24.2.1 phil uint32_t ns_rx_demicfail; /* rx demic failed */
61 1.24.2.1 phil uint32_t ns_rx_decap; /* rx decapsulation failed */
62 1.24.2.1 phil uint32_t ns_rx_defrag; /* rx defragmentation failed */
63 1.24.2.1 phil uint32_t ns_rx_disassoc; /* rx disassociation */
64 1.24.2.1 phil uint32_t ns_rx_deauth; /* rx deauthentication */
65 1.24.2.1 phil uint32_t ns_rx_action; /* rx action */
66 1.24.2.1 phil uint32_t ns_rx_decryptcrc; /* rx decrypt failed on crc */
67 1.24.2.1 phil uint32_t ns_rx_unauth; /* rx on unauthorized port */
68 1.24.2.1 phil uint32_t ns_rx_unencrypted; /* rx unecrypted w/ privacy */
69 1.24.2.1 phil uint32_t ns_rx_drop; /* rx discard other reason */
70 1.24.2.1 phil
71 1.24.2.1 phil uint32_t ns_tx_data; /* tx data frames */
72 1.24.2.1 phil uint32_t ns_tx_mgmt; /* tx management frames */
73 1.24.2.1 phil uint32_t ns_tx_ctrl; /* tx control frames */
74 1.24.2.1 phil uint32_t ns_tx_ucast; /* tx unicast frames */
75 1.24.2.1 phil uint32_t ns_tx_mcast; /* tx multi/broadcast frames */
76 1.24.2.1 phil uint64_t ns_tx_bytes; /* tx data count (bytes) */
77 1.24.2.1 phil uint32_t ns_tx_probereq; /* tx probe request frames */
78 1.9 dyoung
79 1.24.2.1 phil uint32_t ns_tx_novlantag; /* tx discard 'cuz no tag */
80 1.24.2.1 phil uint32_t ns_tx_vlanmismatch; /* tx discard 'cuz bad tag */
81 1.9 dyoung
82 1.24.2.1 phil uint32_t ns_ps_discard; /* ps discard 'cuz of age */
83 1.9 dyoung
84 1.9 dyoung /* MIB-related state */
85 1.24.2.1 phil uint32_t ns_tx_assoc; /* [re]associations */
86 1.24.2.1 phil uint32_t ns_tx_assoc_fail; /* [re]association failures */
87 1.24.2.1 phil uint32_t ns_tx_auth; /* [re]authentications */
88 1.24.2.1 phil uint32_t ns_tx_auth_fail; /* [re]authentication failures*/
89 1.24.2.1 phil uint32_t ns_tx_deauth; /* deauthentications */
90 1.24.2.1 phil uint32_t ns_tx_deauth_code; /* last deauth reason */
91 1.24.2.1 phil uint32_t ns_tx_disassoc; /* disassociations */
92 1.24.2.1 phil uint32_t ns_tx_disassoc_code; /* last disassociation reason */
93 1.24.2.1 phil
94 1.24.2.1 phil /* Hardware A-MSDU decode */
95 1.24.2.1 phil uint32_t ns_rx_amsdu_more; /* RX decap A-MSDU, more coming from A-MSDU */
96 1.24.2.1 phil uint32_t ns_rx_amsdu_more_end; /* RX decap A-MSDU (or any other frame), no more coming */
97 1.24.2.1 phil uint32_t ns_spare[6];
98 1.11 dyoung };
99 1.11 dyoung
100 1.24.2.6 christos struct ieee80211_ostats {
101 1.24.2.6 christos u_int32_t is_rx_badversion; /* rx frame with bad version */
102 1.24.2.6 christos u_int32_t is_rx_tooshort; /* rx frame too short */
103 1.24.2.6 christos u_int32_t is_rx_wrongbss; /* rx from wrong bssid */
104 1.24.2.6 christos u_int32_t is_rx_dup; /* rx discard 'cuz dup */
105 1.24.2.6 christos u_int32_t is_rx_wrongdir; /* rx w/ wrong direction */
106 1.24.2.6 christos u_int32_t is_rx_mcastecho; /* rx discard 'cuz mcast echo */
107 1.24.2.6 christos u_int32_t is_rx_notassoc; /* rx discard 'cuz sta !assoc */
108 1.24.2.6 christos u_int32_t is_rx_nowep; /* rx w/ wep but wep !config */
109 1.24.2.6 christos u_int32_t is_rx_wepfail; /* rx wep processing failed */
110 1.24.2.6 christos u_int32_t is_rx_decap; /* rx decapsulation failed */
111 1.24.2.6 christos u_int32_t is_rx_mgtdiscard; /* rx discard mgt frames */
112 1.24.2.6 christos u_int32_t is_rx_ctl; /* rx discard ctrl frames */
113 1.24.2.6 christos u_int32_t is_rx_rstoobig; /* rx rate set truncated */
114 1.24.2.6 christos u_int32_t is_rx_elem_missing; /* rx required element missing*/
115 1.24.2.6 christos u_int32_t is_rx_elem_toobig; /* rx element too big */
116 1.24.2.6 christos u_int32_t is_rx_elem_toosmall; /* rx element too small */
117 1.24.2.6 christos u_int32_t is_rx_elem_unknown; /* rx element unknown */
118 1.24.2.6 christos u_int32_t is_rx_badchan; /* rx frame w/ invalid chan */
119 1.24.2.6 christos u_int32_t is_rx_chanmismatch; /* rx frame chan mismatch */
120 1.24.2.6 christos u_int32_t is_rx_nodealloc; /* rx frame dropped */
121 1.24.2.6 christos u_int32_t is_rx_ssidmismatch; /* rx frame ssid mismatch */
122 1.24.2.6 christos u_int32_t is_rx_auth_unsupported; /* rx w/ unsupported auth alg */
123 1.24.2.6 christos u_int32_t is_rx_auth_fail; /* rx sta auth failure */
124 1.24.2.6 christos u_int32_t is_rx_assoc_bss; /* rx assoc from wrong bssid */
125 1.24.2.6 christos u_int32_t is_rx_assoc_notauth; /* rx assoc w/o auth */
126 1.24.2.6 christos u_int32_t is_rx_assoc_capmismatch;/* rx assoc w/ cap mismatch */
127 1.24.2.6 christos u_int32_t is_rx_assoc_norate; /* rx assoc w/ no rate match */
128 1.24.2.6 christos u_int32_t is_rx_deauth; /* rx deauthentication */
129 1.24.2.6 christos u_int32_t is_rx_disassoc; /* rx disassociation */
130 1.24.2.6 christos u_int32_t is_rx_badsubtype; /* rx frame w/ unknown subtype*/
131 1.24.2.6 christos u_int32_t is_rx_nombuf; /* rx failed for lack of mbuf */
132 1.24.2.6 christos u_int32_t is_rx_decryptcrc; /* rx decrypt failed on crc */
133 1.24.2.6 christos u_int32_t is_rx_ahdemo_mgt; /* rx discard ahdemo mgt frame*/
134 1.24.2.6 christos u_int32_t is_rx_bad_auth; /* rx bad auth request */
135 1.24.2.6 christos u_int32_t is_tx_nombuf; /* tx failed for lack of mbuf */
136 1.24.2.6 christos u_int32_t is_tx_nonode; /* tx failed for no node */
137 1.24.2.6 christos u_int32_t is_tx_unknownmgt; /* tx of unknown mgt frame */
138 1.24.2.6 christos u_int32_t is_scan_active; /* active scans started */
139 1.24.2.6 christos u_int32_t is_scan_passive; /* passive scans started */
140 1.24.2.6 christos u_int32_t is_node_timeout; /* nodes timed out inactivity */
141 1.24.2.6 christos u_int32_t is_crypto_nomem; /* no memory for crypto ctx */
142 1.24.2.6 christos };
143 1.24.2.6 christos
144 1.9 dyoung /*
145 1.9 dyoung * Summary statistics.
146 1.9 dyoung */
147 1.6 dyoung struct ieee80211_stats {
148 1.24.2.1 phil uint32_t is_rx_badversion; /* rx frame with bad version */
149 1.24.2.1 phil uint32_t is_rx_tooshort; /* rx frame too short */
150 1.24.2.1 phil uint32_t is_rx_wrongbss; /* rx from wrong bssid */
151 1.24.2.1 phil uint32_t is_rx_dup; /* rx discard 'cuz dup */
152 1.24.2.1 phil uint32_t is_rx_wrongdir; /* rx w/ wrong direction */
153 1.24.2.1 phil uint32_t is_rx_mcastecho; /* rx discard 'cuz mcast echo */
154 1.24.2.1 phil uint32_t is_rx_notassoc; /* rx discard 'cuz sta !assoc */
155 1.24.2.1 phil uint32_t is_rx_noprivacy; /* rx w/ wep but privacy off */
156 1.24.2.1 phil uint32_t is_rx_unencrypted; /* rx w/o wep and privacy on */
157 1.24.2.1 phil uint32_t is_rx_wepfail; /* rx wep processing failed */
158 1.24.2.1 phil uint32_t is_rx_decap; /* rx decapsulation failed */
159 1.24.2.1 phil uint32_t is_rx_mgtdiscard; /* rx discard mgt frames */
160 1.24.2.1 phil uint32_t is_rx_ctl; /* rx ctrl frames */
161 1.24.2.1 phil uint32_t is_rx_beacon; /* rx beacon frames */
162 1.24.2.1 phil uint32_t is_rx_rstoobig; /* rx rate set truncated */
163 1.24.2.1 phil uint32_t is_rx_elem_missing; /* rx required element missing*/
164 1.24.2.1 phil uint32_t is_rx_elem_toobig; /* rx element too big */
165 1.24.2.1 phil uint32_t is_rx_elem_toosmall; /* rx element too small */
166 1.24.2.1 phil uint32_t is_rx_elem_unknown; /* rx element unknown */
167 1.24.2.1 phil uint32_t is_rx_badchan; /* rx frame w/ invalid chan */
168 1.24.2.1 phil uint32_t is_rx_chanmismatch; /* rx frame chan mismatch */
169 1.24.2.1 phil uint32_t is_rx_nodealloc; /* rx frame dropped */
170 1.24.2.1 phil uint32_t is_rx_ssidmismatch; /* rx frame ssid mismatch */
171 1.24.2.1 phil uint32_t is_rx_auth_unsupported; /* rx w/ unsupported auth alg */
172 1.24.2.1 phil uint32_t is_rx_auth_fail; /* rx sta auth failure */
173 1.24.2.1 phil uint32_t is_rx_auth_countermeasures;/* rx auth discard 'cuz CM */
174 1.24.2.1 phil uint32_t is_rx_assoc_bss; /* rx assoc from wrong bssid */
175 1.24.2.1 phil uint32_t is_rx_assoc_notauth; /* rx assoc w/o auth */
176 1.24.2.1 phil uint32_t is_rx_assoc_capmismatch;/* rx assoc w/ cap mismatch */
177 1.24.2.1 phil uint32_t is_rx_assoc_norate; /* rx assoc w/ no rate match */
178 1.24.2.1 phil uint32_t is_rx_assoc_badwpaie; /* rx assoc w/ bad WPA IE */
179 1.24.2.1 phil uint32_t is_rx_deauth; /* rx deauthentication */
180 1.24.2.1 phil uint32_t is_rx_disassoc; /* rx disassociation */
181 1.24.2.1 phil uint32_t is_rx_badsubtype; /* rx frame w/ unknown subtype*/
182 1.24.2.1 phil uint32_t is_rx_nobuf; /* rx failed for lack of buf */
183 1.24.2.1 phil uint32_t is_rx_decryptcrc; /* rx decrypt failed on crc */
184 1.24.2.1 phil uint32_t is_rx_ahdemo_mgt; /* rx discard ahdemo mgt frame*/
185 1.24.2.1 phil uint32_t is_rx_bad_auth; /* rx bad auth request */
186 1.24.2.1 phil uint32_t is_rx_unauth; /* rx on unauthorized port */
187 1.24.2.1 phil uint32_t is_rx_badkeyid; /* rx w/ incorrect keyid */
188 1.24.2.1 phil uint32_t is_rx_ccmpreplay; /* rx seq# violation (CCMP) */
189 1.24.2.1 phil uint32_t is_rx_ccmpformat; /* rx format bad (CCMP) */
190 1.24.2.1 phil uint32_t is_rx_ccmpmic; /* rx MIC check failed (CCMP) */
191 1.24.2.1 phil uint32_t is_rx_tkipreplay; /* rx seq# violation (TKIP) */
192 1.24.2.1 phil uint32_t is_rx_tkipformat; /* rx format bad (TKIP) */
193 1.24.2.1 phil uint32_t is_rx_tkipmic; /* rx MIC check failed (TKIP) */
194 1.24.2.1 phil uint32_t is_rx_tkipicv; /* rx ICV check failed (TKIP) */
195 1.24.2.1 phil uint32_t is_rx_badcipher; /* rx failed 'cuz key type */
196 1.24.2.1 phil uint32_t is_rx_nocipherctx; /* rx failed 'cuz key !setup */
197 1.24.2.1 phil uint32_t is_rx_acl; /* rx discard 'cuz acl policy */
198 1.24.2.1 phil uint32_t is_tx_nobuf; /* tx failed for lack of buf */
199 1.24.2.1 phil uint32_t is_tx_nonode; /* tx failed for no node */
200 1.24.2.1 phil uint32_t is_tx_unknownmgt; /* tx of unknown mgt frame */
201 1.24.2.1 phil uint32_t is_tx_badcipher; /* tx failed 'cuz key type */
202 1.24.2.1 phil uint32_t is_tx_nodefkey; /* tx failed 'cuz no defkey */
203 1.24.2.1 phil uint32_t is_tx_noheadroom; /* tx failed 'cuz no space */
204 1.24.2.1 phil uint32_t is_tx_fragframes; /* tx frames fragmented */
205 1.24.2.1 phil uint32_t is_tx_frags; /* tx fragments created */
206 1.24.2.1 phil uint32_t is_scan_active; /* active scans started */
207 1.24.2.1 phil uint32_t is_scan_passive; /* passive scans started */
208 1.24.2.1 phil uint32_t is_node_timeout; /* nodes timed out inactivity */
209 1.24.2.1 phil uint32_t is_crypto_nomem; /* no memory for crypto ctx */
210 1.24.2.1 phil uint32_t is_crypto_tkip; /* tkip crypto done in s/w */
211 1.24.2.1 phil uint32_t is_crypto_tkipenmic; /* tkip en-MIC done in s/w */
212 1.24.2.1 phil uint32_t is_crypto_tkipdemic; /* tkip de-MIC done in s/w */
213 1.24.2.1 phil uint32_t is_crypto_tkipcm; /* tkip counter measures */
214 1.24.2.1 phil uint32_t is_crypto_ccmp; /* ccmp crypto done in s/w */
215 1.24.2.1 phil uint32_t is_crypto_wep; /* wep crypto done in s/w */
216 1.24.2.1 phil uint32_t is_crypto_setkey_cipher;/* cipher rejected key */
217 1.24.2.1 phil uint32_t is_crypto_setkey_nokey; /* no key index for setkey */
218 1.24.2.1 phil uint32_t is_crypto_delkey; /* driver key delete failed */
219 1.24.2.1 phil uint32_t is_crypto_badcipher; /* unknown cipher */
220 1.24.2.1 phil uint32_t is_crypto_nocipher; /* cipher not available */
221 1.24.2.1 phil uint32_t is_crypto_attachfail; /* cipher attach failed */
222 1.24.2.1 phil uint32_t is_crypto_swfallback; /* cipher fallback to s/w */
223 1.24.2.1 phil uint32_t is_crypto_keyfail; /* driver key alloc failed */
224 1.24.2.1 phil uint32_t is_crypto_enmicfail; /* en-MIC failed */
225 1.24.2.1 phil uint32_t is_ibss_capmismatch; /* merge failed-cap mismatch */
226 1.24.2.1 phil uint32_t is_ibss_norate; /* merge failed-rate mismatch */
227 1.24.2.1 phil uint32_t is_ps_unassoc; /* ps-poll for unassoc. sta */
228 1.24.2.1 phil uint32_t is_ps_badaid; /* ps-poll w/ incorrect aid */
229 1.24.2.1 phil uint32_t is_ps_qempty; /* ps-poll w/ nothing to send */
230 1.24.2.1 phil uint32_t is_ff_badhdr; /* fast frame rx'd w/ bad hdr */
231 1.24.2.1 phil uint32_t is_ff_tooshort; /* fast frame rx decap error */
232 1.24.2.1 phil uint32_t is_ff_split; /* fast frame rx split error */
233 1.24.2.1 phil uint32_t is_ff_decap; /* fast frames decap'd */
234 1.24.2.1 phil uint32_t is_ff_encap; /* fast frames encap'd for tx */
235 1.24.2.1 phil uint32_t is_rx_badbintval; /* rx frame w/ bogus bintval */
236 1.24.2.1 phil uint32_t is_rx_demicfail; /* rx demic failed */
237 1.24.2.1 phil uint32_t is_rx_defrag; /* rx defragmentation failed */
238 1.24.2.1 phil uint32_t is_rx_mgmt; /* rx management frames */
239 1.24.2.1 phil uint32_t is_rx_action; /* rx action mgt frames */
240 1.24.2.1 phil uint32_t is_amsdu_tooshort; /* A-MSDU rx decap error */
241 1.24.2.1 phil uint32_t is_amsdu_split; /* A-MSDU rx split error */
242 1.24.2.1 phil uint32_t is_amsdu_decap; /* A-MSDU decap'd */
243 1.24.2.1 phil uint32_t is_amsdu_encap; /* A-MSDU encap'd for tx */
244 1.24.2.1 phil uint32_t is_ampdu_bar_bad; /* A-MPDU BAR out of window */
245 1.24.2.1 phil uint32_t is_ampdu_bar_oow; /* A-MPDU BAR before ADDBA */
246 1.24.2.1 phil uint32_t is_ampdu_bar_move; /* A-MPDU BAR moved window */
247 1.24.2.1 phil uint32_t is_ampdu_bar_rx; /* A-MPDU BAR frames handled */
248 1.24.2.1 phil uint32_t is_ampdu_rx_flush; /* A-MPDU frames flushed */
249 1.24.2.1 phil uint32_t is_ampdu_rx_oor; /* A-MPDU frames out-of-order */
250 1.24.2.1 phil uint32_t is_ampdu_rx_copy; /* A-MPDU frames copied down */
251 1.24.2.1 phil uint32_t is_ampdu_rx_drop; /* A-MPDU frames dropped */
252 1.24.2.1 phil uint32_t is_tx_badstate; /* tx discard state != RUN */
253 1.24.2.1 phil uint32_t is_tx_notassoc; /* tx failed, sta not assoc */
254 1.24.2.1 phil uint32_t is_tx_classify; /* tx classification failed */
255 1.24.2.1 phil uint32_t is_dwds_mcast; /* discard mcast over dwds */
256 1.24.2.1 phil uint32_t is_dwds_qdrop; /* dwds pending frame q full */
257 1.24.2.1 phil uint32_t is_ht_assoc_nohtcap; /* non-HT sta rejected */
258 1.24.2.1 phil uint32_t is_ht_assoc_downgrade; /* HT sta forced to legacy */
259 1.24.2.1 phil uint32_t is_ht_assoc_norate; /* HT assoc w/ rate mismatch */
260 1.24.2.1 phil uint32_t is_ampdu_rx_age; /* A-MPDU sent up 'cuz of age */
261 1.24.2.1 phil uint32_t is_ampdu_rx_move; /* A-MPDU MSDU moved window */
262 1.24.2.1 phil uint32_t is_addba_reject; /* ADDBA reject 'cuz disabled */
263 1.24.2.1 phil uint32_t is_addba_norequest; /* ADDBA response w/o ADDBA */
264 1.24.2.1 phil uint32_t is_addba_badtoken; /* ADDBA response w/ wrong
265 1.24.2.1 phil dialogtoken */
266 1.24.2.1 phil uint32_t is_addba_badpolicy; /* ADDBA resp w/ wrong policy */
267 1.24.2.1 phil uint32_t is_ampdu_stop; /* A-MPDU stream stopped */
268 1.24.2.1 phil uint32_t is_ampdu_stop_failed; /* A-MPDU stream not running */
269 1.24.2.1 phil uint32_t is_ampdu_rx_reorder; /* A-MPDU held for rx reorder */
270 1.24.2.1 phil uint32_t is_scan_bg; /* background scans started */
271 1.24.2.1 phil uint8_t is_rx_deauth_code; /* last rx'd deauth reason */
272 1.24.2.1 phil uint8_t is_rx_disassoc_code; /* last rx'd disassoc reason */
273 1.24.2.1 phil uint8_t is_rx_authfail_code; /* last rx'd auth fail reason */
274 1.24.2.1 phil uint32_t is_beacon_miss; /* beacon miss notification */
275 1.24.2.1 phil uint32_t is_rx_badstate; /* rx discard state != RUN */
276 1.24.2.1 phil uint32_t is_ff_flush; /* ff's flush'd from stageq */
277 1.24.2.1 phil uint32_t is_tx_ctl; /* tx ctrl frames */
278 1.24.2.1 phil uint32_t is_ampdu_rexmt; /* A-MPDU frames rexmt ok */
279 1.24.2.1 phil uint32_t is_ampdu_rexmt_fail; /* A-MPDU frames rexmt fail */
280 1.24.2.1 phil
281 1.24.2.1 phil uint32_t is_mesh_wrongmesh; /* dropped 'cuz not mesh sta*/
282 1.24.2.1 phil uint32_t is_mesh_nolink; /* dropped 'cuz link not estab*/
283 1.24.2.1 phil uint32_t is_mesh_fwd_ttl; /* mesh not fwd'd 'cuz ttl 0 */
284 1.24.2.1 phil uint32_t is_mesh_fwd_nobuf; /* mesh not fwd'd 'cuz no mbuf*/
285 1.24.2.1 phil uint32_t is_mesh_fwd_tooshort; /* mesh not fwd'd 'cuz no hdr */
286 1.24.2.1 phil uint32_t is_mesh_fwd_disabled; /* mesh not fwd'd 'cuz disabled */
287 1.24.2.1 phil uint32_t is_mesh_fwd_nopath; /* mesh not fwd'd 'cuz path unknown */
288 1.24.2.1 phil
289 1.24.2.1 phil uint32_t is_hwmp_wrongseq; /* wrong hwmp seq no. */
290 1.24.2.1 phil uint32_t is_hwmp_rootreqs; /* root PREQs sent */
291 1.24.2.1 phil uint32_t is_hwmp_rootrann; /* root RANNs sent */
292 1.24.2.1 phil
293 1.24.2.1 phil uint32_t is_mesh_badae; /* dropped 'cuz invalid AE */
294 1.24.2.1 phil uint32_t is_mesh_rtaddfailed; /* route add failed */
295 1.24.2.1 phil uint32_t is_mesh_notproxy; /* dropped 'cuz not proxying */
296 1.24.2.1 phil uint32_t is_rx_badalign; /* dropped 'cuz misaligned */
297 1.24.2.1 phil uint32_t is_hwmp_proxy; /* PREP for proxy route */
298 1.24.2.1 phil uint32_t is_beacon_bad; /* Number of bad beacons */
299 1.24.2.1 phil uint32_t is_ampdu_bar_tx; /* A-MPDU BAR frames TXed */
300 1.24.2.1 phil uint32_t is_ampdu_bar_tx_retry; /* A-MPDU BAR frames TX rtry */
301 1.24.2.1 phil uint32_t is_ampdu_bar_tx_fail; /* A-MPDU BAR frames TX fail */
302 1.24.2.1 phil
303 1.24.2.1 phil uint32_t is_ff_encapfail; /* failed FF encap */
304 1.24.2.1 phil uint32_t is_amsdu_encapfail; /* failed A-MSDU encap */
305 1.24.2.1 phil
306 1.24.2.1 phil uint32_t is_spare[5];
307 1.9 dyoung };
308 1.9 dyoung
309 1.9 dyoung /*
310 1.9 dyoung * Max size of optional information elements. We artificially
311 1.9 dyoung * constrain this; it's limited only by the max frame size (and
312 1.9 dyoung * the max parameter size of the wireless extensions).
313 1.9 dyoung */
314 1.9 dyoung #define IEEE80211_MAX_OPT_IE 256
315 1.9 dyoung
316 1.9 dyoung /*
317 1.9 dyoung * WPA/RSN get/set key request. Specify the key/cipher
318 1.9 dyoung * type and whether the key is to be used for sending and/or
319 1.9 dyoung * receiving. The key index should be set only when working
320 1.9 dyoung * with global keys (use IEEE80211_KEYIX_NONE for ``no index'').
321 1.9 dyoung * Otherwise a unicast/pairwise key is specified by the bssid
322 1.9 dyoung * (on a station) or mac address (on an ap). They key length
323 1.9 dyoung * must include any MIC key data; otherwise it should be no
324 1.24.2.1 phil * more than IEEE80211_KEYBUF_SIZE.
325 1.9 dyoung */
326 1.9 dyoung struct ieee80211req_key {
327 1.24.2.1 phil uint8_t ik_type; /* key/cipher type */
328 1.24.2.1 phil uint8_t ik_pad;
329 1.24.2.1 phil uint16_t ik_keyix; /* key index */
330 1.24.2.1 phil uint8_t ik_keylen; /* key length in bytes */
331 1.24.2.1 phil uint8_t ik_flags;
332 1.9 dyoung /* NB: IEEE80211_KEY_XMIT and IEEE80211_KEY_RECV defined elsewhere */
333 1.9 dyoung #define IEEE80211_KEY_DEFAULT 0x80 /* default xmit key */
334 1.24.2.1 phil uint8_t ik_macaddr[IEEE80211_ADDR_LEN];
335 1.24.2.1 phil uint64_t ik_keyrsc; /* key receive sequence counter */
336 1.24.2.1 phil uint64_t ik_keytsc; /* key transmit sequence counter */
337 1.24.2.1 phil uint8_t ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];
338 1.9 dyoung };
339 1.9 dyoung
340 1.9 dyoung /*
341 1.9 dyoung * Delete a key either by index or address. Set the index
342 1.9 dyoung * to IEEE80211_KEYIX_NONE when deleting a unicast key.
343 1.9 dyoung */
344 1.9 dyoung struct ieee80211req_del_key {
345 1.24.2.1 phil uint8_t idk_keyix; /* key index */
346 1.24.2.1 phil uint8_t idk_macaddr[IEEE80211_ADDR_LEN];
347 1.9 dyoung };
348 1.9 dyoung
349 1.9 dyoung /*
350 1.9 dyoung * MLME state manipulation request. IEEE80211_MLME_ASSOC
351 1.9 dyoung * only makes sense when operating as a station. The other
352 1.9 dyoung * requests can be used when operating as a station or an
353 1.9 dyoung * ap (to effect a station).
354 1.9 dyoung */
355 1.9 dyoung struct ieee80211req_mlme {
356 1.24.2.1 phil uint8_t im_op; /* operation to perform */
357 1.9 dyoung #define IEEE80211_MLME_ASSOC 1 /* associate station */
358 1.9 dyoung #define IEEE80211_MLME_DISASSOC 2 /* disassociate station */
359 1.9 dyoung #define IEEE80211_MLME_DEAUTH 3 /* deauthenticate station */
360 1.9 dyoung #define IEEE80211_MLME_AUTHORIZE 4 /* authorize station */
361 1.9 dyoung #define IEEE80211_MLME_UNAUTHORIZE 5 /* unauthorize station */
362 1.24.2.1 phil #define IEEE80211_MLME_AUTH 6 /* authenticate station */
363 1.24.2.1 phil uint8_t im_ssid_len; /* length of optional ssid */
364 1.24.2.1 phil uint16_t im_reason; /* 802.11 reason code */
365 1.24.2.1 phil uint8_t im_macaddr[IEEE80211_ADDR_LEN];
366 1.24.2.1 phil uint8_t im_ssid[IEEE80211_NWID_LEN];
367 1.9 dyoung };
368 1.9 dyoung
369 1.9 dyoung /*
370 1.9 dyoung * MAC ACL operations.
371 1.9 dyoung */
372 1.9 dyoung enum {
373 1.9 dyoung IEEE80211_MACCMD_POLICY_OPEN = 0, /* set policy: no ACL's */
374 1.9 dyoung IEEE80211_MACCMD_POLICY_ALLOW = 1, /* set policy: allow traffic */
375 1.9 dyoung IEEE80211_MACCMD_POLICY_DENY = 2, /* set policy: deny traffic */
376 1.9 dyoung IEEE80211_MACCMD_FLUSH = 3, /* flush ACL database */
377 1.9 dyoung IEEE80211_MACCMD_DETACH = 4, /* detach ACL policy */
378 1.15 skrll IEEE80211_MACCMD_POLICY = 5, /* get ACL policy */
379 1.24.2.1 phil IEEE80211_MACCMD_LIST = 6, /* get ACL database */
380 1.24.2.1 phil IEEE80211_MACCMD_POLICY_RADIUS = 7, /* set policy: RADIUS managed */
381 1.15 skrll };
382 1.15 skrll
383 1.15 skrll struct ieee80211req_maclist {
384 1.24.2.1 phil uint8_t ml_macaddr[IEEE80211_ADDR_LEN];
385 1.24.2.1 phil } __packed;
386 1.24.2.1 phil
387 1.24.2.1 phil /*
388 1.24.2.1 phil * Mesh Routing Table Operations.
389 1.24.2.1 phil */
390 1.24.2.1 phil enum {
391 1.24.2.1 phil IEEE80211_MESH_RTCMD_LIST = 0, /* list HWMP routing table */
392 1.24.2.1 phil IEEE80211_MESH_RTCMD_FLUSH = 1, /* flush HWMP routing table */
393 1.24.2.1 phil IEEE80211_MESH_RTCMD_ADD = 2, /* add entry to the table */
394 1.24.2.1 phil IEEE80211_MESH_RTCMD_DELETE = 3, /* delete an entry from the table */
395 1.24.2.1 phil };
396 1.24.2.1 phil
397 1.24.2.1 phil struct ieee80211req_mesh_route {
398 1.24.2.1 phil uint8_t imr_flags;
399 1.24.2.1 phil #define IEEE80211_MESHRT_FLAGS_DISCOVER 0x01
400 1.24.2.1 phil #define IEEE80211_MESHRT_FLAGS_VALID 0x02
401 1.24.2.1 phil #define IEEE80211_MESHRT_FLAGS_PROXY 0x04
402 1.24.2.1 phil #define IEEE80211_MESHRT_FLAGS_GATE 0x08
403 1.24.2.1 phil uint8_t imr_dest[IEEE80211_ADDR_LEN];
404 1.24.2.1 phil uint8_t imr_nexthop[IEEE80211_ADDR_LEN];
405 1.24.2.1 phil uint16_t imr_nhops;
406 1.24.2.1 phil uint8_t imr_pad;
407 1.24.2.1 phil uint32_t imr_metric;
408 1.24.2.1 phil uint32_t imr_lifetime;
409 1.24.2.1 phil uint32_t imr_lastmseq;
410 1.9 dyoung };
411 1.9 dyoung
412 1.9 dyoung /*
413 1.24.2.1 phil * HWMP root modes
414 1.24.2.1 phil */
415 1.24.2.1 phil enum {
416 1.24.2.1 phil IEEE80211_HWMP_ROOTMODE_DISABLED = 0, /* disabled */
417 1.24.2.1 phil IEEE80211_HWMP_ROOTMODE_NORMAL = 1, /* normal PREPs */
418 1.24.2.1 phil IEEE80211_HWMP_ROOTMODE_PROACTIVE = 2, /* proactive PREPS */
419 1.24.2.1 phil IEEE80211_HWMP_ROOTMODE_RANN = 3, /* use RANN elemid */
420 1.24.2.1 phil };
421 1.24.2.1 phil
422 1.24.2.1 phil
423 1.24.2.1 phil /*
424 1.24.2.1 phil * Set the active channel list by IEEE channel #: each channel
425 1.24.2.1 phil * to be marked active is set in a bit vector. Note this list is
426 1.24.2.1 phil * intersected with the available channel list in calculating
427 1.24.2.1 phil * the set of channels actually used in scanning.
428 1.9 dyoung */
429 1.9 dyoung struct ieee80211req_chanlist {
430 1.24.2.1 phil uint8_t ic_channels[32]; /* NB: can be variable length */
431 1.9 dyoung };
432 1.9 dyoung
433 1.9 dyoung /*
434 1.9 dyoung * Get the active channel list info.
435 1.9 dyoung */
436 1.9 dyoung struct ieee80211req_chaninfo {
437 1.9 dyoung u_int ic_nchans;
438 1.24.2.1 phil struct ieee80211_channel ic_chans[1]; /* NB: variable length */
439 1.9 dyoung };
440 1.24.2.1 phil #define IEEE80211_CHANINFO_SIZE(_nchan) \
441 1.24.2.1 phil (sizeof(struct ieee80211req_chaninfo) + \
442 1.24.2.1 phil (((_nchan)-1) * sizeof(struct ieee80211_channel)))
443 1.24.2.1 phil #define IEEE80211_CHANINFO_SPACE(_ci) \
444 1.24.2.1 phil IEEE80211_CHANINFO_SIZE((_ci)->ic_nchans)
445 1.9 dyoung
446 1.9 dyoung /*
447 1.9 dyoung * Retrieve the WPA/RSN information element for an associated station.
448 1.9 dyoung */
449 1.24.2.1 phil struct ieee80211req_wpaie { /* old version w/ only one ie */
450 1.24.2.1 phil uint8_t wpa_macaddr[IEEE80211_ADDR_LEN];
451 1.24.2.1 phil uint8_t wpa_ie[IEEE80211_MAX_OPT_IE];
452 1.24.2.1 phil };
453 1.24.2.1 phil struct ieee80211req_wpaie2 {
454 1.24.2.1 phil uint8_t wpa_macaddr[IEEE80211_ADDR_LEN];
455 1.24.2.1 phil uint8_t wpa_ie[IEEE80211_MAX_OPT_IE];
456 1.24.2.1 phil uint8_t rsn_ie[IEEE80211_MAX_OPT_IE];
457 1.9 dyoung };
458 1.9 dyoung
459 1.9 dyoung /*
460 1.9 dyoung * Retrieve per-node statistics.
461 1.9 dyoung */
462 1.9 dyoung struct ieee80211req_sta_stats {
463 1.9 dyoung union {
464 1.9 dyoung /* NB: explicitly force 64-bit alignment */
465 1.24.2.1 phil uint8_t macaddr[IEEE80211_ADDR_LEN];
466 1.24.2.1 phil uint64_t pad;
467 1.9 dyoung } is_u;
468 1.9 dyoung struct ieee80211_nodestats is_stats;
469 1.9 dyoung };
470 1.9 dyoung
471 1.9 dyoung /*
472 1.9 dyoung * Station information block; the mac address is used
473 1.9 dyoung * to retrieve other data like stats, unicast key, etc.
474 1.9 dyoung */
475 1.9 dyoung struct ieee80211req_sta_info {
476 1.24.2.1 phil uint16_t isi_len; /* total length (mult of 4) */
477 1.24.2.1 phil uint16_t isi_ie_off; /* offset to IE data */
478 1.24.2.1 phil uint16_t isi_ie_len; /* IE length */
479 1.24.2.1 phil uint16_t isi_freq; /* MHz */
480 1.24.2.1 phil uint32_t isi_flags; /* channel flags */
481 1.24.2.1 phil uint32_t isi_state; /* state flags */
482 1.24.2.1 phil uint8_t isi_authmode; /* authentication algorithm */
483 1.24.2.1 phil int8_t isi_rssi; /* receive signal strength */
484 1.24.2.1 phil int8_t isi_noise; /* noise floor */
485 1.24.2.1 phil uint8_t isi_capinfo; /* capabilities */
486 1.24.2.1 phil uint8_t isi_erp; /* ERP element */
487 1.24.2.1 phil uint8_t isi_macaddr[IEEE80211_ADDR_LEN];
488 1.24.2.1 phil uint8_t isi_nrates;
489 1.9 dyoung /* negotiated rates */
490 1.24.2.1 phil uint8_t isi_rates[IEEE80211_RATE_MAXSIZE];
491 1.24.2.1 phil uint8_t isi_txrate; /* legacy/IEEE rate or MCS */
492 1.24.2.1 phil uint16_t isi_associd; /* assoc response */
493 1.24.2.1 phil uint16_t isi_txpower; /* current tx power */
494 1.24.2.1 phil uint16_t isi_vlan; /* vlan tag */
495 1.24.2.1 phil /* NB: [IEEE80211_NONQOS_TID] holds seq#'s for non-QoS stations */
496 1.24.2.1 phil uint16_t isi_txseqs[IEEE80211_TID_SIZE];/* tx seq #/TID */
497 1.24.2.1 phil uint16_t isi_rxseqs[IEEE80211_TID_SIZE];/* rx seq#/TID */
498 1.24.2.1 phil uint16_t isi_inact; /* inactivity timer */
499 1.24.2.1 phil uint16_t isi_txmbps; /* current tx rate in .5 Mb/s */
500 1.24.2.1 phil uint16_t isi_pad;
501 1.24.2.1 phil uint32_t isi_jointime; /* time of assoc/join */
502 1.24.2.1 phil struct ieee80211_mimo_info isi_mimo; /* MIMO info for 11n sta's */
503 1.24.2.1 phil /* 11s info */
504 1.24.2.1 phil uint16_t isi_peerid;
505 1.24.2.1 phil uint16_t isi_localid;
506 1.24.2.1 phil uint8_t isi_peerstate;
507 1.9 dyoung /* XXX frag state? */
508 1.9 dyoung /* variable length IE data */
509 1.9 dyoung };
510 1.9 dyoung
511 1.9 dyoung /*
512 1.9 dyoung * Retrieve per-station information; to retrieve all
513 1.9 dyoung * specify a mac address of ff:ff:ff:ff:ff:ff.
514 1.9 dyoung */
515 1.9 dyoung struct ieee80211req_sta_req {
516 1.9 dyoung union {
517 1.9 dyoung /* NB: explicitly force 64-bit alignment */
518 1.24.2.1 phil uint8_t macaddr[IEEE80211_ADDR_LEN];
519 1.24.2.1 phil uint64_t pad;
520 1.9 dyoung } is_u;
521 1.9 dyoung struct ieee80211req_sta_info info[1]; /* variable length */
522 1.9 dyoung };
523 1.9 dyoung
524 1.9 dyoung /*
525 1.9 dyoung * Get/set per-station tx power cap.
526 1.9 dyoung */
527 1.9 dyoung struct ieee80211req_sta_txpow {
528 1.24.2.1 phil uint8_t it_macaddr[IEEE80211_ADDR_LEN];
529 1.24.2.1 phil uint8_t it_txpow;
530 1.6 dyoung };
531 1.6 dyoung
532 1.9 dyoung /*
533 1.24.2.1 phil * WME parameters manipulated with IEEE80211_IOC_WME_CWMIN
534 1.24.2.1 phil * through IEEE80211_IOC_WME_ACKPOLICY are set and return
535 1.24.2.1 phil * using i_val and i_len. i_val holds the value itself.
536 1.24.2.1 phil * i_len specifies the AC and, as appropriate, then high bit
537 1.24.2.1 phil * specifies whether the operation is to be applied to the
538 1.24.2.1 phil * BSS or ourself.
539 1.9 dyoung */
540 1.9 dyoung #define IEEE80211_WMEPARAM_SELF 0x0000 /* parameter applies to self */
541 1.9 dyoung #define IEEE80211_WMEPARAM_BSS 0x8000 /* parameter applies to BSS */
542 1.9 dyoung #define IEEE80211_WMEPARAM_VAL 0x7fff /* parameter value */
543 1.9 dyoung
544 1.1 dyoung /*
545 1.24.2.1 phil * Application Information Elements can be appended to a variety
546 1.24.2.1 phil * of frames with the IEE80211_IOC_APPIE request. This request
547 1.24.2.1 phil * piggybacks on a normal ieee80211req; the frame type is passed
548 1.24.2.1 phil * in i_val as the 802.11 FC0 bytes and the length of the IE data
549 1.24.2.1 phil * is passed in i_len. The data is referenced in i_data. If i_len
550 1.24.2.1 phil * is zero then any previously configured IE data is removed. At
551 1.24.2.1 phil * most IEEE80211_MAX_APPIE data be appened. Note that multiple
552 1.24.2.1 phil * IE's can be supplied; the data is treated opaquely.
553 1.24.2.1 phil */
554 1.24.2.1 phil #define IEEE80211_MAX_APPIE 1024 /* max app IE data */
555 1.24.2.1 phil /*
556 1.24.2.1 phil * Hack: the WPA authenticator uses this mechanism to specify WPA
557 1.24.2.1 phil * ie's that are used instead of the ones normally constructed using
558 1.24.2.1 phil * the cipher state setup with separate ioctls. This avoids issues
559 1.24.2.1 phil * like the authenticator ordering ie data differently than the
560 1.24.2.1 phil * net80211 layer and needing to keep separate state for WPA and RSN.
561 1.24.2.1 phil */
562 1.24.2.1 phil #define IEEE80211_APPIE_WPA \
563 1.24.2.1 phil (IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_BEACON | \
564 1.24.2.1 phil IEEE80211_FC0_SUBTYPE_PROBE_RESP)
565 1.24.2.1 phil
566 1.24.2.1 phil /*
567 1.24.2.1 phil * Station mode roaming parameters. These are maintained
568 1.24.2.1 phil * per band/mode and control the roaming algorithm.
569 1.24.2.1 phil */
570 1.24.2.1 phil struct ieee80211_roamparams_req {
571 1.24.2.1 phil struct ieee80211_roamparam params[IEEE80211_MODE_MAX];
572 1.24.2.1 phil };
573 1.24.2.1 phil
574 1.24.2.1 phil /*
575 1.24.2.1 phil * Transmit parameters. These can be used to set fixed transmit
576 1.24.2.1 phil * rate for each operating mode when operating as client or on a
577 1.24.2.1 phil * per-client basis according to the capabilities of the client
578 1.24.2.1 phil * (e.g. an 11b client associated to an 11g ap) when operating as
579 1.24.2.1 phil * an ap.
580 1.24.2.1 phil *
581 1.24.2.1 phil * MCS are distinguished from legacy rates by or'ing in 0x80.
582 1.24.2.1 phil */
583 1.24.2.1 phil struct ieee80211_txparams_req {
584 1.24.2.1 phil struct ieee80211_txparam params[IEEE80211_MODE_MAX];
585 1.24.2.1 phil };
586 1.24.2.1 phil
587 1.24.2.1 phil /*
588 1.24.2.1 phil * Set regulatory domain state with IEEE80211_IOC_REGDOMAIN.
589 1.24.2.1 phil * Note this is both the regulatory description and the channel
590 1.24.2.1 phil * list. The get request for IEEE80211_IOC_REGDOMAIN returns
591 1.24.2.1 phil * only the regdomain info; the channel list is obtained
592 1.24.2.1 phil * separately with IEEE80211_IOC_CHANINFO.
593 1.24.2.1 phil */
594 1.24.2.1 phil struct ieee80211_regdomain_req {
595 1.24.2.1 phil struct ieee80211_regdomain rd;
596 1.24.2.1 phil struct ieee80211req_chaninfo chaninfo;
597 1.24.2.1 phil };
598 1.24.2.1 phil #define IEEE80211_REGDOMAIN_SIZE(_nchan) \
599 1.24.2.1 phil (sizeof(struct ieee80211_regdomain_req) + \
600 1.24.2.1 phil (((_nchan)-1) * sizeof(struct ieee80211_channel)))
601 1.24.2.1 phil #define IEEE80211_REGDOMAIN_SPACE(_req) \
602 1.24.2.1 phil IEEE80211_REGDOMAIN_SIZE((_req)->chaninfo.ic_nchans)
603 1.24.2.1 phil
604 1.24.2.1 phil /*
605 1.24.2.1 phil * Get driver capabilities. Driver, hardware crypto, and
606 1.24.2.1 phil * HT/802.11n capabilities, and a table that describes what
607 1.24.2.1 phil * the radio can do.
608 1.24.2.1 phil */
609 1.24.2.1 phil struct ieee80211_devcaps_req {
610 1.24.2.1 phil uint32_t dc_drivercaps; /* general driver caps */
611 1.24.2.1 phil uint32_t dc_cryptocaps; /* hardware crypto support */
612 1.24.2.1 phil uint32_t dc_htcaps; /* HT/802.11n support */
613 1.24.2.1 phil uint32_t dc_vhtcaps; /* VHT/802.11ac capabilities */
614 1.24.2.1 phil struct ieee80211req_chaninfo dc_chaninfo;
615 1.24.2.1 phil };
616 1.24.2.1 phil #define IEEE80211_DEVCAPS_SIZE(_nchan) \
617 1.24.2.1 phil (sizeof(struct ieee80211_devcaps_req) + \
618 1.24.2.1 phil (((_nchan)-1) * sizeof(struct ieee80211_channel)))
619 1.24.2.1 phil #define IEEE80211_DEVCAPS_SPACE(_dc) \
620 1.24.2.1 phil IEEE80211_DEVCAPS_SIZE((_dc)->dc_chaninfo.ic_nchans)
621 1.24.2.1 phil
622 1.24.2.1 phil struct ieee80211_chanswitch_req {
623 1.24.2.1 phil struct ieee80211_channel csa_chan; /* new channel */
624 1.24.2.1 phil int csa_mode; /* CSA mode */
625 1.24.2.1 phil int csa_count; /* beacon count to switch */
626 1.24.2.1 phil };
627 1.24.2.1 phil
628 1.24.2.1 phil /*
629 1.24.2.1 phil * Get/set per-station vlan tag.
630 1.24.2.1 phil */
631 1.24.2.1 phil struct ieee80211req_sta_vlan {
632 1.24.2.1 phil uint8_t sv_macaddr[IEEE80211_ADDR_LEN];
633 1.24.2.1 phil uint16_t sv_vlan;
634 1.24.2.1 phil };
635 1.24.2.1 phil
636 1.24.2.1 phil /*
637 1.1 dyoung * FreeBSD-style ioctls.
638 1.1 dyoung */
639 1.1 dyoung /* the first member must be matched with struct ifreq */
640 1.1 dyoung struct ieee80211req {
641 1.1 dyoung char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
642 1.24.2.1 phil uint16_t i_type; /* req type */
643 1.1 dyoung int16_t i_val; /* Index or simple value */
644 1.24.2.1 phil uint16_t i_len; /* Index or simple value */
645 1.1 dyoung void *i_data; /* Extra data */
646 1.1 dyoung };
647 1.24.2.3 phil
648 1.24.2.3 phil #ifdef __FreeBSD__
649 1.1 dyoung #define SIOCS80211 _IOW('i', 234, struct ieee80211req)
650 1.1 dyoung #define SIOCG80211 _IOWR('i', 235, struct ieee80211req)
651 1.9 dyoung #define SIOCG80211STATS _IOWR('i', 236, struct ifreq)
652 1.1 dyoung
653 1.24.2.3 phil #elif __NetBSD__
654 1.24.2.6 christos #define SIOCS80211 _IOW('i', 244, struct ieee80211req)
655 1.24.2.6 christos #define SIOCG80211 _IOWR('i', 245, struct ieee80211req)
656 1.24.2.6 christos #define SIOCG80211STATS _IOWR('i', 246, struct ifreq)
657 1.24.2.6 christos #define SIOCG80211ZSTATS _IOWR('i', 247, struct ifreq)
658 1.24.2.6 christos #define OSIOCG80211STATS _IOWR('i', 242, struct ifreq)
659 1.24.2.6 christos #define OSIOCG80211ZSTATS _IOWR('i', 243, struct ifreq)
660 1.24.2.6 christos #endif /* __NetBSD__ */
661 1.24.2.3 phil
662 1.1 dyoung #define IEEE80211_IOC_SSID 1
663 1.1 dyoung #define IEEE80211_IOC_NUMSSIDS 2
664 1.1 dyoung #define IEEE80211_IOC_WEP 3
665 1.1 dyoung #define IEEE80211_WEP_NOSUP -1
666 1.1 dyoung #define IEEE80211_WEP_OFF 0
667 1.1 dyoung #define IEEE80211_WEP_ON 1
668 1.1 dyoung #define IEEE80211_WEP_MIXED 2
669 1.1 dyoung #define IEEE80211_IOC_WEPKEY 4
670 1.1 dyoung #define IEEE80211_IOC_NUMWEPKEYS 5
671 1.1 dyoung #define IEEE80211_IOC_WEPTXKEY 6
672 1.1 dyoung #define IEEE80211_IOC_AUTHMODE 7
673 1.1 dyoung #define IEEE80211_IOC_STATIONNAME 8
674 1.1 dyoung #define IEEE80211_IOC_CHANNEL 9
675 1.1 dyoung #define IEEE80211_IOC_POWERSAVE 10
676 1.1 dyoung #define IEEE80211_POWERSAVE_NOSUP -1
677 1.1 dyoung #define IEEE80211_POWERSAVE_OFF 0
678 1.1 dyoung #define IEEE80211_POWERSAVE_CAM 1
679 1.1 dyoung #define IEEE80211_POWERSAVE_PSP 2
680 1.1 dyoung #define IEEE80211_POWERSAVE_PSP_CAM 3
681 1.1 dyoung #define IEEE80211_POWERSAVE_ON IEEE80211_POWERSAVE_CAM
682 1.1 dyoung #define IEEE80211_IOC_POWERSAVESLEEP 11
683 1.6 dyoung #define IEEE80211_IOC_RTSTHRESHOLD 12
684 1.7 dyoung #define IEEE80211_IOC_PROTMODE 13
685 1.7 dyoung #define IEEE80211_PROTMODE_OFF 0
686 1.7 dyoung #define IEEE80211_PROTMODE_CTS 1
687 1.7 dyoung #define IEEE80211_PROTMODE_RTSCTS 2
688 1.9 dyoung #define IEEE80211_IOC_TXPOWER 14 /* global tx power limit */
689 1.9 dyoung #define IEEE80211_IOC_BSSID 15
690 1.9 dyoung #define IEEE80211_IOC_ROAMING 16 /* roaming mode */
691 1.9 dyoung #define IEEE80211_IOC_PRIVACY 17 /* privacy invoked */
692 1.9 dyoung #define IEEE80211_IOC_DROPUNENCRYPTED 18 /* discard unencrypted frames */
693 1.9 dyoung #define IEEE80211_IOC_WPAKEY 19
694 1.9 dyoung #define IEEE80211_IOC_DELKEY 20
695 1.9 dyoung #define IEEE80211_IOC_MLME 21
696 1.24.2.1 phil /* 22 was IEEE80211_IOC_OPTIE, replaced by IEEE80211_IOC_APPIE */
697 1.24.2.1 phil /* 23 was IEEE80211_IOC_SCAN_REQ */
698 1.24.2.1 phil /* 24 was IEEE80211_IOC_SCAN_RESULTS */
699 1.9 dyoung #define IEEE80211_IOC_COUNTERMEASURES 25 /* WPA/TKIP countermeasures */
700 1.9 dyoung #define IEEE80211_IOC_WPA 26 /* WPA mode (0,1,2) */
701 1.9 dyoung #define IEEE80211_IOC_CHANLIST 27 /* channel list */
702 1.9 dyoung #define IEEE80211_IOC_WME 28 /* WME mode (on, off) */
703 1.9 dyoung #define IEEE80211_IOC_HIDESSID 29 /* hide SSID mode (on, off) */
704 1.9 dyoung #define IEEE80211_IOC_APBRIDGE 30 /* AP inter-sta bridging */
705 1.24.2.1 phil /* 31-35,37-38 were for WPA authenticator settings */
706 1.24.2.1 phil /* 36 was IEEE80211_IOC_DRIVER_CAPS */
707 1.9 dyoung #define IEEE80211_IOC_WPAIE 39 /* WPA information element */
708 1.9 dyoung #define IEEE80211_IOC_STA_STATS 40 /* per-station statistics */
709 1.9 dyoung #define IEEE80211_IOC_MACCMD 41 /* MAC ACL operation */
710 1.9 dyoung #define IEEE80211_IOC_CHANINFO 42 /* channel info list */
711 1.9 dyoung #define IEEE80211_IOC_TXPOWMAX 43 /* max tx power for channel */
712 1.9 dyoung #define IEEE80211_IOC_STA_TXPOW 44 /* per-station tx power limit */
713 1.24.2.1 phil /* 45 was IEEE80211_IOC_STA_INFO */
714 1.9 dyoung #define IEEE80211_IOC_WME_CWMIN 46 /* WME: ECWmin */
715 1.9 dyoung #define IEEE80211_IOC_WME_CWMAX 47 /* WME: ECWmax */
716 1.9 dyoung #define IEEE80211_IOC_WME_AIFS 48 /* WME: AIFSN */
717 1.9 dyoung #define IEEE80211_IOC_WME_TXOPLIMIT 49 /* WME: txops limit */
718 1.9 dyoung #define IEEE80211_IOC_WME_ACM 50 /* WME: ACM (bss only) */
719 1.9 dyoung #define IEEE80211_IOC_WME_ACKPOLICY 51 /* WME: ACK policy (!bss only)*/
720 1.9 dyoung #define IEEE80211_IOC_DTIM_PERIOD 52 /* DTIM period (beacons) */
721 1.9 dyoung #define IEEE80211_IOC_BEACON_INTERVAL 53 /* beacon interval (ms) */
722 1.9 dyoung #define IEEE80211_IOC_ADDMAC 54 /* add sta to MAC ACL table */
723 1.9 dyoung #define IEEE80211_IOC_DELMAC 55 /* del sta from MAC ACL table */
724 1.10 dyoung #define IEEE80211_IOC_PUREG 56 /* pure 11g (no 11b stations) */
725 1.24.2.1 phil #define IEEE80211_IOC_FF 57 /* ATH fast frames (on, off) */
726 1.24.2.1 phil #define IEEE80211_IOC_TURBOP 58 /* ATH turbo' (on, off) */
727 1.24.2.1 phil #define IEEE80211_IOC_BGSCAN 59 /* bg scanning (on, off) */
728 1.24.2.1 phil #define IEEE80211_IOC_BGSCAN_IDLE 60 /* bg scan idle threshold */
729 1.24.2.1 phil #define IEEE80211_IOC_BGSCAN_INTERVAL 61 /* bg scan interval */
730 1.24.2.1 phil #define IEEE80211_IOC_SCANVALID 65 /* scan cache valid threshold */
731 1.24.2.1 phil /* 66-72 were IEEE80211_IOC_ROAM_* and IEEE80211_IOC_MCAST_RATE */
732 1.15 skrll #define IEEE80211_IOC_FRAGTHRESHOLD 73 /* tx fragmentation threshold */
733 1.24.2.1 phil #define IEEE80211_IOC_BURST 75 /* packet bursting */
734 1.24.2.1 phil #define IEEE80211_IOC_SCAN_RESULTS 76 /* get scan results */
735 1.24.2.1 phil #define IEEE80211_IOC_BMISSTHRESHOLD 77 /* beacon miss threshold */
736 1.24.2.1 phil #define IEEE80211_IOC_STA_INFO 78 /* station/neighbor info */
737 1.24.2.1 phil #define IEEE80211_IOC_WPAIE2 79 /* WPA+RSN info elements */
738 1.24.2.1 phil #define IEEE80211_IOC_CURCHAN 80 /* current channel */
739 1.24.2.1 phil #define IEEE80211_IOC_SHORTGI 81 /* 802.11n half GI */
740 1.24.2.1 phil #define IEEE80211_IOC_AMPDU 82 /* 802.11n A-MPDU (on, off) */
741 1.24.2.1 phil #define IEEE80211_IOC_AMPDU_LIMIT 83 /* A-MPDU length limit */
742 1.24.2.1 phil #define IEEE80211_IOC_AMPDU_DENSITY 84 /* A-MPDU density */
743 1.24.2.1 phil #define IEEE80211_IOC_AMSDU 85 /* 802.11n A-MSDU (on, off) */
744 1.24.2.1 phil #define IEEE80211_IOC_AMSDU_LIMIT 86 /* A-MSDU length limit */
745 1.24.2.1 phil #define IEEE80211_IOC_PUREN 87 /* pure 11n (no legacy sta's) */
746 1.24.2.1 phil #define IEEE80211_IOC_DOTH 88 /* 802.11h (on, off) */
747 1.24.2.1 phil /* 89-91 were regulatory items */
748 1.24.2.1 phil #define IEEE80211_IOC_HTCOMPAT 92 /* support pre-D1.10 HT ie's */
749 1.24.2.1 phil #define IEEE80211_IOC_DWDS 93 /* DWDS/4-address handling */
750 1.24.2.1 phil #define IEEE80211_IOC_INACTIVITY 94 /* sta inactivity handling */
751 1.24.2.1 phil #define IEEE80211_IOC_APPIE 95 /* application IE's */
752 1.24.2.1 phil #define IEEE80211_IOC_WPS 96 /* WPS operation */
753 1.24.2.1 phil #define IEEE80211_IOC_TSN 97 /* TSN operation */
754 1.24.2.1 phil #define IEEE80211_IOC_DEVCAPS 98 /* driver+device capabilities */
755 1.24.2.1 phil #define IEEE80211_IOC_CHANSWITCH 99 /* start 11h channel switch */
756 1.24.2.1 phil #define IEEE80211_IOC_DFS 100 /* DFS (on, off) */
757 1.24.2.1 phil #define IEEE80211_IOC_DOTD 101 /* 802.11d (on, off) */
758 1.24.2.1 phil #define IEEE80211_IOC_HTPROTMODE 102 /* HT protection (off, rts) */
759 1.24.2.1 phil #define IEEE80211_IOC_SCAN_REQ 103 /* scan w/ specified params */
760 1.24.2.1 phil #define IEEE80211_IOC_SCAN_CANCEL 104 /* cancel ongoing scan */
761 1.24.2.1 phil #define IEEE80211_IOC_HTCONF 105 /* HT config (off, HT20, HT40)*/
762 1.24.2.1 phil #define IEEE80211_IOC_REGDOMAIN 106 /* regulatory domain info */
763 1.24.2.1 phil #define IEEE80211_IOC_ROAM 107 /* roaming params en masse */
764 1.24.2.1 phil #define IEEE80211_IOC_TXPARAMS 108 /* tx parameters */
765 1.24.2.1 phil #define IEEE80211_IOC_STA_VLAN 109 /* per-station vlan tag */
766 1.24.2.1 phil #define IEEE80211_IOC_SMPS 110 /* MIMO power save */
767 1.24.2.1 phil #define IEEE80211_IOC_RIFS 111 /* RIFS config (on, off) */
768 1.24.2.1 phil #define IEEE80211_IOC_GREENFIELD 112 /* Greenfield (on, off) */
769 1.24.2.1 phil #define IEEE80211_IOC_STBC 113 /* STBC Tx/RX (on, off) */
770 1.24.2.1 phil #define IEEE80211_IOC_LDPC 114 /* LDPC Tx/RX (on, off) */
771 1.24.2.1 phil
772 1.24.2.1 phil /* VHT */
773 1.24.2.1 phil #define IEEE80211_IOC_VHTCONF 130 /* VHT config (off, on; widths) */
774 1.24.2.1 phil
775 1.24.2.1 phil #define IEEE80211_IOC_MESH_ID 170 /* mesh identifier */
776 1.24.2.1 phil #define IEEE80211_IOC_MESH_AP 171 /* accepting peerings */
777 1.24.2.1 phil #define IEEE80211_IOC_MESH_FWRD 172 /* forward frames */
778 1.24.2.1 phil #define IEEE80211_IOC_MESH_PROTO 173 /* mesh protocols */
779 1.24.2.1 phil #define IEEE80211_IOC_MESH_TTL 174 /* mesh TTL */
780 1.24.2.1 phil #define IEEE80211_IOC_MESH_RTCMD 175 /* mesh routing table commands*/
781 1.24.2.1 phil #define IEEE80211_IOC_MESH_PR_METRIC 176 /* mesh metric protocol */
782 1.24.2.1 phil #define IEEE80211_IOC_MESH_PR_PATH 177 /* mesh path protocol */
783 1.24.2.1 phil #define IEEE80211_IOC_MESH_PR_SIG 178 /* mesh sig protocol */
784 1.24.2.1 phil #define IEEE80211_IOC_MESH_PR_CC 179 /* mesh congestion protocol */
785 1.24.2.1 phil #define IEEE80211_IOC_MESH_PR_AUTH 180 /* mesh auth protocol */
786 1.24.2.1 phil #define IEEE80211_IOC_MESH_GATE 181 /* mesh gate XXX: 173? */
787 1.24.2.1 phil
788 1.24.2.1 phil #define IEEE80211_IOC_HWMP_ROOTMODE 190 /* HWMP root mode */
789 1.24.2.1 phil #define IEEE80211_IOC_HWMP_MAXHOPS 191 /* number of hops before drop */
790 1.24.2.1 phil #define IEEE80211_IOC_HWMP_TTL 192 /* HWMP TTL */
791 1.24.2.1 phil
792 1.24.2.1 phil #define IEEE80211_IOC_TDMA_SLOT 201 /* TDMA: assigned slot */
793 1.24.2.1 phil #define IEEE80211_IOC_TDMA_SLOTCNT 202 /* TDMA: slots in bss */
794 1.24.2.1 phil #define IEEE80211_IOC_TDMA_SLOTLEN 203 /* TDMA: slot length (usecs) */
795 1.24.2.1 phil #define IEEE80211_IOC_TDMA_BINTERVAL 204 /* TDMA: beacon intvl (slots) */
796 1.24.2.1 phil
797 1.24.2.1 phil #define IEEE80211_IOC_QUIET 205 /* Quiet Enable/Disable */
798 1.24.2.1 phil #define IEEE80211_IOC_QUIET_PERIOD 206 /* Quiet Period */
799 1.24.2.1 phil #define IEEE80211_IOC_QUIET_OFFSET 207 /* Quiet Offset */
800 1.24.2.1 phil #define IEEE80211_IOC_QUIET_DUR 208 /* Quiet Duration */
801 1.24.2.1 phil #define IEEE80211_IOC_QUIET_COUNT 209 /* Quiet Count */
802 1.24.2.1 phil /*
803 1.24.2.1 phil * Parameters for controlling a scan requested with
804 1.24.2.1 phil * IEEE80211_IOC_SCAN_REQ.
805 1.24.2.1 phil *
806 1.24.2.1 phil * Active scans cause ProbeRequest frames to be issued for each
807 1.24.2.1 phil * specified ssid and, by default, a broadcast ProbeRequest frame.
808 1.24.2.1 phil * The set of ssid's is specified in the request.
809 1.24.2.1 phil *
810 1.24.2.1 phil * By default the scan will cause a BSS to be joined (in station/adhoc
811 1.24.2.1 phil * mode) or a channel to be selected for operation (hostap mode).
812 1.24.2.1 phil * To disable that specify IEEE80211_IOC_SCAN_NOPICK and if the
813 1.24.2.1 phil *
814 1.24.2.1 phil * If the station is currently associated to an AP then a scan request
815 1.24.2.1 phil * will cause the station to leave the current channel and potentially
816 1.24.2.1 phil * miss frames from the AP. Alternatively the station may notify the
817 1.24.2.1 phil * AP that it is going into power save mode before it leaves the channel.
818 1.24.2.1 phil * This ensures frames for the station are buffered by the AP. This is
819 1.24.2.1 phil * termed a ``bg scan'' and is requested with the IEEE80211_IOC_SCAN_BGSCAN
820 1.24.2.1 phil * flag. Background scans may take longer than foreground scans and may
821 1.24.2.1 phil * be preempted by traffic. If a station is not associated to an AP
822 1.24.2.1 phil * then a request for a background scan is automatically done in the
823 1.24.2.1 phil * foreground.
824 1.24.2.1 phil *
825 1.24.2.1 phil * The results of the scan request are cached by the system. This
826 1.24.2.1 phil * information is aged out and/or invalidated based on events like not
827 1.24.2.1 phil * being able to associated to an AP. To flush the current cache
828 1.24.2.1 phil * contents before doing a scan the IEEE80211_IOC_SCAN_FLUSH flag may
829 1.24.2.1 phil * be specified.
830 1.24.2.1 phil *
831 1.24.2.1 phil * By default the scan will be done until a suitable AP is located
832 1.24.2.1 phil * or a channel is found for use. A scan can also be constrained
833 1.24.2.1 phil * to be done once (IEEE80211_IOC_SCAN_ONCE) or to last for no more
834 1.24.2.1 phil * than a specified duration.
835 1.24.2.1 phil */
836 1.24.2.1 phil struct ieee80211_scan_req {
837 1.24.2.1 phil int sr_flags;
838 1.24.2.1 phil #define IEEE80211_IOC_SCAN_NOPICK 0x00001 /* scan only, no selection */
839 1.24.2.1 phil #define IEEE80211_IOC_SCAN_ACTIVE 0x00002 /* active scan (probe req) */
840 1.24.2.1 phil #define IEEE80211_IOC_SCAN_PICK1ST 0x00004 /* ``hey sailor'' mode */
841 1.24.2.1 phil #define IEEE80211_IOC_SCAN_BGSCAN 0x00008 /* bg scan, exit ps at end */
842 1.24.2.1 phil #define IEEE80211_IOC_SCAN_ONCE 0x00010 /* do one complete pass */
843 1.24.2.1 phil #define IEEE80211_IOC_SCAN_NOBCAST 0x00020 /* don't send bcast probe req */
844 1.24.2.1 phil #define IEEE80211_IOC_SCAN_NOJOIN 0x00040 /* no auto-sequencing */
845 1.24.2.1 phil #define IEEE80211_IOC_SCAN_FLUSH 0x10000 /* flush scan cache first */
846 1.24.2.1 phil #define IEEE80211_IOC_SCAN_CHECK 0x20000 /* check scan cache first */
847 1.24.2.1 phil u_int sr_duration; /* duration (ms) */
848 1.24.2.1 phil #define IEEE80211_IOC_SCAN_DURATION_MIN 1
849 1.24.2.1 phil #define IEEE80211_IOC_SCAN_DURATION_MAX 0x7fffffff
850 1.24.2.1 phil #define IEEE80211_IOC_SCAN_FOREVER IEEE80211_IOC_SCAN_DURATION_MAX
851 1.24.2.1 phil u_int sr_mindwell; /* min channel dwelltime (ms) */
852 1.24.2.1 phil u_int sr_maxdwell; /* max channel dwelltime (ms) */
853 1.24.2.1 phil int sr_nssid;
854 1.24.2.1 phil #define IEEE80211_IOC_SCAN_MAX_SSID 3
855 1.24.2.1 phil struct {
856 1.24.2.1 phil int len; /* length in bytes */
857 1.24.2.1 phil uint8_t ssid[IEEE80211_NWID_LEN]; /* ssid contents */
858 1.24.2.1 phil } sr_ssid[IEEE80211_IOC_SCAN_MAX_SSID];
859 1.24.2.1 phil };
860 1.1 dyoung
861 1.9 dyoung /*
862 1.9 dyoung * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS.
863 1.24.2.1 phil * Each result is a fixed size structure followed by a variable
864 1.24.2.1 phil * length SSID and one or more variable length information elements.
865 1.24.2.1 phil * The size of each variable length item is found in the fixed
866 1.24.2.1 phil * size structure and the entire length of the record is specified
867 1.24.2.1 phil * in isr_len. Result records are rounded to a multiple of 4 bytes.
868 1.9 dyoung */
869 1.9 dyoung struct ieee80211req_scan_result {
870 1.24.2.1 phil uint16_t isr_len; /* total length (mult of 4) */
871 1.24.2.1 phil uint16_t isr_ie_off; /* offset to SSID+IE data */
872 1.24.2.1 phil uint16_t isr_ie_len; /* IE length */
873 1.24.2.1 phil uint16_t isr_freq; /* MHz */
874 1.24.2.1 phil uint16_t isr_flags; /* channel flags */
875 1.24.2.1 phil int8_t isr_noise;
876 1.24.2.1 phil int8_t isr_rssi;
877 1.24.2.1 phil uint16_t isr_intval; /* beacon interval */
878 1.24.2.1 phil uint8_t isr_capinfo; /* capabilities */
879 1.24.2.1 phil uint8_t isr_erp; /* ERP element */
880 1.24.2.1 phil uint8_t isr_bssid[IEEE80211_ADDR_LEN];
881 1.24.2.1 phil uint8_t isr_nrates;
882 1.24.2.1 phil uint8_t isr_rates[IEEE80211_RATE_MAXSIZE];
883 1.24.2.1 phil uint8_t isr_ssid_len; /* SSID length */
884 1.24.2.1 phil uint8_t isr_meshid_len; /* MESH ID length */
885 1.24.2.1 phil /* variable length SSID, followed by variable length MESH ID,
886 1.24.2.1 phil followed by IE data */
887 1.2 dyoung };
888 1.2 dyoung
889 1.24.2.1 phil /*
890 1.24.2.1 phil * Virtual AP cloning parameters. The parent device must
891 1.24.2.1 phil * be a vap-capable device. All parameters specified with
892 1.24.2.1 phil * the clone request are fixed for the lifetime of the vap.
893 1.24.2.1 phil *
894 1.24.2.1 phil * There are two flavors of WDS vaps: legacy and dynamic.
895 1.24.2.1 phil * Legacy WDS operation implements a static binding between
896 1.24.2.1 phil * two stations encapsulating traffic in 4-address frames.
897 1.24.2.1 phil * Dynamic WDS vaps are created when a station associates to
898 1.24.2.1 phil * an AP and sends a 4-address frame. If the AP vap is
899 1.24.2.1 phil * configured to support WDS then this will generate an
900 1.24.2.1 phil * event to user programs listening on the routing socket
901 1.24.2.1 phil * and a Dynamic WDS vap will be created to handle traffic
902 1.24.2.1 phil * to/from that station. In both cases the bssid of the
903 1.24.2.1 phil * peer must be specified when creating the vap.
904 1.24.2.1 phil *
905 1.24.2.1 phil * By default a vap will inherit the mac address/bssid of
906 1.24.2.1 phil * the underlying device. To request a unique address the
907 1.24.2.1 phil * IEEE80211_CLONE_BSSID flag should be supplied. This is
908 1.24.2.1 phil * meaningless for WDS vaps as they share the bssid of an
909 1.24.2.1 phil * AP vap that must otherwise exist. Note that some devices
910 1.24.2.1 phil * may not be able to support multiple addresses.
911 1.24.2.1 phil *
912 1.24.2.1 phil * Station mode vap's normally depend on the device to notice
913 1.24.2.1 phil * when the AP stops sending beacon frames. If IEEE80211_CLONE_NOBEACONS
914 1.24.2.1 phil * is specified the net80211 layer will do this in s/w. This
915 1.24.2.1 phil * is mostly useful when setting up a WDS repeater/extender where
916 1.24.2.1 phil * an AP vap is combined with a sta vap and the device isn't able
917 1.24.2.1 phil * to track beacon frames in hardware.
918 1.24.2.1 phil */
919 1.24.2.1 phil struct ieee80211_clone_params {
920 1.24.2.1 phil char icp_parent[IFNAMSIZ]; /* parent device */
921 1.24.2.1 phil uint16_t icp_opmode; /* operating mode */
922 1.24.2.1 phil uint16_t icp_flags; /* see below */
923 1.24.2.1 phil uint8_t icp_bssid[IEEE80211_ADDR_LEN]; /* for WDS links */
924 1.24.2.1 phil uint8_t icp_macaddr[IEEE80211_ADDR_LEN];/* local address */
925 1.24.2.1 phil };
926 1.24.2.1 phil #define IEEE80211_CLONE_BSSID 0x0001 /* allocate unique mac/bssid */
927 1.24.2.1 phil #define IEEE80211_CLONE_NOBEACONS 0x0002 /* don't setup beacon timers */
928 1.24.2.1 phil #define IEEE80211_CLONE_WDSLEGACY 0x0004 /* legacy WDS processing */
929 1.24.2.1 phil #define IEEE80211_CLONE_MACADDR 0x0008 /* use specified mac addr */
930 1.24.2.1 phil #define IEEE80211_CLONE_TDMA 0x0010 /* operate in TDMA mode */
931 1.24.2.3 phil
932 1.24.2.4 phil #if __NetBSD__
933 1.24.2.5 phil
934 1.24.2.5 phil #define OLD_IEEE80211_IOC_SCAN_REQ 23
935 1.24.2.5 phil #define OLD_IEEE80211_IOC_SCAN_RESULTS 24
936 1.24.2.5 phil
937 1.24.2.5 phil /*
938 1.24.2.5 phil * Scan result data returned for OLD_IEEE80211_IOC_SCAN_RESULTS.
939 1.24.2.5 phil */
940 1.24.2.5 phil struct old_ieee80211req_scan_result {
941 1.24.2.5 phil u_int16_t isr_len; /* length (mult of 4) */
942 1.24.2.5 phil u_int16_t isr_freq; /* MHz */
943 1.24.2.5 phil u_int16_t isr_flags; /* channel flags */
944 1.24.2.5 phil u_int8_t isr_noise;
945 1.24.2.5 phil u_int8_t isr_rssi;
946 1.24.2.5 phil u_int8_t isr_intval; /* beacon interval */
947 1.24.2.5 phil u_int8_t isr_capinfo; /* capabilities */
948 1.24.2.5 phil u_int8_t isr_erp; /* ERP element */
949 1.24.2.5 phil u_int8_t isr_bssid[IEEE80211_ADDR_LEN];
950 1.24.2.5 phil u_int8_t isr_nrates;
951 1.24.2.5 phil u_int8_t isr_rates[IEEE80211_RATE_MAXSIZE];
952 1.24.2.5 phil u_int8_t isr_ssid_len; /* SSID length */
953 1.24.2.5 phil u_int8_t isr_ie_len; /* IE length */
954 1.24.2.5 phil u_int8_t isr_pad[5];
955 1.24.2.5 phil /* variable length SSID followed by IE data */
956 1.24.2.5 phil };
957 1.24.2.5 phil
958 1.24.2.5 phil
959 1.24.2.3 phil /* nwid is pointed at by ifr.ifr_data */
960 1.24.2.3 phil struct ieee80211_nwid {
961 1.24.2.3 phil u_int8_t i_len;
962 1.24.2.3 phil u_int8_t i_nwid[IEEE80211_NWID_LEN];
963 1.24.2.3 phil };
964 1.24.2.3 phil
965 1.24.2.3 phil #define SIOCS80211NWID _IOWR('i', 230, struct ifreq)
966 1.24.2.3 phil #define SIOCG80211NWID _IOWR('i', 231, struct ifreq)
967 1.24.2.3 phil
968 1.24.2.3 phil /* the first member must be matched with struct ifreq */
969 1.24.2.3 phil struct ieee80211_nwkey {
970 1.24.2.3 phil char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
971 1.24.2.3 phil int i_wepon; /* wep enabled flag */
972 1.24.2.3 phil int i_defkid; /* default encrypt key id */
973 1.24.2.3 phil struct {
974 1.24.2.3 phil int i_keylen;
975 1.24.2.3 phil u_int8_t *i_keydat;
976 1.24.2.3 phil } i_key[IEEE80211_WEP_NKID];
977 1.24.2.3 phil };
978 1.24.2.3 phil #define SIOCS80211NWKEY _IOW('i', 232, struct ieee80211_nwkey)
979 1.24.2.3 phil #define SIOCG80211NWKEY _IOWR('i', 233, struct ieee80211_nwkey)
980 1.24.2.3 phil /* i_wepon */
981 1.24.2.3 phil #define IEEE80211_NWKEY_OPEN 0 /* No privacy */
982 1.24.2.3 phil #define IEEE80211_NWKEY_WEP 1 /* WEP enabled */
983 1.24.2.3 phil #define IEEE80211_NWKEY_EAP 2 /* EAP enabled */
984 1.24.2.3 phil #define IEEE80211_NWKEY_PERSIST 0x100 /* designate persist keyset */
985 1.24.2.3 phil
986 1.24.2.3 phil /* power management parameters */
987 1.24.2.3 phil struct ieee80211_power {
988 1.24.2.3 phil char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
989 1.24.2.3 phil int i_enabled; /* 1 == on, 0 == off */
990 1.24.2.3 phil int i_maxsleep; /* max sleep in ms */
991 1.24.2.3 phil };
992 1.24.2.3 phil #define SIOCS80211POWER _IOW('i', 234, struct ieee80211_power)
993 1.24.2.3 phil #define SIOCG80211POWER _IOWR('i', 235, struct ieee80211_power)
994 1.24.2.3 phil
995 1.24.2.3 phil struct ieee80211_auth {
996 1.24.2.3 phil char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
997 1.24.2.3 phil int i_authtype;
998 1.24.2.3 phil };
999 1.24.2.3 phil
1000 1.24.2.3 phil #define SIOCS80211AUTH _IOW('i', 236, struct ieee80211_auth)
1001 1.24.2.3 phil #define SIOCG80211AUTH _IOWR('i', 237, struct ieee80211_auth)
1002 1.24.2.3 phil
1003 1.24.2.3 phil struct ieee80211chanreq {
1004 1.24.2.3 phil char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
1005 1.24.2.3 phil u_int16_t i_channel;
1006 1.24.2.3 phil };
1007 1.24.2.3 phil
1008 1.24.2.3 phil #ifndef IEEE80211_CHAN_ANY
1009 1.24.2.3 phil #define IEEE80211_CHAN_ANY 0xffff
1010 1.24.2.3 phil #endif
1011 1.24.2.3 phil
1012 1.24.2.3 phil #define SIOCS80211CHANNEL _IOW('i', 238, struct ieee80211chanreq)
1013 1.24.2.3 phil #define SIOCG80211CHANNEL _IOWR('i', 239, struct ieee80211chanreq)
1014 1.24.2.3 phil
1015 1.24.2.3 phil struct ieee80211_bssid {
1016 1.24.2.3 phil char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
1017 1.24.2.3 phil u_int8_t i_bssid[IEEE80211_ADDR_LEN];
1018 1.24.2.3 phil };
1019 1.24.2.3 phil
1020 1.24.2.3 phil #define SIOCS80211BSSID _IOW('i', 240, struct ieee80211_bssid)
1021 1.24.2.3 phil #define SIOCG80211BSSID _IOWR('i', 241, struct ieee80211_bssid)
1022 1.24.2.3 phil
1023 1.24.2.3 phil #endif
1024 1.24.2.3 phil
1025 1.1 dyoung
1026 1.24.2.1 phil #endif /* _NET80211_IEEE80211_IOCTL_H_ */
1027