| 1 |
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ |
| 2 |
/* |
| 3 |
* Copyright (C) 2012-2014, 2019-2022, 2024-2025 Intel Corporation |
| 4 |
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH |
| 5 |
* Copyright (C) 2016-2017 Intel Deutschland GmbH |
| 6 |
*/ |
| 7 |
#ifndef __iwl_fw_api_phy_h__ |
| 8 |
#define __iwl_fw_api_phy_h__ |
| 9 |
#include <linux/types.h> |
| 10 |
#include <linux/bits.h> |
| 11 |
|
| 12 |
/** |
| 13 |
* enum iwl_phy_ops_subcmd_ids - PHY group commands |
| 14 |
*/ |
| 15 |
enum iwl_phy_ops_subcmd_ids { |
| 16 |
/** |
| 17 |
* @CMD_DTS_MEASUREMENT_TRIGGER_WIDE: |
| 18 |
* Uses either &struct iwl_dts_measurement_cmd or |
| 19 |
* &struct iwl_ext_dts_measurement_cmd |
| 20 |
*/ |
| 21 |
CMD_DTS_MEASUREMENT_TRIGGER_WIDE = 0x0, |
| 22 |
|
| 23 |
/** |
| 24 |
* @CTDP_CONFIG_CMD: &struct iwl_ctdp_cmd |
| 25 |
*/ |
| 26 |
CTDP_CONFIG_CMD = 0x03, |
| 27 |
|
| 28 |
/** |
| 29 |
* @TEMP_REPORTING_THRESHOLDS_CMD: &struct temp_report_ths_cmd |
| 30 |
*/ |
| 31 |
TEMP_REPORTING_THRESHOLDS_CMD = 0x04, |
| 32 |
|
| 33 |
/** |
| 34 |
* @PER_CHAIN_LIMIT_OFFSET_CMD: &struct iwl_geo_tx_power_profiles_cmd_v1, |
| 35 |
* &struct iwl_geo_tx_power_profiles_cmd_v2, |
| 36 |
* &struct iwl_geo_tx_power_profiles_cmd_v3, |
| 37 |
* &struct iwl_geo_tx_power_profiles_cmd_v4 or |
| 38 |
* &struct iwl_geo_tx_power_profiles_cmd_v5 |
| 39 |
*/ |
| 40 |
PER_CHAIN_LIMIT_OFFSET_CMD = 0x05, |
| 41 |
|
| 42 |
/** |
| 43 |
* @PER_PLATFORM_ANT_GAIN_CMD: &union iwl_ppag_table_cmd |
| 44 |
*/ |
| 45 |
PER_PLATFORM_ANT_GAIN_CMD = 0x07, |
| 46 |
|
| 47 |
/** |
| 48 |
* @AP_TX_POWER_CONSTRAINTS_CMD: &struct iwl_txpower_constraints_cmd |
| 49 |
*/ |
| 50 |
AP_TX_POWER_CONSTRAINTS_CMD = 0x0C, |
| 51 |
|
| 52 |
/** |
| 53 |
* @CT_KILL_NOTIFICATION: &struct ct_kill_notif |
| 54 |
*/ |
| 55 |
CT_KILL_NOTIFICATION = 0xFE, |
| 56 |
|
| 57 |
/** |
| 58 |
* @DTS_MEASUREMENT_NOTIF_WIDE: |
| 59 |
* &struct iwl_dts_measurement_notif_v1 or |
| 60 |
* &struct iwl_dts_measurement_notif |
| 61 |
*/ |
| 62 |
DTS_MEASUREMENT_NOTIF_WIDE = 0xFF, |
| 63 |
}; |
| 64 |
|
| 65 |
/* DTS measurements */ |
| 66 |
|
| 67 |
enum iwl_dts_measurement_flags { |
| 68 |
DTS_TRIGGER_CMD_FLAGS_TEMP = BIT(0), |
| 69 |
DTS_TRIGGER_CMD_FLAGS_VOLT = BIT(1), |
| 70 |
}; |
| 71 |
|
| 72 |
/** |
| 73 |
* struct iwl_dts_measurement_cmd - request DTS temp and/or voltage measurements |
| 74 |
* |
| 75 |
* @flags: indicates which measurements we want as specified in |
| 76 |
* &enum iwl_dts_measurement_flags |
| 77 |
*/ |
| 78 |
struct iwl_dts_measurement_cmd { |
| 79 |
__le32 flags; |
| 80 |
} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */ |
| 81 |
|
| 82 |
/** |
| 83 |
* enum iwl_dts_control_measurement_mode - DTS measurement type |
| 84 |
* @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read |
| 85 |
* back (latest value. Not waiting for new value). Use automatic |
| 86 |
* SW DTS configuration. |
| 87 |
* @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings, |
| 88 |
* trigger DTS reading and provide read back temperature read |
| 89 |
* when available. |
| 90 |
* @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read |
| 91 |
* @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result, |
| 92 |
* without measurement trigger. |
| 93 |
*/ |
| 94 |
enum iwl_dts_control_measurement_mode { |
| 95 |
DTS_AUTOMATIC = 0, |
| 96 |
DTS_REQUEST_READ = 1, |
| 97 |
DTS_OVER_WRITE = 2, |
| 98 |
DTS_DIRECT_WITHOUT_MEASURE = 3, |
| 99 |
}; |
| 100 |
|
| 101 |
/** |
| 102 |
* enum iwl_dts_used - DTS to use or used for measurement in the DTS request |
| 103 |
* @DTS_USE_TOP: Top |
| 104 |
* @DTS_USE_CHAIN_A: chain A |
| 105 |
* @DTS_USE_CHAIN_B: chain B |
| 106 |
* @DTS_USE_CHAIN_C: chain C |
| 107 |
* @XTAL_TEMPERATURE: read temperature from xtal |
| 108 |
*/ |
| 109 |
enum iwl_dts_used { |
| 110 |
DTS_USE_TOP = 0, |
| 111 |
DTS_USE_CHAIN_A = 1, |
| 112 |
DTS_USE_CHAIN_B = 2, |
| 113 |
DTS_USE_CHAIN_C = 3, |
| 114 |
XTAL_TEMPERATURE = 4, |
| 115 |
}; |
| 116 |
|
| 117 |
/** |
| 118 |
* enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode |
| 119 |
* @DTS_BIT6_MODE: bit 6 mode |
| 120 |
* @DTS_BIT8_MODE: bit 8 mode |
| 121 |
*/ |
| 122 |
enum iwl_dts_bit_mode { |
| 123 |
DTS_BIT6_MODE = 0, |
| 124 |
DTS_BIT8_MODE = 1, |
| 125 |
}; |
| 126 |
|
| 127 |
/** |
| 128 |
* struct iwl_ext_dts_measurement_cmd - request extended DTS temp measurements |
| 129 |
* @control_mode: see &enum iwl_dts_control_measurement_mode |
| 130 |
* @temperature: used when over write DTS mode is selected |
| 131 |
* @sensor: set temperature sensor to use. See &enum iwl_dts_used |
| 132 |
* @avg_factor: average factor to DTS in request DTS read mode |
| 133 |
* @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode |
| 134 |
* @step_duration: step duration for the DTS |
| 135 |
*/ |
| 136 |
struct iwl_ext_dts_measurement_cmd { |
| 137 |
__le32 control_mode; |
| 138 |
__le32 temperature; |
| 139 |
__le32 sensor; |
| 140 |
__le32 avg_factor; |
| 141 |
__le32 bit_mode; |
| 142 |
__le32 step_duration; |
| 143 |
} __packed; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */ |
| 144 |
|
| 145 |
/** |
| 146 |
* struct iwl_dts_measurement_notif_v1 - measurements notification |
| 147 |
* |
| 148 |
* @temp: the measured temperature |
| 149 |
* @voltage: the measured voltage |
| 150 |
*/ |
| 151 |
struct iwl_dts_measurement_notif_v1 { |
| 152 |
__le32 temp; |
| 153 |
__le32 voltage; |
| 154 |
} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/ |
| 155 |
|
| 156 |
/** |
| 157 |
* struct iwl_dts_measurement_notif - measurements notification |
| 158 |
* |
| 159 |
* @temp: the measured temperature |
| 160 |
* @voltage: the measured voltage |
| 161 |
* @threshold_idx: the trip index that was crossed |
| 162 |
*/ |
| 163 |
struct iwl_dts_measurement_notif { |
| 164 |
__le32 temp; |
| 165 |
__le32 voltage; |
| 166 |
__le32 threshold_idx; |
| 167 |
} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */ |
| 168 |
|
| 169 |
/** |
| 170 |
* struct iwl_dts_measurement_resp - measurements response |
| 171 |
* |
| 172 |
* @temp: the measured temperature |
| 173 |
*/ |
| 174 |
struct iwl_dts_measurement_resp { |
| 175 |
__le32 temp; |
| 176 |
} __packed; /* CMD_DTS_MEASUREMENT_RSP_API_S_VER_1 */ |
| 177 |
|
| 178 |
/** |
| 179 |
* struct ct_kill_notif - CT-kill entry notification |
| 180 |
* This structure represent both versions of this notification. |
| 181 |
* |
| 182 |
* @temperature: the current temperature in celsius |
| 183 |
* @dts: only in v2: DTS that trigger the CT Kill bitmap: |
| 184 |
* bit 0: ToP master |
| 185 |
* bit 1: PA chain A master |
| 186 |
* bit 2: PA chain B master |
| 187 |
* bit 3: ToP slave |
| 188 |
* bit 4: PA chain A slave |
| 189 |
* bit 5: PA chain B slave) |
| 190 |
* bits 6,7: reserved (set to 0) |
| 191 |
* @scheme: only for v2: scheme that trigger the CT Kill (0-SW, 1-HW) |
| 192 |
*/ |
| 193 |
struct ct_kill_notif { |
| 194 |
__le16 temperature; |
| 195 |
u8 dts; |
| 196 |
u8 scheme; |
| 197 |
} __packed; /* CT_KILL_NOTIFICATION_API_S_VER_1, CT_KILL_NOTIFICATION_API_S_VER_2 */ |
| 198 |
|
| 199 |
/** |
| 200 |
* enum iwl_ctdp_cmd_operation - CTDP command operations |
| 201 |
* @CTDP_CMD_OPERATION_START: update the current budget |
| 202 |
* @CTDP_CMD_OPERATION_STOP: stop ctdp |
| 203 |
* @CTDP_CMD_OPERATION_REPORT: get the average budget |
| 204 |
*/ |
| 205 |
enum iwl_ctdp_cmd_operation { |
| 206 |
CTDP_CMD_OPERATION_START = 0x1, |
| 207 |
CTDP_CMD_OPERATION_STOP = 0x2, |
| 208 |
CTDP_CMD_OPERATION_REPORT = 0x4, |
| 209 |
};/* CTDP_CMD_OPERATION_TYPE_E */ |
| 210 |
|
| 211 |
/** |
| 212 |
* struct iwl_ctdp_cmd - track and manage the FW power consumption budget |
| 213 |
* |
| 214 |
* @operation: see &enum iwl_ctdp_cmd_operation |
| 215 |
* @budget: the budget in milliwatt |
| 216 |
* @window_size: defined in API but not used |
| 217 |
*/ |
| 218 |
struct iwl_ctdp_cmd { |
| 219 |
__le32 operation; |
| 220 |
__le32 budget; |
| 221 |
__le32 window_size; |
| 222 |
} __packed; |
| 223 |
|
| 224 |
#define IWL_MAX_DTS_TRIPS 8 |
| 225 |
|
| 226 |
/** |
| 227 |
* struct temp_report_ths_cmd - set temperature thresholds |
| 228 |
* |
| 229 |
* @num_temps: number of temperature thresholds passed |
| 230 |
* @thresholds: array with the thresholds to be configured |
| 231 |
*/ |
| 232 |
struct temp_report_ths_cmd { |
| 233 |
__le32 num_temps; |
| 234 |
__le16 thresholds[IWL_MAX_DTS_TRIPS]; |
| 235 |
} __packed; /* GRP_PHY_TEMP_REPORTING_THRESHOLDS_CMD */ |
| 236 |
|
| 237 |
#endif /* __iwl_fw_api_phy_h__ */ |