1 /******************************************************************************
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
11 * Copyright(c) 2019 Intel Corporation
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of version 2 of the GNU General Public License as
15 * published by the Free Software Foundation.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
22 * The full GNU General Public License is included in this distribution
23 * in the file called COPYING.
25 * Contact Information:
26 * Intel Linux Wireless <linuxwifi@intel.com>
27 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
34 * Copyright(c) 2019 Intel Corporation
35 * All rights reserved.
37 * Redistribution and use in source and binary forms, with or without
38 * modification, are permitted provided that the following conditions
41 * * Redistributions of source code must retain the above copyright
42 * notice, this list of conditions and the following disclaimer.
43 * * Redistributions in binary form must reproduce the above copyright
44 * notice, this list of conditions and the following disclaimer in
45 * the documentation and/or other materials provided with the
47 * * Neither the name Intel Corporation nor the names of its
48 * contributors may be used to endorse or promote products derived
49 * from this software without specific prior written permission.
51 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
52 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
53 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
54 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
55 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
56 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
57 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
58 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
59 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
60 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
61 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
63 *****************************************************************************/
65 #ifndef __iwl_fw_api_phy_h__
66 #define __iwl_fw_api_phy_h__
69 * enum iwl_phy_ops_subcmd_ids - PHY group commands
71 enum iwl_phy_ops_subcmd_ids
{
73 * @CMD_DTS_MEASUREMENT_TRIGGER_WIDE:
74 * Uses either &struct iwl_dts_measurement_cmd or
75 * &struct iwl_ext_dts_measurement_cmd
77 CMD_DTS_MEASUREMENT_TRIGGER_WIDE
= 0x0,
80 * @CTDP_CONFIG_CMD: &struct iwl_mvm_ctdp_cmd
82 CTDP_CONFIG_CMD
= 0x03,
85 * @TEMP_REPORTING_THRESHOLDS_CMD: &struct temp_report_ths_cmd
87 TEMP_REPORTING_THRESHOLDS_CMD
= 0x04,
90 * @GEO_TX_POWER_LIMIT: &struct iwl_geo_tx_power_profiles_cmd
92 GEO_TX_POWER_LIMIT
= 0x05,
95 * @PER_PLATFORM_ANT_GAIN_CMD: &struct iwl_ppag_table_cmd
97 PER_PLATFORM_ANT_GAIN_CMD
= 0x07,
100 * @CT_KILL_NOTIFICATION: &struct ct_kill_notif
102 CT_KILL_NOTIFICATION
= 0xFE,
105 * @DTS_MEASUREMENT_NOTIF_WIDE:
106 * &struct iwl_dts_measurement_notif_v1 or
107 * &struct iwl_dts_measurement_notif_v2
109 DTS_MEASUREMENT_NOTIF_WIDE
= 0xFF,
112 /* DTS measurements */
114 enum iwl_dts_measurement_flags
{
115 DTS_TRIGGER_CMD_FLAGS_TEMP
= BIT(0),
116 DTS_TRIGGER_CMD_FLAGS_VOLT
= BIT(1),
120 * struct iwl_dts_measurement_cmd - request DTS temp and/or voltage measurements
122 * @flags: indicates which measurements we want as specified in
123 * &enum iwl_dts_measurement_flags
125 struct iwl_dts_measurement_cmd
{
127 } __packed
; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */
130 * enum iwl_dts_control_measurement_mode - DTS measurement type
131 * @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read
132 * back (latest value. Not waiting for new value). Use automatic
133 * SW DTS configuration.
134 * @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings,
135 * trigger DTS reading and provide read back temperature read
137 * @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read
138 * @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result,
139 * without measurement trigger.
141 enum iwl_dts_control_measurement_mode
{
143 DTS_REQUEST_READ
= 1,
145 DTS_DIRECT_WITHOUT_MEASURE
= 3,
149 * enum iwl_dts_used - DTS to use or used for measurement in the DTS request
151 * @DTS_USE_CHAIN_A: chain A
152 * @DTS_USE_CHAIN_B: chain B
153 * @DTS_USE_CHAIN_C: chain C
154 * @XTAL_TEMPERATURE: read temperature from xtal
161 XTAL_TEMPERATURE
= 4,
165 * enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode
166 * @DTS_BIT6_MODE: bit 6 mode
167 * @DTS_BIT8_MODE: bit 8 mode
169 enum iwl_dts_bit_mode
{
175 * struct iwl_ext_dts_measurement_cmd - request extended DTS temp measurements
176 * @control_mode: see &enum iwl_dts_control_measurement_mode
177 * @temperature: used when over write DTS mode is selected
178 * @sensor: set temperature sensor to use. See &enum iwl_dts_used
179 * @avg_factor: average factor to DTS in request DTS read mode
180 * @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode
181 * @step_duration: step duration for the DTS
183 struct iwl_ext_dts_measurement_cmd
{
189 __le32 step_duration
;
190 } __packed
; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */
193 * struct iwl_dts_measurement_notif_v1 - measurements notification
195 * @temp: the measured temperature
196 * @voltage: the measured voltage
198 struct iwl_dts_measurement_notif_v1
{
201 } __packed
; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/
204 * struct iwl_dts_measurement_notif_v2 - measurements notification
206 * @temp: the measured temperature
207 * @voltage: the measured voltage
208 * @threshold_idx: the trip index that was crossed
210 struct iwl_dts_measurement_notif_v2
{
213 __le32 threshold_idx
;
214 } __packed
; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */
217 * struct ct_kill_notif - CT-kill entry notification
219 * @temperature: the current temperature in celsius
220 * @reserved: reserved
222 struct ct_kill_notif
{
225 } __packed
; /* GRP_PHY_CT_KILL_NTF */
228 * enum ctdp_cmd_operation - CTDP command operations
229 * @CTDP_CMD_OPERATION_START: update the current budget
230 * @CTDP_CMD_OPERATION_STOP: stop ctdp
231 * @CTDP_CMD_OPERATION_REPORT: get the average budget
233 enum iwl_mvm_ctdp_cmd_operation
{
234 CTDP_CMD_OPERATION_START
= 0x1,
235 CTDP_CMD_OPERATION_STOP
= 0x2,
236 CTDP_CMD_OPERATION_REPORT
= 0x4,
237 };/* CTDP_CMD_OPERATION_TYPE_E */
240 * struct iwl_mvm_ctdp_cmd - track and manage the FW power consumption budget
242 * @operation: see &enum iwl_mvm_ctdp_cmd_operation
243 * @budget: the budget in milliwatt
244 * @window_size: defined in API but not used
246 struct iwl_mvm_ctdp_cmd
{
252 #define IWL_MAX_DTS_TRIPS 8
255 * struct temp_report_ths_cmd - set temperature thresholds
257 * @num_temps: number of temperature thresholds passed
258 * @thresholds: array with the thresholds to be configured
260 struct temp_report_ths_cmd
{
262 __le16 thresholds
[IWL_MAX_DTS_TRIPS
];
263 } __packed
; /* GRP_PHY_TEMP_REPORTING_THRESHOLDS_CMD */
265 #endif /* __iwl_fw_api_phy_h__ */