1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
3 * Copyright (C) 2012-2014, 2019-2022, 2024 Intel Corporation
4 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
5 * Copyright (C) 2016-2017 Intel Deutschland GmbH
7 #ifndef __iwl_fw_api_phy_h__
8 #define __iwl_fw_api_phy_h__
11 * enum iwl_phy_ops_subcmd_ids - PHY group commands
13 enum iwl_phy_ops_subcmd_ids {
15 * @CMD_DTS_MEASUREMENT_TRIGGER_WIDE:
16 * Uses either &struct iwl_dts_measurement_cmd or
17 * &struct iwl_ext_dts_measurement_cmd
19 CMD_DTS_MEASUREMENT_TRIGGER_WIDE = 0x0,
22 * @CTDP_CONFIG_CMD: &struct iwl_mvm_ctdp_cmd
24 CTDP_CONFIG_CMD = 0x03,
27 * @TEMP_REPORTING_THRESHOLDS_CMD: &struct temp_report_ths_cmd
29 TEMP_REPORTING_THRESHOLDS_CMD = 0x04,
32 * @PER_CHAIN_LIMIT_OFFSET_CMD: &struct iwl_geo_tx_power_profiles_cmd_v1,
33 * &struct iwl_geo_tx_power_profiles_cmd_v2,
34 * &struct iwl_geo_tx_power_profiles_cmd_v3,
35 * &struct iwl_geo_tx_power_profiles_cmd_v4 or
36 * &struct iwl_geo_tx_power_profiles_cmd_v5
38 PER_CHAIN_LIMIT_OFFSET_CMD = 0x05,
41 * @PER_PLATFORM_ANT_GAIN_CMD: &union iwl_ppag_table_cmd
43 PER_PLATFORM_ANT_GAIN_CMD = 0x07,
46 * @AP_TX_POWER_CONSTRAINTS_CMD: &struct iwl_txpower_constraints_cmd
48 AP_TX_POWER_CONSTRAINTS_CMD = 0x0C,
51 * @CT_KILL_NOTIFICATION: &struct ct_kill_notif
53 CT_KILL_NOTIFICATION = 0xFE,
56 * @DTS_MEASUREMENT_NOTIF_WIDE:
57 * &struct iwl_dts_measurement_notif_v1 or
58 * &struct iwl_dts_measurement_notif_v2
60 DTS_MEASUREMENT_NOTIF_WIDE = 0xFF,
63 /* DTS measurements */
65 enum iwl_dts_measurement_flags {
66 DTS_TRIGGER_CMD_FLAGS_TEMP = BIT(0),
67 DTS_TRIGGER_CMD_FLAGS_VOLT = BIT(1),
71 * struct iwl_dts_measurement_cmd - request DTS temp and/or voltage measurements
73 * @flags: indicates which measurements we want as specified in
74 * &enum iwl_dts_measurement_flags
76 struct iwl_dts_measurement_cmd {
78 } __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */
81 * enum iwl_dts_control_measurement_mode - DTS measurement type
82 * @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read
83 * back (latest value. Not waiting for new value). Use automatic
84 * SW DTS configuration.
85 * @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings,
86 * trigger DTS reading and provide read back temperature read
88 * @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read
89 * @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result,
90 * without measurement trigger.
92 enum iwl_dts_control_measurement_mode {
96 DTS_DIRECT_WITHOUT_MEASURE = 3,
100 * enum iwl_dts_used - DTS to use or used for measurement in the DTS request
102 * @DTS_USE_CHAIN_A: chain A
103 * @DTS_USE_CHAIN_B: chain B
104 * @DTS_USE_CHAIN_C: chain C
105 * @XTAL_TEMPERATURE: read temperature from xtal
112 XTAL_TEMPERATURE = 4,
116 * enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode
117 * @DTS_BIT6_MODE: bit 6 mode
118 * @DTS_BIT8_MODE: bit 8 mode
120 enum iwl_dts_bit_mode {
126 * struct iwl_ext_dts_measurement_cmd - request extended DTS temp measurements
127 * @control_mode: see &enum iwl_dts_control_measurement_mode
128 * @temperature: used when over write DTS mode is selected
129 * @sensor: set temperature sensor to use. See &enum iwl_dts_used
130 * @avg_factor: average factor to DTS in request DTS read mode
131 * @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode
132 * @step_duration: step duration for the DTS
134 struct iwl_ext_dts_measurement_cmd {
140 __le32 step_duration;
141 } __packed; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */
144 * struct iwl_dts_measurement_notif_v1 - measurements notification
146 * @temp: the measured temperature
147 * @voltage: the measured voltage
149 struct iwl_dts_measurement_notif_v1 {
152 } __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/
155 * struct iwl_dts_measurement_notif_v2 - measurements notification
157 * @temp: the measured temperature
158 * @voltage: the measured voltage
159 * @threshold_idx: the trip index that was crossed
161 struct iwl_dts_measurement_notif_v2 {
164 __le32 threshold_idx;
165 } __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */
168 * struct iwl_dts_measurement_resp - measurements response
170 * @temp: the measured temperature
172 struct iwl_dts_measurement_resp {
174 } __packed; /* CMD_DTS_MEASUREMENT_RSP_API_S_VER_1 */
177 * struct ct_kill_notif - CT-kill entry notification
178 * This structure represent both versions of this notification.
180 * @temperature: the current temperature in celsius
181 * @dts: only in v2: DTS that trigger the CT Kill bitmap:
183 * bit 1: PA chain A master
184 * bit 2: PA chain B master
186 * bit 4: PA chain A slave
187 * bit 5: PA chain B slave)
188 * bits 6,7: reserved (set to 0)
189 * @scheme: only for v2: scheme that trigger the CT Kill (0-SW, 1-HW)
191 struct ct_kill_notif {
195 } __packed; /* CT_KILL_NOTIFICATION_API_S_VER_1, CT_KILL_NOTIFICATION_API_S_VER_2 */
198 * enum iwl_mvm_ctdp_cmd_operation - CTDP command operations
199 * @CTDP_CMD_OPERATION_START: update the current budget
200 * @CTDP_CMD_OPERATION_STOP: stop ctdp
201 * @CTDP_CMD_OPERATION_REPORT: get the average budget
203 enum iwl_mvm_ctdp_cmd_operation {
204 CTDP_CMD_OPERATION_START = 0x1,
205 CTDP_CMD_OPERATION_STOP = 0x2,
206 CTDP_CMD_OPERATION_REPORT = 0x4,
207 };/* CTDP_CMD_OPERATION_TYPE_E */
210 * struct iwl_mvm_ctdp_cmd - track and manage the FW power consumption budget
212 * @operation: see &enum iwl_mvm_ctdp_cmd_operation
213 * @budget: the budget in milliwatt
214 * @window_size: defined in API but not used
216 struct iwl_mvm_ctdp_cmd {
222 #define IWL_MAX_DTS_TRIPS 8
225 * struct temp_report_ths_cmd - set temperature thresholds
227 * @num_temps: number of temperature thresholds passed
228 * @thresholds: array with the thresholds to be configured
230 struct temp_report_ths_cmd {
232 __le16 thresholds[IWL_MAX_DTS_TRIPS];
233 } __packed; /* GRP_PHY_TEMP_REPORTING_THRESHOLDS_CMD */
235 #endif /* __iwl_fw_api_phy_h__ */