]>
Commit | Line | Data |
---|---|---|
8ca151b5 JB |
1 | /****************************************************************************** |
2 | * | |
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. | |
5 | * | |
6 | * GPL LICENSE SUMMARY | |
7 | * | |
51368bf7 | 8 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
8b4139dc | 9 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH |
a6bff3cb | 10 | * Copyright(c) 2015 - 2017 Intel Deutschland GmbH |
f2134f66 | 11 | * Copyright (C) 2018 - 2020 Intel Corporation |
8ca151b5 JB |
12 | * |
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. | |
16 | * | |
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. | |
21 | * | |
8ca151b5 | 22 | * The full GNU General Public License is included in this distribution |
410dc5aa | 23 | * in the file called COPYING. |
8ca151b5 JB |
24 | * |
25 | * Contact Information: | |
d01c5366 | 26 | * Intel Linux Wireless <linuxwifi@intel.com> |
8ca151b5 JB |
27 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 |
28 | * | |
29 | * BSD LICENSE | |
30 | * | |
51368bf7 | 31 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
8b4139dc | 32 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH |
a6bff3cb | 33 | * Copyright(c) 2015 - 2017 Intel Deutschland GmbH |
f2134f66 | 34 | * Copyright (C) 2018 - 2020 Intel Corporation |
8ca151b5 JB |
35 | * All rights reserved. |
36 | * | |
37 | * Redistribution and use in source and binary forms, with or without | |
38 | * modification, are permitted provided that the following conditions | |
39 | * are met: | |
40 | * | |
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 | |
46 | * distribution. | |
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. | |
50 | * | |
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. | |
62 | * | |
63 | *****************************************************************************/ | |
64 | ||
d172a5ef JB |
65 | #ifndef __iwl_fw_api_power_h__ |
66 | #define __iwl_fw_api_power_h__ | |
8ca151b5 JB |
67 | |
68 | /* Power Management Commands, Responses, Notifications */ | |
69 | ||
9180ac50 EG |
70 | /** |
71 | * enum iwl_ltr_config_flags - masks for LTR config command flags | |
72 | * @LTR_CFG_FLAG_FEATURE_ENABLE: Feature operational status | |
73 | * @LTR_CFG_FLAG_HW_DIS_ON_SHADOW_REG_ACCESS: allow LTR change on shadow | |
74 | * memory access | |
75 | * @LTR_CFG_FLAG_HW_EN_SHRT_WR_THROUGH: allow LTR msg send on ANY LTR | |
76 | * reg change | |
77 | * @LTR_CFG_FLAG_HW_DIS_ON_D0_2_D3: allow LTR msg send on transition from | |
78 | * D0 to D3 | |
79 | * @LTR_CFG_FLAG_SW_SET_SHORT: fixed static short LTR register | |
80 | * @LTR_CFG_FLAG_SW_SET_LONG: fixed static short LONG register | |
81 | * @LTR_CFG_FLAG_DENIE_C10_ON_PD: allow going into C10 on PD | |
3a07d36c JB |
82 | * @LTR_CFG_FLAG_UPDATE_VALUES: update config values and short |
83 | * idle timeout | |
9180ac50 EG |
84 | */ |
85 | enum iwl_ltr_config_flags { | |
86 | LTR_CFG_FLAG_FEATURE_ENABLE = BIT(0), | |
87 | LTR_CFG_FLAG_HW_DIS_ON_SHADOW_REG_ACCESS = BIT(1), | |
88 | LTR_CFG_FLAG_HW_EN_SHRT_WR_THROUGH = BIT(2), | |
89 | LTR_CFG_FLAG_HW_DIS_ON_D0_2_D3 = BIT(3), | |
90 | LTR_CFG_FLAG_SW_SET_SHORT = BIT(4), | |
91 | LTR_CFG_FLAG_SW_SET_LONG = BIT(5), | |
92 | LTR_CFG_FLAG_DENIE_C10_ON_PD = BIT(6), | |
3a07d36c | 93 | LTR_CFG_FLAG_UPDATE_VALUES = BIT(7), |
9180ac50 EG |
94 | }; |
95 | ||
84bfffa9 EG |
96 | /** |
97 | * struct iwl_ltr_config_cmd_v1 - configures the LTR | |
69d22e73 | 98 | * @flags: See &enum iwl_ltr_config_flags |
3a07d36c JB |
99 | * @static_long: static LTR Long register value. |
100 | * @static_short: static LTR Short register value. | |
84bfffa9 EG |
101 | */ |
102 | struct iwl_ltr_config_cmd_v1 { | |
103 | __le32 flags; | |
104 | __le32 static_long; | |
105 | __le32 static_short; | |
106 | } __packed; /* LTR_CAPABLE_API_S_VER_1 */ | |
107 | ||
108 | #define LTR_VALID_STATES_NUM 4 | |
109 | ||
9180ac50 EG |
110 | /** |
111 | * struct iwl_ltr_config_cmd - configures the LTR | |
69d22e73 | 112 | * @flags: See &enum iwl_ltr_config_flags |
3a07d36c JB |
113 | * @static_long: static LTR Long register value. |
114 | * @static_short: static LTR Short register value. | |
115 | * @ltr_cfg_values: LTR parameters table values (in usec) in folowing order: | |
116 | * TX, RX, Short Idle, Long Idle. Used only if %LTR_CFG_FLAG_UPDATE_VALUES | |
117 | * is set. | |
118 | * @ltr_short_idle_timeout: LTR Short Idle timeout (in usec). Used only if | |
119 | * %LTR_CFG_FLAG_UPDATE_VALUES is set. | |
9180ac50 EG |
120 | */ |
121 | struct iwl_ltr_config_cmd { | |
122 | __le32 flags; | |
123 | __le32 static_long; | |
124 | __le32 static_short; | |
84bfffa9 EG |
125 | __le32 ltr_cfg_values[LTR_VALID_STATES_NUM]; |
126 | __le32 ltr_short_idle_timeout; | |
127 | } __packed; /* LTR_CAPABLE_API_S_VER_2 */ | |
9180ac50 | 128 | |
bd4ace2a AB |
129 | /* Radio LP RX Energy Threshold measured in dBm */ |
130 | #define POWER_LPRX_RSSI_THRESHOLD 75 | |
131 | #define POWER_LPRX_RSSI_THRESHOLD_MAX 94 | |
132 | #define POWER_LPRX_RSSI_THRESHOLD_MIN 30 | |
133 | ||
8ca151b5 | 134 | /** |
9180ac50 | 135 | * enum iwl_power_flags - masks for power table command flags |
83bdad52 AB |
136 | * @POWER_FLAGS_POWER_SAVE_ENA_MSK: '1' Allow to save power by turning off |
137 | * receiver and transmitter. '0' - does not allow. | |
8ca151b5 JB |
138 | * @POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK: '0' Driver disables power management, |
139 | * '1' Driver enables PM (use rest of parameters) | |
f4a3e2fe | 140 | * @POWER_FLAGS_SKIP_OVER_DTIM_MSK: '0' PM have to walk up every DTIM, |
8ca151b5 | 141 | * '1' PM could sleep over DTIM till listen Interval. |
e811ada7 AB |
142 | * @POWER_FLAGS_SNOOZE_ENA_MSK: Enable snoozing only if uAPSD is enabled and all |
143 | * access categories are both delivery and trigger enabled. | |
144 | * @POWER_FLAGS_BT_SCO_ENA: Enable BT SCO coex only if uAPSD and | |
145 | * PBW Snoozing enabled | |
8ca151b5 | 146 | * @POWER_FLAGS_ADVANCE_PM_ENA_MSK: Advanced PM (uAPSD) enable mask |
83bdad52 | 147 | * @POWER_FLAGS_LPRX_ENA_MSK: Low Power RX enable. |
3a07d36c | 148 | * @POWER_FLAGS_UAPSD_MISBEHAVING_ENA_MSK: AP/GO's uAPSD misbehaving |
175a70b7 | 149 | * detection enablement |
8ca151b5 JB |
150 | */ |
151 | enum iwl_power_flags { | |
83bdad52 AB |
152 | POWER_FLAGS_POWER_SAVE_ENA_MSK = BIT(0), |
153 | POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK = BIT(1), | |
f4a3e2fe | 154 | POWER_FLAGS_SKIP_OVER_DTIM_MSK = BIT(2), |
e811ada7 AB |
155 | POWER_FLAGS_SNOOZE_ENA_MSK = BIT(5), |
156 | POWER_FLAGS_BT_SCO_ENA = BIT(8), | |
83bdad52 AB |
157 | POWER_FLAGS_ADVANCE_PM_ENA_MSK = BIT(9), |
158 | POWER_FLAGS_LPRX_ENA_MSK = BIT(11), | |
175a70b7 | 159 | POWER_FLAGS_UAPSD_MISBEHAVING_ENA_MSK = BIT(12), |
8ca151b5 JB |
160 | }; |
161 | ||
83bdad52 AB |
162 | #define IWL_POWER_VEC_SIZE 5 |
163 | ||
8ca151b5 | 164 | /** |
e811ada7 AB |
165 | * struct iwl_powertable_cmd - legacy power command. Beside old API support this |
166 | * is used also with a new power API for device wide power settings. | |
8ca151b5 JB |
167 | * POWER_TABLE_CMD = 0x77 (command, has simple generic response) |
168 | * | |
8ca151b5 JB |
169 | * @flags: Power table command flags from POWER_FLAGS_* |
170 | * @keep_alive_seconds: Keep alive period in seconds. Default - 25 sec. | |
e16cf7ec AB |
171 | * Minimum allowed:- 3 * DTIM. Keep alive period must be |
172 | * set regardless of power scheme or current power state. | |
173 | * FW use this value also when PM is disabled. | |
3a07d36c | 174 | * @debug_flags: debug flags |
8ca151b5 JB |
175 | * @rx_data_timeout: Minimum time (usec) from last Rx packet for AM to |
176 | * PSM transition - legacy PM | |
177 | * @tx_data_timeout: Minimum time (usec) from last Tx packet for AM to | |
178 | * PSM transition - legacy PM | |
83bdad52 | 179 | * @sleep_interval: not in use |
1bd2d175 AB |
180 | * @skip_dtim_periods: Number of DTIM periods to skip if Skip over DTIM flag |
181 | * is set. For example, if it is required to skip over | |
182 | * one DTIM, this value need to be set to 2 (DTIM periods). | |
8ca151b5 JB |
183 | * @lprx_rssi_threshold: Signal strength up to which LP RX can be enabled. |
184 | * Default: 80dbm | |
8ca151b5 JB |
185 | */ |
186 | struct iwl_powertable_cmd { | |
5b1dbfc3 | 187 | /* PM_POWER_TABLE_CMD_API_S_VER_6 */ |
8ca151b5 | 188 | __le16 flags; |
83bdad52 AB |
189 | u8 keep_alive_seconds; |
190 | u8 debug_flags; | |
8ca151b5 JB |
191 | __le32 rx_data_timeout; |
192 | __le32 tx_data_timeout; | |
83bdad52 | 193 | __le32 sleep_interval[IWL_POWER_VEC_SIZE]; |
1bd2d175 | 194 | __le32 skip_dtim_periods; |
83bdad52 | 195 | __le32 lprx_rssi_threshold; |
8ca151b5 JB |
196 | } __packed; |
197 | ||
64b928c4 AB |
198 | /** |
199 | * enum iwl_device_power_flags - masks for device power command flags | |
3a07d36c JB |
200 | * @DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK: |
201 | * '1' Allow to save power by turning off | |
ceef91c8 | 202 | * receiver and transmitter. '0' - does not allow. |
48e775e6 HD |
203 | * @DEVICE_POWER_FLAGS_ALLOW_MEM_RETENTION_MSK: |
204 | * Device Retention indication, '1' indicate retention is enabled. | |
205 | * @DEVICE_POWER_FLAGS_32K_CLK_VALID_MSK: | |
206 | * 32Khz external slow clock valid indication, '1' indicate cloack is | |
207 | * valid. | |
64b928c4 AB |
208 | */ |
209 | enum iwl_device_power_flags { | |
48e775e6 HD |
210 | DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK = BIT(0), |
211 | DEVICE_POWER_FLAGS_ALLOW_MEM_RETENTION_MSK = BIT(1), | |
212 | DEVICE_POWER_FLAGS_32K_CLK_VALID_MSK = BIT(12), | |
64b928c4 AB |
213 | }; |
214 | ||
215 | /** | |
216 | * struct iwl_device_power_cmd - device wide power command. | |
217 | * DEVICE_POWER_CMD = 0x77 (command, has simple generic response) | |
218 | * | |
67625865 | 219 | * @flags: Power table command flags from &enum iwl_device_power_flags |
3a07d36c | 220 | * @reserved: reserved (padding) |
64b928c4 AB |
221 | */ |
222 | struct iwl_device_power_cmd { | |
223 | /* PM_POWER_TABLE_CMD_API_S_VER_6 */ | |
224 | __le16 flags; | |
225 | __le16 reserved; | |
226 | } __packed; | |
227 | ||
e811ada7 AB |
228 | /** |
229 | * struct iwl_mac_power_cmd - New power command containing uAPSD support | |
230 | * MAC_PM_POWER_TABLE = 0xA9 (command, has simple generic response) | |
d172a5ef | 231 | * @id_and_color: MAC contex identifier, &enum iwl_ctxt_id_and_color |
e811ada7 AB |
232 | * @flags: Power table command flags from POWER_FLAGS_* |
233 | * @keep_alive_seconds: Keep alive period in seconds. Default - 25 sec. | |
234 | * Minimum allowed:- 3 * DTIM. Keep alive period must be | |
235 | * set regardless of power scheme or current power state. | |
236 | * FW use this value also when PM is disabled. | |
237 | * @rx_data_timeout: Minimum time (usec) from last Rx packet for AM to | |
238 | * PSM transition - legacy PM | |
239 | * @tx_data_timeout: Minimum time (usec) from last Tx packet for AM to | |
240 | * PSM transition - legacy PM | |
e811ada7 AB |
241 | * @skip_dtim_periods: Number of DTIM periods to skip if Skip over DTIM flag |
242 | * is set. For example, if it is required to skip over | |
243 | * one DTIM, this value need to be set to 2 (DTIM periods). | |
244 | * @rx_data_timeout_uapsd: Minimum time (usec) from last Rx packet for AM to | |
245 | * PSM transition - uAPSD | |
246 | * @tx_data_timeout_uapsd: Minimum time (usec) from last Tx packet for AM to | |
247 | * PSM transition - uAPSD | |
248 | * @lprx_rssi_threshold: Signal strength up to which LP RX can be enabled. | |
249 | * Default: 80dbm | |
89716344 AB |
250 | * @snooze_interval: Maximum time between attempts to retrieve buffered data |
251 | * from the AP [msec] | |
252 | * @snooze_window: A window of time in which PBW snoozing insures that all | |
253 | * packets received. It is also the minimum time from last | |
254 | * received unicast RX packet, before client stops snoozing | |
255 | * for data. [msec] | |
e811ada7 AB |
256 | * @snooze_step: TBD |
257 | * @qndp_tid: TID client shall use for uAPSD QNDP triggers | |
258 | * @uapsd_ac_flags: Set trigger-enabled and delivery-enabled indication for | |
259 | * each corresponding AC. | |
260 | * Use IEEE80211_WMM_IE_STA_QOSINFO_AC* for correct values. | |
261 | * @uapsd_max_sp: Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct | |
262 | * values. | |
e3c588ec AB |
263 | * @heavy_tx_thld_packets: TX threshold measured in number of packets |
264 | * @heavy_rx_thld_packets: RX threshold measured in number of packets | |
265 | * @heavy_tx_thld_percentage: TX threshold measured in load's percentage | |
266 | * @heavy_rx_thld_percentage: RX threshold measured in load's percentage | |
3a07d36c JB |
267 | * @limited_ps_threshold: (unused) |
268 | * @reserved: reserved (padding) | |
269 | */ | |
e811ada7 AB |
270 | struct iwl_mac_power_cmd { |
271 | /* CONTEXT_DESC_API_T_VER_1 */ | |
272 | __le32 id_and_color; | |
273 | ||
274 | /* CLIENT_PM_POWER_TABLE_S_VER_1 */ | |
275 | __le16 flags; | |
276 | __le16 keep_alive_seconds; | |
277 | __le32 rx_data_timeout; | |
278 | __le32 tx_data_timeout; | |
279 | __le32 rx_data_timeout_uapsd; | |
280 | __le32 tx_data_timeout_uapsd; | |
281 | u8 lprx_rssi_threshold; | |
282 | u8 skip_dtim_periods; | |
283 | __le16 snooze_interval; | |
284 | __le16 snooze_window; | |
285 | u8 snooze_step; | |
286 | u8 qndp_tid; | |
287 | u8 uapsd_ac_flags; | |
288 | u8 uapsd_max_sp; | |
e3c588ec AB |
289 | u8 heavy_tx_thld_packets; |
290 | u8 heavy_rx_thld_packets; | |
291 | u8 heavy_tx_thld_percentage; | |
292 | u8 heavy_rx_thld_percentage; | |
e811ada7 AB |
293 | u8 limited_ps_threshold; |
294 | u8 reserved; | |
295 | } __packed; | |
296 | ||
175a70b7 AB |
297 | /* |
298 | * struct iwl_uapsd_misbehaving_ap_notif - FW sends this notification when | |
299 | * associated AP is identified as improperly implementing uAPSD protocol. | |
300 | * PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78 | |
301 | * @sta_id: index of station in uCode's station table - associated AP ID in | |
302 | * this context. | |
303 | */ | |
304 | struct iwl_uapsd_misbehaving_ap_notif { | |
305 | __le32 sta_id; | |
306 | u8 mac_id; | |
307 | u8 reserved[3]; | |
308 | } __packed; | |
309 | ||
d44c3fe6 AA |
310 | /** |
311 | * struct iwl_reduce_tx_power_cmd - TX power reduction command | |
312 | * REDUCE_TX_POWER_CMD = 0x9f | |
313 | * @flags: (reserved for future implementation) | |
314 | * @mac_context_id: id of the mac ctx for which we are reducing TX power. | |
315 | * @pwr_restriction: TX power restriction in dBms. | |
316 | */ | |
317 | struct iwl_reduce_tx_power_cmd { | |
318 | u8 flags; | |
319 | u8 mac_context_id; | |
320 | __le16 pwr_restriction; | |
321 | } __packed; /* TX_REDUCED_POWER_API_S_VER_1 */ | |
322 | ||
da03f029 JB |
323 | enum iwl_dev_tx_power_cmd_mode { |
324 | IWL_TX_POWER_MODE_SET_MAC = 0, | |
325 | IWL_TX_POWER_MODE_SET_DEVICE = 1, | |
326 | IWL_TX_POWER_MODE_SET_CHAINS = 2, | |
55bfa4b9 | 327 | IWL_TX_POWER_MODE_SET_ACK = 3, |
0791c2fc HD |
328 | IWL_TX_POWER_MODE_SET_SAR_TIMER = 4, |
329 | IWL_TX_POWER_MODE_SET_SAR_TIMER_DEFAULT_TABLE = 5, | |
330 | }; /* TX_POWER_REDUCED_FLAGS_TYPE_API_E_VER_5 */; | |
da03f029 | 331 | |
4b87e5af LC |
332 | #define IWL_NUM_CHAIN_LIMITS 2 |
333 | #define IWL_NUM_SUB_BANDS 5 | |
f2134f66 | 334 | #define IWL_NUM_SUB_BANDS_V2 11 |
4b87e5af | 335 | |
d44c3fe6 | 336 | /** |
4b87e5af | 337 | * struct iwl_dev_tx_power_cmd - TX power reduction command |
da03f029 | 338 | * @set_mode: see &enum iwl_dev_tx_power_cmd_mode |
d44c3fe6 AA |
339 | * @mac_context_id: id of the mac ctx for which we are reducing TX power. |
340 | * @pwr_restriction: TX power restriction in 1/8 dBms. | |
341 | * @dev_24: device TX power restriction in 1/8 dBms | |
342 | * @dev_52_low: device TX power restriction upper band - low | |
343 | * @dev_52_high: device TX power restriction upper band - high | |
4b87e5af | 344 | * @per_chain_restriction: per chain restrictions |
d44c3fe6 | 345 | */ |
4b87e5af | 346 | struct iwl_dev_tx_power_cmd_v3 { |
d44c3fe6 AA |
347 | __le32 set_mode; |
348 | __le32 mac_context_id; | |
349 | __le16 pwr_restriction; | |
350 | __le16 dev_24; | |
351 | __le16 dev_52_low; | |
352 | __le16 dev_52_high; | |
da03f029 JB |
353 | __le16 per_chain_restriction[IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS]; |
354 | } __packed; /* TX_REDUCED_POWER_API_S_VER_3 */ | |
355 | ||
d44c3fe6 AA |
356 | #define IWL_DEV_MAX_TX_POWER 0x7FFF |
357 | ||
55bfa4b9 LC |
358 | /** |
359 | * struct iwl_dev_tx_power_cmd - TX power reduction command | |
360 | * @v3: version 3 of the command, embedded here for easier software handling | |
361 | * @enable_ack_reduction: enable or disable close range ack TX power | |
362 | * reduction. | |
3a07d36c | 363 | * @reserved: reserved (padding) |
55bfa4b9 | 364 | */ |
0791c2fc | 365 | struct iwl_dev_tx_power_cmd_v4 { |
55bfa4b9 LC |
366 | /* v4 is just an extension of v3 - keep this here */ |
367 | struct iwl_dev_tx_power_cmd_v3 v3; | |
368 | u8 enable_ack_reduction; | |
369 | u8 reserved[3]; | |
370 | } __packed; /* TX_REDUCED_POWER_API_S_VER_4 */ | |
371 | ||
0791c2fc HD |
372 | /** |
373 | * struct iwl_dev_tx_power_cmd - TX power reduction command | |
374 | * @v3: version 3 of the command, embedded here for easier software handling | |
375 | * @enable_ack_reduction: enable or disable close range ack TX power | |
376 | * reduction. | |
377 | * @per_chain_restriction_changed: is per_chain_restriction has changed | |
378 | * from last command. used if set_mode is | |
379 | * IWL_TX_POWER_MODE_SET_SAR_TIMER. | |
380 | * note: if not changed, the command is used for keep alive only. | |
381 | * @reserved: reserved (padding) | |
382 | * @timer_period: timer in milliseconds. if expires FW will change to default | |
383 | * BIOS values. relevant if setMode is IWL_TX_POWER_MODE_SET_SAR_TIMER | |
384 | */ | |
385 | struct iwl_dev_tx_power_cmd { | |
386 | /* v5 is just an extension of v3 - keep this here */ | |
387 | struct iwl_dev_tx_power_cmd_v3 v3; | |
388 | u8 enable_ack_reduction; | |
389 | u8 per_chain_restriction_changed; | |
390 | u8 reserved[2]; | |
391 | __le32 timer_period; | |
392 | } __packed; /* TX_REDUCED_POWER_API_S_VER_5 */ | |
393 | ||
e7a3b8d8 | 394 | #define IWL_NUM_GEO_PROFILES 3 |
a6bff3cb HD |
395 | |
396 | /** | |
397 | * enum iwl_geo_per_chain_offset_operation - type of operation | |
398 | * @IWL_PER_CHAIN_OFFSET_SET_TABLES: send the tables from the host to the FW. | |
399 | * @IWL_PER_CHAIN_OFFSET_GET_CURRENT_TABLE: retrieve the last configured table. | |
400 | */ | |
401 | enum iwl_geo_per_chain_offset_operation { | |
402 | IWL_PER_CHAIN_OFFSET_SET_TABLES, | |
403 | IWL_PER_CHAIN_OFFSET_GET_CURRENT_TABLE, | |
404 | }; /* GEO_TX_POWER_LIMIT FLAGS TYPE */ | |
405 | ||
406 | /** | |
407 | * struct iwl_per_chain_offset - embedded struct for GEO_TX_POWER_LIMIT. | |
408 | * @max_tx_power: maximum allowed tx power. | |
409 | * @chain_a: tx power offset for chain a. | |
410 | * @chain_b: tx power offset for chain b. | |
411 | */ | |
412 | struct iwl_per_chain_offset { | |
413 | __le16 max_tx_power; | |
414 | u8 chain_a; | |
415 | u8 chain_b; | |
416 | } __packed; /* PER_CHAIN_LIMIT_OFFSET_PER_CHAIN_S_VER_1 */ | |
417 | ||
418 | struct iwl_per_chain_offset_group { | |
419 | struct iwl_per_chain_offset lb; | |
420 | struct iwl_per_chain_offset hb; | |
421 | } __packed; /* PER_CHAIN_LIMIT_OFFSET_GROUP_S_VER_1 */ | |
422 | ||
0c3d7282 HD |
423 | /** |
424 | * struct iwl_geo_tx_power_profile_cmd_v1 - struct for GEO_TX_POWER_LIMIT cmd. | |
425 | * @ops: operations, value from &enum iwl_geo_per_chain_offset_operation | |
426 | * @table: offset profile per band. | |
427 | */ | |
428 | struct iwl_geo_tx_power_profiles_cmd_v1 { | |
429 | __le32 ops; | |
430 | struct iwl_per_chain_offset_group table[IWL_NUM_GEO_PROFILES]; | |
431 | } __packed; /* GEO_TX_POWER_LIMIT_VER_1 */ | |
432 | ||
a6bff3cb HD |
433 | /** |
434 | * struct iwl_geo_tx_power_profile_cmd - struct for GEO_TX_POWER_LIMIT cmd. | |
435 | * @ops: operations, value from &enum iwl_geo_per_chain_offset_operation | |
436 | * @table: offset profile per band. | |
0c3d7282 | 437 | * @table_revision: BIOS table revision. |
a6bff3cb HD |
438 | */ |
439 | struct iwl_geo_tx_power_profiles_cmd { | |
440 | __le32 ops; | |
441 | struct iwl_per_chain_offset_group table[IWL_NUM_GEO_PROFILES]; | |
0c3d7282 | 442 | __le32 table_revision; |
a6bff3cb HD |
443 | } __packed; /* GEO_TX_POWER_LIMIT */ |
444 | ||
7fe90e0e HD |
445 | /** |
446 | * struct iwl_geo_tx_power_profiles_resp - response to GEO_TX_POWER_LIMIT cmd | |
447 | * @profile_idx: current geo profile in use | |
448 | */ | |
449 | struct iwl_geo_tx_power_profiles_resp { | |
450 | __le32 profile_idx; | |
451 | } __packed; /* GEO_TX_POWER_LIMIT_RESP */ | |
452 | ||
6ce1e5c0 | 453 | /** |
f2134f66 GA |
454 | * union iwl_ppag_table_cmd - union for all versions of PPAG command |
455 | * @v1: version 1, table revision = 0 | |
456 | * @v2: version 2, table revision = 1 | |
457 | * | |
6ce1e5c0 GA |
458 | * @enabled: 1 if PPAG is enabled, 0 otherwise |
459 | * @gain: table of antenna gain values per chain and sub-band | |
460 | * @reserved: reserved | |
461 | */ | |
f2134f66 GA |
462 | union iwl_ppag_table_cmd { |
463 | struct { | |
464 | __le32 enabled; | |
465 | s8 gain[IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS]; | |
466 | s8 reserved[2]; | |
467 | } v1; | |
468 | struct { | |
469 | __le32 enabled; | |
470 | s8 gain[IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V2]; | |
471 | s8 reserved[2]; | |
472 | } v2; | |
473 | } __packed; | |
6ce1e5c0 | 474 | |
7df15b1e HG |
475 | /** |
476 | * struct iwl_beacon_filter_cmd | |
477 | * REPLY_BEACON_FILTERING_CMD = 0xd2 (command) | |
7df15b1e HG |
478 | * @bf_energy_delta: Used for RSSI filtering, if in 'normal' state. Send beacon |
479 | * to driver if delta in Energy values calculated for this and last | |
480 | * passed beacon is greater than this threshold. Zero value means that | |
481 | * the Energy change is ignored for beacon filtering, and beacon will | |
482 | * not be forced to be sent to driver regardless of this delta. Typical | |
483 | * energy delta 5dB. | |
484 | * @bf_roaming_energy_delta: Used for RSSI filtering, if in 'roaming' state. | |
485 | * Send beacon to driver if delta in Energy values calculated for this | |
486 | * and last passed beacon is greater than this threshold. Zero value | |
487 | * means that the Energy change is ignored for beacon filtering while in | |
488 | * Roaming state, typical energy delta 1dB. | |
489 | * @bf_roaming_state: Used for RSSI filtering. If absolute Energy values | |
490 | * calculated for current beacon is less than the threshold, use | |
491 | * Roaming Energy Delta Threshold, otherwise use normal Energy Delta | |
492 | * Threshold. Typical energy threshold is -72dBm. | |
5dca7c24 HG |
493 | * @bf_temp_threshold: This threshold determines the type of temperature |
494 | * filtering (Slow or Fast) that is selected (Units are in Celsuis): | |
31a658b2 | 495 | * If the current temperature is above this threshold - Fast filter |
5dca7c24 HG |
496 | * will be used, If the current temperature is below this threshold - |
497 | * Slow filter will be used. | |
498 | * @bf_temp_fast_filter: Send Beacon to driver if delta in temperature values | |
499 | * calculated for this and the last passed beacon is greater than this | |
500 | * threshold. Zero value means that the temperature change is ignored for | |
7df15b1e HG |
501 | * beacon filtering; beacons will not be forced to be sent to driver |
502 | * regardless of whether its temerature has been changed. | |
5dca7c24 HG |
503 | * @bf_temp_slow_filter: Send Beacon to driver if delta in temperature values |
504 | * calculated for this and the last passed beacon is greater than this | |
505 | * threshold. Zero value means that the temperature change is ignored for | |
506 | * beacon filtering; beacons will not be forced to be sent to driver | |
507 | * regardless of whether its temerature has been changed. | |
7df15b1e | 508 | * @bf_enable_beacon_filter: 1, beacon filtering is enabled; 0, disabled. |
3a07d36c JB |
509 | * @bf_debug_flag: beacon filtering debug configuration |
510 | * @bf_escape_timer: Send beacons to to driver if no beacons were passed | |
7df15b1e HG |
511 | * for a specific period of time. Units: Beacons. |
512 | * @ba_escape_timer: Fully receive and parse beacon if no beacons were passed | |
513 | * for a longer period of time then this escape-timeout. Units: Beacons. | |
514 | * @ba_enable_beacon_abort: 1, beacon abort is enabled; 0, disabled. | |
537ea3bb AG |
515 | * @bf_threshold_absolute_low: See below. |
516 | * @bf_threshold_absolute_high: Send Beacon to driver if Energy value calculated | |
517 | * for this beacon crossed this absolute threshold. For the 'Increase' | |
518 | * direction the bf_energy_absolute_low[i] is used. For the 'Decrease' | |
519 | * direction the bf_energy_absolute_high[i] is used. Zero value means | |
520 | * that this specific threshold is ignored for beacon filtering, and | |
521 | * beacon will not be forced to be sent to driver due to this setting. | |
7df15b1e HG |
522 | */ |
523 | struct iwl_beacon_filter_cmd { | |
5dca7c24 HG |
524 | __le32 bf_energy_delta; |
525 | __le32 bf_roaming_energy_delta; | |
526 | __le32 bf_roaming_state; | |
527 | __le32 bf_temp_threshold; | |
528 | __le32 bf_temp_fast_filter; | |
529 | __le32 bf_temp_slow_filter; | |
530 | __le32 bf_enable_beacon_filter; | |
531 | __le32 bf_debug_flag; | |
7df15b1e HG |
532 | __le32 bf_escape_timer; |
533 | __le32 ba_escape_timer; | |
5dca7c24 | 534 | __le32 ba_enable_beacon_abort; |
537ea3bb AG |
535 | __le32 bf_threshold_absolute_low[2]; |
536 | __le32 bf_threshold_absolute_high[2]; | |
537 | } __packed; /* BEACON_FILTER_CONFIG_API_S_VER_4 */ | |
7df15b1e HG |
538 | |
539 | /* Beacon filtering and beacon abort */ | |
540 | #define IWL_BF_ENERGY_DELTA_DEFAULT 5 | |
3dd37d05 | 541 | #define IWL_BF_ENERGY_DELTA_D0I3 20 |
7df15b1e HG |
542 | #define IWL_BF_ENERGY_DELTA_MAX 255 |
543 | #define IWL_BF_ENERGY_DELTA_MIN 0 | |
544 | ||
545 | #define IWL_BF_ROAMING_ENERGY_DELTA_DEFAULT 1 | |
3dd37d05 | 546 | #define IWL_BF_ROAMING_ENERGY_DELTA_D0I3 20 |
7df15b1e HG |
547 | #define IWL_BF_ROAMING_ENERGY_DELTA_MAX 255 |
548 | #define IWL_BF_ROAMING_ENERGY_DELTA_MIN 0 | |
549 | ||
550 | #define IWL_BF_ROAMING_STATE_DEFAULT 72 | |
3dd37d05 | 551 | #define IWL_BF_ROAMING_STATE_D0I3 72 |
7df15b1e HG |
552 | #define IWL_BF_ROAMING_STATE_MAX 255 |
553 | #define IWL_BF_ROAMING_STATE_MIN 0 | |
554 | ||
5dca7c24 | 555 | #define IWL_BF_TEMP_THRESHOLD_DEFAULT 112 |
3dd37d05 | 556 | #define IWL_BF_TEMP_THRESHOLD_D0I3 112 |
5dca7c24 HG |
557 | #define IWL_BF_TEMP_THRESHOLD_MAX 255 |
558 | #define IWL_BF_TEMP_THRESHOLD_MIN 0 | |
559 | ||
560 | #define IWL_BF_TEMP_FAST_FILTER_DEFAULT 1 | |
3dd37d05 | 561 | #define IWL_BF_TEMP_FAST_FILTER_D0I3 1 |
5dca7c24 HG |
562 | #define IWL_BF_TEMP_FAST_FILTER_MAX 255 |
563 | #define IWL_BF_TEMP_FAST_FILTER_MIN 0 | |
564 | ||
565 | #define IWL_BF_TEMP_SLOW_FILTER_DEFAULT 5 | |
f739c39c | 566 | #define IWL_BF_TEMP_SLOW_FILTER_D0I3 20 |
5dca7c24 HG |
567 | #define IWL_BF_TEMP_SLOW_FILTER_MAX 255 |
568 | #define IWL_BF_TEMP_SLOW_FILTER_MIN 0 | |
7df15b1e HG |
569 | |
570 | #define IWL_BF_ENABLE_BEACON_FILTER_DEFAULT 1 | |
571 | ||
572 | #define IWL_BF_DEBUG_FLAG_DEFAULT 0 | |
3dd37d05 | 573 | #define IWL_BF_DEBUG_FLAG_D0I3 0 |
7df15b1e | 574 | |
fb68e1a4 | 575 | #define IWL_BF_ESCAPE_TIMER_DEFAULT 0 |
50675360 | 576 | #define IWL_BF_ESCAPE_TIMER_D0I3 0 |
7df15b1e HG |
577 | #define IWL_BF_ESCAPE_TIMER_MAX 1024 |
578 | #define IWL_BF_ESCAPE_TIMER_MIN 0 | |
579 | ||
8434925f | 580 | #define IWL_BA_ESCAPE_TIMER_DEFAULT 6 |
3dd37d05 | 581 | #define IWL_BA_ESCAPE_TIMER_D0I3 6 |
b34b912f | 582 | #define IWL_BA_ESCAPE_TIMER_D3 9 |
7df15b1e HG |
583 | #define IWL_BA_ESCAPE_TIMER_MAX 1024 |
584 | #define IWL_BA_ESCAPE_TIMER_MIN 0 | |
585 | ||
586 | #define IWL_BA_ENABLE_BEACON_ABORT_DEFAULT 1 | |
587 | ||
3dd37d05 EP |
588 | #define IWL_BF_CMD_CONFIG(mode) \ |
589 | .bf_energy_delta = cpu_to_le32(IWL_BF_ENERGY_DELTA ## mode), \ | |
590 | .bf_roaming_energy_delta = \ | |
591 | cpu_to_le32(IWL_BF_ROAMING_ENERGY_DELTA ## mode), \ | |
592 | .bf_roaming_state = cpu_to_le32(IWL_BF_ROAMING_STATE ## mode), \ | |
593 | .bf_temp_threshold = cpu_to_le32(IWL_BF_TEMP_THRESHOLD ## mode), \ | |
594 | .bf_temp_fast_filter = cpu_to_le32(IWL_BF_TEMP_FAST_FILTER ## mode), \ | |
595 | .bf_temp_slow_filter = cpu_to_le32(IWL_BF_TEMP_SLOW_FILTER ## mode), \ | |
596 | .bf_debug_flag = cpu_to_le32(IWL_BF_DEBUG_FLAG ## mode), \ | |
597 | .bf_escape_timer = cpu_to_le32(IWL_BF_ESCAPE_TIMER ## mode), \ | |
598 | .ba_escape_timer = cpu_to_le32(IWL_BA_ESCAPE_TIMER ## mode) | |
071d4990 | 599 | |
3dd37d05 EP |
600 | #define IWL_BF_CMD_CONFIG_DEFAULTS IWL_BF_CMD_CONFIG(_DEFAULT) |
601 | #define IWL_BF_CMD_CONFIG_D0I3 IWL_BF_CMD_CONFIG(_D0I3) | |
d172a5ef | 602 | #endif /* __iwl_fw_api_power_h__ */ |