Path: blob/main/sys/contrib/dev/iwlwifi/fw/api/phy.h
48427 views
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */1/*2* Copyright (C) 2012-2014, 2019-2022, 2024-2025 Intel Corporation3* Copyright (C) 2013-2015 Intel Mobile Communications GmbH4* Copyright (C) 2016-2017 Intel Deutschland GmbH5*/6#ifndef __iwl_fw_api_phy_h__7#define __iwl_fw_api_phy_h__8#include <linux/types.h>9#include <linux/bits.h>10#if defined(__FreeBSD__)11#include <linux/bitops.h>12#endif1314/**15* enum iwl_phy_ops_subcmd_ids - PHY group commands16*/17enum iwl_phy_ops_subcmd_ids {18/**19* @CMD_DTS_MEASUREMENT_TRIGGER_WIDE:20* Uses either &struct iwl_dts_measurement_cmd or21* &struct iwl_ext_dts_measurement_cmd22*/23CMD_DTS_MEASUREMENT_TRIGGER_WIDE = 0x0,2425/**26* @CTDP_CONFIG_CMD: &struct iwl_ctdp_cmd27*/28CTDP_CONFIG_CMD = 0x03,2930/**31* @TEMP_REPORTING_THRESHOLDS_CMD: &struct temp_report_ths_cmd32*/33TEMP_REPORTING_THRESHOLDS_CMD = 0x04,3435/**36* @PER_CHAIN_LIMIT_OFFSET_CMD: &struct iwl_geo_tx_power_profiles_cmd_v1,37* &struct iwl_geo_tx_power_profiles_cmd_v2,38* &struct iwl_geo_tx_power_profiles_cmd_v3,39* &struct iwl_geo_tx_power_profiles_cmd_v4 or40* &struct iwl_geo_tx_power_profiles_cmd_v541*/42PER_CHAIN_LIMIT_OFFSET_CMD = 0x05,4344/**45* @PER_PLATFORM_ANT_GAIN_CMD: &union iwl_ppag_table_cmd46*/47PER_PLATFORM_ANT_GAIN_CMD = 0x07,4849/**50* @AP_TX_POWER_CONSTRAINTS_CMD: &struct iwl_txpower_constraints_cmd51*/52AP_TX_POWER_CONSTRAINTS_CMD = 0x0C,5354/**55* @CT_KILL_NOTIFICATION: &struct ct_kill_notif56*/57CT_KILL_NOTIFICATION = 0xFE,5859/**60* @DTS_MEASUREMENT_NOTIF_WIDE:61* &struct iwl_dts_measurement_notif_v1 or62* &struct iwl_dts_measurement_notif63*/64DTS_MEASUREMENT_NOTIF_WIDE = 0xFF,65};6667/* DTS measurements */6869enum iwl_dts_measurement_flags {70DTS_TRIGGER_CMD_FLAGS_TEMP = BIT(0),71DTS_TRIGGER_CMD_FLAGS_VOLT = BIT(1),72};7374/**75* struct iwl_dts_measurement_cmd - request DTS temp and/or voltage measurements76*77* @flags: indicates which measurements we want as specified in78* &enum iwl_dts_measurement_flags79*/80struct iwl_dts_measurement_cmd {81__le32 flags;82} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */8384/**85* enum iwl_dts_control_measurement_mode - DTS measurement type86* @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read87* back (latest value. Not waiting for new value). Use automatic88* SW DTS configuration.89* @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings,90* trigger DTS reading and provide read back temperature read91* when available.92* @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read93* @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result,94* without measurement trigger.95*/96enum iwl_dts_control_measurement_mode {97DTS_AUTOMATIC = 0,98DTS_REQUEST_READ = 1,99DTS_OVER_WRITE = 2,100DTS_DIRECT_WITHOUT_MEASURE = 3,101};102103/**104* enum iwl_dts_used - DTS to use or used for measurement in the DTS request105* @DTS_USE_TOP: Top106* @DTS_USE_CHAIN_A: chain A107* @DTS_USE_CHAIN_B: chain B108* @DTS_USE_CHAIN_C: chain C109* @XTAL_TEMPERATURE: read temperature from xtal110*/111enum iwl_dts_used {112DTS_USE_TOP = 0,113DTS_USE_CHAIN_A = 1,114DTS_USE_CHAIN_B = 2,115DTS_USE_CHAIN_C = 3,116XTAL_TEMPERATURE = 4,117};118119/**120* enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode121* @DTS_BIT6_MODE: bit 6 mode122* @DTS_BIT8_MODE: bit 8 mode123*/124enum iwl_dts_bit_mode {125DTS_BIT6_MODE = 0,126DTS_BIT8_MODE = 1,127};128129/**130* struct iwl_ext_dts_measurement_cmd - request extended DTS temp measurements131* @control_mode: see &enum iwl_dts_control_measurement_mode132* @temperature: used when over write DTS mode is selected133* @sensor: set temperature sensor to use. See &enum iwl_dts_used134* @avg_factor: average factor to DTS in request DTS read mode135* @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode136* @step_duration: step duration for the DTS137*/138struct iwl_ext_dts_measurement_cmd {139__le32 control_mode;140__le32 temperature;141__le32 sensor;142__le32 avg_factor;143__le32 bit_mode;144__le32 step_duration;145} __packed; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */146147/**148* struct iwl_dts_measurement_notif_v1 - measurements notification149*150* @temp: the measured temperature151* @voltage: the measured voltage152*/153struct iwl_dts_measurement_notif_v1 {154__le32 temp;155__le32 voltage;156} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/157158/**159* struct iwl_dts_measurement_notif - measurements notification160*161* @temp: the measured temperature162* @voltage: the measured voltage163* @threshold_idx: the trip index that was crossed164*/165struct iwl_dts_measurement_notif {166__le32 temp;167__le32 voltage;168__le32 threshold_idx;169} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */170171/**172* struct iwl_dts_measurement_resp - measurements response173*174* @temp: the measured temperature175*/176struct iwl_dts_measurement_resp {177__le32 temp;178} __packed; /* CMD_DTS_MEASUREMENT_RSP_API_S_VER_1 */179180/**181* struct ct_kill_notif - CT-kill entry notification182* This structure represent both versions of this notification.183*184* @temperature: the current temperature in celsius185* @dts: only in v2: DTS that trigger the CT Kill bitmap:186* bit 0: ToP master187* bit 1: PA chain A master188* bit 2: PA chain B master189* bit 3: ToP slave190* bit 4: PA chain A slave191* bit 5: PA chain B slave)192* bits 6,7: reserved (set to 0)193* @scheme: only for v2: scheme that trigger the CT Kill (0-SW, 1-HW)194*/195struct ct_kill_notif {196__le16 temperature;197u8 dts;198u8 scheme;199} __packed; /* CT_KILL_NOTIFICATION_API_S_VER_1, CT_KILL_NOTIFICATION_API_S_VER_2 */200201/**202* enum iwl_ctdp_cmd_operation - CTDP command operations203* @CTDP_CMD_OPERATION_START: update the current budget204* @CTDP_CMD_OPERATION_STOP: stop ctdp205* @CTDP_CMD_OPERATION_REPORT: get the average budget206*/207enum iwl_ctdp_cmd_operation {208CTDP_CMD_OPERATION_START = 0x1,209CTDP_CMD_OPERATION_STOP = 0x2,210CTDP_CMD_OPERATION_REPORT = 0x4,211};/* CTDP_CMD_OPERATION_TYPE_E */212213/**214* struct iwl_ctdp_cmd - track and manage the FW power consumption budget215*216* @operation: see &enum iwl_ctdp_cmd_operation217* @budget: the budget in milliwatt218* @window_size: defined in API but not used219*/220struct iwl_ctdp_cmd {221__le32 operation;222__le32 budget;223__le32 window_size;224} __packed;225226#define IWL_MAX_DTS_TRIPS 8227228/**229* struct temp_report_ths_cmd - set temperature thresholds230*231* @num_temps: number of temperature thresholds passed232* @thresholds: array with the thresholds to be configured233*/234struct temp_report_ths_cmd {235__le32 num_temps;236__le16 thresholds[IWL_MAX_DTS_TRIPS];237} __packed; /* GRP_PHY_TEMP_REPORTING_THRESHOLDS_CMD */238239#endif /* __iwl_fw_api_phy_h__ */240241242