]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blob - drivers/net/wireless/intel/iwlwifi/fw/api/power.h
iwlwifi: acpi: support ppag table command v2
[mirror_ubuntu-jammy-kernel.git] / drivers / net / wireless / intel / iwlwifi / fw / api / power.h
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 *
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
10 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
11 * Copyright (C) 2018 - 2020 Intel Corporation
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 *
22 * The full GNU General Public License is included in this distribution
23 * in the file called COPYING.
24 *
25 * Contact Information:
26 * Intel Linux Wireless <linuxwifi@intel.com>
27 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
28 *
29 * BSD LICENSE
30 *
31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
32 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
33 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
34 * Copyright (C) 2018 - 2020 Intel Corporation
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
65 #ifndef __iwl_fw_api_power_h__
66 #define __iwl_fw_api_power_h__
67
68 /* Power Management Commands, Responses, Notifications */
69
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
82 * @LTR_CFG_FLAG_UPDATE_VALUES: update config values and short
83 * idle timeout
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),
93 LTR_CFG_FLAG_UPDATE_VALUES = BIT(7),
94 };
95
96 /**
97 * struct iwl_ltr_config_cmd_v1 - configures the LTR
98 * @flags: See &enum iwl_ltr_config_flags
99 * @static_long: static LTR Long register value.
100 * @static_short: static LTR Short register value.
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
110 /**
111 * struct iwl_ltr_config_cmd - configures the LTR
112 * @flags: See &enum iwl_ltr_config_flags
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.
120 */
121 struct iwl_ltr_config_cmd {
122 __le32 flags;
123 __le32 static_long;
124 __le32 static_short;
125 __le32 ltr_cfg_values[LTR_VALID_STATES_NUM];
126 __le32 ltr_short_idle_timeout;
127 } __packed; /* LTR_CAPABLE_API_S_VER_2 */
128
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
134 /**
135 * enum iwl_power_flags - masks for power table command flags
136 * @POWER_FLAGS_POWER_SAVE_ENA_MSK: '1' Allow to save power by turning off
137 * receiver and transmitter. '0' - does not allow.
138 * @POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK: '0' Driver disables power management,
139 * '1' Driver enables PM (use rest of parameters)
140 * @POWER_FLAGS_SKIP_OVER_DTIM_MSK: '0' PM have to walk up every DTIM,
141 * '1' PM could sleep over DTIM till listen Interval.
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
146 * @POWER_FLAGS_ADVANCE_PM_ENA_MSK: Advanced PM (uAPSD) enable mask
147 * @POWER_FLAGS_LPRX_ENA_MSK: Low Power RX enable.
148 * @POWER_FLAGS_UAPSD_MISBEHAVING_ENA_MSK: AP/GO's uAPSD misbehaving
149 * detection enablement
150 */
151 enum iwl_power_flags {
152 POWER_FLAGS_POWER_SAVE_ENA_MSK = BIT(0),
153 POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK = BIT(1),
154 POWER_FLAGS_SKIP_OVER_DTIM_MSK = BIT(2),
155 POWER_FLAGS_SNOOZE_ENA_MSK = BIT(5),
156 POWER_FLAGS_BT_SCO_ENA = BIT(8),
157 POWER_FLAGS_ADVANCE_PM_ENA_MSK = BIT(9),
158 POWER_FLAGS_LPRX_ENA_MSK = BIT(11),
159 POWER_FLAGS_UAPSD_MISBEHAVING_ENA_MSK = BIT(12),
160 };
161
162 #define IWL_POWER_VEC_SIZE 5
163
164 /**
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.
167 * POWER_TABLE_CMD = 0x77 (command, has simple generic response)
168 *
169 * @flags: Power table command flags from POWER_FLAGS_*
170 * @keep_alive_seconds: Keep alive period in seconds. Default - 25 sec.
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.
174 * @debug_flags: debug flags
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
179 * @sleep_interval: not in use
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).
183 * @lprx_rssi_threshold: Signal strength up to which LP RX can be enabled.
184 * Default: 80dbm
185 */
186 struct iwl_powertable_cmd {
187 /* PM_POWER_TABLE_CMD_API_S_VER_6 */
188 __le16 flags;
189 u8 keep_alive_seconds;
190 u8 debug_flags;
191 __le32 rx_data_timeout;
192 __le32 tx_data_timeout;
193 __le32 sleep_interval[IWL_POWER_VEC_SIZE];
194 __le32 skip_dtim_periods;
195 __le32 lprx_rssi_threshold;
196 } __packed;
197
198 /**
199 * enum iwl_device_power_flags - masks for device power command flags
200 * @DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK:
201 * '1' Allow to save power by turning off
202 * receiver and transmitter. '0' - does not allow.
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.
208 */
209 enum iwl_device_power_flags {
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),
213 };
214
215 /**
216 * struct iwl_device_power_cmd - device wide power command.
217 * DEVICE_POWER_CMD = 0x77 (command, has simple generic response)
218 *
219 * @flags: Power table command flags from &enum iwl_device_power_flags
220 * @reserved: reserved (padding)
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
228 /**
229 * struct iwl_mac_power_cmd - New power command containing uAPSD support
230 * MAC_PM_POWER_TABLE = 0xA9 (command, has simple generic response)
231 * @id_and_color: MAC contex identifier, &enum iwl_ctxt_id_and_color
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
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
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]
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.
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
267 * @limited_ps_threshold: (unused)
268 * @reserved: reserved (padding)
269 */
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;
289 u8 heavy_tx_thld_packets;
290 u8 heavy_rx_thld_packets;
291 u8 heavy_tx_thld_percentage;
292 u8 heavy_rx_thld_percentage;
293 u8 limited_ps_threshold;
294 u8 reserved;
295 } __packed;
296
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
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
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,
327 IWL_TX_POWER_MODE_SET_ACK = 3,
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 */;
331
332 #define IWL_NUM_CHAIN_LIMITS 2
333 #define IWL_NUM_SUB_BANDS 5
334 #define IWL_NUM_SUB_BANDS_V2 11
335
336 /**
337 * struct iwl_dev_tx_power_cmd - TX power reduction command
338 * @set_mode: see &enum iwl_dev_tx_power_cmd_mode
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
344 * @per_chain_restriction: per chain restrictions
345 */
346 struct iwl_dev_tx_power_cmd_v3 {
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;
353 __le16 per_chain_restriction[IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS];
354 } __packed; /* TX_REDUCED_POWER_API_S_VER_3 */
355
356 #define IWL_DEV_MAX_TX_POWER 0x7FFF
357
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.
363 * @reserved: reserved (padding)
364 */
365 struct iwl_dev_tx_power_cmd_v4 {
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
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
394 #define IWL_NUM_GEO_PROFILES 3
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
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
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.
437 * @table_revision: BIOS table revision.
438 */
439 struct iwl_geo_tx_power_profiles_cmd {
440 __le32 ops;
441 struct iwl_per_chain_offset_group table[IWL_NUM_GEO_PROFILES];
442 __le32 table_revision;
443 } __packed; /* GEO_TX_POWER_LIMIT */
444
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
453 /**
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 *
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 */
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;
474
475 /**
476 * struct iwl_beacon_filter_cmd
477 * REPLY_BEACON_FILTERING_CMD = 0xd2 (command)
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.
493 * @bf_temp_threshold: This threshold determines the type of temperature
494 * filtering (Slow or Fast) that is selected (Units are in Celsuis):
495 * If the current temperature is above this threshold - Fast filter
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
501 * beacon filtering; beacons will not be forced to be sent to driver
502 * regardless of whether its temerature has been changed.
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.
508 * @bf_enable_beacon_filter: 1, beacon filtering is enabled; 0, disabled.
509 * @bf_debug_flag: beacon filtering debug configuration
510 * @bf_escape_timer: Send beacons to to driver if no beacons were passed
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.
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.
522 */
523 struct iwl_beacon_filter_cmd {
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;
532 __le32 bf_escape_timer;
533 __le32 ba_escape_timer;
534 __le32 ba_enable_beacon_abort;
535 __le32 bf_threshold_absolute_low[2];
536 __le32 bf_threshold_absolute_high[2];
537 } __packed; /* BEACON_FILTER_CONFIG_API_S_VER_4 */
538
539 /* Beacon filtering and beacon abort */
540 #define IWL_BF_ENERGY_DELTA_DEFAULT 5
541 #define IWL_BF_ENERGY_DELTA_D0I3 20
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
546 #define IWL_BF_ROAMING_ENERGY_DELTA_D0I3 20
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
551 #define IWL_BF_ROAMING_STATE_D0I3 72
552 #define IWL_BF_ROAMING_STATE_MAX 255
553 #define IWL_BF_ROAMING_STATE_MIN 0
554
555 #define IWL_BF_TEMP_THRESHOLD_DEFAULT 112
556 #define IWL_BF_TEMP_THRESHOLD_D0I3 112
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
561 #define IWL_BF_TEMP_FAST_FILTER_D0I3 1
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
566 #define IWL_BF_TEMP_SLOW_FILTER_D0I3 20
567 #define IWL_BF_TEMP_SLOW_FILTER_MAX 255
568 #define IWL_BF_TEMP_SLOW_FILTER_MIN 0
569
570 #define IWL_BF_ENABLE_BEACON_FILTER_DEFAULT 1
571
572 #define IWL_BF_DEBUG_FLAG_DEFAULT 0
573 #define IWL_BF_DEBUG_FLAG_D0I3 0
574
575 #define IWL_BF_ESCAPE_TIMER_DEFAULT 0
576 #define IWL_BF_ESCAPE_TIMER_D0I3 0
577 #define IWL_BF_ESCAPE_TIMER_MAX 1024
578 #define IWL_BF_ESCAPE_TIMER_MIN 0
579
580 #define IWL_BA_ESCAPE_TIMER_DEFAULT 6
581 #define IWL_BA_ESCAPE_TIMER_D0I3 6
582 #define IWL_BA_ESCAPE_TIMER_D3 9
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
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)
599
600 #define IWL_BF_CMD_CONFIG_DEFAULTS IWL_BF_CMD_CONFIG(_DEFAULT)
601 #define IWL_BF_CMD_CONFIG_D0I3 IWL_BF_CMD_CONFIG(_D0I3)
602 #endif /* __iwl_fw_api_power_h__ */