Lines Matching +full:low +full:- +full:latency

1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
3 * Copyright (C) 2012-2014, 2018-2024 Intel Corporation
4 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5 * Copyright (C) 2016-2017 Intel Deutschland GmbH
26 #include "iwl-op-mode.h"
27 #include "iwl-trans.h"
28 #include "fw/notif-wait.h"
29 #include "iwl-nvm-utils.h"
31 #include "iwl-config.h"
33 #include "fw-api.h"
38 #include "mei/iwl-mei.h"
39 #include "iwl-nvm-parse.h"
57 * 0" TBTT when the CSA time-event needs to be scheduled to start. It
90 * struct iwl_mvm_mod_params - module parameters for iwlmvm
123 * mvm->time_event_lock is held, as it value is used to indicate
136 * @IWL_POWER_SCHEME_LP: Low Power
224 * enum iwl_mvm_low_latency_force - low latency force mode set by debugfs
226 * @LOW_LATENCY_FORCE_ON: for low latency on
227 * @LOW_LATENCY_FORCE_OFF: for low latency off
238 * enum iwl_mvm_low_latency_cause - low latency set causes
239 * @LOW_LATENCY_TRAFFIC: indicates low latency traffic was detected
240 * @LOW_LATENCY_DEBUGFS: low latency mode set from debugfs
241 * @LOW_LATENCY_VCMD: low latency mode set from vendor command
242 * @LOW_LATENCY_VIF_TYPE: low latency mode set because of vif type (ap)
245 * @LOW_LATENCY_DEBUGFS_FORCE: low latency force mode from debugfs
259 * struct iwl_mvm_link_bf_data - beacon filtering related data
275 * struct iwl_probe_resp_data - data for NoA/CSA updates
287 * struct iwl_mvm_vif_link_info - per link data in Virtual Interface
288 * @ap_sta_id: the sta_id of the AP - valid only if VIF type is STA
300 * @he_ru_2mhz_block: 26-tone RU OFDMA transmissions should be blocked
305 * @cab_queue: content-after-beacon (multicast) queue
350 * enum iwl_mvm_esr_state - defines reasons for which the EMLSR is exited or
352 * The low 16 bits are used for blocking reasons, and the 16 higher bits
354 * For the blocking reasons - use iwl_mvm_(un)block_esr(), and for the exit
355 * reasons - use iwl_mvm_exit_esr().
364 * @IWL_MVM_ESR_BLOCKED_NON_BSS: An active non-BSS interface's link is
366 * @IWL_MVM_ESR_BLOCKED_ROC: remain-on-channel is preventing EMLSR
369 * due to low RSSI.
375 * @IWL_MVM_ESR_EXIT_LINK_USAGE: Exit EMLSR due to low tpt on secondary link
397 * struct iwl_mvm_esr_exit - details of the last exit from EMLSR mode.
408 * struct iwl_mvm_vif - data per Virtual Interface, it is a MAC context
414 * @ap_assoc_sta_count: count of stations associated to us - valid only
419 * @pm_enabled - indicate if MAC power management is allowed
422 * @low_latency: bit flags for low latency
424 * @low_latency_actual: boolean, indicates low latency is set,
438 * @deflink: default link data for use in non-MLO
486 * @uapsd_misbehaving_ap_addr: MLD address/BSSID of U-APSD misbehaving AP, to
487 * not use U-APSD on reconnection
489 * in U-APSD
599 link_id < ARRAY_SIZE((mvm_vif)->link); \
601 if ((mvm_vif)->link[link_id])
606 return (void *)vif->drv_priv;
653 * struct iwl_mvm_tt_mgmt - Thermal Throttling Management structure
672 * struct iwl_mvm_thermal_device - thermal zone related data
715 #define IWL_MVM_DEBUG_SET_TEMPERATURE_MIN -100
773 * struct iwl_mvm_reorder_buffer - per ra/tid/queue reorder buffer
793 * struct iwl_mvm_reorder_buf_entry - reorder buffer entry per-queue/per-seqno
806 * struct iwl_mvm_baid_data - BA session data
841 return (void *)((u8 *)buf -
842 offsetof(struct iwl_mvm_baid_data, reorder_buf) -
843 sizeof(*buf) * buf->queue);
847 * enum iwl_mvm_queue_status - queue status
893 return (void *)txq->drv_priv;
902 return (void *)sta->txq[tid]->drv_priv;
906 * struct iwl_mvm_tvqm_txq_info - maps TVQM hw queue to tid
965 * struct iwl_mvm_acs_survey_channel - per-channel survey information
989 /* Storage space for per-channel information follows */
1023 * for beacon filtering -
1089 /* Scan status, cmd (pre-allocated) and auxiliary station */
1094 /* For CDB this is low band scan type, for non-CDB - type. */
1174 /* -1 for always, 0 for never, >0 for that many times */
1202 u32 last_netdetect_scans; /* no. of scans in the last net-detect wake */
1208 /* BT-Coex */
1281 * Current cs sta - might be different from periodic cs peer
1282 * station. Value is meaningless when the cs-state is idle.
1286 /* TDLS periodic channel-switch peer */
1295 /* timestamp of last ch-sw request sent (GP2 time) */
1377 ((struct iwl_mvm *)(_iwl_op_mode)->op_mode_specific)
1380 IWL_OP_MODE_GET_MVM((struct iwl_op_mode *)((_hw)->priv))
1382 DEFINE_GUARD(mvm, struct iwl_mvm *, mutex_lock(&_T->mutex), mutex_unlock(&_T->mutex))
1385 * enum iwl_mvm_status - MVM status bits
1386 * @IWL_MVM_STATUS_HW_RFKILL: HW RF-kill is asserted
1387 * @IWL_MVM_STATUS_HW_CTKILL: CT-kill is active
1388 * @IWL_MVM_STATUS_ROC_P2P_RUNNING: remain-on-channel on P2P is running (when
1392 * @IWL_MVM_STATUS_ROC_AUX_RUNNING: AUX remain-on-channel is running
1426 return test_bit(IWL_MVM_STATUS_HW_RFKILL, &mvm->status) ||
1427 test_bit(IWL_MVM_STATUS_HW_CTKILL, &mvm->status);
1432 return test_bit(IWL_MVM_STATUS_HW_RFKILL, &mvm->status);
1437 return test_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status);
1448 if (sta_id >= mvm->fw->ucode_capa.num_stations)
1451 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]);
1465 if (sta_id >= mvm->fw->ucode_capa.num_stations)
1468 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id],
1469 lockdep_is_held(&mvm->mutex));
1481 if (WARN_ON(vif_id >= ARRAY_SIZE(mvm->vif_id_to_mac)))
1485 return rcu_dereference(mvm->vif_id_to_mac[vif_id]);
1487 return rcu_dereference_protected(mvm->vif_id_to_mac[vif_id],
1488 lockdep_is_held(&mvm->mutex));
1494 if (IWL_FW_CHECK(mvm, link_id >= ARRAY_SIZE(mvm->link_id_to_link_conf),
1499 return rcu_dereference(mvm->link_id_to_link_conf[link_id]);
1501 return rcu_dereference_protected(mvm->link_id_to_link_conf[link_id],
1502 lockdep_is_held(&mvm->mutex));
1507 return fw_has_api(&mvm->fw->ucode_capa,
1513 return fw_has_api(&mvm->fw->ucode_capa,
1519 return fw_has_api(&mvm->fw->ucode_capa,
1526 return fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_OCE);
1531 return fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_FRAG_EBS);
1536 return fw_has_api(&mvm->fw->ucode_capa,
1554 bool nvm_lar = mvm->nvm_data->lar_enabled;
1555 bool tlv_lar = fw_has_capa(&mvm->fw->ucode_capa,
1562 if (mvm->cfg->nvm_type == IWL_NVM_EXT)
1570 return fw_has_api(&mvm->fw->ucode_capa,
1572 fw_has_capa(&mvm->fw->ucode_capa,
1578 return fw_has_capa(&mvm->fw->ucode_capa,
1585 return fw_has_capa(&mvm->fw->ucode_capa,
1592 return fw_has_capa(&mvm->fw->ucode_capa,
1600 return fw_has_capa(&mvm->fw->ucode_capa,
1608 return fw_has_capa(&mvm->fw->ucode_capa,
1614 return fw_has_capa(&fw->ucode_capa,
1626 /* TODO - replace with TLV once defined */
1627 return mvm->trans->trans_cfg->gen2;
1632 /* TODO - better define this */
1633 return mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_22000;
1642 * There is a compilation for CDB and non-CDB FW, but there may
1645 * runtime check will also have to be here - once defined.
1647 return fw_has_capa(&mvm->fw->ucode_capa,
1658 return mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_22000;
1663 return fw_has_api(&mvm->fw->ucode_capa,
1670 return fw_has_api(&mvm->fw->ucode_capa,
1676 return fw_has_api(&mvm->fw->ucode_capa,
1682 return fw_has_api(&mvm->fw->ucode_capa,
1688 return fw_has_api(&mvm->fw->ucode_capa,
1694 return fw_has_api(&mvm->fw->ucode_capa,
1700 return fw_has_capa(&mvm->fw->ucode_capa,
1708 return &((struct iwl_mvm_tx_resp *)tx_resp)->status;
1710 return ((struct iwl_mvm_tx_resp_v3 *)tx_resp)->status;
1715 /* these two TLV are redundant since the responsibility to CT-kill by
1719 return fw_has_capa(&mvm->fw->ucode_capa,
1721 fw_has_capa(&mvm->fw->ucode_capa,
1727 return fw_has_capa(&mvm->fw->ucode_capa,
1733 if ((CSR_HW_RFID_TYPE(trans->hw_rf_id) == IWL_CFG_RF_TYPE_FM) &&
1734 !CSR_HW_RFID_IS_CDB(trans->hw_rf_id))
1736 return CSR_HW_RFID_STEP(trans->hw_rf_id);
1744 struct iwl_trans *trans = mvm->fwrt.trans;
1746 if (vif->type == NL80211_IFTYPE_AP)
1747 return mvm->fw->ucode_capa.num_beacons;
1751 (CSR_HW_RFID_TYPE(trans->hw_rf_id) == IWL_CFG_RF_TYPE_FM &&
1752 CSR_HW_RFID_IS_CDB(trans->hw_rf_id)))
1765 if (mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_BZ)
1806 iwl_fwrt_dump_error_logs(&mvm->fwrt);
1866 struct ieee80211_key_conf *keyconf = info->control.hw_key;
1868 tx_cmd->sec_ctl = TX_CMD_SEC_CCM;
1869 memcpy(tx_cmd->key, keyconf->key, keyconf->keylen);
1874 flush_work(&mvm->async_handlers_wk);
1903 u8 tx_ant = mvm->fw->valid_tx_ant;
1905 if (mvm->nvm_data && mvm->nvm_data->valid_tx_ant)
1906 tx_ant &= mvm->nvm_data->valid_tx_ant;
1908 if (mvm->set_tx_ant)
1909 tx_ant &= mvm->set_tx_ant;
1916 u8 rx_ant = mvm->fw->valid_rx_ant;
1918 if (mvm->nvm_data && mvm->nvm_data->valid_rx_ant)
1919 rx_ant &= mvm->nvm_data->valid_rx_ant;
1921 if (mvm->set_rx_ant)
1922 rx_ant &= mvm->set_rx_ant;
1943 return mvm->fw->phy_config & phy_config;
2144 * struct iwl_mvm_roc_ops - callbacks for the remain_on_channel()
2147 * non-MLD versions of remain_on_channel() is these function calls,
2187 return &cmd->quotas[i];
2189 quotas = (struct iwl_time_quota_data_v1 *)cmd->quotas;
2377 /* Low latency */
2381 /* get SystemLowLatencyMode - only needed for beacon threshold? */
2393 * Normally low-latency should only be active on interfaces
2398 * the current desired low-latency state.
2400 return mvmvif->low_latency_actual;
2410 mvmvif->low_latency |= cause;
2412 mvmvif->low_latency &= ~cause;
2418 if (mvmvif->low_latency & LOW_LATENCY_DEBUGFS_FORCE_ENABLE &&
2426 new_state = !!(mvmvif->low_latency &
2430 * Check if any other one set low latency
2432 new_state = !!(mvmvif->low_latency &
2436 mvmvif->low_latency_actual = new_state;
2444 return ((BIT(mvm->trans->trans_cfg->base_params->num_of_queues) - 1) &
2450 /* Thermal management and CT-kill */
2533 * We use TID 4 (VI) as a FW-used-only TID when TDLS connections are present.
2682 * struct iwl_mvm_switch_vif_chanctx_ops - callbacks for switch_vif_chanctx()
2685 * non-MLD versions of switch_vif_chanctx() is these function calls,
2717 return fw_has_capa(&mvm->fw->ucode_capa,
2732 sizeof(struct iwl_fw_channel_info) -
2742 ci->channel = cpu_to_le32(chan);
2743 ci->band = band;
2744 ci->width = width;
2745 ci->ctrl_pos = ctrl_pos;
2750 ci_v1->channel = chan;
2751 ci_v1->band = band;
2752 ci_v1->width = width;
2753 ci_v1->ctrl_pos = ctrl_pos;
2762 enum nl80211_band band = chandef->chan->band;
2764 iwl_mvm_set_chan_info(mvm, ci, chandef->chan->hw_value,
2796 if (mvm->mei_registered)
2805 if (mvm->mei_registered)
2811 if (mvm->mei_registered)
2817 if (mvm->mei_registered)
2824 mvm->hw_registered ? rfkill_soft_blocked(mvm->hw->wiphy->rfkill) : false;
2826 if (mvm->mei_registered)
2835 return iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id, 0) >= 4;
2841 struct ieee80211_mgmt *mgmt = (void *)skb->data;
2843 if (mvm->mei_scan_filter.is_mei_limited_scan &&
2844 (ieee80211_is_probe_resp(mgmt->frame_control) ||
2845 ieee80211_is_beacon(mgmt->frame_control))) {
2846 skb_queue_tail(&mvm->mei_scan_filter.scan_res, skb);
2847 schedule_work(&mvm->mei_scan_filter.scan_work);
2993 return use_def ? &ctx->def : &ctx->min_def;
3019 bool low);