Lines Matching +full:gpio +full:- +full:in +full:- +full:accum

10  * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
16 * This program is distributed in the hope that it will be useful, but
26 * The full GNU General Public License is included in this distribution
27 * in the file called COPYING.
31 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
35 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
38 * Redistribution and use in source and binary forms, with or without
44 * * Redistributions in binary form must reproduce the above copyright
45 * notice, this list of conditions and the following disclaimer in
55 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
60 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
61 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
73 * BEGIN iwl-csr.h
80 * whenever platform supplies power to device, even when device is in
81 * low power states due to driver-invoked device resets
82 * (e.g. IWM_CSR_RESET_REG_FLAG_SW_RESET) or uCode-driven power-saving modes.
91 * NOTE: Device does need to be awake in order to read this memory
95 #define IWM_CSR_INT_COALESCING (0x004) /* accum ints, 32-usec units */
109 * 31-16: Reserved
110 * 15-4: Type of device: see IWM_CSR_HW_REV_TYPE_xxx definitions
111 * 3-2: Revision step: 0 = A, 1 = B, 2 = C, 3 = D
112 * 1-0: "Dash" (-) value, as in A-1, etc.
117 * EEPROM and OTP (one-time-programmable) memory reads
120 * in order to read.
131 * UCODE-DRIVER GP (general purpose) mailbox registers.
150 /* Analog phase-lock-loop configuration */
158 * 3-2: 0 = A, 1 = B, 2 = C, 3 = D step
159 * 1-0: "Dash" (-) value, as in C-1, etc.
194 /* interrupt flags in INTA, set by uCode or hardware (e.g. dma),
218 /* interrupt flags in FH (flow handler) (PCI busmaster DMA) */
233 /* GPIO */
250 * Indicates state of (platform's) hardware RF-Kill switch
251 * 26-24: POWER_SAVE_TYPE
252 * Indicates current power-saving mode:
253 * 000 -- No power saving
254 * 001 -- MAC power-down
255 * 010 -- PHY (radio) power-down
256 * 011 -- Error
257 * 9-6: SYS_CONFIG
261 * Indicates MAC is entering a power-saving sleep power-down.
262 * Not a good time to access device-internal resources.
265 * access to device-internal resources. Host must wait for
266 * MAC_CLOCK_READY (and !GOING_TO_SLEEP) before accessing non-CSR
276 * init or post-power-down restore of internal SRAM memory.
278 * SRAM is restored and uCode is in normal operation mode.
279 * Later devices (5xxx/6xxx/1xxx) use non-volatile SRAM, and
342 /* One-time-programmable memory general purpose reg */
343 #define IWM_CSR_OTP_GP_REG_DEVICE_SELECT (0x00010000) /* 0 - EEPROM, 1 - OTP */
344 #define IWM_CSR_OTP_GP_REG_OTP_ACCESS_MODE (0x00020000) /* 0 - absolute, 1 - relative */
360 * UCODE-DRIVER GP (general purpose) mailbox register 1
371 * Host sets this during RF KILL power-down sequence (HW, SW, CT KILL)
379 * uCode sets this when preparing a power-saving power-down.
380 * uCode resets this when power-up is complete and SRAM is sane.
384 * Later devices (5xxx/6xxx/1xxx) use non-volatile SRAM, and
446 /* Write index table - shadow registers */
488 * Once the RXF-to-DRAM DMA is active, this flag is immediately turned off.
500 #define IWM_RFH_RXF_DMA_RB_SIZE_MASK (0x000F0000) /* bits 16-19 */
512 /* RB Circular Buffer size:defines the table sizes in RBD units */
513 #define IWM_RFH_RXF_DMA_RBDCB_SIZE_MASK (0x00F00000) /* bits 20-23 */
524 #define IWM_RFH_RXF_DMA_MIN_RB_SIZE_MASK (0x03000000) /* bit 24-25 */
529 #define IWM_RFH_DMA_EN_MASK (0xC0000000) /* bits 30-31*/
552 /* extended range in FW SRAM */
563 * HBUS (Host-side Bus)
567 * may be powered-down.
584 * data registers auto-increment the address by one dword.
586 * 0-31: memory address within device
602 * 0-15: register address (offset) within device
603 * 24-25: (# bytes - 1) to read or write (e.g. 3 for dword)
650 * Per-Tx-queue write pointer (index, really!)
653 * 0-7: queue write index
654 * 11-8: queue selector
664 * the CSR_INT_COALESCING is an 8 bit register in 32-usec unit
684 /* Those are the masks INSIDE the flags bit-field: */
719 * END iwl-csr.h
723 * BEGIN iwl-fw.h
777 * @IWM_UCODE_TLV_FLAGS_DW_BC_TABLE: The SCD byte count table is in DWORDS
779 * @IWM_UCODE_TLV_FLAGS_SHORT_BL: 16 entries of black list instead of 64 in scan
828 * (command version 3) that supports per-chain limits
829 * @IWM_UCODE_TLV_API_SCAN_TSF_REPORT: Scan start time reported in scan
831 * received during scan, are reported in TSF of the mac specified in the
836 * @IWM_UCODE_TLV_API_EXT_SCAN_PRIORITY: scan APIs use 8-level priority
875 * channel in DS parameter set element in probe requests.
876 * @IWM_UCODE_TLV_CAPA_WFA_TPC_REP_IE_SUPPORT: supports adding TPC Report IE in
882 * @IWM_UCODE_TLV_CAPA_CNSLDTD_D3_D0_IMG: Consolidated D3-D0 image
888 * @IWM_UCODE_TLV_CAPA_P2P_STANDALONE_UAPSD: support p2p standalone U-APSD
889 * @IWM_UCODE_TLV_CAPA_BT_COEX_PLCR: enabled BT Coex packet level co-running
892 * IWM_UCODE_TLV_API_WIFI_MCC_UPDATE. When either is set, multi-source LAR
897 * @IWM_UCODE_TLV_CAPA_UMAC_UPLOAD: supports upload mode in umac (1=supported,
901 * @IWM_UCODE_TLV_CAPA_BT_MPLUT_SUPPORT: supports bt-coex Multi-priority LUT
907 * @IWM_UCODE_TLV_CAPA_CT_KILL_BY_FW: firmware responsible for CT-kill
911 * @IWM_UCODE_TLV_CAPA_USNIFFER_UNIFIED: supports usniffer enabled in
916 * @IWM_UCODE_TLV_CAPA_LMAC_UPLOAD: supports upload mode in lmac (1=supported,
1016 * struct iwm_fw_cipher_scheme - a cipher scheme supported by FW.
1022 * @key_idx_off: an offset of key index byte in the security header
1025 * @mic_len: mic length in bytes
1026 * @hw_cipher: a HW cipher index used in host commands
1042 * struct iwm_fw_cscheme_list - a cipher scheme list
1052 * END iwl-fw.h
1056 * BEGIN iwl-fw-file.h
1069 uint8_t data[0]; /* in same order as sizes */
1078 uint8_t data[0]; /* in same order as sizes */
1121 * Following two are not in our base tag, but allow
1191 * END iwl-fw-file.h
1195 * BEGIN iwl-prph.h
1199 * Registers in this file are internal, not PCI bus memory mapped.
1246 * write to bit 24 in order to reset the CPU
1268 * (Transmit Frame Descriptors) from up to 16 circular Tx queues resident in
1277 * (cf. iwl5000_default_queue_to_tx_fifo in iwl-5000.c):
1279 * 0 -- EDCA BK (background) frames, lowest priority
1280 * 1 -- EDCA BE (best effort) frames, normal priority
1281 * 2 -- EDCA VI (video) frames, higher priority
1282 * 3 -- EDCA VO (voice) and management frames, highest priority
1283 * 4 -- unused
1284 * 5 -- unused
1285 * 6 -- unused
1286 * 7 -- Commands
1288 * Driver should normally map queues 0-6 to Tx DMA/FIFO channels 0-6.
1289 * In addition, driver can map the remaining queues to Tx DMA/FIFO
1290 * channels 0-3 to support 11n aggregation via EDCA DMA channels.
1292 * The driver sets up each queue to work in one of two modes:
1294 * 1) Scheduler-Ack, in which the scheduler automatically supports a
1295 * block-ack (BA) window of up to 64 TFDs. In this mode, each queue
1298 * Quality-Of-Service (QOS) priority, destined for a single station.
1300 * In scheduler-ack mode, the scheduler keeps track of the Tx status of
1303 * automatically processes block-acks received from the receiving STA,
1304 * and reschedules un-acked frames to be retransmitted (successful
1305 * Tx completion may end up being out-of-order).
1307 * The driver must maintain the queue's Byte Count table in host DRAM
1311 * 2) FIFO (a.k.a. non-Scheduler-ACK), in which each TFD is processed in order.
1317 * This mode does not require use of the Byte Count table in host DRAM.
1321 * 2) Shared scheduler data base in internal SRAM
1322 * 3) Shared data in host DRAM
1328 * 2) 16 Byte Count circular buffers in 16 KBytes contiguous memory
1339 * can keep track of at one time when creating block-ack chains of frames.
1340 * Note that "64" matches the number of ack bits in a block-ack packet.
1406 return IWM_SCD_BASE + 0x284 + (chnl - 20) * 4; in IWM_SCD_QUEUE_WRPTR()
1430 * END iwl-prph.h
1434 * BEGIN iwl-fh.h
1449 * Keep-Warm (KW) buffer base address.
1452 * host DRAM powered on (via dummy accesses to DRAM) to maintain low-latency
1454 * from going into a power-savings mode that would cause higher DRAM latency,
1455 * and possible data over/under-runs, before all Tx/Rx is complete.
1459 * automatically invokes keep-warm accesses when normal accesses might not
1463 * 31-0: Keep-warm buffer physical base address [35:4], must be 4K aligned
1471 * Device has 16 base pointer registers, one for each of 16 host-DRAM-resident
1474 * bytes from one another. Each TFD circular buffer in DRAM must be 256-byte
1475 * aligned (address bits 0-7 must be 0).
1477 * for them are in different places.
1479 * Bit fields in each pointer register:
1480 * 27-0: TFD CB physical base address [35:8], must be 256-byte aligned
1495 return IWM_FH_MEM_CBBC_16_19_LOWER_BOUND + 4 * (chnl - 16); in IWM_FH_MEM_CBBC_QUEUE()
1496 return IWM_FH_MEM_CBBC_20_31_LOWER_BOUND + 4 * (chnl - 20); in IWM_FH_MEM_CBBC_QUEUE()
1518 * Driver sets up RB size and number of RBDs in the CB via Rx config
1522 * 27-0: Receive Buffer physical address bits [35:8], 256-byte aligned
1527 * 2) Rx status buffer, 8 bytes, in which uCode indicates which Rx Buffers
1532 * Bit fields in lower dword of Rx status buffer (upper dword not used
1534 * 31-12: Not used by driver
1535 * 11- 0: Index of last filled Rx buffer descriptor
1544 * available, i.e. one RBD past the tail of the ready-to-fill RBDs within
1549 * NOTE: DEVICE EXPECTS THE WRITE INDEX TO BE INCREMENTED IN MULTIPLES OF 8.
1552 * buffer), it updates the Rx status buffer in host DRAM, 2) described above,
1574 * Physical base address of 8-byte Rx Status buffer.
1576 * 31-0: Rx status buffer physical base address [35:4], must 16-byte aligned.
1583 * 27-0: RBD CD physical base address [35:8], must be 256-byte aligned.
1590 * 11-0: Index of driver's most recent prepared-to-be-filled RBD, + 1.
1591 * NOTE: For 256-entry circular buffer, use only bits [7:0].
1611 * 31-30: Rx DMA channel enable: '00' off/pause, '01' pause at end of frame,
1613 * 29-24: reserved
1614 * 23-20: # RBDs in circular buffer = 2^value; use "8" for 256 RBDs (normal),
1616 * 19-18: reserved
1617 * 17-16: size of each receive buffer; '00' 4K (normal), '01' 8K,
1619 * 15-14: reserved
1620 * 13-12: IRQ destination; '00' none, '01' host driver (normal operation)
1621 * 11- 4: timeout for closing Rx buffer and interrupting host (units 32 usec)
1623 * 3- 0: reserved
1633 #define IWM_FH_RCSR_CHNL0_RX_CONFIG_RB_TIMEOUT_MSK (0x00000FF0) /* bits 4-11 */
1636 #define IWM_FH_RCSR_CHNL0_RX_CONFIG_RB_SIZE_MSK (0x00030000) /* bits 16-17 */
1637 #define IWM_FH_RCSR_CHNL0_RX_CONFIG_RBDBC_SIZE_MSK (0x00F00000) /* bits 20-23 */
1638 #define IWM_FH_RCSR_CHNL0_RX_CONFIG_DMA_CHNL_EN_MSK (0xC0000000) /* bits 30-31*/
1682 /* TFDB Area - TFDs buffer table */
1693 * supported in hardware (don't confuse these with the 16 Tx queues in DRAM,
1705 * 31-30: Tx DMA channel enable: '00' off/pause, '01' pause at end of frame,
1707 * 29- 4: Reserved, set to "0"
1709 * 2- 0: Reserved, set to "0"
1759 * 31-24: 1 = Channel buffers empty (channel 7:0)
1760 * 23-16: 1 = No pending requests (channel 7:0)
1770 * uCode/driver must write "1" in order to clear this flag
1772 * uCode/driver must write "1" in order to clear this flag
1773 * 16-9:Each status bit is for one channel. Indicates that an (Error) ActDMA
1776 * uCode/driver must write "1" in order to clear this flag
1777 * 7-0: Each status bit indicates a channel's TxCredit error. When an error
1782 * uCode/driver must write "1" in order to clear this flag
1794 (IWM_FH_SRVC_LOWER_BOUND + ((_chnl) - 9) * 0x4)
1801 * it is brought from the memory to TX-FIFO
1816 * struct iwm_rb_status - reseve buffer status
1818 * @closed_rb_num [0:11] - Indicates the index of the RB which was closed
1819 * @closed_fr_num [0:11] - Indicates the index of the RX Frame which was closed
1820 * @finished_rb_num [0:11] - Indicates the index of the current RB
1821 * in which the last frame was written to
1822 * @finished_fr_num [0:11] - Indicates the index of the RX Frame
1852 * @hi_n_len 0-3 [35:32] portion of dma
1853 * 4-15 length of the tx buffer
1866 * @ num_tbs 0-4 number of active tbs
1868 * 6-7 padding (not used)
1872 * Each Tx queue uses a circular buffer of 256 TFDs stored in host DRAM.
1874 * contiguous 256 TFDs x 128 bytes-per-TFD = 32 KBytes
1880 * in host DRAM. These buffers collectively contain the (one) frame described
1882 * itself, but buffers may be scattered in host DRAM. Each buffer has max size
1883 * of (4K - 4). The concatenates all of a TFD's buffers into a single
1884 * Tx frame, up to 8 KBytes in size.
1898 /* Fixed (non-configurable) rx data from phy */
1903 * @tfd_offset 0-12 - tx command byte count
1904 * 12-16 - station index
1912 * END iwl-fh.h
1916 * BEGIN mvm/fw-api.h
1926 * DQA - Dynamic Queue Allocation -introduction
1928 * Dynamic Queue Allocation (AKA "DQA") is a feature implemented in iwlwifi
1929 * to allow dynamic allocation of queues on-demand, rather than allocate them
1931 * per RA/TID, thus allowing an AP - for example - to send BE traffic to STA2
1935 * Although the queues in DQA mode are dynamically allocated, there are still
1937 * TXQ #0 - command queue
1938 * TXQ #1 - aux frames
1939 * TXQ #2 - P2P device frames
1940 * TXQ #3 - P2P GO/SoftAP GCAST/BCAST frames
1941 * TXQ #4 - BSS DATA frames queue
1942 * TXQ #5-8 - non-QoS data, QoS no-data, and MGMT frames queue pool
1943 * TXQ #9 - P2P GO/SoftAP probe responses
1944 * TXQ #10-31 - QoS DATA frames queue pool (for Tx aggregation)
1960 /* Reserve 8 DQA Tx queues, from 10 up to 17, for A-MPDU aggregation. */
1963 #define IWM_LAST_AGG_TX_QUEUE (IWM_FIRST_AGG_TX_QUEUE + IWM_MAX_TID_COUNT - 1)
1965 /* legacy non-DQA queues; the legacy command queue uses a different number! */
2048 /* Power - legacy power table command */
2068 /* RF-KILL commands and notifications */
2076 /* Power - new power table command */
2111 /* for WoWLAN in particular */
2167 * struct iwm_cmd_response - generic response struct for most commands
2183 * struct iwm_reduce_tx_power_cmd - TX power reduction command
2187 * @pwr_restriction: TX power restriction in dBms.
2208 /* This defines the bitmap of various calibrations to enable in both
2253 * struct iwm_ct_kill_notif - CT-kill entry notification
2255 * @temperature: the current temperature in celsius
2264 * struct iwm_temp_report_ths_cmd - set temperature thresholds
2289 * phy db - configure operational ucode
2304 * phy db - Receive phy db chunk after calibrations
2312 /* 7k family NVM HW-Section offset (in words) definitions */
2314 /* 7k family NVM SW-Section offset (in words) definitions */
2320 #define IWM_NVM_CHANNELS 0x1E0 - IWM_NVM_SW_SECTION
2321 /* 7k family NVM calibration section offset (in words) definitions */
2323 #define IWM_XTAL_CALIB (0x316 - IWM_NVM_CALIB_SECTION)
2325 /* 8k family NVM HW-Section offset (in words) definitions */
2332 /* 8k family NVM SW-Section offset (in words) definitions */
2339 /* 8k family NVM REGULATORY -Section offset (in words) definitions */
2345 /* 8k family NVM calibration section offset (in words) definitions */
2347 #define IWM_XTAL_CALIB_8000 (0x316 - IWM_NVM_CALIB_SECTION_8000)
2357 #define IWM_NVM_RF_CFG_DASH_MSK(x) (x & 0x3) /* bits 0-1 */
2358 #define IWM_NVM_RF_CFG_STEP_MSK(x) ((x >> 2) & 0x3) /* bits 2-3 */
2359 #define IWM_NVM_RF_CFG_TYPE_MSK(x) ((x >> 4) & 0x3) /* bits 4-5 */
2360 #define IWM_NVM_RF_CFG_PNUM_MSK(x) ((x >> 6) & 0x3) /* bits 6-7 */
2361 #define IWM_NVM_RF_CFG_TX_ANT_MSK(x) ((x >> 8) & 0xF) /* bits 8-11 */
2362 #define IWM_NVM_RF_CFG_RX_ANT_MSK(x) ((x >> 12) & 0xF) /* bits 12-15 */
2372 * channel flags in NVM
2415 * struct iwm_nvm_access_cmd_ver2 - Request the device to send an NVM section
2416 * @op_code: 0 - read, 1 - write
2419 * @offset: offset in bytes into the section
2420 * @length: in bytes, to read/write
2465 * struct iwm_fw_paging_cmd - paging layout
2469 * Send to FW the paging layout in the driver.
2472 * @block_size: the block size in powers of 2
2473 * @block_num: number of blocks specified in the command.
2484 * struct iwm_nvm_access_resp_ver2 - response to IWM_NVM_ACCESS_CMD
2485 * @offset: offset in bytes into the section
2486 * @length: in bytes, either how much was written or read
2578 * struct iwm_soc_configuration_cmd - Set device stabilization latency
2580 * @flags: soc settings flags. In VER_1, we can only set the DISCRETE
2581 * flag, because the FW treats the whole value as an integer. In
2608 * struct iwm_error_resp - FW error indication
2615 * @timestamp: TSF in usecs.
2629 * struct iwm_fw_cmd_version - firmware command version entry
2702 /* Time event - defines for command API v1 */
2729 /* Time Event dependencies: none, on another TE, or in a specific time */
2765 /* Time event - defines for command API */
2768 * DOC: Time Events - what is it?
2773 * In order to make sure that the fw is on a specific channel at a certain time
2785 * When the driver needs to make sure we are in a certain channel, at a certain
2797 * Is there an end-time for the event?
2848 * @IWM_TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC
2876 * struct iwm_time_event_cmd_api - configuring Time Events
2886 * @apply_time: When to start the Time Event (in GP2)
2887 * @max_delay: maximum delay to event's start (apply time), in TU
2889 * @interval: interval between repetitions, in TU
2890 * @duration: duration of event in TU
2916 * struct iwm_time_event_resp - response structure to iwm_time_event_cmd
2919 * @unique_id: the unique ID assigned (in ADD) or given (others) to the TE
2930 * struct iwm_time_event_notif - notifications of time event start/stop
2932 * @timestamp: action timestamp in GP2
2952 * struct iwm_binding_cmd_v1 - configuring bindings
2970 * struct iwm_binding_cmd - configuring bindings
2991 /* The maximal number of fragments in the FW's schedule session */
2995 * struct iwm_time_quota_data - configuration of time quota per binding
2997 * @quota: absolute time quota in TU. The scheduler will try to divide the
2999 * @max_duration: max uninterrupted context duration in TU
3008 * struct iwm_time_quota_cmd - configuration of time quota between bindings
3021 * struct iwm_time_quota_data - configuration of time quota per binding
3023 * @quota: absolute time quota in TU. The scheduler will try to divide the
3025 * @max_duration: max uninterrupted context duration in TU
3036 * struct iwm_time_quota_cmd - configuration of time quota between bindings
3038 * Note: on non-CDB the fourth one is the auxilary mac and is essentially zero.
3063 * For VHT - bit-2 marks if the control is lower/upper relative to center-freq
3064 * bits-1:0 mark the distance from the center freq. for 20Mhz, offset is 0.
3095 * struct iwm_fw_channel_info - channel information
3138 * struct iwm_phy_context_cmd - config of the PHY context
3214 * struct iwm_rx_phy_info - phy info
3222 * @beacon_time_stamp: beacon at on-air rise
3227 * @byte_count: frame's byte-count
3272 * @IWM_RX_RES_PHY_FLAGS_AGG: set if the packet was part of an A-MPDU
3297 * in the driver.
3418 * struct iwm_radio_version_notif - information on the radio version
3439 * struct iwm_radio_version_notif - information on the radio version
3448 * struct iwm_missed_beacons_notif - information on missed beacons
3466 * struct iwm_mfuart_load_notif - mfuart image version & status
3481 * struct iwm_set_calib_default_cmd - set default value for calibration.
3497 * struct iwm_mcast_filter_cmd - configure multicast filter.
3500 * to identify network interface adopted in host-device IF.
3501 * It is used by FW as index in array of addresses. This array has
3503 * @count: Number of MAC addresses in the array
3547 * count the number of times we have to re-tune
3548 * in order to get out of bad PHY status
3558 uint32_t filtered_frames; /* count frames that were dumped in the
3562 uint32_t channel_beacons; /* beacons with our bss id and in our
3565 uint32_t adc_rx_saturation_time; /* count in 0.8us units the time the
3566 * ADC was in saturation */
3567 uint32_t ina_detection_search_time;/* total time (in 0.8us) searched
3573 uint32_t channel_load; /* counts RX Enable time in uSec */
3706 * while associated. To disable this behavior, set DISABLE_NOTIF flag in the
3788 * @state: smart fifo state, types listed in enum %iwm_sf_state.
3789 * @watermark: Minimum allowed available free space in RXF for transient state.
3791 * in long delay state.
3792 * @full_on_timeouts: timer values for each scenario in full on state.
3802 * END mvm/fw-api.h
3806 * BEGIN mvm/fw-api-mac.h
3845 * @IWM_FW_MAC_TYPE_PIBSS: Pseudo-IBSS
3883 * struct iwm_mac_data_ap - configuration data for AP MAC context
3884 * @beacon_time: beacon transmit time in system time
3885 * @beacon_tsf: beacon transmit time in TSF
3886 * @bi: beacon interval in TU
3888 * @dtim_interval: dtim transmit time in TU
3906 * struct iwm_mac_data_ibss - configuration data for IBSS MAC context
3907 * @beacon_time: beacon transmit time in system time
3908 * @beacon_tsf: beacon transmit time in TSF
3909 * @bi: beacon interval in TU
3922 * struct iwm_mac_data_sta - configuration data for station MAC context
3924 * @dtim_time: DTIM arrival time in system time
3925 * @dtim_tsf: DTIM arrival time in TSF
3926 * @bi: beacon interval in TU, applicable only when associated
3928 * @dtim_interval: DTIM interval in TU, applicable only when associated
3930 * @listen_interval: in beacon intervals, applicable only when associated
3947 * struct iwm_mac_data_go - configuration data for P2P GO MAC context
3949 * @ctwin: client traffic window in TU (period after TBTT when GO is present).
3960 * struct iwm_mac_data_p2p_sta - configuration data for P2P client MAC context
3962 * @ctwin: client traffic window in TU (period after TBTT when GO is present).
3971 * struct iwm_mac_data_pibss - Pseudo IBSS config data
3972 * @stats_interval: interval in TU between statistics notifications to host.
3979 * struct iwm_mac_data_p2p_dev - configuration data for the P2P Device MAC
3982 * other channels as well. This should be to true only in case that the
4001 * (in station mode when associated)
4028 * struct iwm_ac_qos - QOS timing params for IWM_MAC_CONTEXT_CMD
4029 * @cw_min: Contention window, start value in numbers of slots.
4030 * Should be a power-of-2, minus 1. Device's default is 0x0f.
4031 * @cw_max: Contention window, max value in numbers of slots.
4032 * Should be a power-of-2, minus 1. Device's default is 0x3f.
4033 * @aifsn: Number of slots in Arbitration Interframe Space (before
4036 * @edca_txop: Length of Tx opportunity, in uSecs. Device default is 0.
4039 * in struct iwm_qosparam_cmd.
4054 * struct iwm_mac_ctx_cmd - command structure to configure MAC contexts
4121 * END mvm/fw-api-mac.h
4125 * BEGIN mvm/fw-api-power.h
4152 * struct iwm_ltr_config_cmd_v1 - configures the LTR
4164 * struct iwm_ltr_config_cmd - configures the LTR
4179 /* Radio LP RX Energy Threshold measured in dBm */
4187 * receiver and transmitter. '0' - does not allow.
4226 * struct iwm_device_power_cmd - device wide power command.
4238 * struct iwm_mac_power_cmd - New power command containing uAPSD support
4242 * @keep_alive_seconds: Keep alive period in seconds. Default - 25 sec.
4243 * Minimum allowed:- 3 * DTIM. Keep alive period must be
4247 * PSM transition - legacy PM
4249 * PSM transition - legacy PM
4250 * @sleep_interval: not in use
4255 * PSM transition - uAPSD
4257 * PSM transition - uAPSD
4263 * @snooze_window: A window of time in which PBW snoozing insures that all
4269 * @uapsd_ac_flags: Set trigger-enabled and delivery-enabled indication for
4274 * @heavy_tx_thld_packets: TX threshold measured in number of packets
4275 * @heavy_rx_thld_packets: RX threshold measured in number of packets
4276 * @heavy_tx_thld_percentage: TX threshold measured in load's percentage
4277 * @heavy_rx_thld_percentage: RX threshold measured in load's percentage
4311 * struct iwm_uapsd_misbehaving_ap_notif - FW sends this notification when
4314 * @sta_id: index of station in uCode's station table - associated AP ID in
4327 * @bf_energy_delta: Used for RSSI filtering, if in 'normal' state. Send beacon
4328 * to driver if delta in Energy values calculated for this and last
4333 * @bf_roaming_energy_delta: Used for RSSI filtering, if in 'roaming' state.
4334 * Send beacon to driver if delta in Energy values calculated for this
4336 * means that the Energy change is ignored for beacon filtering while in
4341 * Threshold. Typical energy threshold is -72dBm.
4343 * filtering (Slow or Fast) that is selected (Units are in Celsuis):
4344 * If the current temperature is above this threshold - Fast filter
4345 * will be used, If the current temperature is below this threshold -
4347 * @bf_temp_fast_filter: Send Beacon to driver if delta in temperature values
4352 * @bf_temp_slow_filter: Send Beacon to driver if delta in temperature values
4361 * for a longer period of time then this escape-timeout. Units: Beacons.
4431 * END mvm/fw-api-power.h
4435 * BEGIN mvm/fw-api-rs.h
4545 * The 32-bit value has different layouts in the low 8 bites depending on the
4549 * High-throughput (HT) rate format
4551 * Very High-throughput (VHT) rate format
4567 /* Bit 26: (1) VHT format, (0) legacy format in bits 8:0 */
4576 * High-throughput (HT) rate format for bits 7:0
4578 * 2-0: MCS rate base
4587 * 4-3: 0) Single stream (SISO)
4590 * 5: Value of 0x20 in bits 7:0 indicates 6 Mbps HT40 duplicate data
4591 * (bits 7-6 are zero)
4594 * support MCSes above 15/23, and 0-7 have one stream, 8-15 have two
4595 * streams and 16-23 have three streams. We could also support MCS 32
4609 * Very High-throughput (VHT) rate format for bits 7:0
4611 * 3-0: VHT MCS (0-9)
4612 * 5-4: number of streams - 1:
4618 /* Bit 4-5: (0) SISO, (1) MIMO2 (2) MIMO3 */
4626 * 3-0: 0xD) 6 Mbps
4634 * (bits 7-4 are 0)
4639 * 6-0: 10) 1 Mbps
4649 * Bit 11-12: (0) 20MHz, (1) 40MHz, (2) 80MHz, (3) 160MHz
4663 /* Bit 14-16: Antenna selection (1) Ant A, (2) Ant B, (4) Ant C */
4675 /* Bit 17-18: (0) SS, (1) SS*2 */
4687 /* Bit 24-25: (0) 20MHz (no dup), (1) 2x20MHz, (2) 4x20MHz, 3 8x20MHz */
4698 /* # entries in rate scale table to support Tx retries */
4707 /* Bit 1-3: LQ command color. Used to match responses to LQ commands */
4711 /* Bit 4-5: Tx RTS BW Signalling
4722 * Dyanmic BW selection allows Tx with narrower BW then requested in rates
4737 * struct iwm_lq_cmd - link quality command
4741 * @mimo_delim: the first SISO index in rs_table, which separates MIMO
4743 * @single_stream_ant_msk: best antenna for SISO (can be dual in CDD).
4747 * @agg_time_limit: aggregation max time threshold in usec/100, meaning
4749 * @agg_disable_start_th: try-count threshold for starting aggregation.
4750 * If a frame has higher try-count, it should not be selected for
4752 * @agg_frame_cnt_limit: max frame count in an aggregation.
4755 * 2 - 0x3f: maximal number of frames (up to 3f == 63)
4780 * END mvm/fw-api-rs.h
4784 * BEGIN mvm/fw-api-tx.h
4788 * bitmasks for tx_flags in TX command
4789 * @IWM_TX_CMD_FLG_PROT_REQUIRE: use RTS or CTS-to-self to protect the frame
4802 * Should be set for mgmt, non-QOS data, mcast, bcast and in scan command
4803 * @IWM_TX_CMD_FLG_MORE_FRAG: this frame is non-last MPDU
4805 * @IWM_TX_CMD_FLG_TSF: FW should calculate and insert TSF in the frame
4815 * @IWM_TX_CMD_FLG_DUR: disable duration overwriting used in PS-Poll Assoc-id
4850 * enum iwm_tx_pm_timeouts - pm timeout values in TX command
4877 * bits 0:2 - security control (IWM_TX_CMD_SEC_*)
4878 * bit 3 - immediate ACK required
4879 * bit 4 - rate is taken from STA table
4880 * bit 5 - frame belongs to BA stream
4881 * bit 6 - immediate BA response expected
4882 * bit 7 - unused
4883 * bits 8:15 - Station ID
4884 * bits 16:31 - rate
4897 * TX command Frame life time in us - to be written in pm_frame_timeout
4905 * TID for non QoS frames - to be written in tid_tspec
4912 * Limits on the retransmissions - to be written in {data,rts}_retry_limit
4921 * enum iwm_tx_offload_assist_flags_pos - set %iwm_tx_cmd offload_assist values
4922 * @TX_CMD_OFFLD_IP_HDR: offset to start of IP header (in words)
4924 * note: tx_cmd, mac header and pad are not counted in the offset.
4925 * This is used to help the offload in case there is tunneling such as
4926 * IPv6 in IPv4, in such case the ip header offset should point to the
4931 * @TX_CMD_OFFLD_MH_SIZE: size of the mac header in words. Includes the IV
4933 * @TX_CMD_OFFLD_PAD: mark 2-byte pad was inserted after the mac header for
4935 * @TX_CMD_OFFLD_AMSDU: mark TX command is A-MSDU
4946 * struct iwm_tx_cmd - TX command struct to FW
4948 * @len: in bytes of the payload, see below for details
4953 * @sta_id: index of destination station in FW station table
4960 * @dram_lsb_ptr: Physical address of scratch area in the command (try_cnt +
4967 * @driver_txop: duration od EDCA TXOP, in 32-usec units. Set this if not
4975 * + 8-byte MIC (not used for CCM/WEP)
4976 * It does not include post-MAC padding, i.e.,
4978 * Range of len: 14-2342 bytes.
5061 * @IWM_AGG_TX_STATE_TRY_CNT_MSK: Retry count for 1st frame in aggregation (retries
5064 * rate table entry used for all frames in the new agg.
5099 * This response may be in one of two slightly different formats, indicated
5107 * frames that used block-acknowledge. All frames were transmitted at
5108 * same rate. Rate scaling may have been used if first frame in this new
5109 * agg block failed in previous agg block(s).
5111 * Note that, for aggregation, ACK (block-ack) status is not delivered
5112 * here; block-ack has not been received by the time the device records
5120 * struct iwm_agg_tx_status - per packet TX aggregation status
5128 /* OpenBSD update - convert code to use this */
5140 * bit-7 invalid rate indication
5150 * struct iwm_tx_resp - notifies that fw is TXing a packet
5156 * @initial_rate: for non-agg: rate of the successful Tx. For agg: rate of the
5158 * @wireless_media_time: for non-agg: RTS + CTS + frame tx attempts time + ACK.
5159 * for agg: RTS + CTS + aggregation tx time + block-ack time.
5160 * in usec.
5172 * @status: for non-agg: frame status IWM_TX_STATUS_*
5205 * struct iwm_ba_notif - notifies about reception of BA
5208 * @sta_id: Index of recipient (BA-sending) station in fw's station table
5211 * bit in @bitmap corresponds to the sequence number stored here)
5212 * @bitmap: the bitmap of the BA notification as seen in the air
5215 * @txed: number of Txed frames in this batch
5216 * @txed_2_done: number of Acked frames in this batch
5219 * for Tx-ing then this value will be set to 0 by FW.
5239 * struct iwm_mac_beacon_cmd - beacon template command
5243 * @tim_idx: the offset of the tim IE in the beacon
5269 * struct iwm_tx_path_flush_cmd -- queue/FIFO flush command
5281 * struct iwl_tx_path_flush_cmd -- queue/FIFO flush command
5293 * iwm_get_scd_ssn - returns the SSN of the SCD
5294 * @tx_resp: the Tx response from the fw (agg or non-agg)
5298 * can't know in advance the number of MPDUs that will be sent in the current
5300 * Hence, it can't know in advance what the SSN of the SCD will be at the end
5307 return le32_to_cpup((uint32_t *)&tx_resp->status + in iwm_get_scd_ssn()
5308 tx_resp->frame_count) & 0xfff; in iwm_get_scd_ssn()
5312 * END mvm/fw-api-tx.h
5316 * BEGIN mvm/fw-api-scan.h
5320 * struct iwm_scd_txq_cfg_cmd - New txq hw scheduler config command
5363 #define IWM_SCAN_CHANNEL_NSSIDS(x) (((1 << (x)) - 1) << 1)
5365 /* Max number of IEs for direct SSID scans in a command */
5369 * struct iwm_ssid_ie - directed scan network information element
5371 * Up to 20 of these may appear in IWM_REPLY_SCAN_CMD,
5372 * selected by "type" bit field in struct iwm_scan_channel;
5374 * SSID IEs get transmitted in reverse order of entry.
5388 /* Default watchdog (in MS) for scheduled scan iteration */
5399 * iwm_scan_schedule_lmac - schedule of scan offload
5400 * @delay: delay between iterations, in seconds.
5411 * iwm_scan_req_tx_cmd - SCAN_REQ_TX_CMD_API_S
5415 * @sta_id: index of destination station in FW station table
5429 * iwm_scan_channel_cfg_lmac - SCAN_CHANNEL_CFG_S_VER2
5430 * @flags: bits 1-20: directed scan to i'th ssid
5432 * @channel_number: channel number 1-13 etc
5434 * @iter_interval: interval in seconds between iterations on one channel
5444 * iwm_scan_probe_segment - PROBE_SEGMENT_API_S_VER_1
5445 * @offset: offset in the data block
5453 /* iwm_scan_probe_req - PROBE_REQUEST_FRAME_API_S_VER_2
5466 /* iwl_scan_probe_req - PROBE_REQUEST_FRAME_API_S_VER_v2
5484 /* iwm_scan_channel_opt - CHANNEL_OPTIMIZATION_API_S
5488 * 1 - EBS is disabled.
5489 * 2 - every second scan will be full scan(and so on).
5505 * @IWM_LMAC_SCAN_FLAGS_RRM_ENABLED: insert WFA vendor-specific TPC report
5526 * iwm_scan_req_lmac - SCAN_REQUEST_CMD_API_S_VER_1
5529 * @active-dwell: dwell time for active channels
5530 * @passive-dwell: dwell time for passive channels
5531 * @fragmented-dwell: dwell time for fragmented passive scan
5532 * @extended_dwell: dwell time for channels 1, 6 and 11 (in certain cases)
5536 * @max_out_time: max time (in TU) to be out of associated channel
5544 * @delay: delay in seconds before first iteration
5578 * iwm_scan_offload_complete - PERIODIC_SCAN_COMPLETE_NTF_API_S_VER_2
5583 * @time_after_last_iter; time in seconds elapsed after last iteration
5595 * struct iwm_scan_results_notif - scan results for one channel -
5601 * @duration: duration spent in channel, in usecs
5616 * iwm_scan_offload_blacklist - IWM_SCAN_OFFLOAD_BLACKLIST_S
5619 * @client_bitmap: clients ignore this entry - enum scan_framework_client
5636 * iwm_scan_offload_profile - IWM_SCAN_OFFLOAD_PROFILE_S
5637 * @ssid_index: index to ssid list in fixed part
5638 * @unicast_cipher: encryption olgorithm to match - bitmap
5639 * @aut_alg: authentication olgorithm to match - bitmap
5642 * @client_bitmap: clients waiting for match - enum scan_framework_client
5655 * iwm_scan_offload_profile_cfg - IWM_SCAN_OFFLOAD_PROFILES_CFG_API_S_VER_1
5659 * @num_profiles: num of profiles in the list
5662 * @active_clients: active clients bitmap - enum scan_framework_client
5689 * struct iwm_lmac_scan_complete_notif - notifies end of scanning (all channels)
5695 * @tsf_low: TSF timer (lower half) in usecs
5696 * @tsf_high: TSF timer (higher half) in usecs
5713 * 8-bit mask (see IWM_SCAN_MASK).
5737 /* Bits 26-31 are for num of channels in channel_array */
5755 /* Bits 16-27 are for supported rates */
5766 * @tx_chains: valid_tx antenna - ANT_* definitions
5767 * @rx_chains: valid_rx antenna - ANT_* definitions
5768 * @legacy_rates: default legacy rates - enum scan_config_rates
5775 * @mac_addr: default mac address to be used in probes
5776 * @bcast_sta_id: the index of the station in the fw
5777 * @channel_flags: default channel flags - enum iwm_channel_flags
5845 * @flags: bitmap - 0-19: directed scan to i'th ssid.
5846 * @channel_num: channel number 1-13 etc.
5852 #define IWM_SCAN_CHANNEL_UMAC_NSSIDS(x) ((1 << (x)) - 1)
5860 * @interval: interval in seconds between scan iterations
5871 * struct iwm_scan_req_umac_tail - the rest of the UMAC scan request command
5874 * @delay: delay in TUs before starting the first scan iteration
5890 * struct iwm_scan_req_umac_tail - the rest of the UMAC scan request command
5893 * @delay: delay in TUs before starting the first scan iteration
5911 * @count: num of channels in scan request
5927 * @ooc_priority: out of channel priority - &enum iwl_scan_priority
5941 * @max_out_time: max out of serving channel time, per LMAC - for CDB there
5943 * @suspend_time: max suspend time, per LMAC - for CDB there are 2 LMACs
6068 * struct iwm_scan_offload_profile_match - match information
6074 * the channels passed in tue scan offload request
6086 * struct iwm_scan_offload_profiles_query - match results query response
6088 * matches passed in the scan offload request
6111 * struct iwm_umac_scan_iter_complete_notif - notifies end of scanning iteration
6113 * @scanned_channels: number of channels scanned and number of valid elements in
6118 * @tsf_low: TSF timer (lower half) in usecs
6119 * @tsf_high: TSF timer (higher half) in usecs
6144 * END mvm/fw-api-scan.h
6148 * BEGIN mvm/fw-api-sta.h
6158 * @IWM_STA_FLG_PS: set if STA is in Power Save
6167 * @IWM_STA_FLG_MAX_AGG_SIZE_MSK: maximal size for A-MPDU
6172 * will send all the frames in 20MHz even when FAT channel is requested.
6228 * @IWM_STA_KEY_FLG_WEP_KEY_MAP: wep is either a group key (0 - legacy WEP) or from
6229 * station info array (1 - n 1X mode)
6279 * @IWM_STA_SLEEP_STATE_MOREDATA: set more-data bit on
6309 * struct iwm_keyinfo - key information
6312 * @tkip_rx_ttak: 10-byte unicast TKIP TTAK for Rx
6313 * @key_offset: key offset in the fw's key table
6314 * @key: 16-byte unicast decryption key
6316 * @hw_tkip_mic_rx_key: byte: MIC Rx Key - used for TKIP only
6317 * @hw_tkip_mic_tx_key: byte: MIC Tx Key - used for TKIP only
6338 * struct iwm_add_sta_cmd_v7 - Add/modify a station in the fw's sta table.
6346 * @sta_id: index of station in uCode's station table
6348 * alone. 1 - modify, 0 - don't change.
6351 * @add_immediate_ba_tid: tid for which to add block-ack support (Rx)
6354 * @remove_immediate_ba_tid: tid for which to remove block-ack support (Rx)
6356 * @add_immediate_ba_ssn: ssn for the Rx block-ack session. Used together with
6359 * asleep. Used to synchronise PS-poll and u-APSD responses while ucode
6362 * @assoc_id: assoc_id to be sent in VHT PLCP (9-bit), for grp use 0, for AP
6363 * mac-addr.
6367 * The device contains an internal table of per-station information, with info
6372 * entry, or modifying a pre-existing one.
6397 * struct iwm_add_sta_cmd - Add/modify a station in the fw's sta table.
6400 * @awake_acs: ACs to transmit data on while station is sleeping (for U-APSD)
6407 * @sta_id: index of station in uCode's station table
6409 * alone. 1 - modify, 0 - don't change.
6414 * @add_immediate_ba_tid: tid for which to add block-ack support (Rx)
6417 * @remove_immediate_ba_tid: tid for which to remove block-ack support (Rx)
6419 * @add_immediate_ba_ssn: ssn for the Rx block-ack session. Used together with
6422 * asleep. Used to synchronise PS-poll and u-APSD responses while ucode
6426 * @assoc_id: assoc_id to be sent in VHT PLCP (9-bit), for grp use 0, for AP
6427 * mac-addr.
6432 * @sp_length: the size of the SP in actual number of frames
6436 * The device contains an internal table of per-station information, with info
6441 * entry, or modifying a pre-existing one.
6472 * @IWM_STA_LINK: Link station - normal RX and TX traffic.
6473 * @IWM_STA_GENERAL_PURPOSE: General purpose. In AP mode used for beacons
6486 * struct iwm_add_sta_key_common - add/modify sta key common part
6488 * @sta_id: index of station in uCode's station table
6489 * @key_offset: key offset in key storage
6503 * struct iwm_add_sta_key_cmd_v1 - add/modify sta key
6507 * @tkip_rx_ttak: 10-byte unicast TKIP TTAK for Rx
6517 * struct iwm_add_sta_key_cmd - add/modify sta key
6531 * status in the response to ADD_STA command
6533 * @IWM_ADD_STA_STATIONS_OVERLOAD: no room left in the fw's station table
6544 * struct iwm_rm_sta_cmd - Add / modify a station in the fw's station table
6610 * struct iwm_bt_coex_cmd - bt coex configuration command
6623 * Location Aware Regulatory (LAR) API - MCC updates
6627 * struct iwm_mcc_update_cmd_v1 - Request the device to update geographic
6629 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
6630 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
6631 * MCC in the cmd response will be the relevant MCC in the NVM.
6643 * struct iwm_mcc_update_cmd - Request the device to update geographic
6645 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
6646 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
6647 * MCC in the cmd response will be the relevant MCC in the NVM.
6663 * iwm_mcc_update_resp_v1 - response to MCC_UPDATE_CMD.
6666 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
6671 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
6686 * iwm_mcc_update_resp_v2 - response to MCC_UPDATE_CMD.
6689 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
6694 * @time: time elapsed from the MCC test start (in 30 seconds TU)
6696 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
6716 * iwm_mcc_update_resp_v3 - response to MCC_UPDATE_CMD.
6719 * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
6724 * @time: time elapsed from the MCC test start (in 30 seconds TU)
6726 * @n_channels: number of channels in @channels_data (may be 14, 39, 50 or 51
6743 * struct iwm_mcc_chub_notif - chub notifies of mcc change
6750 * The MCC is two letter-code, ascii upper case[A-Z] or '00' for world domain.
6751 * 'ZZ' MCC will be used to switch to NVM default profile; in this case, the
6752 * MCC in the cmd response will be the relevant MCC in the NVM.
6787 * struct iwm_dts_measurement_notif_v1 - measurements notification
6798 * struct iwm_dts_measurement_notif_v2 - measurements notification
6812 * Some cherry-picked definitions
6821 * header from 4 bytes to 8 bytes to introduce a group (in place of the
6825 * These functions retrieve specific information from the id field in
6881 #define IWM_MAX_CMD_PAYLOAD_SIZE ((4096 - 4) - sizeof(struct iwm_cmd_header))
6899 uint8_t data_wide[IWM_DEF_CMD_PAYLOAD_SIZE -
6914 * 28-26: Reserved
6919 * 21-16: RX queue
6920 * 15-14: Reserved
6921 * 13-00: RX frame size
6940 return le32toh(pkt->len_n_flags) & IWM_FH_RSCSR_FRAME_SIZE_MSK; in iwm_rx_packet_len()
6947 return iwm_rx_packet_len(pkt) - sizeof(pkt->hdr); in iwm_rx_packet_payload_len()
6951 #define IWM_MIN_DBM -100
6952 #define IWM_MAX_DBM -33 /* realistic guess */
6955 bus_space_read_4((sc)->sc_st, (sc)->sc_sh, (reg))
6958 bus_space_write_4((sc)->sc_st, (sc)->sc_sh, (reg), (val))
6961 bus_space_write_1((sc)->sc_st, (sc)->sc_sh, (reg), (val))
6970 bus_space_barrier((sc)->sc_st, (sc)->sc_sh, 0, (sc)->sc_sz, \
6974 bus_space_barrier((sc)->sc_st, (sc)->sc_sh, 0, (sc)->sc_sz, \