Lines Matching +full:cs +full:- +full:dev +full:- +full:assoc

1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
3 * Copyright (C) 2012-2014, 2018-2025 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
124 * mvm->time_event_lock is held, as it value is used to indicate
134 * enum iwl_power_scheme - iwl power schemes
225 * enum iwl_mvm_low_latency_force - low latency force mode set by debugfs
239 * enum iwl_mvm_low_latency_cause - low latency set causes
260 * struct iwl_mvm_link_bf_data - beacon filtering related data
276 * struct iwl_probe_resp_data - data for NoA/CSA updates
288 * struct iwl_mvm_vif_link_info - per link data in Virtual Interface
289 * @ap_sta_id: the sta_id of the AP - valid only if VIF type is STA
301 * @he_ru_2mhz_block: 26-tone RU OFDMA transmissions should be blocked
306 * @cab_queue: content-after-beacon (multicast) queue
356 * enum iwl_mvm_esr_state - defines reasons for which the EMLSR is exited or
360 * For the blocking reasons - use iwl_mvm_(un)block_esr(), and for the exit
361 * reasons - use iwl_mvm_exit_esr().
370 * @IWL_MVM_ESR_BLOCKED_NON_BSS: An active non-BSS interface's link is
372 * @IWL_MVM_ESR_BLOCKED_ROC: remain-on-channel is preventing EMLSR
373 * @IWL_MVM_ESR_BLOCKED_TMP_NON_BSS: An expected active non-BSS interface's link
375 * is an indication that a non-BSS interface is to be added.
407 * struct iwl_mvm_esr_exit - details of the last exit from EMLSR mode.
418 * struct iwl_mvm_vif - data per Virtual Interface, it is a MAC context
424 * @ap_assoc_sta_count: count of stations associated to us - valid only
429 * @pm_enabled - indicate if MAC power management is allowed
448 * @deflink: default link data for use in non-MLO
454 * link selection. Valid only for a MLO vif after assoc. 0 if there wasn't
498 * @uapsd_misbehaving_ap_addr: MLD address/BSSID of U-APSD misbehaving AP, to
499 * not use U-APSD on reconnection
501 * in U-APSD
612 link_id < ARRAY_SIZE((mvm_vif)->link); \
614 if ((mvm_vif)->link[link_id])
619 return (void *)vif->drv_priv; in iwl_mvm_vif_from_mac80211()
666 * struct iwl_mvm_tt_mgmt - Thermal Throttling Management structure
689 * struct iwl_mvm_thermal_device - thermal zone related data
732 #define IWL_MVM_DEBUG_SET_TEMPERATURE_MIN -100
790 * struct iwl_mvm_reorder_buffer - per ra/tid/queue reorder buffer
806 * struct iwl_mvm_reorder_buf_entry - reorder buffer entry per-queue/per-seqno
819 * struct iwl_mvm_baid_data - BA session data
854 return (void *)((u8 *)buf - in iwl_mvm_baid_data_from_reorder_buf()
855 offsetof(struct iwl_mvm_baid_data, reorder_buf) - in iwl_mvm_baid_data_from_reorder_buf()
856 sizeof(*buf) * buf->queue); in iwl_mvm_baid_data_from_reorder_buf()
860 * enum iwl_mvm_queue_status - queue status
906 return (void *)txq->drv_priv; in iwl_mvm_txq_from_mac80211()
915 return (void *)sta->txq[tid]->drv_priv; in iwl_mvm_txq_from_tid()
919 * struct iwl_mvm_tvqm_txq_info - maps TVQM hw queue to tid
978 * struct iwl_mvm_acs_survey_channel - per-channel survey information
1002 /* Storage space for per-channel information follows */
1008 struct device *dev; member
1036 * for beacon filtering -
1105 /* Scan status, cmd (pre-allocated) and auxiliary station */
1110 /* For CDB this is low band scan type, for non-CDB - type. */
1214 u32 last_netdetect_scans; /* no. of scans in the last net-detect wake */
1220 /* BT-Coex - only one of those will be used */
1291 * Current cs sta - might be different from periodic cs peer
1292 * station. Value is meaningless when the cs-state is idle.
1296 /* TDLS periodic channel-switch peer */
1305 /* timestamp of last ch-sw request sent (GP2 time) */
1382 ((struct iwl_mvm *)(_iwl_op_mode)->op_mode_specific)
1385 IWL_OP_MODE_GET_MVM((struct iwl_op_mode *)((_hw)->priv))
1387 DEFINE_GUARD(mvm, struct iwl_mvm *, mutex_lock(&_T->mutex), mutex_unlock(&_T->mutex))
1390 * enum iwl_mvm_status - MVM status bits
1391 * @IWL_MVM_STATUS_HW_RFKILL: HW RF-kill is asserted
1392 * @IWL_MVM_STATUS_HW_CTKILL: CT-kill is active
1393 * @IWL_MVM_STATUS_ROC_P2P_RUNNING: remain-on-channel on P2P is running (when
1397 * @IWL_MVM_STATUS_ROC_AUX_RUNNING: AUX remain-on-channel is running
1428 return test_bit(IWL_MVM_STATUS_HW_RFKILL, &mvm->status) || in iwl_mvm_is_radio_killed()
1429 test_bit(IWL_MVM_STATUS_HW_CTKILL, &mvm->status); in iwl_mvm_is_radio_killed()
1434 return test_bit(IWL_MVM_STATUS_HW_RFKILL, &mvm->status); in iwl_mvm_is_radio_hw_killed()
1439 return test_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status); in iwl_mvm_firmware_running()
1450 if (sta_id >= mvm->fw->ucode_capa.num_stations) in iwl_mvm_sta_from_staid_rcu()
1453 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); in iwl_mvm_sta_from_staid_rcu()
1467 if (sta_id >= mvm->fw->ucode_capa.num_stations) in iwl_mvm_sta_from_staid_protected()
1470 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], in iwl_mvm_sta_from_staid_protected()
1471 lockdep_is_held(&mvm->mutex)); in iwl_mvm_sta_from_staid_protected()
1483 if (WARN_ON(vif_id >= ARRAY_SIZE(mvm->vif_id_to_mac))) in iwl_mvm_rcu_dereference_vif_id()
1487 return rcu_dereference(mvm->vif_id_to_mac[vif_id]); in iwl_mvm_rcu_dereference_vif_id()
1489 return rcu_dereference_protected(mvm->vif_id_to_mac[vif_id], in iwl_mvm_rcu_dereference_vif_id()
1490 lockdep_is_held(&mvm->mutex)); in iwl_mvm_rcu_dereference_vif_id()
1495 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_is_adaptive_dwell_supported()
1501 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_is_adaptive_dwell_v2_supported()
1507 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_is_adwell_hb_ap_num_supported()
1514 return fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_OCE); in iwl_mvm_is_oce_supported()
1519 return fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_FRAG_EBS); in iwl_mvm_is_frag_ebs_supported()
1524 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_is_short_beacon_notif_supported()
1542 bool nvm_lar = mvm->nvm_data->lar_enabled; in iwl_mvm_is_lar_supported()
1543 bool tlv_lar = fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_is_lar_supported()
1550 if (mvm->trans->cfg->nvm_type == IWL_NVM_EXT) in iwl_mvm_is_lar_supported()
1558 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_is_wifi_mcc_supported()
1560 fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_is_wifi_mcc_supported()
1566 return fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_bt_is_rrc_supported()
1573 return fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_is_csum_supported()
1579 return fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_is_mplut_supported()
1587 return fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_is_p2p_scm_uapsd_supported()
1595 return fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_has_new_rx_api()
1601 return fw_has_capa(&fw->ucode_capa, in iwl_mvm_has_mld_api()
1613 /* TODO - replace with TLV once defined */ in iwl_mvm_has_new_tx_api()
1614 return mvm->trans->mac_cfg->gen2; in iwl_mvm_has_new_tx_api()
1619 /* TODO - better define this */ in iwl_mvm_has_unified_ucode()
1620 return mvm->trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_22000; in iwl_mvm_has_unified_ucode()
1629 * There is a compilation for CDB and non-CDB FW, but there may in iwl_mvm_is_cdb_supported()
1632 * runtime check will also have to be here - once defined. in iwl_mvm_is_cdb_supported()
1634 return fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_is_cdb_supported()
1645 return mvm->trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_22000; in iwl_mvm_cdb_scan_api()
1650 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_is_scan_ext_chan_supported()
1657 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_is_reduced_config_scan_supported()
1663 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_is_band_in_rx_supported()
1669 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_has_new_rx_stats_api()
1675 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_has_quota_low_latency()
1681 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_has_no_host_disable_tx()
1687 return fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_has_tlc_offload()
1695 return &((struct iwl_tx_resp *)tx_resp)->status; in iwl_mvm_get_agg_status()
1697 return ((struct iwl_tx_resp_v3 *)tx_resp)->status; in iwl_mvm_get_agg_status()
1702 /* these two TLV are redundant since the responsibility to CT-kill by in iwl_mvm_is_tt_in_fw()
1706 return fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_is_tt_in_fw()
1708 fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_is_tt_in_fw()
1714 return fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_is_ctdp_supported()
1720 if (CSR_HW_RFID_IS_CDB(trans->info.hw_rf_id)) in iwl_mvm_is_esr_supported()
1723 switch (CSR_HW_RFID_TYPE(trans->info.hw_rf_id)) { in iwl_mvm_is_esr_supported()
1726 return CSR_HW_RFID_STEP(trans->info.hw_rf_id); in iwl_mvm_is_esr_supported()
1738 struct iwl_trans *trans = mvm->fwrt.trans; in iwl_mvm_max_active_links()
1740 if (vif->type == NL80211_IFTYPE_AP) in iwl_mvm_max_active_links()
1741 return mvm->fw->ucode_capa.num_beacons; in iwl_mvm_max_active_links()
1745 (CSR_HW_RFID_TYPE(trans->info.hw_rf_id) == IWL_CFG_RF_TYPE_FM && in iwl_mvm_max_active_links()
1746 CSR_HW_RFID_IS_CDB(trans->info.hw_rf_id))) in iwl_mvm_max_active_links()
1759 if (mvm->trans->mac_cfg->device_family >= IWL_DEVICE_FAMILY_BZ) in iwl_mvm_mac_ac_to_tx_fifo()
1768 return iwl_fw_lookup_cmd_ver(mvm->fw, in iwl_mvm_has_rlc_offload()
1804 iwl_fwrt_dump_error_logs(&mvm->fwrt); in iwl_mvm_dump_nic_error_log()
1864 struct ieee80211_key_conf *keyconf = info->control.hw_key; in iwl_mvm_set_tx_cmd_ccmp()
1866 tx_cmd_params->sec_ctl = TX_CMD_SEC_CCM; in iwl_mvm_set_tx_cmd_ccmp()
1867 memcpy(tx_cmd_params->key, keyconf->key, keyconf->keylen); in iwl_mvm_set_tx_cmd_ccmp()
1872 flush_work(&mvm->async_handlers_wk); in iwl_mvm_wait_for_async_handlers()
1901 u8 tx_ant = mvm->fw->valid_tx_ant; in iwl_mvm_get_valid_tx_ant()
1903 if (mvm->nvm_data && mvm->nvm_data->valid_tx_ant) in iwl_mvm_get_valid_tx_ant()
1904 tx_ant &= mvm->nvm_data->valid_tx_ant; in iwl_mvm_get_valid_tx_ant()
1906 if (mvm->set_tx_ant) in iwl_mvm_get_valid_tx_ant()
1907 tx_ant &= mvm->set_tx_ant; in iwl_mvm_get_valid_tx_ant()
1914 u8 rx_ant = mvm->fw->valid_rx_ant; in iwl_mvm_get_valid_rx_ant()
1916 if (mvm->nvm_data && mvm->nvm_data->valid_rx_ant) in iwl_mvm_get_valid_rx_ant()
1917 rx_ant &= mvm->nvm_data->valid_rx_ant; in iwl_mvm_get_valid_rx_ant()
1919 if (mvm->set_rx_ant) in iwl_mvm_get_valid_rx_ant()
1920 rx_ant &= mvm->set_rx_ant; in iwl_mvm_get_valid_rx_ant()
1941 return mvm->fw->phy_config & phy_config; in iwl_mvm_get_phy_config()
2147 * struct iwl_mvm_roc_ops - callbacks for the remain_on_channel()
2150 * non-MLD versions of remain_on_channel() is these function calls,
2190 return &cmd->quotas[i]; in iwl_mvm_quota_cmd_get_quota()
2192 quotas = (struct iwl_time_quota_data_v1 *)cmd->quotas; in iwl_mvm_quota_cmd_get_quota()
2386 /* get SystemLowLatencyMode - only needed for beacon threshold? */
2398 * Normally low-latency should only be active on interfaces in iwl_mvm_vif_low_latency()
2403 * the current desired low-latency state. in iwl_mvm_vif_low_latency()
2405 return mvmvif->low_latency_actual; in iwl_mvm_vif_low_latency()
2415 mvmvif->low_latency |= cause; in iwl_mvm_vif_set_low_latency()
2417 mvmvif->low_latency &= ~cause; in iwl_mvm_vif_set_low_latency()
2423 if (mvmvif->low_latency & LOW_LATENCY_DEBUGFS_FORCE_ENABLE && in iwl_mvm_vif_set_low_latency()
2431 new_state = !!(mvmvif->low_latency & in iwl_mvm_vif_set_low_latency()
2437 new_state = !!(mvmvif->low_latency & in iwl_mvm_vif_set_low_latency()
2441 mvmvif->low_latency_actual = new_state; in iwl_mvm_vif_set_low_latency()
2449 return ((BIT(mvm->trans->mac_cfg->base->num_of_queues) - 1) & in iwl_mvm_flushable_queues()
2455 /* Thermal management and CT-kill */
2526 * We use TID 4 (VI) as a FW-used-only TID when TDLS connections are present.
2673 * struct iwl_mvm_switch_vif_chanctx_ops - callbacks for switch_vif_chanctx()
2676 * non-MLD versions of switch_vif_chanctx() is these function calls,
2708 return fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_has_ultra_hb_channel()
2723 sizeof(struct iwl_fw_channel_info) - in iwl_mvm_chan_info_padding()
2733 ci->channel = cpu_to_le32(chan); in iwl_mvm_set_chan_info()
2734 ci->band = band; in iwl_mvm_set_chan_info()
2735 ci->width = width; in iwl_mvm_set_chan_info()
2736 ci->ctrl_pos = ctrl_pos; in iwl_mvm_set_chan_info()
2741 ci_v1->channel = chan; in iwl_mvm_set_chan_info()
2742 ci_v1->band = band; in iwl_mvm_set_chan_info()
2743 ci_v1->width = width; in iwl_mvm_set_chan_info()
2744 ci_v1->ctrl_pos = ctrl_pos; in iwl_mvm_set_chan_info()
2753 enum nl80211_band band = chandef->chan->band; in iwl_mvm_set_chan_info_chandef()
2755 iwl_mvm_set_chan_info(mvm, ci, chandef->chan->hw_value, in iwl_mvm_set_chan_info_chandef()
2787 if (mvm->mei_registered) in iwl_mvm_mei_get_ownership()
2796 if (mvm->mei_registered) in iwl_mvm_mei_tx_copy_to_csme()
2802 if (mvm->mei_registered) in iwl_mvm_mei_host_disassociated()
2808 if (mvm->mei_registered) in iwl_mvm_mei_device_state()
2815 mvm->hw_registered ? rfkill_soft_blocked(mvm->hw->wiphy->rfkill) : false; in iwl_mvm_mei_set_sw_rfkill_state()
2817 if (mvm->mei_registered) in iwl_mvm_mei_set_sw_rfkill_state()
2826 return iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id, 0) >= 4; in iwl_mvm_has_p2p_over_aux()
2832 struct ieee80211_mgmt *mgmt = (void *)skb->data; in iwl_mvm_mei_filter_scan()
2834 if (mvm->mei_scan_filter.is_mei_limited_scan && in iwl_mvm_mei_filter_scan()
2835 (ieee80211_is_probe_resp(mgmt->frame_control) || in iwl_mvm_mei_filter_scan()
2836 ieee80211_is_beacon(mgmt->frame_control))) { in iwl_mvm_mei_filter_scan()
2837 skb_queue_tail(&mvm->mei_scan_filter.scan_res, skb); in iwl_mvm_mei_filter_scan()
2838 schedule_work(&mvm->mei_scan_filter.scan_work); in iwl_mvm_mei_filter_scan()