Lines Matching +full:fw +full:- +full:cfg
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
3 * Copyright (C) 2024-2025 Intel Corporation
11 #include "iwl-trans.h"
12 #include "iwl-op-mode.h"
13 #include "fw/runtime.h"
14 #include "fw/notif-wait.h"
15 #include "fw/api/commands.h"
16 #include "fw/api/scan.h"
17 #include "fw/api/mac-cfg.h"
18 #include "fw/api/mac.h"
19 #include "fw/api/phy-ctxt.h"
20 #include "fw/api/datapath.h"
21 #include "fw/api/rx.h"
22 #include "fw/api/rs.h"
23 #include "fw/api/context.h"
24 #include "fw/api/coex.h"
25 #include "fw/api/location.h"
27 #include "fw/dbg.h"
37 #include "ftm-initiator.h"
44 * the WiFi-7 features. MLD stands for multi-link device. Note that there are
45 * devices that do not support WiFi-7 or even WiFi 6E and yet use iwlmld, but
46 * the firmware APIs used in this driver are WiFi-7 compatible.
51 * interface defined in iwl-op-mode.h to interact with the transport layer
60 * relies on cfg80211's wiphy->mtx and takes the lock when needed. All the
83 * - struct iwl_mld (matches mac80211's struct ieee80211_hw)
85 * - struct iwl_mld_vif (matches macu80211's struct ieee80211_vif)
89 * - struct iwl_mld_sta (matches mac80211's struct ieee80211_sta)
102 * struct iwl_mld - MLD op mode
104 * @fw_id_to_bss_conf: maps a fw id of a link to the corresponding
106 * @fw_id_to_vif: maps a fw id of a MAC context to the corresponding
107 * ieee80211_vif. Mapping is valid only when the MAC exists in the fw.
108 * @fw_id_to_txq: maps a fw id of a txq to the corresponding
112 * @num_igtks: the number if iGTKs that were sent to the FW.
115 * @monitor.ampdu_ref: the id of the A-MPDU for sniffer
116 * @monitor.ampdu_toggle: the state of the previous packet to track A-MPDU
122 * @fw_id_to_link_sta: maps a fw id of a sta to the corresponding
124 * preserve the fw sta ids during a restart (for SN/PN restoring).
125 * FW ids of internal stations will be mapped to ERR_PTR, and will be
126 * re-allocated during a restart, so make sure to free it in restart
128 * @netdetect: indicates the FW is in suspend mode with netdetect configured
133 * @cfg: pointer to the device configuration
134 * @fw: a pointer to the fw object
138 * @fwrt: fw runtime data
143 * When &async_handlers_wk runs - it runs these handlers one by one.
149 * @fw_status: bitmap of fw status bits
152 * @in_d3: indicates FW is in suspend mode and should be resumed
169 * @fw_id_to_ba: maps a fw (BA) id to a corresponding Block Ack session data.
178 * from firmware upon fw/hw error and sent back to the firmware in
182 * TX rate_n_flags for non-STA mgmt frames (toggles on every TX failure).
183 * @fw_rates_ver_3: FW rates are in version 3
184 * @low_latency: low-latency manager.
221 /* And here fields that survive a fw restart */
224 const struct iwl_rf_cfg *cfg; member
225 const struct iwl_fw *fw; member
301 memset((void *)&(_ptr)->zeroed_on_hw_restart, 0, \
302 sizeof((_ptr)->zeroed_on_hw_restart))
309 CLEANUP_STRUCT(&mld->scan); in iwl_cleanup_mld()
312 mld->fw_status.in_d3 = false; in iwl_cleanup_mld()
324 * struct iwl_mld_mod_params - module parameters for iwlmld
335 ((struct iwl_mld *)(_iwl_op_mode)->op_mode_specific)
338 IWL_OP_MODE_GET_MLD((struct iwl_op_mode *)((_hw)->priv))
356 mld->radio_kill.ct = state; in iwl_mld_set_ctkill()
358 wiphy_rfkill_set_hw_state(mld->wiphy, in iwl_mld_set_ctkill()
359 mld->radio_kill.hw || mld->radio_kill.ct); in iwl_mld_set_ctkill()
364 mld->radio_kill.hw = state; in iwl_mld_set_hwkill()
366 wiphy_rfkill_set_hw_state(mld->wiphy, in iwl_mld_set_hwkill()
367 mld->radio_kill.hw || mld->radio_kill.ct); in iwl_mld_set_hwkill()
372 u8 tx_ant = mld->fw->valid_tx_ant; in iwl_mld_get_valid_tx_ant()
374 if (mld->nvm_data && mld->nvm_data->valid_tx_ant) in iwl_mld_get_valid_tx_ant()
375 tx_ant &= mld->nvm_data->valid_tx_ant; in iwl_mld_get_valid_tx_ant()
382 u8 rx_ant = mld->fw->valid_rx_ant; in iwl_mld_get_valid_rx_ant()
384 if (mld->nvm_data && mld->nvm_data->valid_rx_ant) in iwl_mld_get_valid_rx_ant()
385 rx_ant &= mld->nvm_data->valid_rx_ant; in iwl_mld_get_valid_rx_ant()
432 return is_lb ? rate : -1; in iwl_mld_legacy_hw_idx_to_mac80211_idx()
440 * which can't acquire the wiphy->mutex.
441 * @RX_HANDLER_ASYNC: If the handler needs to hold wiphy->mutex
443 * it will be called from a worker with wiphy->mutex held.
451 * struct iwl_rx_handler: handler for FW notification
500 const struct iwl_rf_cfg *cfg, const struct iwl_fw *fw,
513 u8 arr_sz = ARRAY_SIZE(mld->fw_id_to_##_mac80211_type); \
516 arr_sz = mld->fw->ucode_capa.num_stations; \
519 arr_sz = mld->fw->ucode_capa.num_links; \
522 if (rcu_access_pointer(mld->fw_id_to_##_mac80211_type[idx])) \
526 rcu_assign_pointer(mld->fw_id_to_##_mac80211_type[idx], mac80211_ptr); \
529 return -ENOSPC; \
535 if (IWL_FW_CHECK(mld, fw_link_id >= mld->fw->ucode_capa.num_links, in iwl_mld_fw_id_to_link_conf()
539 return wiphy_dereference(mld->wiphy, in iwl_mld_fw_id_to_link_conf()
540 mld->fw_id_to_bss_conf[fw_link_id]); in iwl_mld_fw_id_to_link_conf()
576 if (!fw_has_capa(&mld->fw->ucode_capa, in iwl_mld_get_lmac_id()
586 return mld->fw_status.in_hw_restart && in iwl_mld_error_before_recovery()
587 !iwl_trans_fw_running(mld->trans); in iwl_mld_error_before_recovery()