if_iwmvar.h revision 1.6 1 1.6 nonaka /* $NetBSD: if_iwmvar.h,v 1.6 2015/04/28 15:38:02 nonaka Exp $ */
2 1.5 nonaka /* OpenBSD: if_iwmvar.h,v 1.7 2015/03/02 13:51:10 jsg Exp */
3 1.1 pooka
4 1.1 pooka /*
5 1.1 pooka * Copyright (c) 2014 genua mbh <info (at) genua.de>
6 1.1 pooka * Copyright (c) 2014 Fixup Software Ltd.
7 1.1 pooka *
8 1.1 pooka * Permission to use, copy, modify, and distribute this software for any
9 1.1 pooka * purpose with or without fee is hereby granted, provided that the above
10 1.1 pooka * copyright notice and this permission notice appear in all copies.
11 1.1 pooka *
12 1.1 pooka * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 1.1 pooka * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 1.1 pooka * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 1.1 pooka * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 1.1 pooka * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 1.1 pooka * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 1.1 pooka * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 1.1 pooka */
20 1.1 pooka
21 1.1 pooka /*-
22 1.1 pooka * Based on BSD-licensed source modules in the Linux iwlwifi driver,
23 1.1 pooka * which were used as the reference documentation for this implementation.
24 1.1 pooka *
25 1.1 pooka * Driver version we are currently based off of is
26 1.1 pooka * Linux 3.14.3 (tag id a2df521e42b1d9a23f620ac79dbfe8655a8391dd)
27 1.1 pooka *
28 1.1 pooka ***********************************************************************
29 1.1 pooka *
30 1.1 pooka * This file is provided under a dual BSD/GPLv2 license. When using or
31 1.1 pooka * redistributing this file, you may do so under either license.
32 1.1 pooka *
33 1.1 pooka * GPL LICENSE SUMMARY
34 1.1 pooka *
35 1.1 pooka * Copyright(c) 2007 - 2013 Intel Corporation. All rights reserved.
36 1.1 pooka *
37 1.1 pooka * This program is free software; you can redistribute it and/or modify
38 1.1 pooka * it under the terms of version 2 of the GNU General Public License as
39 1.1 pooka * published by the Free Software Foundation.
40 1.1 pooka *
41 1.1 pooka * This program is distributed in the hope that it will be useful, but
42 1.1 pooka * WITHOUT ANY WARRANTY; without even the implied warranty of
43 1.1 pooka * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
44 1.1 pooka * General Public License for more details.
45 1.1 pooka *
46 1.1 pooka * You should have received a copy of the GNU General Public License
47 1.1 pooka * along with this program; if not, write to the Free Software
48 1.1 pooka * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
49 1.1 pooka * USA
50 1.1 pooka *
51 1.1 pooka * The full GNU General Public License is included in this distribution
52 1.1 pooka * in the file called COPYING.
53 1.1 pooka *
54 1.1 pooka * Contact Information:
55 1.1 pooka * Intel Linux Wireless <ilw (at) linux.intel.com>
56 1.1 pooka * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
57 1.1 pooka *
58 1.1 pooka *
59 1.1 pooka * BSD LICENSE
60 1.1 pooka *
61 1.1 pooka * Copyright(c) 2005 - 2013 Intel Corporation. All rights reserved.
62 1.1 pooka * All rights reserved.
63 1.1 pooka *
64 1.1 pooka * Redistribution and use in source and binary forms, with or without
65 1.1 pooka * modification, are permitted provided that the following conditions
66 1.1 pooka * are met:
67 1.1 pooka *
68 1.1 pooka * * Redistributions of source code must retain the above copyright
69 1.1 pooka * notice, this list of conditions and the following disclaimer.
70 1.1 pooka * * Redistributions in binary form must reproduce the above copyright
71 1.1 pooka * notice, this list of conditions and the following disclaimer in
72 1.1 pooka * the documentation and/or other materials provided with the
73 1.1 pooka * distribution.
74 1.1 pooka * * Neither the name Intel Corporation nor the names of its
75 1.1 pooka * contributors may be used to endorse or promote products derived
76 1.1 pooka * from this software without specific prior written permission.
77 1.1 pooka *
78 1.1 pooka * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
79 1.1 pooka * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
80 1.1 pooka * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
81 1.1 pooka * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
82 1.1 pooka * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
83 1.1 pooka * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
84 1.1 pooka * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
85 1.1 pooka * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
86 1.1 pooka * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
87 1.1 pooka * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
88 1.1 pooka * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
89 1.1 pooka */
90 1.1 pooka
91 1.1 pooka /*-
92 1.1 pooka * Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini (at) free.fr>
93 1.1 pooka *
94 1.1 pooka * Permission to use, copy, modify, and distribute this software for any
95 1.1 pooka * purpose with or without fee is hereby granted, provided that the above
96 1.1 pooka * copyright notice and this permission notice appear in all copies.
97 1.1 pooka *
98 1.1 pooka * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
99 1.1 pooka * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
100 1.1 pooka * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
101 1.1 pooka * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
102 1.1 pooka * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
103 1.1 pooka * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
104 1.1 pooka * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
105 1.1 pooka */
106 1.1 pooka
107 1.1 pooka struct iwm_rx_radiotap_header {
108 1.1 pooka struct ieee80211_radiotap_header wr_ihdr;
109 1.1 pooka uint64_t wr_tsft;
110 1.1 pooka uint8_t wr_flags;
111 1.1 pooka uint8_t wr_rate;
112 1.1 pooka uint16_t wr_chan_freq;
113 1.1 pooka uint16_t wr_chan_flags;
114 1.1 pooka int8_t wr_dbm_antsignal;
115 1.1 pooka int8_t wr_dbm_antnoise;
116 1.1 pooka } __packed;
117 1.1 pooka
118 1.1 pooka #define IWM_RX_RADIOTAP_PRESENT \
119 1.1 pooka ((1 << IEEE80211_RADIOTAP_TSFT) | \
120 1.1 pooka (1 << IEEE80211_RADIOTAP_FLAGS) | \
121 1.1 pooka (1 << IEEE80211_RADIOTAP_RATE) | \
122 1.1 pooka (1 << IEEE80211_RADIOTAP_CHANNEL) | \
123 1.1 pooka (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | \
124 1.1 pooka (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE))
125 1.1 pooka
126 1.1 pooka struct iwm_tx_radiotap_header {
127 1.1 pooka struct ieee80211_radiotap_header wt_ihdr;
128 1.1 pooka uint8_t wt_flags;
129 1.1 pooka uint8_t wt_rate;
130 1.1 pooka uint16_t wt_chan_freq;
131 1.1 pooka uint16_t wt_chan_flags;
132 1.1 pooka uint8_t wt_hwqueue;
133 1.1 pooka } __packed;
134 1.1 pooka
135 1.1 pooka #define IWM_TX_RADIOTAP_PRESENT \
136 1.1 pooka ((1 << IEEE80211_RADIOTAP_FLAGS) | \
137 1.1 pooka (1 << IEEE80211_RADIOTAP_RATE) | \
138 1.1 pooka (1 << IEEE80211_RADIOTAP_CHANNEL))
139 1.1 pooka
140 1.1 pooka #define IWM_UCODE_SECT_MAX 6
141 1.1 pooka #define IWM_FWDMASEGSZ (192*1024)
142 1.1 pooka /* sanity check value */
143 1.1 pooka #define IWM_FWMAXSIZE (2*1024*1024)
144 1.1 pooka
145 1.1 pooka /*
146 1.1 pooka * fw_status is used to determine if we've already parsed the firmware file
147 1.1 pooka *
148 1.1 pooka * In addition to the following, status < 0 ==> -error
149 1.1 pooka */
150 1.1 pooka #define IWM_FW_STATUS_NONE 0
151 1.1 pooka #define IWM_FW_STATUS_INPROGRESS 1
152 1.1 pooka #define IWM_FW_STATUS_DONE 2
153 1.1 pooka
154 1.1 pooka enum iwm_ucode_type {
155 1.1 pooka IWM_UCODE_TYPE_INIT,
156 1.1 pooka IWM_UCODE_TYPE_REGULAR,
157 1.1 pooka IWM_UCODE_TYPE_WOW,
158 1.1 pooka IWM_UCODE_TYPE_MAX
159 1.1 pooka };
160 1.1 pooka
161 1.1 pooka struct iwm_fw_info {
162 1.1 pooka void *fw_rawdata;
163 1.1 pooka size_t fw_rawsize;
164 1.1 pooka int fw_status;
165 1.1 pooka
166 1.1 pooka struct iwm_fw_sects {
167 1.1 pooka struct iwm_fw_onesect {
168 1.1 pooka void *fws_data;
169 1.1 pooka uint32_t fws_len;
170 1.4 nonaka uint32_t fws_devoff;
171 1.1 pooka
172 1.1 pooka void *fws_alloc;
173 1.1 pooka size_t fws_allocsize;
174 1.1 pooka } fw_sect[IWM_UCODE_SECT_MAX];
175 1.1 pooka size_t fw_totlen;
176 1.1 pooka int fw_count;
177 1.1 pooka } fw_sects[IWM_UCODE_TYPE_MAX];
178 1.1 pooka };
179 1.1 pooka
180 1.1 pooka struct iwm_nvm_data {
181 1.1 pooka int n_hw_addrs;
182 1.1 pooka uint8_t hw_addr[ETHER_ADDR_LEN];
183 1.1 pooka
184 1.1 pooka uint8_t calib_version;
185 1.1 pooka uint16_t calib_voltage;
186 1.1 pooka
187 1.1 pooka uint16_t raw_temperature;
188 1.1 pooka uint16_t kelvin_temperature;
189 1.1 pooka uint16_t kelvin_voltage;
190 1.1 pooka uint16_t xtal_calib[2];
191 1.1 pooka
192 1.1 pooka int sku_cap_band_24GHz_enable;
193 1.1 pooka int sku_cap_band_52GHz_enable;
194 1.1 pooka int sku_cap_11n_enable;
195 1.1 pooka int sku_cap_amt_enable;
196 1.1 pooka int sku_cap_ipan_enable;
197 1.1 pooka
198 1.1 pooka uint8_t radio_cfg_type;
199 1.1 pooka uint8_t radio_cfg_step;
200 1.1 pooka uint8_t radio_cfg_dash;
201 1.1 pooka uint8_t radio_cfg_pnum;
202 1.1 pooka uint8_t valid_tx_ant, valid_rx_ant;
203 1.1 pooka
204 1.1 pooka uint16_t nvm_version;
205 1.1 pooka uint8_t max_tx_pwr_half_dbm;
206 1.1 pooka };
207 1.1 pooka
208 1.1 pooka /* max bufs per tfd the driver will use */
209 1.1 pooka #define IWM_MAX_CMD_TBS_PER_TFD 2
210 1.1 pooka
211 1.1 pooka struct iwm_rx_packet;
212 1.1 pooka struct iwm_host_cmd {
213 1.1 pooka const void *data[IWM_MAX_CMD_TBS_PER_TFD];
214 1.1 pooka struct iwm_rx_packet *resp_pkt;
215 1.1 pooka unsigned long _rx_page_addr;
216 1.1 pooka uint32_t _rx_page_order;
217 1.1 pooka int handler_status;
218 1.1 pooka
219 1.1 pooka uint32_t flags;
220 1.1 pooka uint16_t len[IWM_MAX_CMD_TBS_PER_TFD];
221 1.1 pooka uint8_t dataflags[IWM_MAX_CMD_TBS_PER_TFD];
222 1.1 pooka uint8_t id;
223 1.1 pooka };
224 1.1 pooka
225 1.1 pooka /*
226 1.1 pooka * DMA glue is from iwn
227 1.1 pooka */
228 1.1 pooka
229 1.1 pooka struct iwm_dma_info {
230 1.1 pooka bus_dma_tag_t tag;
231 1.1 pooka bus_dmamap_t map;
232 1.1 pooka bus_dma_segment_t seg;
233 1.1 pooka bus_addr_t paddr;
234 1.1 pooka void *vaddr;
235 1.1 pooka bus_size_t size;
236 1.1 pooka };
237 1.1 pooka
238 1.1 pooka #define IWM_TX_RING_COUNT 256
239 1.1 pooka #define IWM_TX_RING_LOMARK 192
240 1.1 pooka #define IWM_TX_RING_HIMARK 224
241 1.1 pooka
242 1.1 pooka struct iwm_tx_data {
243 1.1 pooka bus_dmamap_t map;
244 1.1 pooka bus_addr_t cmd_paddr;
245 1.1 pooka bus_addr_t scratch_paddr;
246 1.1 pooka struct mbuf *m;
247 1.1 pooka struct iwm_node *in;
248 1.1 pooka int done;
249 1.1 pooka };
250 1.1 pooka
251 1.1 pooka struct iwm_tx_ring {
252 1.1 pooka struct iwm_dma_info desc_dma;
253 1.1 pooka struct iwm_dma_info cmd_dma;
254 1.1 pooka struct iwm_tfd *desc;
255 1.1 pooka struct iwm_device_cmd *cmd;
256 1.1 pooka struct iwm_tx_data data[IWM_TX_RING_COUNT];
257 1.1 pooka int qid;
258 1.1 pooka int queued;
259 1.1 pooka int cur;
260 1.1 pooka };
261 1.1 pooka
262 1.1 pooka #define IWM_RX_RING_COUNT 256
263 1.1 pooka #define IWM_RBUF_COUNT (IWM_RX_RING_COUNT + 32)
264 1.1 pooka /* Linux driver optionally uses 8k buffer */
265 1.1 pooka #define IWM_RBUF_SIZE 4096
266 1.1 pooka
267 1.1 pooka struct iwm_softc;
268 1.1 pooka struct iwm_rbuf {
269 1.1 pooka struct iwm_softc *sc;
270 1.1 pooka void *vaddr;
271 1.1 pooka bus_addr_t paddr;
272 1.1 pooka };
273 1.1 pooka
274 1.1 pooka struct iwm_rx_data {
275 1.1 pooka struct mbuf *m;
276 1.1 pooka bus_dmamap_t map;
277 1.1 pooka int wantresp;
278 1.1 pooka };
279 1.1 pooka
280 1.1 pooka struct iwm_rx_ring {
281 1.1 pooka struct iwm_dma_info desc_dma;
282 1.1 pooka struct iwm_dma_info stat_dma;
283 1.1 pooka struct iwm_dma_info buf_dma;
284 1.1 pooka uint32_t *desc;
285 1.1 pooka struct iwm_rb_status *stat;
286 1.1 pooka struct iwm_rx_data data[IWM_RX_RING_COUNT];
287 1.1 pooka int cur;
288 1.1 pooka };
289 1.1 pooka
290 1.1 pooka #define IWM_FLAG_USE_ICT 0x01
291 1.1 pooka #define IWM_FLAG_HW_INITED 0x02
292 1.1 pooka #define IWM_FLAG_STOPPED 0x04
293 1.1 pooka #define IWM_FLAG_RFKILL 0x08
294 1.1 pooka #define IWM_FLAG_BUSY 0x10
295 1.2 nonaka #define IWM_FLAG_ATTACHED 0x20
296 1.1 pooka
297 1.1 pooka struct iwm_ucode_status {
298 1.1 pooka uint32_t uc_error_event_table;
299 1.1 pooka uint32_t uc_log_event_table;
300 1.4 nonaka
301 1.1 pooka int uc_ok;
302 1.1 pooka int uc_intr;
303 1.1 pooka };
304 1.1 pooka
305 1.1 pooka #define IWM_CMD_RESP_MAX PAGE_SIZE
306 1.1 pooka
307 1.1 pooka #define IWM_OTP_LOW_IMAGE_SIZE 2048
308 1.1 pooka
309 1.1 pooka #define IWM_MVM_TE_SESSION_PROTECTION_MAX_TIME_MS 500
310 1.1 pooka #define IWM_MVM_TE_SESSION_PROTECTION_MIN_TIME_MS 400
311 1.1 pooka
312 1.1 pooka /*
313 1.1 pooka * Command headers are in iwl-trans.h, which is full of all
314 1.1 pooka * kinds of other junk, so we just replicate the structures here.
315 1.1 pooka * First the software bits:
316 1.1 pooka */
317 1.1 pooka enum IWM_CMD_MODE {
318 1.1 pooka IWM_CMD_SYNC = 0,
319 1.1 pooka IWM_CMD_ASYNC = (1 << 0),
320 1.1 pooka IWM_CMD_WANT_SKB = (1 << 1),
321 1.1 pooka IWM_CMD_SEND_IN_RFKILL = (1 << 2),
322 1.1 pooka };
323 1.1 pooka enum iwm_hcmd_dataflag {
324 1.4 nonaka IWM_HCMD_DFL_NOCOPY = (1 << 0),
325 1.4 nonaka IWM_HCMD_DFL_DUP = (1 << 1),
326 1.1 pooka };
327 1.1 pooka
328 1.1 pooka /*
329 1.1 pooka * iwlwifi/iwl-phy-db
330 1.1 pooka */
331 1.1 pooka
332 1.1 pooka #define IWM_NUM_PAPD_CH_GROUPS 4
333 1.1 pooka #define IWM_NUM_TXP_CH_GROUPS 9
334 1.1 pooka
335 1.1 pooka struct iwm_phy_db_entry {
336 1.1 pooka uint16_t size;
337 1.1 pooka uint8_t *data;
338 1.1 pooka };
339 1.1 pooka
340 1.1 pooka struct iwm_phy_db {
341 1.1 pooka struct iwm_phy_db_entry cfg;
342 1.1 pooka struct iwm_phy_db_entry calib_nch;
343 1.1 pooka struct iwm_phy_db_entry calib_ch_group_papd[IWM_NUM_PAPD_CH_GROUPS];
344 1.1 pooka struct iwm_phy_db_entry calib_ch_group_txp[IWM_NUM_TXP_CH_GROUPS];
345 1.1 pooka };
346 1.1 pooka
347 1.1 pooka struct iwm_int_sta {
348 1.1 pooka uint32_t sta_id;
349 1.1 pooka uint32_t tfd_queue_msk;
350 1.1 pooka };
351 1.1 pooka
352 1.1 pooka struct iwm_mvm_phy_ctxt {
353 1.1 pooka uint16_t id;
354 1.1 pooka uint16_t color;
355 1.1 pooka uint32_t ref;
356 1.1 pooka struct ieee80211_channel *channel;
357 1.1 pooka };
358 1.1 pooka
359 1.1 pooka struct iwm_bf_data {
360 1.1 pooka int bf_enabled; /* filtering */
361 1.1 pooka int ba_enabled; /* abort */
362 1.1 pooka int ave_beacon_signal;
363 1.1 pooka int last_cqm_event;
364 1.1 pooka };
365 1.1 pooka
366 1.6 nonaka enum iwm_intr_type {
367 1.6 nonaka IWM_INTR_INTX,
368 1.6 nonaka IWM_INTR_MSI
369 1.6 nonaka };
370 1.6 nonaka
371 1.1 pooka struct iwm_softc {
372 1.3 nonaka device_t sc_dev;
373 1.1 pooka struct ethercom sc_ec;
374 1.1 pooka struct ieee80211com sc_ic;
375 1.1 pooka
376 1.1 pooka int (*sc_newstate)(struct ieee80211com *, enum ieee80211_state, int);
377 1.1 pooka int sc_newstate_pending;
378 1.1 pooka
379 1.1 pooka struct ieee80211_amrr sc_amrr;
380 1.1 pooka struct callout sc_calib_to;
381 1.1 pooka
382 1.1 pooka bus_space_tag_t sc_st;
383 1.1 pooka bus_space_handle_t sc_sh;
384 1.6 nonaka enum iwm_intr_type sc_intr_type;
385 1.6 nonaka #ifdef __HAVE_PCI_MSI_MSIX
386 1.6 nonaka pci_intr_handle_t *sc_pihp;
387 1.6 nonaka #endif
388 1.1 pooka
389 1.1 pooka bus_size_t sc_sz;
390 1.1 pooka bus_dma_tag_t sc_dmat;
391 1.1 pooka pci_chipset_tag_t sc_pct;
392 1.1 pooka pcitag_t sc_pcitag;
393 1.3 nonaka pcireg_t sc_pciid;
394 1.1 pooka const void *sc_ih;
395 1.1 pooka
396 1.1 pooka /* TX scheduler rings. */
397 1.1 pooka struct iwm_dma_info sched_dma;
398 1.1 pooka uint32_t sched_base;
399 1.1 pooka
400 1.4 nonaka /* TX/RX rings. */
401 1.1 pooka struct iwm_tx_ring txq[IWM_MVM_MAX_QUEUES];
402 1.1 pooka struct iwm_rx_ring rxq;
403 1.1 pooka int qfullmsk;
404 1.1 pooka
405 1.1 pooka int sc_sf_state;
406 1.1 pooka
407 1.4 nonaka /* ICT table. */
408 1.1 pooka struct iwm_dma_info ict_dma;
409 1.1 pooka int ict_cur;
410 1.1 pooka
411 1.1 pooka int sc_hw_rev;
412 1.1 pooka int sc_hw_id;
413 1.1 pooka
414 1.1 pooka struct iwm_dma_info kw_dma;
415 1.1 pooka struct iwm_dma_info fw_dma;
416 1.1 pooka
417 1.1 pooka int sc_fw_chunk_done;
418 1.1 pooka int sc_init_complete;
419 1.1 pooka
420 1.1 pooka struct iwm_ucode_status sc_uc;
421 1.1 pooka enum iwm_ucode_type sc_uc_current;
422 1.1 pooka int sc_fwver;
423 1.1 pooka
424 1.1 pooka int sc_capaflags;
425 1.1 pooka int sc_capa_max_probe_len;
426 1.1 pooka
427 1.1 pooka int sc_intmask;
428 1.1 pooka int sc_flags;
429 1.1 pooka
430 1.1 pooka /*
431 1.1 pooka * So why do we need a separate stopped flag and a generation?
432 1.1 pooka * the former protects the device from issueing commands when it's
433 1.1 pooka * stopped (duh). The latter protects against race from a very
434 1.1 pooka * fast stop/unstop cycle where threads waiting for responses do
435 1.1 pooka * not have a chance to run in between. Notably: we want to stop
436 1.1 pooka * the device from interrupt context when it craps out, so we
437 1.1 pooka * don't have the luxury of waiting for quiescense.
438 1.1 pooka */
439 1.1 pooka int sc_generation;
440 1.1 pooka
441 1.1 pooka int sc_cap_off; /* PCIe caps */
442 1.1 pooka
443 1.1 pooka const char *sc_fwname;
444 1.1 pooka bus_size_t sc_fwdmasegsz;
445 1.1 pooka struct iwm_fw_info sc_fw;
446 1.1 pooka int sc_fw_phy_config;
447 1.1 pooka struct iwm_tlv_calib_ctrl sc_default_calib[IWM_UCODE_TYPE_MAX];
448 1.1 pooka
449 1.1 pooka struct iwm_nvm_data sc_nvm;
450 1.1 pooka struct iwm_phy_db sc_phy_db;
451 1.1 pooka
452 1.1 pooka struct iwm_bf_data sc_bf;
453 1.1 pooka
454 1.1 pooka int sc_tx_timer;
455 1.1 pooka
456 1.1 pooka struct iwm_scan_cmd *sc_scan_cmd;
457 1.1 pooka size_t sc_scan_cmd_len;
458 1.1 pooka int sc_scan_last_antenna;
459 1.1 pooka int sc_scanband;
460 1.1 pooka
461 1.1 pooka int sc_auth_prot;
462 1.1 pooka
463 1.1 pooka int sc_fixed_ridx;
464 1.1 pooka
465 1.1 pooka int sc_staid;
466 1.1 pooka int sc_nodecolor;
467 1.1 pooka
468 1.1 pooka uint8_t sc_cmd_resp[IWM_CMD_RESP_MAX];
469 1.1 pooka int sc_wantresp;
470 1.1 pooka
471 1.1 pooka struct workqueue *sc_nswq, *sc_eswq;
472 1.1 pooka struct work sc_eswk;
473 1.1 pooka
474 1.1 pooka struct iwm_rx_phy_info sc_last_phy_info;
475 1.1 pooka int sc_ampdu_ref;
476 1.1 pooka
477 1.1 pooka struct iwm_int_sta sc_aux_sta;
478 1.1 pooka
479 1.1 pooka /* phy contexts. we only use the first one */
480 1.1 pooka struct iwm_mvm_phy_ctxt sc_phyctxt[IWM_NUM_PHY_CTX];
481 1.1 pooka
482 1.1 pooka struct iwm_notif_statistics sc_stats;
483 1.1 pooka int sc_noise;
484 1.1 pooka
485 1.5 nonaka int host_interrupt_operation_mode;
486 1.5 nonaka
487 1.1 pooka struct bpf_if * sc_drvbpf;
488 1.1 pooka
489 1.1 pooka union {
490 1.1 pooka struct iwm_rx_radiotap_header th;
491 1.1 pooka uint8_t pad[IEEE80211_RADIOTAP_HDRLEN];
492 1.1 pooka } sc_rxtapu;
493 1.1 pooka #define sc_rxtap sc_rxtapu.th
494 1.1 pooka int sc_rxtap_len;
495 1.1 pooka
496 1.1 pooka union {
497 1.1 pooka struct iwm_tx_radiotap_header th;
498 1.1 pooka uint8_t pad[IEEE80211_RADIOTAP_HDRLEN];
499 1.1 pooka } sc_txtapu;
500 1.1 pooka #define sc_txtap sc_txtapu.th
501 1.1 pooka int sc_txtap_len;
502 1.1 pooka };
503 1.1 pooka
504 1.1 pooka struct iwm_node {
505 1.1 pooka struct ieee80211_node in_ni;
506 1.1 pooka struct iwm_mvm_phy_ctxt *in_phyctxt;
507 1.1 pooka
508 1.1 pooka uint16_t in_id;
509 1.1 pooka uint16_t in_color;
510 1.1 pooka int in_tsfid;
511 1.1 pooka
512 1.1 pooka /* status "bits" */
513 1.1 pooka int in_assoc;
514 1.1 pooka
515 1.1 pooka struct iwm_lq_cmd in_lq;
516 1.1 pooka struct ieee80211_amrr_node in_amn;
517 1.1 pooka
518 1.1 pooka uint8_t in_ridx[IEEE80211_RATE_MAXSIZE];
519 1.1 pooka };
520 1.1 pooka #define IWM_STATION_ID 0
521 1.1 pooka
522 1.1 pooka #define IWM_ICT_SIZE 4096
523 1.1 pooka #define IWM_ICT_COUNT (IWM_ICT_SIZE / sizeof (uint32_t))
524 1.1 pooka #define IWM_ICT_PADDR_SHIFT 12
525