1*42a5529eSkettenis /* $OpenBSD: if_iwxvar.h,v 1.42 2024/11/08 09:12:46 kettenis Exp $ */ 25d6d7b90Sstsp 35d6d7b90Sstsp /* 45d6d7b90Sstsp * Copyright (c) 2014 genua mbh <info@genua.de> 55d6d7b90Sstsp * Copyright (c) 2014 Fixup Software Ltd. 65d6d7b90Sstsp * 75d6d7b90Sstsp * Permission to use, copy, modify, and distribute this software for any 85d6d7b90Sstsp * purpose with or without fee is hereby granted, provided that the above 95d6d7b90Sstsp * copyright notice and this permission notice appear in all copies. 105d6d7b90Sstsp * 115d6d7b90Sstsp * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 125d6d7b90Sstsp * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 135d6d7b90Sstsp * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 145d6d7b90Sstsp * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 155d6d7b90Sstsp * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 165d6d7b90Sstsp * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 175d6d7b90Sstsp * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 185d6d7b90Sstsp */ 195d6d7b90Sstsp 205d6d7b90Sstsp /*- 215d6d7b90Sstsp * Based on BSD-licensed source modules in the Linux iwlwifi driver, 225d6d7b90Sstsp * which were used as the reference documentation for this implementation. 235d6d7b90Sstsp * 245d6d7b90Sstsp ****************************************************************************** 255d6d7b90Sstsp * 265d6d7b90Sstsp * This file is provided under a dual BSD/GPLv2 license. When using or 275d6d7b90Sstsp * redistributing this file, you may do so under either license. 285d6d7b90Sstsp * 295d6d7b90Sstsp * GPL LICENSE SUMMARY 305d6d7b90Sstsp * 315d6d7b90Sstsp * Copyright(c) 2017 Intel Deutschland GmbH 325d6d7b90Sstsp * Copyright(c) 2018 - 2019 Intel Corporation 335d6d7b90Sstsp * 345d6d7b90Sstsp * This program is free software; you can redistribute it and/or modify 355d6d7b90Sstsp * it under the terms of version 2 of the GNU General Public License as 365d6d7b90Sstsp * published by the Free Software Foundation. 375d6d7b90Sstsp * 385d6d7b90Sstsp * This program is distributed in the hope that it will be useful, but 395d6d7b90Sstsp * WITHOUT ANY WARRANTY; without even the implied warranty of 405d6d7b90Sstsp * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 415d6d7b90Sstsp * General Public License for more details. 425d6d7b90Sstsp * 435d6d7b90Sstsp * BSD LICENSE 445d6d7b90Sstsp * 455d6d7b90Sstsp * Copyright(c) 2017 Intel Deutschland GmbH 465d6d7b90Sstsp * Copyright(c) 2018 - 2019 Intel Corporation 475d6d7b90Sstsp * All rights reserved. 485d6d7b90Sstsp * 495d6d7b90Sstsp * Redistribution and use in source and binary forms, with or without 505d6d7b90Sstsp * modification, are permitted provided that the following conditions 515d6d7b90Sstsp * are met: 525d6d7b90Sstsp * 535d6d7b90Sstsp * * Redistributions of source code must retain the above copyright 545d6d7b90Sstsp * notice, this list of conditions and the following disclaimer. 555d6d7b90Sstsp * * Redistributions in binary form must reproduce the above copyright 565d6d7b90Sstsp * notice, this list of conditions and the following disclaimer in 575d6d7b90Sstsp * the documentation and/or other materials provided with the 585d6d7b90Sstsp * distribution. 595d6d7b90Sstsp * * Neither the name Intel Corporation nor the names of its 605d6d7b90Sstsp * contributors may be used to endorse or promote products derived 615d6d7b90Sstsp * from this software without specific prior written permission. 625d6d7b90Sstsp * 635d6d7b90Sstsp * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 645d6d7b90Sstsp * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 655d6d7b90Sstsp * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 665d6d7b90Sstsp * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 675d6d7b90Sstsp * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 685d6d7b90Sstsp * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 695d6d7b90Sstsp * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 705d6d7b90Sstsp * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 715d6d7b90Sstsp * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 725d6d7b90Sstsp * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 735d6d7b90Sstsp * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 745d6d7b90Sstsp * 755d6d7b90Sstsp ***************************************************************************** 765d6d7b90Sstsp */ 775d6d7b90Sstsp 785d6d7b90Sstsp /*- 795d6d7b90Sstsp * Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr> 805d6d7b90Sstsp * 815d6d7b90Sstsp * Permission to use, copy, modify, and distribute this software for any 825d6d7b90Sstsp * purpose with or without fee is hereby granted, provided that the above 835d6d7b90Sstsp * copyright notice and this permission notice appear in all copies. 845d6d7b90Sstsp * 855d6d7b90Sstsp * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 865d6d7b90Sstsp * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 875d6d7b90Sstsp * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 885d6d7b90Sstsp * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 895d6d7b90Sstsp * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 905d6d7b90Sstsp * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 915d6d7b90Sstsp * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 925d6d7b90Sstsp */ 935d6d7b90Sstsp 945d6d7b90Sstsp struct iwx_rx_radiotap_header { 955d6d7b90Sstsp struct ieee80211_radiotap_header wr_ihdr; 965d6d7b90Sstsp uint64_t wr_tsft; 975d6d7b90Sstsp uint8_t wr_flags; 985d6d7b90Sstsp uint8_t wr_rate; 995d6d7b90Sstsp uint16_t wr_chan_freq; 1005d6d7b90Sstsp uint16_t wr_chan_flags; 1015d6d7b90Sstsp int8_t wr_dbm_antsignal; 1025d6d7b90Sstsp int8_t wr_dbm_antnoise; 1035d6d7b90Sstsp } __packed; 1045d6d7b90Sstsp 1055d6d7b90Sstsp #define IWX_RX_RADIOTAP_PRESENT \ 1065d6d7b90Sstsp ((1 << IEEE80211_RADIOTAP_TSFT) | \ 1075d6d7b90Sstsp (1 << IEEE80211_RADIOTAP_FLAGS) | \ 1085d6d7b90Sstsp (1 << IEEE80211_RADIOTAP_RATE) | \ 1095d6d7b90Sstsp (1 << IEEE80211_RADIOTAP_CHANNEL) | \ 1105d6d7b90Sstsp (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | \ 1115d6d7b90Sstsp (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE)) 1125d6d7b90Sstsp 1135d6d7b90Sstsp struct iwx_tx_radiotap_header { 1145d6d7b90Sstsp struct ieee80211_radiotap_header wt_ihdr; 1155d6d7b90Sstsp uint8_t wt_flags; 1165d6d7b90Sstsp uint8_t wt_rate; 1175d6d7b90Sstsp uint16_t wt_chan_freq; 1185d6d7b90Sstsp uint16_t wt_chan_flags; 1195d6d7b90Sstsp } __packed; 1205d6d7b90Sstsp 1215d6d7b90Sstsp #define IWX_TX_RADIOTAP_PRESENT \ 1225d6d7b90Sstsp ((1 << IEEE80211_RADIOTAP_FLAGS) | \ 1235d6d7b90Sstsp (1 << IEEE80211_RADIOTAP_RATE) | \ 124eb1adcecSmpi (1 << IEEE80211_RADIOTAP_CHANNEL)) 1255d6d7b90Sstsp 126*42a5529eSkettenis #define IWX_UCODE_SECT_MAX 60 1275d6d7b90Sstsp 1285d6d7b90Sstsp /* 1295d6d7b90Sstsp * fw_status is used to determine if we've already parsed the firmware file 1305d6d7b90Sstsp * 1315d6d7b90Sstsp * In addition to the following, status < 0 ==> -error 1325d6d7b90Sstsp */ 1335d6d7b90Sstsp #define IWX_FW_STATUS_NONE 0 1345d6d7b90Sstsp #define IWX_FW_STATUS_INPROGRESS 1 1355d6d7b90Sstsp #define IWX_FW_STATUS_DONE 2 1365d6d7b90Sstsp 1375d6d7b90Sstsp enum iwx_ucode_type { 1385d6d7b90Sstsp IWX_UCODE_TYPE_REGULAR, 1395d6d7b90Sstsp IWX_UCODE_TYPE_INIT, 1405d6d7b90Sstsp IWX_UCODE_TYPE_WOW, 1415d6d7b90Sstsp IWX_UCODE_TYPE_REGULAR_USNIFFER, 1425d6d7b90Sstsp IWX_UCODE_TYPE_MAX 1435d6d7b90Sstsp }; 1445d6d7b90Sstsp 1455d6d7b90Sstsp struct iwx_fw_info { 1465d6d7b90Sstsp void *fw_rawdata; 1475d6d7b90Sstsp size_t fw_rawsize; 1485d6d7b90Sstsp int fw_status; 1495d6d7b90Sstsp 1505d6d7b90Sstsp struct iwx_fw_sects { 1515d6d7b90Sstsp struct iwx_fw_onesect { 1525d6d7b90Sstsp void *fws_data; 1535d6d7b90Sstsp uint32_t fws_len; 1545d6d7b90Sstsp uint32_t fws_devoff; 1555d6d7b90Sstsp } fw_sect[IWX_UCODE_SECT_MAX]; 1565d6d7b90Sstsp size_t fw_totlen; 1575d6d7b90Sstsp int fw_count; 1585d6d7b90Sstsp } fw_sects[IWX_UCODE_TYPE_MAX]; 1595d6d7b90Sstsp 1605d6d7b90Sstsp /* FW debug data parsed for driver usage */ 1615d6d7b90Sstsp int dbg_dest_tlv_init; 1625d6d7b90Sstsp uint8_t *dbg_dest_ver; 1635d6d7b90Sstsp uint8_t n_dest_reg; 1645d6d7b90Sstsp struct iwx_fw_dbg_dest_tlv_v1 *dbg_dest_tlv_v1; 1655d6d7b90Sstsp 1665d6d7b90Sstsp struct iwx_fw_dbg_conf_tlv *dbg_conf_tlv[IWX_FW_DBG_CONF_MAX]; 1675d6d7b90Sstsp size_t dbg_conf_tlv_len[IWX_FW_DBG_CONF_MAX]; 1685d6d7b90Sstsp struct iwx_fw_dbg_trigger_tlv *dbg_trigger_tlv[IWX_FW_DBG_TRIGGER_MAX]; 1695d6d7b90Sstsp size_t dbg_trigger_tlv_len[IWX_FW_DBG_TRIGGER_MAX]; 1705d6d7b90Sstsp struct iwx_fw_dbg_mem_seg_tlv *dbg_mem_tlv; 1715d6d7b90Sstsp size_t n_mem_tlv; 1724735940aSstsp 1734735940aSstsp /* Copy of firmware image loader found in file. */ 1744735940aSstsp uint8_t *iml; 1754735940aSstsp size_t iml_len; 1765d6d7b90Sstsp }; 1775d6d7b90Sstsp 1785d6d7b90Sstsp struct iwx_nvm_data { 1795d6d7b90Sstsp int n_hw_addrs; 1805d6d7b90Sstsp uint8_t hw_addr[ETHER_ADDR_LEN]; 1815d6d7b90Sstsp 1825d6d7b90Sstsp int sku_cap_band_24GHz_enable; 1835d6d7b90Sstsp int sku_cap_band_52GHz_enable; 1845d6d7b90Sstsp int sku_cap_11n_enable; 18525915785Sstsp int sku_cap_11ac_enable; 18625915785Sstsp int sku_cap_11ax_enable; 1875d6d7b90Sstsp int sku_cap_amt_enable; 1885d6d7b90Sstsp int sku_cap_ipan_enable; 1895d6d7b90Sstsp int sku_cap_mimo_disable; 19025915785Sstsp int lar_enabled; 1915d6d7b90Sstsp 1925d6d7b90Sstsp uint8_t valid_tx_ant, valid_rx_ant; 1935d6d7b90Sstsp 1945d6d7b90Sstsp uint16_t nvm_version; 1955d6d7b90Sstsp }; 1965d6d7b90Sstsp 1975d6d7b90Sstsp /* max bufs per tfd the driver will use */ 1985d6d7b90Sstsp #define IWX_MAX_CMD_TBS_PER_TFD 2 1995d6d7b90Sstsp 2005d6d7b90Sstsp struct iwx_host_cmd { 2015d6d7b90Sstsp const void *data[IWX_MAX_CMD_TBS_PER_TFD]; 2025d6d7b90Sstsp struct iwx_rx_packet *resp_pkt; 2035d6d7b90Sstsp size_t resp_pkt_len; 2045d6d7b90Sstsp unsigned long _rx_page_addr; 2055d6d7b90Sstsp uint32_t _rx_page_order; 2065d6d7b90Sstsp int handler_status; 2075d6d7b90Sstsp 2085d6d7b90Sstsp uint32_t flags; 2095d6d7b90Sstsp uint16_t len[IWX_MAX_CMD_TBS_PER_TFD]; 2105d6d7b90Sstsp uint8_t dataflags[IWX_MAX_CMD_TBS_PER_TFD]; 2115d6d7b90Sstsp uint32_t id; 2125d6d7b90Sstsp }; 2135d6d7b90Sstsp 2145d6d7b90Sstsp /* 2155d6d7b90Sstsp * DMA glue is from iwn 2165d6d7b90Sstsp */ 2175d6d7b90Sstsp 2185d6d7b90Sstsp struct iwx_dma_info { 2195d6d7b90Sstsp bus_dma_tag_t tag; 2205d6d7b90Sstsp bus_dmamap_t map; 2215d6d7b90Sstsp bus_dma_segment_t seg; 2225d6d7b90Sstsp bus_addr_t paddr; 2235d6d7b90Sstsp void *vaddr; 2245d6d7b90Sstsp bus_size_t size; 2255d6d7b90Sstsp }; 2265d6d7b90Sstsp 2275d6d7b90Sstsp #define IWX_TX_RING_COUNT IWX_DEFAULT_QUEUE_SIZE 2285d6d7b90Sstsp #define IWX_TX_RING_LOMARK 192 2295d6d7b90Sstsp #define IWX_TX_RING_HIMARK 224 2305d6d7b90Sstsp 2315d6d7b90Sstsp struct iwx_tx_data { 2325d6d7b90Sstsp bus_dmamap_t map; 2335d6d7b90Sstsp bus_addr_t cmd_paddr; 2345d6d7b90Sstsp struct mbuf *m; 2355d6d7b90Sstsp struct iwx_node *in; 2362030561eSstsp int flags; 2372030561eSstsp #define IWX_TXDATA_FLAG_CMD_IS_NARROW 0x01 2385d6d7b90Sstsp }; 2395d6d7b90Sstsp 2405d6d7b90Sstsp struct iwx_tx_ring { 2415d6d7b90Sstsp struct iwx_dma_info desc_dma; 2425d6d7b90Sstsp struct iwx_dma_info cmd_dma; 2435d6d7b90Sstsp struct iwx_dma_info bc_tbl; 2445d6d7b90Sstsp struct iwx_tfh_tfd *desc; 2455d6d7b90Sstsp struct iwx_device_cmd *cmd; 2465d6d7b90Sstsp struct iwx_tx_data data[IWX_TX_RING_COUNT]; 2475d6d7b90Sstsp int qid; 2485d6d7b90Sstsp int queued; 2495d6d7b90Sstsp int cur; 2504735940aSstsp int cur_hw; 2515d6d7b90Sstsp int tail; 2524735940aSstsp int tail_hw; 25389e2b009Sstsp int tid; 2545d6d7b90Sstsp }; 2555d6d7b90Sstsp 2565d6d7b90Sstsp #define IWX_RX_MQ_RING_COUNT 512 2575d6d7b90Sstsp /* Linux driver optionally uses 8k buffer */ 2585d6d7b90Sstsp #define IWX_RBUF_SIZE 4096 2595d6d7b90Sstsp 2605d6d7b90Sstsp struct iwx_rx_data { 2615d6d7b90Sstsp struct mbuf *m; 2625d6d7b90Sstsp bus_dmamap_t map; 2635d6d7b90Sstsp }; 2645d6d7b90Sstsp 2655d6d7b90Sstsp struct iwx_rx_ring { 2665d6d7b90Sstsp struct iwx_dma_info free_desc_dma; 2675d6d7b90Sstsp struct iwx_dma_info stat_dma; 2685d6d7b90Sstsp struct iwx_dma_info used_desc_dma; 2695d6d7b90Sstsp void *desc; 2705d6d7b90Sstsp struct iwx_rb_status *stat; 2715d6d7b90Sstsp struct iwx_rx_data data[IWX_RX_MQ_RING_COUNT]; 2725d6d7b90Sstsp int cur; 2735d6d7b90Sstsp }; 2745d6d7b90Sstsp 2755d6d7b90Sstsp #define IWX_FLAG_USE_ICT 0x01 /* using Interrupt Cause Table */ 2765d6d7b90Sstsp #define IWX_FLAG_RFKILL 0x02 /* radio kill switch is set */ 2775d6d7b90Sstsp #define IWX_FLAG_SCANNING 0x04 /* scan in progress */ 2785d6d7b90Sstsp #define IWX_FLAG_MAC_ACTIVE 0x08 /* MAC context added to firmware */ 2795d6d7b90Sstsp #define IWX_FLAG_BINDING_ACTIVE 0x10 /* MAC->PHY binding added to firmware */ 2805d6d7b90Sstsp #define IWX_FLAG_STA_ACTIVE 0x20 /* AP added to firmware station table */ 2815d6d7b90Sstsp #define IWX_FLAG_TE_ACTIVE 0x40 /* time event is scheduled */ 2825d6d7b90Sstsp #define IWX_FLAG_HW_ERR 0x80 /* hardware error occurred */ 2835d6d7b90Sstsp #define IWX_FLAG_SHUTDOWN 0x100 /* shutting down; new tasks forbidden */ 2845d6d7b90Sstsp #define IWX_FLAG_BGSCAN 0x200 /* background scan in progress */ 28589e2b009Sstsp #define IWX_FLAG_TXFLUSH 0x400 /* Tx queue flushing in progress */ 2865d6d7b90Sstsp 2875d6d7b90Sstsp struct iwx_ucode_status { 2885d6d7b90Sstsp uint32_t uc_lmac_error_event_table[2]; 2895d6d7b90Sstsp uint32_t uc_umac_error_event_table; 2905d6d7b90Sstsp uint32_t uc_log_event_table; 2915d6d7b90Sstsp unsigned int error_event_table_tlv_status; 2925d6d7b90Sstsp 2935d6d7b90Sstsp int uc_ok; 2945d6d7b90Sstsp int uc_intr; 2955d6d7b90Sstsp }; 2965d6d7b90Sstsp 2975d6d7b90Sstsp #define IWX_ERROR_EVENT_TABLE_LMAC1 (1 << 0) 2985d6d7b90Sstsp #define IWX_ERROR_EVENT_TABLE_LMAC2 (1 << 1) 2995d6d7b90Sstsp #define IWX_ERROR_EVENT_TABLE_UMAC (1 << 2) 3005d6d7b90Sstsp 3015d6d7b90Sstsp #define IWX_CMD_RESP_MAX PAGE_SIZE 3025d6d7b90Sstsp 3035d6d7b90Sstsp /* lower blocks contain EEPROM image and calibration data */ 3045d6d7b90Sstsp #define IWX_OTP_LOW_IMAGE_SIZE_FAMILY_7000 16384 3055d6d7b90Sstsp #define IWX_OTP_LOW_IMAGE_SIZE_FAMILY_8000 32768 3065d6d7b90Sstsp 3075d6d7b90Sstsp #define IWX_TE_SESSION_PROTECTION_MAX_TIME_MS 1000 3085d6d7b90Sstsp #define IWX_TE_SESSION_PROTECTION_MIN_TIME_MS 400 3095d6d7b90Sstsp 3105d6d7b90Sstsp enum IWX_CMD_MODE { 3115d6d7b90Sstsp IWX_CMD_ASYNC = (1 << 0), 3125d6d7b90Sstsp IWX_CMD_WANT_RESP = (1 << 1), 3135d6d7b90Sstsp IWX_CMD_SEND_IN_RFKILL = (1 << 2), 3145d6d7b90Sstsp }; 3155d6d7b90Sstsp enum iwx_hcmd_dataflag { 3165d6d7b90Sstsp IWX_HCMD_DFL_NOCOPY = (1 << 0), 3175d6d7b90Sstsp IWX_HCMD_DFL_DUP = (1 << 1), 3185d6d7b90Sstsp }; 3195d6d7b90Sstsp 3205d6d7b90Sstsp #define IWX_NUM_PAPD_CH_GROUPS 9 3215d6d7b90Sstsp #define IWX_NUM_TXP_CH_GROUPS 9 3225d6d7b90Sstsp 3235d6d7b90Sstsp struct iwx_phy_ctxt { 3245d6d7b90Sstsp uint16_t id; 3255d6d7b90Sstsp uint16_t color; 3265d6d7b90Sstsp uint32_t ref; 3275d6d7b90Sstsp struct ieee80211_channel *channel; 328b4d5bb03Sstsp uint8_t sco; /* 40 MHz secondary channel offset */ 329f696a5c4Sstsp uint8_t vht_chan_width; 3305d6d7b90Sstsp }; 3315d6d7b90Sstsp 3325d6d7b90Sstsp struct iwx_bf_data { 3335d6d7b90Sstsp int bf_enabled; /* filtering */ 3345d6d7b90Sstsp int ba_enabled; /* abort */ 3355d6d7b90Sstsp int ave_beacon_signal; 3365d6d7b90Sstsp int last_cqm_event; 3375d6d7b90Sstsp }; 3385d6d7b90Sstsp 3395d6d7b90Sstsp /** 3405d6d7b90Sstsp * struct iwx_self_init_dram - dram data used by self init process 3415d6d7b90Sstsp * @fw: lmac and umac dram data 342580f643cSstsp * @lmac_cnt: number of lmac sections in fw image 343580f643cSstsp * @umac_cnt: number of umac sections in fw image 3445d6d7b90Sstsp * @paging: paging dram data 345580f643cSstsp * @paging_cnt: number of paging sections needed by fw image 3465d6d7b90Sstsp */ 3475d6d7b90Sstsp struct iwx_self_init_dram { 3485d6d7b90Sstsp struct iwx_dma_info *fw; 349580f643cSstsp int lmac_cnt; 350580f643cSstsp int umac_cnt; 3515d6d7b90Sstsp struct iwx_dma_info *paging; 3525d6d7b90Sstsp int paging_cnt; 3535d6d7b90Sstsp }; 3545d6d7b90Sstsp 355ccc2d1c4Sstsp /** 356ccc2d1c4Sstsp * struct iwx_reorder_buffer - per ra/tid/queue reorder buffer 357ccc2d1c4Sstsp * @head_sn: reorder window head sn 358ccc2d1c4Sstsp * @num_stored: number of mpdus stored in the buffer 359ccc2d1c4Sstsp * @buf_size: the reorder buffer size as set by the last addba request 360ccc2d1c4Sstsp * @queue: queue of this reorder buffer 361ccc2d1c4Sstsp * @last_amsdu: track last ASMDU SN for duplication detection 362ccc2d1c4Sstsp * @last_sub_index: track ASMDU sub frame index for duplication detection 363ccc2d1c4Sstsp * @reorder_timer: timer for frames are in the reorder buffer. For AMSDU 364ccc2d1c4Sstsp * it is the time of last received sub-frame 365ccc2d1c4Sstsp * @removed: prevent timer re-arming 366ccc2d1c4Sstsp * @valid: reordering is valid for this queue 367ccc2d1c4Sstsp * @consec_oldsn_drops: consecutive drops due to old SN 368ccc2d1c4Sstsp * @consec_oldsn_ampdu_gp2: A-MPDU GP2 timestamp to track 369ccc2d1c4Sstsp * when to apply old SN consecutive drop workaround 370ccc2d1c4Sstsp * @consec_oldsn_prev_drop: track whether or not an MPDU 371ccc2d1c4Sstsp * that was single/part of the previous A-MPDU was 372ccc2d1c4Sstsp * dropped due to old SN 373ccc2d1c4Sstsp */ 374ccc2d1c4Sstsp struct iwx_reorder_buffer { 375ccc2d1c4Sstsp uint16_t head_sn; 376ccc2d1c4Sstsp uint16_t num_stored; 377ccc2d1c4Sstsp uint16_t buf_size; 378ccc2d1c4Sstsp uint16_t last_amsdu; 379ccc2d1c4Sstsp uint8_t last_sub_index; 380ccc2d1c4Sstsp struct timeout reorder_timer; 381ccc2d1c4Sstsp int removed; 382ccc2d1c4Sstsp int valid; 383ccc2d1c4Sstsp unsigned int consec_oldsn_drops; 384ccc2d1c4Sstsp uint32_t consec_oldsn_ampdu_gp2; 385ccc2d1c4Sstsp unsigned int consec_oldsn_prev_drop; 386ccc2d1c4Sstsp #define IWX_AMPDU_CONSEC_DROPS_DELBA 10 387ccc2d1c4Sstsp }; 388ccc2d1c4Sstsp 389ccc2d1c4Sstsp /** 390ccc2d1c4Sstsp * struct iwx_reorder_buf_entry - reorder buffer entry per frame sequence number 391ccc2d1c4Sstsp * @frames: list of mbufs stored (A-MSDU subframes share a sequence number) 392ccc2d1c4Sstsp * @reorder_time: time the packet was stored in the reorder buffer 393ccc2d1c4Sstsp */ 394ccc2d1c4Sstsp struct iwx_reorder_buf_entry { 395ccc2d1c4Sstsp struct mbuf_list frames; 396ccc2d1c4Sstsp struct timeval reorder_time; 397ccc2d1c4Sstsp uint32_t rx_pkt_status; 398ccc2d1c4Sstsp int chanidx; 399ccc2d1c4Sstsp int is_shortpre; 400ccc2d1c4Sstsp uint32_t rate_n_flags; 401ccc2d1c4Sstsp uint32_t device_timestamp; 402ccc2d1c4Sstsp struct ieee80211_rxinfo rxi; 403ccc2d1c4Sstsp }; 404ccc2d1c4Sstsp 405ccc2d1c4Sstsp /** 406ccc2d1c4Sstsp * struct iwx_rxba_data - BA session data 407ccc2d1c4Sstsp * @sta_id: station id 408ccc2d1c4Sstsp * @tid: tid of the session 409ccc2d1c4Sstsp * @baid: baid of the session 410ccc2d1c4Sstsp * @timeout: the timeout set in the addba request 411ccc2d1c4Sstsp * @entries_per_queue: # of buffers per queue 412ccc2d1c4Sstsp * @last_rx: last rx timestamp, updated only if timeout passed from last update 413ccc2d1c4Sstsp * @session_timer: timer to check if BA session expired, runs at 2 * timeout 414ccc2d1c4Sstsp * @sc: softc pointer, needed for timer context 415ccc2d1c4Sstsp * @reorder_buf: reorder buffer 416ccc2d1c4Sstsp * @reorder_buf_data: buffered frames, one entry per sequence number 417ccc2d1c4Sstsp */ 418ccc2d1c4Sstsp struct iwx_rxba_data { 419ccc2d1c4Sstsp uint8_t sta_id; 420ccc2d1c4Sstsp uint8_t tid; 421ccc2d1c4Sstsp uint8_t baid; 422ccc2d1c4Sstsp uint16_t timeout; 423ccc2d1c4Sstsp uint16_t entries_per_queue; 424ccc2d1c4Sstsp struct timeval last_rx; 425ccc2d1c4Sstsp struct timeout session_timer; 426ccc2d1c4Sstsp struct iwx_softc *sc; 427ccc2d1c4Sstsp struct iwx_reorder_buffer reorder_buf; 428ccc2d1c4Sstsp struct iwx_reorder_buf_entry entries[IEEE80211_BA_MAX_WINSZ]; 429ccc2d1c4Sstsp }; 430ccc2d1c4Sstsp 431ccc2d1c4Sstsp static inline struct iwx_rxba_data * 432ccc2d1c4Sstsp iwx_rxba_data_from_reorder_buf(struct iwx_reorder_buffer *buf) 433ccc2d1c4Sstsp { 434ccc2d1c4Sstsp return (void *)((uint8_t *)buf - 435ccc2d1c4Sstsp offsetof(struct iwx_rxba_data, reorder_buf)); 436ccc2d1c4Sstsp } 437ccc2d1c4Sstsp 438ccc2d1c4Sstsp /** 439ccc2d1c4Sstsp * struct iwx_rxq_dup_data - per station per rx queue data 440ccc2d1c4Sstsp * @last_seq: last sequence per tid for duplicate packet detection 441ccc2d1c4Sstsp * @last_sub_frame: last subframe packet 442ccc2d1c4Sstsp */ 443ccc2d1c4Sstsp struct iwx_rxq_dup_data { 444ccc2d1c4Sstsp uint16_t last_seq[IWX_MAX_TID_COUNT + 1]; 445ccc2d1c4Sstsp uint8_t last_sub_frame[IWX_MAX_TID_COUNT + 1]; 446ccc2d1c4Sstsp }; 447ccc2d1c4Sstsp 448c4d46e12Sstsp struct iwx_setkey_task_arg { 449c4d46e12Sstsp int sta_id; 450c4d46e12Sstsp struct ieee80211_node *ni; 451c4d46e12Sstsp struct ieee80211_key *k; 452c4d46e12Sstsp }; 453c4d46e12Sstsp 45489e2b009Sstsp struct iwx_ba_task_data { 45589e2b009Sstsp uint32_t start_tidmask; 45689e2b009Sstsp uint32_t stop_tidmask; 45789e2b009Sstsp }; 45889e2b009Sstsp 4599787ce4dSstsp 4609787ce4dSstsp /* 4619787ce4dSstsp * Device configuration parameters which cannot be detected based on 4629787ce4dSstsp * PCI vendor/product ID alone. 4639787ce4dSstsp */ 4649787ce4dSstsp struct iwx_device_cfg { 4659787ce4dSstsp const char *fw_name; 4664735940aSstsp const char *pnvm_name; 4679787ce4dSstsp int tx_with_siso_diversity; 4689787ce4dSstsp int uhb_supported; 4694735940aSstsp int xtal_latency; 4704735940aSstsp int low_latency_xtal; 4719787ce4dSstsp }; 4729787ce4dSstsp 4739787ce4dSstsp /* Firmware listed here must be available in fw_update(8). */ 474aecca5e6Sstsp #define IWX_CC_A_FW "iwx-cc-a0-77" 475aecca5e6Sstsp #define IWX_TY_A_GF_A_FW "iwx-ty-a0-gf-a0-77" 4764735940aSstsp #define IWX_TY_A_GF_A_PNVM "iwx-ty-a0-gf-a0.pnvm" 477aecca5e6Sstsp #define IWX_QU_B_HR_B_FW "iwx-Qu-b0-hr-b0-77" 478aecca5e6Sstsp #define IWX_QU_B_JF_B_FW "iwx-Qu-b0-jf-b0-77" 479aecca5e6Sstsp #define IWX_QU_C_HR_B_FW "iwx-Qu-c0-hr-b0-77" 480aecca5e6Sstsp #define IWX_QU_C_JF_B_FW "iwx-Qu-c0-jf-b0-77" 481aecca5e6Sstsp #define IWX_QUZ_A_HR_B_FW "iwx-QuZ-a0-hr-b0-77" 482aecca5e6Sstsp #define IWX_QUZ_A_JF_B_FW "iwx-QuZ-a0-jf-b0-77" 483aecca5e6Sstsp #define IWX_SO_A_GF_A_FW "iwx-so-a0-gf-a0-77" 4844735940aSstsp #define IWX_SO_A_GF_A_PNVM "iwx-so-a0-gf-a0.pnvm" 485aecca5e6Sstsp #define IWX_SO_A_GF4_A_FW "iwx-so-a0-gf4-a0-77" 4864735940aSstsp #define IWX_SO_A_GF4_A_PNVM "iwx-so-a0-gf4-a0.pnvm" 487aecca5e6Sstsp #define IWX_SO_A_HR_B_FW "iwx-so-a0-hr-b0-77" 488aecca5e6Sstsp #define IWX_SO_A_JF_B_FW "iwx-so-a0-jf-b0-77" 489*42a5529eSkettenis #define IWX_MA_B_HR_B_FW "iwx-ma-a0-hr-b0-83" 490*42a5529eSkettenis #define IWX_MA_B_HR_B_PNVM "iwx-ma-a0-hr-b0.pnvm" 491*42a5529eSkettenis #define IWX_MA_B_GF_A_FW "iwx-ma-b0-gf-a0-83" 492*42a5529eSkettenis #define IWX_MA_B_GF_A_PNVM "iwx-ma-b0-gf-a0.pnvm" 493*42a5529eSkettenis #define IWX_MA_B_GF4_A_FW "iwx-ma-b0-gf4-a0-83" 494*42a5529eSkettenis #define IWX_MA_B_GF4_A_PNVM "iwx-ma-b0-gf4-a0.pnvm" 495*42a5529eSkettenis #define IWX_MA_A_FM_A_FW "iwx-ma-a0-fm-a0-83" 496*42a5529eSkettenis #define IWX_MA_A_FM_A_PNVM "iwx-ma-a0-fm-a0.pnvm" 4979787ce4dSstsp 4989787ce4dSstsp const struct iwx_device_cfg iwx_9560_quz_a0_jf_b0_cfg = { 4999787ce4dSstsp .fw_name = IWX_QUZ_A_JF_B_FW, 5009787ce4dSstsp }; 5019787ce4dSstsp 5029787ce4dSstsp const struct iwx_device_cfg iwx_9560_qu_c0_jf_b0_cfg = { 5039787ce4dSstsp .fw_name = IWX_QU_C_JF_B_FW, 5049787ce4dSstsp }; 5059787ce4dSstsp 5069787ce4dSstsp const struct iwx_device_cfg iwx_qu_b0_hr1_b0 = { 5079787ce4dSstsp .fw_name = IWX_QU_B_HR_B_FW, 5089787ce4dSstsp .tx_with_siso_diversity = true, 5099787ce4dSstsp }; 5109787ce4dSstsp 5119787ce4dSstsp const struct iwx_device_cfg iwx_qu_b0_hr_b0 = { 5129787ce4dSstsp .fw_name = IWX_QU_B_HR_B_FW, 5139787ce4dSstsp }; 5149787ce4dSstsp 5159787ce4dSstsp const struct iwx_device_cfg iwx_ax201_cfg_qu_hr = { 5169787ce4dSstsp .fw_name = IWX_QU_B_HR_B_FW, 5179787ce4dSstsp }; 5189787ce4dSstsp 5199787ce4dSstsp const struct iwx_device_cfg iwx_qu_c0_hr1_b0 = { 5209787ce4dSstsp .fw_name = IWX_QU_C_HR_B_FW, 5219787ce4dSstsp .tx_with_siso_diversity = true, 5229787ce4dSstsp }; 5239787ce4dSstsp 5249787ce4dSstsp const struct iwx_device_cfg iwx_qu_c0_hr_b0 = { 5259787ce4dSstsp .fw_name = IWX_QU_C_HR_B_FW, 5269787ce4dSstsp }; 5279787ce4dSstsp 5289787ce4dSstsp const struct iwx_device_cfg iwx_ax201_cfg_qu_c0_hr_b0 = { 5299787ce4dSstsp .fw_name = IWX_QU_C_HR_B_FW, 5309787ce4dSstsp }; 5319787ce4dSstsp 5329787ce4dSstsp const struct iwx_device_cfg iwx_quz_a0_hr1_b0 = { 5339787ce4dSstsp .fw_name = IWX_QUZ_A_HR_B_FW, 5349787ce4dSstsp }; 5359787ce4dSstsp 5369787ce4dSstsp const struct iwx_device_cfg iwx_ax201_cfg_quz_hr = { 5379787ce4dSstsp .fw_name = IWX_QUZ_A_HR_B_FW, 5389787ce4dSstsp }; 5399787ce4dSstsp 540833d79f6Sstsp const struct iwx_device_cfg iwx_cfg_so_a0_hr_b0 = { 541833d79f6Sstsp .fw_name = IWX_SO_A_HR_B_FW, 542833d79f6Sstsp }; 543833d79f6Sstsp 5449787ce4dSstsp const struct iwx_device_cfg iwx_cfg_quz_a0_hr_b0 = { 5459787ce4dSstsp .fw_name = IWX_QUZ_A_HR_B_FW, 5469787ce4dSstsp }; 5479787ce4dSstsp 5484735940aSstsp const struct iwx_device_cfg iwx_2ax_cfg_so_gf_a0 = { 5494735940aSstsp .fw_name = IWX_SO_A_GF_A_FW, 5504735940aSstsp .pnvm_name = IWX_SO_A_GF_A_PNVM, 5514735940aSstsp .uhb_supported = 1, 5524735940aSstsp }; 5534735940aSstsp 5544735940aSstsp const struct iwx_device_cfg iwx_2ax_cfg_so_gf_a0_long = { 5554735940aSstsp .fw_name = IWX_SO_A_GF_A_FW, 5564735940aSstsp .pnvm_name = IWX_SO_A_GF_A_PNVM, 5574735940aSstsp .uhb_supported = 1, 5584735940aSstsp .xtal_latency = 12000, 5594735940aSstsp .low_latency_xtal = 1, 5604735940aSstsp }; 5614735940aSstsp 5624735940aSstsp const struct iwx_device_cfg iwx_2ax_cfg_so_gf4_a0 = { 5634735940aSstsp .fw_name = IWX_SO_A_GF4_A_FW, 5644735940aSstsp .pnvm_name = IWX_SO_A_GF4_A_PNVM, 5654735940aSstsp .uhb_supported = 1, 5664735940aSstsp .xtal_latency = 12000, 5674735940aSstsp .low_latency_xtal = 1, 5684735940aSstsp }; 5694735940aSstsp 5704735940aSstsp const struct iwx_device_cfg iwx_2ax_cfg_so_gf4_a0_long = { 5714735940aSstsp .fw_name = IWX_SO_A_GF4_A_FW, 5724735940aSstsp .pnvm_name = IWX_SO_A_GF4_A_PNVM, 5734735940aSstsp .uhb_supported = 1, 5744735940aSstsp }; 5754735940aSstsp 5764735940aSstsp const struct iwx_device_cfg iwx_2ax_cfg_ty_gf_a0 = { 5774735940aSstsp .fw_name = IWX_TY_A_GF_A_FW, 5784735940aSstsp .pnvm_name = IWX_TY_A_GF_A_PNVM, 5794735940aSstsp }; 5804735940aSstsp 5814735940aSstsp const struct iwx_device_cfg iwx_2ax_cfg_so_jf_b0 = { 5824735940aSstsp .fw_name = IWX_SO_A_JF_B_FW, 5834735940aSstsp }; 5844735940aSstsp 585*42a5529eSkettenis const struct iwx_device_cfg iwx_cfg_ma_b0_hr_b0 = { 586*42a5529eSkettenis .fw_name = IWX_MA_B_HR_B_FW, 587*42a5529eSkettenis .pnvm_name = IWX_MA_B_HR_B_PNVM, 588*42a5529eSkettenis }; 589*42a5529eSkettenis 590*42a5529eSkettenis const struct iwx_device_cfg iwx_cfg_ma_b0_gf_a0 = { 591*42a5529eSkettenis .fw_name = IWX_MA_B_GF_A_FW, 592*42a5529eSkettenis .pnvm_name = IWX_MA_B_GF_A_PNVM, 593*42a5529eSkettenis }; 594*42a5529eSkettenis 595*42a5529eSkettenis const struct iwx_device_cfg iwx_cfg_ma_b0_gf4_a0 = { 596*42a5529eSkettenis .fw_name = IWX_MA_B_GF4_A_FW, 597*42a5529eSkettenis .pnvm_name = IWX_MA_B_GF4_A_PNVM, 598*42a5529eSkettenis }; 599*42a5529eSkettenis 600*42a5529eSkettenis const struct iwx_device_cfg iwx_cfg_ma_a0_fm_a0 = { 601*42a5529eSkettenis .fw_name = IWX_MA_A_FM_A_FW, 602*42a5529eSkettenis .pnvm_name = IWX_MA_A_FM_A_PNVM, 603*42a5529eSkettenis }; 604*42a5529eSkettenis 6059787ce4dSstsp #define IWX_CFG_ANY (~0) 6069787ce4dSstsp 6079787ce4dSstsp #define IWX_CFG_MAC_TYPE_QU 0x33 6089787ce4dSstsp #define IWX_CFG_MAC_TYPE_QUZ 0x35 6099787ce4dSstsp #define IWX_CFG_MAC_TYPE_QNJ 0x36 6109787ce4dSstsp #define IWX_CFG_MAC_TYPE_SO 0x37 6119787ce4dSstsp #define IWX_CFG_MAC_TYPE_SNJ 0x42 6129787ce4dSstsp #define IWX_CFG_MAC_TYPE_SOF 0x43 6134735940aSstsp #define IWX_CFG_MAC_TYPE_MA 0x44 6144735940aSstsp #define IWX_CFG_MAC_TYPE_BZ 0x46 6154735940aSstsp #define IWX_CFG_MAC_TYPE_GL 0x47 6169787ce4dSstsp 6179787ce4dSstsp #define IWX_CFG_RF_TYPE_JF2 0x105 6189787ce4dSstsp #define IWX_CFG_RF_TYPE_JF1 0x108 6199787ce4dSstsp #define IWX_CFG_RF_TYPE_HR2 0x10a 6209787ce4dSstsp #define IWX_CFG_RF_TYPE_HR1 0x10c 6214735940aSstsp #define IWX_CFG_RF_TYPE_GF 0x10d 6224735940aSstsp #define IWX_CFG_RF_TYPE_MR 0x110 6234735940aSstsp #define IWX_CFG_RF_TYPE_MS 0x111 6244735940aSstsp #define IWX_CFG_RF_TYPE_FM 0x112 6259787ce4dSstsp 6269787ce4dSstsp #define IWX_CFG_RF_ID_JF 0x3 6279787ce4dSstsp #define IWX_CFG_RF_ID_JF1 0x6 6289787ce4dSstsp #define IWX_CFG_RF_ID_JF1_DIV 0xa 6299787ce4dSstsp 6309787ce4dSstsp #define IWX_CFG_NO_160 0x1 6319787ce4dSstsp #define IWX_CFG_160 0x0 6329787ce4dSstsp 6339787ce4dSstsp #define IWX_CFG_CORES_BT 0x0 6349787ce4dSstsp 6359787ce4dSstsp #define IWX_CFG_NO_CDB 0x0 6364735940aSstsp #define IWX_CFG_CDB 0x1 6379787ce4dSstsp 6389787ce4dSstsp #define IWX_SUBDEVICE_RF_ID(subdevice) ((uint16_t)((subdevice) & 0x00f0) >> 4) 6399787ce4dSstsp #define IWX_SUBDEVICE_NO_160(subdevice) ((uint16_t)((subdevice) & 0x0200) >> 9) 6409787ce4dSstsp #define IWX_SUBDEVICE_CORES(subdevice) ((uint16_t)((subdevice) & 0x1c00) >> 10) 6419787ce4dSstsp 6425d6d7b90Sstsp struct iwx_softc { 6435d6d7b90Sstsp struct device sc_dev; 6445d6d7b90Sstsp struct ieee80211com sc_ic; 6455d6d7b90Sstsp int (*sc_newstate)(struct ieee80211com *, enum ieee80211_state, int); 6465d6d7b90Sstsp int sc_newstate_pending; 647f6c92c11Sstsp int attached; 6485d6d7b90Sstsp 6495d6d7b90Sstsp struct task init_task; /* NB: not reference-counted */ 6505d6d7b90Sstsp struct refcnt task_refs; 6515d6d7b90Sstsp struct task newstate_task; 6525d6d7b90Sstsp enum ieee80211_state ns_nstate; 6535d6d7b90Sstsp int ns_arg; 6545d6d7b90Sstsp 6555d6d7b90Sstsp /* Task for firmware BlockAck setup/teardown and its arguments. */ 6565d6d7b90Sstsp struct task ba_task; 65789e2b009Sstsp struct iwx_ba_task_data ba_rx; 65889e2b009Sstsp struct iwx_ba_task_data ba_tx; 6595d6d7b90Sstsp 660c4d46e12Sstsp /* Task for setting encryption keys and its arguments. */ 661c4d46e12Sstsp struct task setkey_task; 662c4d46e12Sstsp /* 663c4d46e12Sstsp * At present we need to process at most two keys at once: 664c4d46e12Sstsp * Our pairwise key and a group key. 665c4d46e12Sstsp * When hostap mode is implemented this array needs to grow or 666c4d46e12Sstsp * it might become a bottleneck for associations that occur at 667c4d46e12Sstsp * roughly the same time. 668c4d46e12Sstsp */ 669c4d46e12Sstsp struct iwx_setkey_task_arg setkey_arg[2]; 670c4d46e12Sstsp int setkey_cur; 671c4d46e12Sstsp int setkey_tail; 672c4d46e12Sstsp int setkey_nkeys; 673c4d46e12Sstsp 67409268e1fSstsp /* Task for ERP/HT prot/slot-time/EDCA updates. */ 67509268e1fSstsp struct task mac_ctxt_task; 6765d6d7b90Sstsp 677b4d5bb03Sstsp /* Task for HT 20/40 MHz channel width updates. */ 678b4d5bb03Sstsp struct task phy_ctxt_task; 679b4d5bb03Sstsp 6805d6d7b90Sstsp bus_space_tag_t sc_st; 6815d6d7b90Sstsp bus_space_handle_t sc_sh; 6825d6d7b90Sstsp bus_size_t sc_sz; 6835d6d7b90Sstsp bus_dma_tag_t sc_dmat; 6849787ce4dSstsp pci_product_id_t sc_pid; 6855d6d7b90Sstsp pci_chipset_tag_t sc_pct; 6865d6d7b90Sstsp pcitag_t sc_pcitag; 6875d6d7b90Sstsp const void *sc_ih; 6885d6d7b90Sstsp int sc_msix; 6895d6d7b90Sstsp 6905d6d7b90Sstsp /* TX/RX rings. */ 69134d6c773Sstsp struct iwx_tx_ring txq[IWX_NUM_TX_QUEUES]; 6925d6d7b90Sstsp struct iwx_rx_ring rxq; 6935d6d7b90Sstsp int qfullmsk; 69489e2b009Sstsp int qenablemsk; 695eec182a6Sstsp int first_data_qid; 69689e2b009Sstsp int aggqid[IEEE80211_NUM_TID]; 6974735940aSstsp int max_tfd_queue_size; 6985d6d7b90Sstsp 6995d6d7b90Sstsp int sc_sf_state; 7005d6d7b90Sstsp 7015d6d7b90Sstsp /* ICT table. */ 7025d6d7b90Sstsp struct iwx_dma_info ict_dma; 7035d6d7b90Sstsp int ict_cur; 7045d6d7b90Sstsp 7055d6d7b90Sstsp int sc_hw_rev; 7065d6d7b90Sstsp #define IWX_SILICON_A_STEP 0 7075d6d7b90Sstsp #define IWX_SILICON_B_STEP 1 7085d6d7b90Sstsp #define IWX_SILICON_C_STEP 2 7099787ce4dSstsp #define IWX_SILICON_Z_STEP 0xf 7105d6d7b90Sstsp int sc_hw_id; 7119787ce4dSstsp int sc_hw_rf_id; 7125d6d7b90Sstsp int sc_device_family; 7135d6d7b90Sstsp #define IWX_DEVICE_FAMILY_22000 1 7149787ce4dSstsp #define IWX_DEVICE_FAMILY_AX210 2 7154735940aSstsp uint32_t sc_sku_id[3]; 716f8f0b499Sstsp uint32_t mac_addr_from_csr; 7175d6d7b90Sstsp 7185d6d7b90Sstsp struct iwx_dma_info ctxt_info_dma; 7195d6d7b90Sstsp struct iwx_self_init_dram init_dram; 7204735940aSstsp struct iwx_dma_info prph_scratch_dma; 7214735940aSstsp struct iwx_dma_info prph_info_dma; 7224735940aSstsp struct iwx_dma_info iml_dma; 7234735940aSstsp struct iwx_dma_info pnvm_dma; 724*42a5529eSkettenis struct iwx_dma_info pnvm_seg_dma[IWX_MAX_DRAM_ENTRY]; 725*42a5529eSkettenis uint32_t pnvm_size; 726*42a5529eSkettenis int pnvm_segs; 7274735940aSstsp uint32_t sc_pnvm_ver; 7285d6d7b90Sstsp 7295d6d7b90Sstsp int sc_fw_chunk_done; 7305d6d7b90Sstsp int sc_init_complete; 7315d6d7b90Sstsp #define IWX_INIT_COMPLETE 0x01 7325d6d7b90Sstsp #define IWX_CALIB_COMPLETE 0x02 7334735940aSstsp #define IWX_PNVM_COMPLETE 0x04 7345d6d7b90Sstsp 7355d6d7b90Sstsp struct iwx_ucode_status sc_uc; 7365d6d7b90Sstsp char sc_fwver[32]; 7375d6d7b90Sstsp 7385d6d7b90Sstsp int sc_capaflags; 7395d6d7b90Sstsp int sc_capa_max_probe_len; 7405d6d7b90Sstsp int sc_capa_n_scan_channels; 7415d6d7b90Sstsp uint8_t sc_ucode_api[howmany(IWX_NUM_UCODE_TLV_API, NBBY)]; 7425d6d7b90Sstsp uint8_t sc_enabled_capa[howmany(IWX_NUM_UCODE_TLV_CAPA, NBBY)]; 7431fb03427Sstsp #define IWX_MAX_FW_CMD_VERSIONS 704 7445d6d7b90Sstsp struct iwx_fw_cmd_version cmd_versions[IWX_MAX_FW_CMD_VERSIONS]; 7455d6d7b90Sstsp int n_cmd_versions; 74608bf42d3Sstsp int sc_rate_n_flags_version; 747*42a5529eSkettenis int sc_use_mld_api; 7485d6d7b90Sstsp 7495d6d7b90Sstsp int sc_intmask; 7505d6d7b90Sstsp int sc_flags; 7515d6d7b90Sstsp 7525d6d7b90Sstsp uint32_t sc_fh_init_mask; 7535d6d7b90Sstsp uint32_t sc_hw_init_mask; 7545d6d7b90Sstsp uint32_t sc_fh_mask; 7555d6d7b90Sstsp uint32_t sc_hw_mask; 7565d6d7b90Sstsp 7575d6d7b90Sstsp int sc_generation; 7585d6d7b90Sstsp 7595d6d7b90Sstsp struct rwlock ioctl_rwl; 7605d6d7b90Sstsp 7615d6d7b90Sstsp int sc_cap_off; /* PCIe caps */ 7625d6d7b90Sstsp 7635d6d7b90Sstsp const char *sc_fwname; 7645d6d7b90Sstsp struct iwx_fw_info sc_fw; 7655d6d7b90Sstsp struct iwx_dma_info fw_mon; 7665d6d7b90Sstsp int sc_fw_phy_config; 7675d6d7b90Sstsp struct iwx_tlv_calib_ctrl sc_default_calib[IWX_UCODE_TYPE_MAX]; 7685d6d7b90Sstsp 7695d6d7b90Sstsp struct iwx_nvm_data sc_nvm; 7705d6d7b90Sstsp struct iwx_bf_data sc_bf; 7714735940aSstsp const char *sc_pnvm_name; 7725d6d7b90Sstsp 77308f56582Sstsp int sc_tx_timer[IWX_NUM_TX_QUEUES]; 7745d6d7b90Sstsp int sc_rx_ba_sessions; 7755d6d7b90Sstsp 776c48c5667Sstsp struct task bgscan_done_task; 777c48c5667Sstsp struct ieee80211_node_switch_bss_arg *bgscan_unref_arg; 778c48c5667Sstsp size_t bgscan_unref_arg_size; 779c48c5667Sstsp 7805d6d7b90Sstsp int sc_scan_last_antenna; 7815d6d7b90Sstsp 7825d6d7b90Sstsp int sc_staid; 7835d6d7b90Sstsp int sc_nodecolor; 7845d6d7b90Sstsp 7855d6d7b90Sstsp uint8_t *sc_cmd_resp_pkt[IWX_TX_RING_COUNT]; 7865d6d7b90Sstsp size_t sc_cmd_resp_len[IWX_TX_RING_COUNT]; 7875d6d7b90Sstsp int sc_nic_locks; 7885d6d7b90Sstsp 7895d6d7b90Sstsp struct taskq *sc_nswq; 7905d6d7b90Sstsp 7915d6d7b90Sstsp struct iwx_rx_phy_info sc_last_phy_info; 7925d6d7b90Sstsp int sc_ampdu_ref; 793ccc2d1c4Sstsp struct iwx_rxba_data sc_rxba_data[IWX_MAX_BAID]; 7945d6d7b90Sstsp 7955d6d7b90Sstsp uint32_t sc_time_event_uid; 7965d6d7b90Sstsp 7975d6d7b90Sstsp /* phy contexts. we only use the first one */ 7985d6d7b90Sstsp struct iwx_phy_ctxt sc_phyctxt[IWX_NUM_PHY_CTX]; 7995d6d7b90Sstsp 8005d6d7b90Sstsp struct iwx_notif_statistics sc_stats; 8015d6d7b90Sstsp int sc_noise; 8025d6d7b90Sstsp 803d4e7b525Sstsp int sc_pm_support; 8045d6d7b90Sstsp int sc_ltr_enabled; 8055d6d7b90Sstsp 8065d6d7b90Sstsp int sc_integrated; 8075d6d7b90Sstsp int sc_tx_with_siso_diversity; 8085d6d7b90Sstsp int sc_max_tfd_queue_size; 809c8ad1f96Sstsp int sc_ltr_delay; 810c8ad1f96Sstsp int sc_xtal_latency; 811c8ad1f96Sstsp int sc_low_latency_xtal; 81225915785Sstsp int sc_uhb_supported; 8134735940aSstsp int sc_umac_prph_offset; 8144735940aSstsp int sc_imr_enabled; 8155d6d7b90Sstsp 8165d6d7b90Sstsp #if NBPFILTER > 0 8175d6d7b90Sstsp caddr_t sc_drvbpf; 8185d6d7b90Sstsp 8195d6d7b90Sstsp union { 8205d6d7b90Sstsp struct iwx_rx_radiotap_header th; 8215d6d7b90Sstsp uint8_t pad[IEEE80211_RADIOTAP_HDRLEN]; 8225d6d7b90Sstsp } sc_rxtapu; 8235d6d7b90Sstsp #define sc_rxtap sc_rxtapu.th 8245d6d7b90Sstsp int sc_rxtap_len; 8255d6d7b90Sstsp 8265d6d7b90Sstsp union { 8275d6d7b90Sstsp struct iwx_tx_radiotap_header th; 8285d6d7b90Sstsp uint8_t pad[IEEE80211_RADIOTAP_HDRLEN]; 8295d6d7b90Sstsp } sc_txtapu; 8305d6d7b90Sstsp #define sc_txtap sc_txtapu.th 8315d6d7b90Sstsp int sc_txtap_len; 8325d6d7b90Sstsp #endif 8335d6d7b90Sstsp }; 8345d6d7b90Sstsp 8355d6d7b90Sstsp struct iwx_node { 8365d6d7b90Sstsp struct ieee80211_node in_ni; 8375d6d7b90Sstsp struct iwx_phy_ctxt *in_phyctxt; 8388e2545beSstsp uint8_t in_macaddr[ETHER_ADDR_LEN]; 8395d6d7b90Sstsp 8405d6d7b90Sstsp uint16_t in_id; 8415d6d7b90Sstsp uint16_t in_color; 842ccc2d1c4Sstsp 843ccc2d1c4Sstsp struct iwx_rxq_dup_data dup_data; 844c4d46e12Sstsp 845c4d46e12Sstsp int in_flags; 846c4d46e12Sstsp #define IWX_NODE_FLAG_HAVE_PAIRWISE_KEY 0x01 847c4d46e12Sstsp #define IWX_NODE_FLAG_HAVE_GROUP_KEY 0x02 8485d6d7b90Sstsp }; 8495d6d7b90Sstsp #define IWX_STATION_ID 0 8505d6d7b90Sstsp #define IWX_AUX_STA_ID 1 8510aac667cSstsp #define IWX_MONITOR_STA_ID 2 8525d6d7b90Sstsp 8535d6d7b90Sstsp #define IWX_ICT_SIZE 4096 8545d6d7b90Sstsp #define IWX_ICT_COUNT (IWX_ICT_SIZE / sizeof (uint32_t)) 8555d6d7b90Sstsp #define IWX_ICT_PADDR_SHIFT 12 856