Lines Matching +full:queue +full:- +full:pkt +full:- +full:tx
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
3 * Copyright (C) 2005-2014, 2018-2023 Intel Corporation
4 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5 * Copyright (C) 2016-2017 Intel Deutschland GmbH
15 #include "iwl-debug.h"
16 #include "iwl-config.h"
18 #include "iwl-op-mode.h"
22 #include "fw/api/dbg-tlv.h"
23 #include "iwl-dbg-tlv.h"
26 #include "iwl-modparams.h"
30 * DOC: Transport layer - what is it ?
67 #define FH_RSCSR_FRAME_SIZE_MSK 0x00003FFF /* bits 0-13 */
83 * 28-27: Reserved
89 * 21-16: RX queue
90 * 15-14: Reserved
91 * 13-00: RX frame size
98 static inline u32 iwl_rx_packet_len(const struct iwl_rx_packet *pkt)
100 return le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK;
103 static inline u32 iwl_rx_packet_payload_len(const struct iwl_rx_packet *pkt)
105 return iwl_rx_packet_len(pkt) - sizeof(pkt->hdr);
109 * enum CMD_MODE - how to send the host commands ?
114 * @CMD_SEND_IN_RFKILL: Send the command even if the NIC is in RF-kill.
118 * trans->system_pm_mode to IWL_PLAT_PM_MODE_D3.
134 * For allocation of the command and tx queues, this establishes the overall
151 u8 payload_wide[DEF_CMD_PAYLOAD_SIZE -
159 * struct iwl_device_tx_cmd - buffer for TX command
179 * enum iwl_hcmd_dataflag - flag for each one of the chunks of the command
209 * struct iwl_host_cmd - Host command to the uCode
241 free_pages(cmd->_rx_page_addr, cmd->_rx_page_order);
243 __free_pages(cmd->_page, cmd->_rx_page_order);
257 return (void *)((unsigned long)page_address(r->_page) + r->_offset);
262 return r->_offset;
267 r->_page_stolen = true;
268 get_page(r->_page);
269 return r->_page;
274 __free_pages(r->_page, r->_rx_page_order);
279 #define IWL_MASK(lo, hi) ((1 << (hi)) | ((1 << (hi)) - (1 << (lo))))
295 * enum iwl_d3_status - WoWLAN image/device status
310 * @STATUS_RFKILL_HW: the actual HW state of the RF-kill switch
311 * @STATUS_RFKILL_OPMODE: RF-kill state reported to opmode
313 * @STATUS_TRANS_DEAD: trans is dead - avoid any read/write operation
343 return -1;
382 * struct iwl_dump_sanitize_ops - dump sanitization operations
383 * @frob_txf: Scrub the TX FIFO data
396 * struct iwl_trans_config - transport configuration
399 * @cmd_queue: the index of the command queue.
402 * @cmd_q_wdg_timeout: the timeout of the watchdog timer for the command queue.
408 * @rx_buf_size: RX buffer size needed for A-MSDUs
412 * @scd_set_active: should the transport configure the SCD for HCMD queue
416 * @cb_data_offs: offset inside skb->cb to store transport data at, must have
419 * @queue_alloc_cmd_ver: queue allocation command version, set to 0
459 * struct iwl_trans_rxq_dma_data - RX queue DMA data
476 * struct iwl_pnvm_image - contains info about the parsed pnvm image
491 * enum iwl_trans_state - state of the transport layer
506 * In system-wide power management the entire platform goes into a low
512 * mode is dictated by the wake-on-WLAN configuration.
516 * - D0: the device is fully powered and the host is awake;
517 * - D3: the device is in low power mode and only reacts to
518 * specific events (e.g. magic-packet received or scan
526 * enum iwl_plat_pm_mode - platform power management mode
529 * behavior when in system-wide suspend (i.e WoWLAN).
532 * device. In system-wide suspend mode, it means that the all
571 * struct iwl_dram_regions - DRAM regions container structure
585 * struct iwl_fw_mon - fw monitor per allocation id
595 * struct iwl_self_init_dram - dram data used by self init process
609 * struct iwl_imr_data - imr dram data used during debug process
631 * struct iwl_pc_data - program counter details
641 * struct iwl_trans_debug - transport debug related data
730 /* sg_offset is valid if it is non-zero */
760 * struct iwl_txq - Tx Queue for DMA
763 * the writeback -- this is DMA memory and an array holding one buffer
764 * for each command on the queue
767 * @lock: queue lock
769 * @stuck_timer: timer that fires if queue gets stuck
772 * @ampdu: true if this queue is an ampdu queue for an specific RA/TID
773 * @wd_timeout: queue watchdog timeout (jiffies) - per queue
774 * @frozen: tx stuck queue timer is frozen
776 * @block: queue is blocked
777 * @bc_tbl: byte count table of the queue (relevant only for gen2 transport)
778 * @write_ptr: 1-st empty entry (index) host_w
781 * @n_window: safe queue window
782 * @id: queue id
783 * @low_mark: low watermark, resume queue if free space more than this
784 * @high_mark: high watermark, stop queue if free space less than this
785 * @overflow_q: overflow queue for handling frames that didn't fit on HW queue
788 * A Tx queue consists of circular buffer of BDs (a.k.a. TFDs, transmit frame
793 * there might be HW changes in the future). For the normal TX
794 * queues, n_window, which is the size of the software queue data
795 * is also 256; however, for the command queue, n_window is only
802 * data is a window overlayed over the HW queue.
809 /* lock for syncing changes on the queue */
836 * struct iwl_trans - transport common data
840 * @trans_cfg: the trans-specific configuration part
844 * @status: a bit-mask of transport status flags
852 * @hw_id: a u32 with the ID of the device / sub-device.
867 * @wait_command_queue: wait queue for sync commands
872 * @dev_cmd_pool: pool for Tx cmd allocation - for internal use only.
874 * @dev_cmd_pool_name: name for the TX command allocation pool
883 * @system_pm_mode: the system-wide power management mode in use.
891 * @invalid_tx_cmd: invalid TX command buffer
997 return kmem_cache_zalloc(trans->dev_cmd_pool, GFP_ATOMIC);
1005 kmem_cache_free(trans->dev_cmd_pool, dev_cmd);
1009 struct iwl_device_tx_cmd *dev_cmd, int queue);
1011 void iwl_trans_reclaim(struct iwl_trans *trans, int queue, int ssn,
1014 void iwl_trans_set_q_ptrs(struct iwl_trans *trans, int queue, int ptr);
1016 void iwl_trans_txq_disable(struct iwl_trans *trans, int queue,
1019 bool iwl_trans_txq_enable_cfg(struct iwl_trans *trans, int queue, u16 ssn,
1023 int iwl_trans_get_rxq_dma_data(struct iwl_trans *trans, int queue,
1026 void iwl_trans_txq_free(struct iwl_trans *trans, int queue);
1034 static inline void iwl_trans_txq_enable(struct iwl_trans *trans, int queue,
1047 iwl_trans_txq_enable_cfg(trans, queue, ssn, &cfg, queue_wdg_timeout);
1051 void iwl_trans_ac_txq_enable(struct iwl_trans *trans, int queue, int fifo,
1056 .sta_id = -1,
1062 iwl_trans_txq_enable_cfg(trans, queue, 0, &cfg, queue_wdg_timeout);
1070 int iwl_trans_wait_txq_empty(struct iwl_trans *trans, int queue);
1139 if (WARN_ON_ONCE(!trans->op_mode))
1143 if (!test_and_set_bit(STATUS_FW_ERROR, &trans->status)) {
1144 trans->state = IWL_TRANS_NO_FW;
1145 iwl_op_mode_nic_error(trans->op_mode, sync);
1151 return trans->state == IWL_TRANS_FW_ALIVE;
1175 return trans->dbg.internal_ini_cfg != IWL_INI_CFG_STATE_NOT_LOADED ||
1176 trans->dbg.external_ini_cfg != IWL_INI_CFG_STATE_NOT_LOADED;