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-2024 Intel Corporation
4 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5 * Copyright (C) 2016-2017 Intel Deutschland GmbH
24 #include "iwl-op-mode.h"
25 #include "iwl-trans.h"
26 #include "fw/notif-wait.h"
27 #include "iwl-nvm-utils.h"
29 #include "iwl-config.h"
31 #include "fw-api.h"
36 #include "mei/iwl-mei.h"
37 #include "iwl-nvm-parse.h"
52 * 0" TBTT when the CSA time-event needs to be scheduled to start. It
85 * struct iwl_mvm_mod_params - module parameters for iwlmvm
118 * mvm->time_event_lock is held, as it value is used to indicate
219 * enum iwl_mvm_low_latency_force - low latency force mode set by debugfs
233 * enum iwl_mvm_low_latency_cause - low latency set causes
254 * struct iwl_mvm_link_bf_data - beacon filtering related data
270 * struct iwl_probe_resp_data - data for NoA/CSA updates
282 * struct iwl_mvm_vif_link_info - per link data in Virtual Interface
283 * @ap_sta_id: the sta_id of the AP - valid only if VIF type is STA
295 * @he_ru_2mhz_block: 26-tone RU OFDMA transmissions should be blocked
300 * @cab_queue: content-after-beacon (multicast) queue
347 * enum iwl_mvm_esr_state - defines reasons for which the EMLSR is exited or
351 * For the blocking reasons - use iwl_mvm_(un)block_esr(), and for the exit
352 * reasons - use iwl_mvm_exit_esr().
361 * @IWL_MVM_ESR_BLOCKED_NON_BSS: An active non-BSS interface's link is
363 * @IWL_MVM_ESR_BLOCKED_ROC: remain-on-channel is preventing EMLSR
396 * struct iwl_mvm_esr_exit - details of the last exit from EMLSR mode.
407 * struct iwl_mvm_vif - data per Virtual Interface, it is a MAC context
413 * @ap_assoc_sta_count: count of stations associated to us - valid only
418 * @pm_enabled - indicate if MAC power management is allowed
437 * @deflink: default link data for use in non-MLO
443 * link selection. Valid only for a MLO vif after assoc. 0 if there wasn't
485 * @uapsd_misbehaving_ap_addr: MLD address/BSSID of U-APSD misbehaving AP, to
486 * not use U-APSD on reconnection
488 * in U-APSD
598 link_id < ARRAY_SIZE((mvm_vif)->link); \
600 if ((mvm_vif)->link[link_id])
605 return (void *)vif->drv_priv; in iwl_mvm_vif_from_mac80211()
652 * struct iwl_mvm_tt_mgmt - Thermal Throttling Management structure
671 * struct iwl_mvm_thermal_device - thermal zone related data
714 #define IWL_MVM_DEBUG_SET_TEMPERATURE_MIN -100
772 * struct iwl_mvm_reorder_buffer - per ra/tid/queue reorder buffer
790 * struct iwl_mvm_reorder_buf_entry - reorder buffer entry per-queue/per-seqno
803 * struct iwl_mvm_baid_data - BA session data
838 return (void *)((u8 *)buf - in iwl_mvm_baid_data_from_reorder_buf()
839 offsetof(struct iwl_mvm_baid_data, reorder_buf) - in iwl_mvm_baid_data_from_reorder_buf()
840 sizeof(*buf) * buf->queue); in iwl_mvm_baid_data_from_reorder_buf()
844 * enum iwl_mvm_queue_status - queue status
890 return (void *)txq->drv_priv; in iwl_mvm_txq_from_mac80211()
899 return (void *)sta->txq[tid]->drv_priv; in iwl_mvm_txq_from_tid()
903 * struct iwl_mvm_tvqm_txq_info - maps TVQM hw queue to tid
962 * struct iwl_mvm_acs_survey_channel - per-channel survey information
986 /* Storage space for per-channel information follows */
992 struct device *dev; member
1020 * for beacon filtering -
1086 /* Scan status, cmd (pre-allocated) and auxiliary station */
1091 /* For CDB this is low band scan type, for non-CDB - type. */
1171 /* -1 for always, 0 for never, >0 for that many times */
1199 u32 last_netdetect_scans; /* no. of scans in the last net-detect wake */
1205 /* BT-Coex - only one of those will be used */
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) */
1378 ((struct iwl_mvm *)(_iwl_op_mode)->op_mode_specific)
1381 IWL_OP_MODE_GET_MVM((struct iwl_op_mode *)((_hw)->priv))
1383 DEFINE_GUARD(mvm, struct iwl_mvm *, mutex_lock(&_T->mutex), mutex_unlock(&_T->mutex))
1386 * enum iwl_mvm_status - MVM status bits
1387 * @IWL_MVM_STATUS_HW_RFKILL: HW RF-kill is asserted
1388 * @IWL_MVM_STATUS_HW_CTKILL: CT-kill is active
1389 * @IWL_MVM_STATUS_ROC_P2P_RUNNING: remain-on-channel on P2P is running (when
1393 * @IWL_MVM_STATUS_ROC_AUX_RUNNING: AUX remain-on-channel is running
1427 return test_bit(IWL_MVM_STATUS_HW_RFKILL, &mvm->status) || in iwl_mvm_is_radio_killed()
1428 test_bit(IWL_MVM_STATUS_HW_CTKILL, &mvm->status); in iwl_mvm_is_radio_killed()
1433 return test_bit(IWL_MVM_STATUS_HW_RFKILL, &mvm->status); in iwl_mvm_is_radio_hw_killed()
1438 return test_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status); in iwl_mvm_firmware_running()
1449 if (sta_id >= mvm->fw->ucode_capa.num_stations) in iwl_mvm_sta_from_staid_rcu()
1452 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); in iwl_mvm_sta_from_staid_rcu()
1466 if (sta_id >= mvm->fw->ucode_capa.num_stations) in iwl_mvm_sta_from_staid_protected()
1469 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], in iwl_mvm_sta_from_staid_protected()
1470 lockdep_is_held(&mvm->mutex)); in iwl_mvm_sta_from_staid_protected()
1482 if (WARN_ON(vif_id >= ARRAY_SIZE(mvm->vif_id_to_mac))) in iwl_mvm_rcu_dereference_vif_id()
1486 return rcu_dereference(mvm->vif_id_to_mac[vif_id]); in iwl_mvm_rcu_dereference_vif_id()
1488 return rcu_dereference_protected(mvm->vif_id_to_mac[vif_id], in iwl_mvm_rcu_dereference_vif_id()
1489 lockdep_is_held(&mvm->mutex)); in iwl_mvm_rcu_dereference_vif_id()
1495 if (IWL_FW_CHECK(mvm, link_id >= ARRAY_SIZE(mvm->link_id_to_link_conf), in iwl_mvm_rcu_fw_link_id_to_link_conf()
1500 return rcu_dereference(mvm->link_id_to_link_conf[link_id]); in iwl_mvm_rcu_fw_link_id_to_link_conf()
1502 return rcu_dereference_protected(mvm->link_id_to_link_conf[link_id], in iwl_mvm_rcu_fw_link_id_to_link_conf()
1503 lockdep_is_held(&mvm->mutex)); in iwl_mvm_rcu_fw_link_id_to_link_conf()
1508 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_is_adaptive_dwell_supported()
1514 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_is_adaptive_dwell_v2_supported()
1520 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_is_adwell_hb_ap_num_supported()
1527 return fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_OCE); in iwl_mvm_is_oce_supported()
1532 return fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_FRAG_EBS); in iwl_mvm_is_frag_ebs_supported()
1537 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_is_short_beacon_notif_supported()
1555 bool nvm_lar = mvm->nvm_data->lar_enabled; in iwl_mvm_is_lar_supported()
1556 bool tlv_lar = fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_is_lar_supported()
1563 if (mvm->cfg->nvm_type == IWL_NVM_EXT) in iwl_mvm_is_lar_supported()
1571 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_is_wifi_mcc_supported()
1573 fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_is_wifi_mcc_supported()
1579 return fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_bt_is_rrc_supported()
1586 return fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_is_csum_supported()
1593 return fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_is_mplut_supported()
1601 return fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_is_p2p_scm_uapsd_supported()
1609 return fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_has_new_rx_api()
1615 return fw_has_capa(&fw->ucode_capa, in iwl_mvm_has_mld_api()
1627 /* TODO - replace with TLV once defined */ in iwl_mvm_has_new_tx_api()
1628 return mvm->trans->trans_cfg->gen2; in iwl_mvm_has_new_tx_api()
1633 /* TODO - better define this */ in iwl_mvm_has_unified_ucode()
1634 return mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_22000; in iwl_mvm_has_unified_ucode()
1643 * There is a compilation for CDB and non-CDB FW, but there may in iwl_mvm_is_cdb_supported()
1646 * runtime check will also have to be here - once defined. in iwl_mvm_is_cdb_supported()
1648 return fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_is_cdb_supported()
1659 return mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_22000; in iwl_mvm_cdb_scan_api()
1664 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_is_scan_ext_chan_supported()
1671 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_is_reduced_config_scan_supported()
1677 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_is_band_in_rx_supported()
1683 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_has_new_rx_stats_api()
1689 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_has_quota_low_latency()
1695 return fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_has_no_host_disable_tx()
1701 return fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_has_tlc_offload()
1709 return &((struct iwl_tx_resp *)tx_resp)->status; in iwl_mvm_get_agg_status()
1711 return ((struct iwl_tx_resp_v3 *)tx_resp)->status; in iwl_mvm_get_agg_status()
1716 /* these two TLV are redundant since the responsibility to CT-kill by in iwl_mvm_is_tt_in_fw()
1720 return fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_is_tt_in_fw()
1722 fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_is_tt_in_fw()
1728 return fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_is_ctdp_supported()
1734 if ((CSR_HW_RFID_TYPE(trans->hw_rf_id) == IWL_CFG_RF_TYPE_FM) && in iwl_mvm_is_esr_supported()
1735 !CSR_HW_RFID_IS_CDB(trans->hw_rf_id)) in iwl_mvm_is_esr_supported()
1737 return CSR_HW_RFID_STEP(trans->hw_rf_id); in iwl_mvm_is_esr_supported()
1745 struct iwl_trans *trans = mvm->fwrt.trans; in iwl_mvm_max_active_links()
1747 if (vif->type == NL80211_IFTYPE_AP) in iwl_mvm_max_active_links()
1748 return mvm->fw->ucode_capa.num_beacons; in iwl_mvm_max_active_links()
1752 (CSR_HW_RFID_TYPE(trans->hw_rf_id) == IWL_CFG_RF_TYPE_FM && in iwl_mvm_max_active_links()
1753 CSR_HW_RFID_IS_CDB(trans->hw_rf_id))) in iwl_mvm_max_active_links()
1766 if (mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_BZ) in iwl_mvm_mac_ac_to_tx_fifo()
1775 return iwl_fw_lookup_cmd_ver(mvm->fw, in iwl_mvm_has_rlc_offload()
1814 iwl_fwrt_dump_error_logs(&mvm->fwrt); in iwl_mvm_dump_nic_error_log()
1874 struct ieee80211_key_conf *keyconf = info->control.hw_key; in iwl_mvm_set_tx_cmd_ccmp()
1876 tx_cmd->sec_ctl = TX_CMD_SEC_CCM; in iwl_mvm_set_tx_cmd_ccmp()
1877 memcpy(tx_cmd->key, keyconf->key, keyconf->keylen); in iwl_mvm_set_tx_cmd_ccmp()
1882 flush_work(&mvm->async_handlers_wk); in iwl_mvm_wait_for_async_handlers()
1911 u8 tx_ant = mvm->fw->valid_tx_ant; in iwl_mvm_get_valid_tx_ant()
1913 if (mvm->nvm_data && mvm->nvm_data->valid_tx_ant) in iwl_mvm_get_valid_tx_ant()
1914 tx_ant &= mvm->nvm_data->valid_tx_ant; in iwl_mvm_get_valid_tx_ant()
1916 if (mvm->set_tx_ant) in iwl_mvm_get_valid_tx_ant()
1917 tx_ant &= mvm->set_tx_ant; in iwl_mvm_get_valid_tx_ant()
1924 u8 rx_ant = mvm->fw->valid_rx_ant; in iwl_mvm_get_valid_rx_ant()
1926 if (mvm->nvm_data && mvm->nvm_data->valid_rx_ant) in iwl_mvm_get_valid_rx_ant()
1927 rx_ant &= mvm->nvm_data->valid_rx_ant; in iwl_mvm_get_valid_rx_ant()
1929 if (mvm->set_rx_ant) in iwl_mvm_get_valid_rx_ant()
1930 rx_ant &= mvm->set_rx_ant; in iwl_mvm_get_valid_rx_ant()
1951 return mvm->fw->phy_config & phy_config; in iwl_mvm_get_phy_config()
2154 * struct iwl_mvm_roc_ops - callbacks for the remain_on_channel()
2157 * non-MLD versions of remain_on_channel() is these function calls,
2197 return &cmd->quotas[i]; in iwl_mvm_quota_cmd_get_quota()
2199 quotas = (struct iwl_time_quota_data_v1 *)cmd->quotas; in iwl_mvm_quota_cmd_get_quota()
2393 /* get SystemLowLatencyMode - only needed for beacon threshold? */
2405 * Normally low-latency should only be active on interfaces in iwl_mvm_vif_low_latency()
2410 * the current desired low-latency state. in iwl_mvm_vif_low_latency()
2412 return mvmvif->low_latency_actual; in iwl_mvm_vif_low_latency()
2422 mvmvif->low_latency |= cause; in iwl_mvm_vif_set_low_latency()
2424 mvmvif->low_latency &= ~cause; in iwl_mvm_vif_set_low_latency()
2430 if (mvmvif->low_latency & LOW_LATENCY_DEBUGFS_FORCE_ENABLE && in iwl_mvm_vif_set_low_latency()
2438 new_state = !!(mvmvif->low_latency & in iwl_mvm_vif_set_low_latency()
2444 new_state = !!(mvmvif->low_latency & in iwl_mvm_vif_set_low_latency()
2448 mvmvif->low_latency_actual = new_state; in iwl_mvm_vif_set_low_latency()
2456 return ((BIT(mvm->trans->trans_cfg->base_params->num_of_queues) - 1) & in iwl_mvm_flushable_queues()
2462 /* Thermal management and CT-kill */
2543 * We use TID 4 (VI) as a FW-used-only TID when TDLS connections are present.
2691 * struct iwl_mvm_switch_vif_chanctx_ops - callbacks for switch_vif_chanctx()
2694 * non-MLD versions of switch_vif_chanctx() is these function calls,
2726 return fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_has_ultra_hb_channel()
2741 sizeof(struct iwl_fw_channel_info) - in iwl_mvm_chan_info_padding()
2751 ci->channel = cpu_to_le32(chan); in iwl_mvm_set_chan_info()
2752 ci->band = band; in iwl_mvm_set_chan_info()
2753 ci->width = width; in iwl_mvm_set_chan_info()
2754 ci->ctrl_pos = ctrl_pos; in iwl_mvm_set_chan_info()
2759 ci_v1->channel = chan; in iwl_mvm_set_chan_info()
2760 ci_v1->band = band; in iwl_mvm_set_chan_info()
2761 ci_v1->width = width; in iwl_mvm_set_chan_info()
2762 ci_v1->ctrl_pos = ctrl_pos; in iwl_mvm_set_chan_info()
2771 enum nl80211_band band = chandef->chan->band; in iwl_mvm_set_chan_info_chandef()
2773 iwl_mvm_set_chan_info(mvm, ci, chandef->chan->hw_value, in iwl_mvm_set_chan_info_chandef()
2805 if (mvm->mei_registered) in iwl_mvm_mei_get_ownership()
2814 if (mvm->mei_registered) in iwl_mvm_mei_tx_copy_to_csme()
2820 if (mvm->mei_registered) in iwl_mvm_mei_host_disassociated()
2826 if (mvm->mei_registered) in iwl_mvm_mei_device_state()
2833 mvm->hw_registered ? rfkill_soft_blocked(mvm->hw->wiphy->rfkill) : false; in iwl_mvm_mei_set_sw_rfkill_state()
2835 if (mvm->mei_registered) in iwl_mvm_mei_set_sw_rfkill_state()
2844 return iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id, 0) >= 4; in iwl_mvm_has_p2p_over_aux()
2850 struct ieee80211_mgmt *mgmt = (void *)skb->data; in iwl_mvm_mei_filter_scan()
2852 if (mvm->mei_scan_filter.is_mei_limited_scan && in iwl_mvm_mei_filter_scan()
2853 (ieee80211_is_probe_resp(mgmt->frame_control) || in iwl_mvm_mei_filter_scan()
2854 ieee80211_is_beacon(mgmt->frame_control))) { in iwl_mvm_mei_filter_scan()
2855 skb_queue_tail(&mvm->mei_scan_filter.scan_res, skb); in iwl_mvm_mei_filter_scan()
2856 schedule_work(&mvm->mei_scan_filter.scan_work); in iwl_mvm_mei_filter_scan()
3002 return use_def ? &ctx->def : &ctx->min_def; in iwl_mvm_chanctx_def()