Lines Matching +full:needs +full:- +full:double +full:- +full:reset

1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
3 * Copyright (C) 2005-2014, 2018-2025 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 ?
55 * 5) Then when finished (or reset):
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
100 return le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK; in iwl_rx_packet_len()
105 return iwl_rx_packet_len(pkt) - sizeof(pkt->hdr); in iwl_rx_packet_payload_len()
109 * enum CMD_MODE - how to send the host commands ?
112 * @CMD_WANT_SKB: Not valid with CMD_ASYNC. The caller needs the buffer of
113 * the response. The caller needs to call iwl_free_resp when done.
114 * @CMD_SEND_IN_RFKILL: Send the command even if the NIC is in RF-kill.
147 u8 payload_wide[DEF_CMD_PAYLOAD_SIZE -
155 * struct iwl_device_tx_cmd - buffer for TX command
175 * enum iwl_hcmd_dataflag - flag for each one of the chunks of the command
205 * struct iwl_host_cmd - Host command to the uCode
237 free_pages(cmd->_rx_page_addr, cmd->_rx_page_order); in iwl_free_resp()
239 __free_pages(cmd->_page, cmd->_rx_page_order); in iwl_free_resp()
253 return (void *)((unsigned long)page_address(r->_page) + r->_offset); in rxb_addr()
258 return r->_offset; in rxb_offset()
263 r->_page_stolen = true; in rxb_steal_page()
264 get_page(r->_page); in rxb_steal_page()
265 return r->_page; in rxb_steal_page()
270 __free_pages(r->_page, r->_rx_page_order); in iwl_free_rxb()
275 #define IWL_MASK(lo, hi) ((1 << (hi)) | ((1 << (hi)) - (1 << (lo))))
291 * enum iwl_d3_status - WoWLAN image/device status
293 * @IWL_D3_STATUS_RESET: device was reset while suspended
306 * @STATUS_RFKILL_HW: the actual HW state of the RF-kill switch
307 * @STATUS_RFKILL_OPMODE: RF-kill state reported to opmode
309 * @STATUS_TRANS_DEAD: trans is dead - avoid any read/write operation
312 * @STATUS_IN_SW_RESET: device is undergoing reset, cleared by opmode
314 * @STATUS_RESET_PENDING: reset worker was scheduled, but didn't dump
316 * @STATUS_TRANS_RESET_IN_PROGRESS: reset is still in progress, don't
317 * attempt another reset yet
351 return -1; in iwl_trans_get_rb_size_order()
390 * struct iwl_dump_sanitize_ops - dump sanitization operations
404 * struct iwl_trans_config - transport configuration
416 * @rx_buf_size: RX buffer size needed for A-MSDUs
422 * @cb_data_offs: offset inside skb->cb to store transport data at, must have
424 * @fw_reset_handshake: firmware supports reset flow handshake
481 * struct iwl_trans_rxq_dma_data - RX queue DMA data
498 * struct iwl_pnvm_image - contains info about the parsed pnvm image
513 * enum iwl_trans_state - state of the transport layer
528 * In system-wide power management the entire platform goes into a low
534 * mode is dictated by the wake-on-WLAN configuration.
538 * - D0: the device is fully powered and the host is awake;
539 * - D3: the device is in low power mode and only reacts to
540 * specific events (e.g. magic-packet received or scan
576 * struct iwl_dram_regions - DRAM regions container structure
590 * struct iwl_fw_mon - fw monitor per allocation id
600 * struct iwl_self_init_dram - dram data used by self init process
614 * struct iwl_imr_data - imr dram data used during debug process
636 * struct iwl_pc_data - program counter details
646 * struct iwl_trans_debug - transport debug related data
672 * @last_tp_resetfw: last handling of reset during debug timepoint
731 /* sg_offset is valid if it is non-zero */
761 * struct iwl_txq - Tx Queue for DMA
764 * the writeback -- this is DMA memory and an array holding one buffer
774 * @wd_timeout: queue watchdog timeout (jiffies) - per queue
779 * @write_ptr: 1-st empty entry (index) host_w
837 * struct iwl_trans_info - transport info for outside use
847 * @hw_id: the ID of the device / sub-device
848 * Bits 0:15 represent the sub-device ID
869 * struct iwl_trans - transport common data
873 * @mac_cfg: the trans-specific configuration part
878 * @status: a bit-mask of transport status flags
887 * @dev_cmd_pool: pool for Tx cmd allocation - for internal use only.
898 * @restart.mode: reset/restart error mode information
899 * @restart.during_reset: error occurred during previous software reset
901 * @request_top_reset: TOP reset was requested, used by the reset
903 * @do_top_reset: indication to the (PCIe) transport/context-info
904 * to do the TOP reset
972 int iwl_trans_d3_suspend(struct iwl_trans *trans, bool test, bool reset);
975 bool test, bool reset);
985 return kmem_cache_zalloc(trans->dev_cmd_pool, GFP_ATOMIC); in iwl_trans_alloc_tx_cmd()
993 kmem_cache_free(trans->dev_cmd_pool, dev_cmd); in iwl_trans_free_tx_cmd()
1044 .sta_id = -1, in iwl_trans_ac_txq_enable()
1129 if (test_bit(STATUS_TRANS_DEAD, &trans->status)) in iwl_trans_schedule_reset()
1132 if (test_and_set_bit(STATUS_TRANS_RESET_IN_PROGRESS, &trans->status)) in iwl_trans_schedule_reset()
1135 trans->restart.mode.type = type; in iwl_trans_schedule_reset()
1136 trans->restart.mode.context = IWL_ERR_CONTEXT_WORKER; in iwl_trans_schedule_reset()
1138 set_bit(STATUS_RESET_PENDING, &trans->status); in iwl_trans_schedule_reset()
1144 trans->restart.during_reset = test_bit(STATUS_IN_SW_RESET, in iwl_trans_schedule_reset()
1145 &trans->status); in iwl_trans_schedule_reset()
1146 queue_delayed_work(system_unbound_wq, &trans->restart.wk, 0); in iwl_trans_schedule_reset()
1152 if (WARN_ON_ONCE(!trans->op_mode)) in iwl_trans_fw_error()
1155 /* prevent double restarts due to the same erroneous FW */ in iwl_trans_fw_error()
1156 if (!test_and_set_bit(STATUS_FW_ERROR, &trans->status)) { in iwl_trans_fw_error()
1157 trans->state = IWL_TRANS_NO_FW; in iwl_trans_fw_error()
1158 iwl_op_mode_nic_error(trans->op_mode, type); in iwl_trans_fw_error()
1166 if (WARN_ON_ONCE(!trans->op_mode)) in iwl_trans_opmode_sw_reset()
1169 set_bit(STATUS_IN_SW_RESET, &trans->status); in iwl_trans_opmode_sw_reset()
1174 if (!trans->op_mode->ops->sw_reset || in iwl_trans_opmode_sw_reset()
1175 !trans->op_mode->ops->sw_reset(trans->op_mode, type)) in iwl_trans_opmode_sw_reset()
1176 clear_bit(STATUS_IN_SW_RESET, &trans->status); in iwl_trans_opmode_sw_reset()
1181 return trans->state == IWL_TRANS_FW_ALIVE; in iwl_trans_fw_running()
1205 return trans->dbg.internal_ini_cfg != IWL_INI_CFG_STATE_NOT_LOADED || in iwl_trans_dbg_ini_valid()
1206 trans->dbg.external_ini_cfg != IWL_INI_CFG_STATE_NOT_LOADED; in iwl_trans_dbg_ini_valid()
1213 clear_bit(STATUS_IN_SW_RESET, &trans->status); in iwl_trans_finish_sw_reset()
1235 u16 result = trans->cfg->num_rbds; in iwl_trans_get_num_rbds()
1239 * frames into the same buffer, so double the value for them. in iwl_trans_get_num_rbds()
1241 if (trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) in iwl_trans_get_num_rbds()
1248 set_bit(STATUS_SUPPRESS_CMD_ERROR_ONCE, &trans->status); in iwl_trans_suppress_cmd_error_once()
1253 return test_bit(STATUS_DEVICE_ENABLED, &trans->status); in iwl_trans_device_enabled()
1258 return test_bit(STATUS_TRANS_DEAD, &trans->status); in iwl_trans_is_dead()
1272 /* TOP reset doesn't require PCIe remove */
1280 /* keep last - special backoff value */
1296 write = (void *)(uintptr_t)&trans->info; in iwl_trans_set_info()
1302 return u32_get_bits(trans->info.hw_id, GENMASK(31, 16)); in iwl_trans_get_device_id()