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 - 2013 Intel Corporation. All rights reserved.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of version 2 of the GNU General Public License as
12 * published by the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
24 * The full GNU General Public License is included in this distribution
25 * in the file called COPYING.
27 * Contact Information:
28 * Intel Linux Wireless <ilw@linux.intel.com>
29 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
33 * Copyright(c) 2012 - 2013 Intel Corporation. All rights reserved.
34 * All rights reserved.
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
40 * * Redistributions of source code must retain the above copyright
41 * notice, this list of conditions and the following disclaimer.
42 * * Redistributions in binary form must reproduce the above copyright
43 * notice, this list of conditions and the following disclaimer in
44 * the documentation and/or other materials provided with the
46 * * Neither the name Intel Corporation nor the names of its
47 * contributors may be used to endorse or promote products derived
48 * from this software without specific prior written permission.
50 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
51 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
52 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
53 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
54 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
55 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
56 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
57 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
58 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
59 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
60 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62 *****************************************************************************/
64 #ifndef __fw_api_power_h__
65 #define __fw_api_power_h__
67 /* Power Management Commands, Responses, Notifications */
70 * enum iwl_ltr_config_flags - masks for LTR config command flags
71 * @LTR_CFG_FLAG_FEATURE_ENABLE: Feature operational status
72 * @LTR_CFG_FLAG_HW_DIS_ON_SHADOW_REG_ACCESS: allow LTR change on shadow
74 * @LTR_CFG_FLAG_HW_EN_SHRT_WR_THROUGH: allow LTR msg send on ANY LTR
76 * @LTR_CFG_FLAG_HW_DIS_ON_D0_2_D3: allow LTR msg send on transition from
78 * @LTR_CFG_FLAG_SW_SET_SHORT: fixed static short LTR register
79 * @LTR_CFG_FLAG_SW_SET_LONG: fixed static short LONG register
80 * @LTR_CFG_FLAG_DENIE_C10_ON_PD: allow going into C10 on PD
82 enum iwl_ltr_config_flags
{
83 LTR_CFG_FLAG_FEATURE_ENABLE
= BIT(0),
84 LTR_CFG_FLAG_HW_DIS_ON_SHADOW_REG_ACCESS
= BIT(1),
85 LTR_CFG_FLAG_HW_EN_SHRT_WR_THROUGH
= BIT(2),
86 LTR_CFG_FLAG_HW_DIS_ON_D0_2_D3
= BIT(3),
87 LTR_CFG_FLAG_SW_SET_SHORT
= BIT(4),
88 LTR_CFG_FLAG_SW_SET_LONG
= BIT(5),
89 LTR_CFG_FLAG_DENIE_C10_ON_PD
= BIT(6),
93 * struct iwl_ltr_config_cmd - configures the LTR
94 * @flags: See %enum iwl_ltr_config_flags
96 struct iwl_ltr_config_cmd
{
102 /* Radio LP RX Energy Threshold measured in dBm */
103 #define POWER_LPRX_RSSI_THRESHOLD 75
104 #define POWER_LPRX_RSSI_THRESHOLD_MAX 94
105 #define POWER_LPRX_RSSI_THRESHOLD_MIN 30
108 * enum iwl_power_flags - masks for power table command flags
109 * @POWER_FLAGS_POWER_SAVE_ENA_MSK: '1' Allow to save power by turning off
110 * receiver and transmitter. '0' - does not allow.
111 * @POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK: '0' Driver disables power management,
112 * '1' Driver enables PM (use rest of parameters)
113 * @POWER_FLAGS_SKIP_OVER_DTIM_MSK: '0' PM have to walk up every DTIM,
114 * '1' PM could sleep over DTIM till listen Interval.
115 * @POWER_FLAGS_SNOOZE_ENA_MSK: Enable snoozing only if uAPSD is enabled and all
116 * access categories are both delivery and trigger enabled.
117 * @POWER_FLAGS_BT_SCO_ENA: Enable BT SCO coex only if uAPSD and
118 * PBW Snoozing enabled
119 * @POWER_FLAGS_ADVANCE_PM_ENA_MSK: Advanced PM (uAPSD) enable mask
120 * @POWER_FLAGS_LPRX_ENA_MSK: Low Power RX enable.
122 enum iwl_power_flags
{
123 POWER_FLAGS_POWER_SAVE_ENA_MSK
= BIT(0),
124 POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK
= BIT(1),
125 POWER_FLAGS_SKIP_OVER_DTIM_MSK
= BIT(2),
126 POWER_FLAGS_SNOOZE_ENA_MSK
= BIT(5),
127 POWER_FLAGS_BT_SCO_ENA
= BIT(8),
128 POWER_FLAGS_ADVANCE_PM_ENA_MSK
= BIT(9),
129 POWER_FLAGS_LPRX_ENA_MSK
= BIT(11),
132 #define IWL_POWER_VEC_SIZE 5
135 * struct iwl_powertable_cmd - legacy power command. Beside old API support this
136 * is used also with a new power API for device wide power settings.
137 * POWER_TABLE_CMD = 0x77 (command, has simple generic response)
139 * @flags: Power table command flags from POWER_FLAGS_*
140 * @keep_alive_seconds: Keep alive period in seconds. Default - 25 sec.
141 * Minimum allowed:- 3 * DTIM. Keep alive period must be
142 * set regardless of power scheme or current power state.
143 * FW use this value also when PM is disabled.
144 * @rx_data_timeout: Minimum time (usec) from last Rx packet for AM to
145 * PSM transition - legacy PM
146 * @tx_data_timeout: Minimum time (usec) from last Tx packet for AM to
147 * PSM transition - legacy PM
148 * @sleep_interval: not in use
149 * @skip_dtim_periods: Number of DTIM periods to skip if Skip over DTIM flag
150 * is set. For example, if it is required to skip over
151 * one DTIM, this value need to be set to 2 (DTIM periods).
152 * @lprx_rssi_threshold: Signal strength up to which LP RX can be enabled.
155 struct iwl_powertable_cmd
{
156 /* PM_POWER_TABLE_CMD_API_S_VER_6 */
158 u8 keep_alive_seconds
;
160 __le32 rx_data_timeout
;
161 __le32 tx_data_timeout
;
162 __le32 sleep_interval
[IWL_POWER_VEC_SIZE
];
163 __le32 skip_dtim_periods
;
164 __le32 lprx_rssi_threshold
;
168 * struct iwl_mac_power_cmd - New power command containing uAPSD support
169 * MAC_PM_POWER_TABLE = 0xA9 (command, has simple generic response)
170 * @id_and_color: MAC contex identifier
171 * @flags: Power table command flags from POWER_FLAGS_*
172 * @keep_alive_seconds: Keep alive period in seconds. Default - 25 sec.
173 * Minimum allowed:- 3 * DTIM. Keep alive period must be
174 * set regardless of power scheme or current power state.
175 * FW use this value also when PM is disabled.
176 * @rx_data_timeout: Minimum time (usec) from last Rx packet for AM to
177 * PSM transition - legacy PM
178 * @tx_data_timeout: Minimum time (usec) from last Tx packet for AM to
179 * PSM transition - legacy PM
180 * @sleep_interval: not in use
181 * @skip_dtim_periods: Number of DTIM periods to skip if Skip over DTIM flag
182 * is set. For example, if it is required to skip over
183 * one DTIM, this value need to be set to 2 (DTIM periods).
184 * @rx_data_timeout_uapsd: Minimum time (usec) from last Rx packet for AM to
185 * PSM transition - uAPSD
186 * @tx_data_timeout_uapsd: Minimum time (usec) from last Tx packet for AM to
187 * PSM transition - uAPSD
188 * @lprx_rssi_threshold: Signal strength up to which LP RX can be enabled.
190 * @num_skip_dtim: Number of DTIMs to skip if Skip over DTIM flag is set
191 * @snooze_interval: Maximum time between attempts to retrieve buffered data
193 * @snooze_window: A window of time in which PBW snoozing insures that all
194 * packets received. It is also the minimum time from last
195 * received unicast RX packet, before client stops snoozing
198 * @qndp_tid: TID client shall use for uAPSD QNDP triggers
199 * @uapsd_ac_flags: Set trigger-enabled and delivery-enabled indication for
200 * each corresponding AC.
201 * Use IEEE80211_WMM_IE_STA_QOSINFO_AC* for correct values.
202 * @uapsd_max_sp: Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct
204 * @heavy_tx_thld_packets: TX threshold measured in number of packets
205 * @heavy_rx_thld_packets: RX threshold measured in number of packets
206 * @heavy_tx_thld_percentage: TX threshold measured in load's percentage
207 * @heavy_rx_thld_percentage: RX threshold measured in load's percentage
208 * @limited_ps_threshold:
210 struct iwl_mac_power_cmd
{
211 /* CONTEXT_DESC_API_T_VER_1 */
214 /* CLIENT_PM_POWER_TABLE_S_VER_1 */
216 __le16 keep_alive_seconds
;
217 __le32 rx_data_timeout
;
218 __le32 tx_data_timeout
;
219 __le32 rx_data_timeout_uapsd
;
220 __le32 tx_data_timeout_uapsd
;
221 u8 lprx_rssi_threshold
;
222 u8 skip_dtim_periods
;
223 __le16 snooze_interval
;
224 __le16 snooze_window
;
229 u8 heavy_tx_thld_packets
;
230 u8 heavy_rx_thld_packets
;
231 u8 heavy_tx_thld_percentage
;
232 u8 heavy_rx_thld_percentage
;
233 u8 limited_ps_threshold
;
238 * struct iwl_beacon_filter_cmd
239 * REPLY_BEACON_FILTERING_CMD = 0xd2 (command)
240 * @id_and_color: MAC contex identifier
241 * @bf_energy_delta: Used for RSSI filtering, if in 'normal' state. Send beacon
242 * to driver if delta in Energy values calculated for this and last
243 * passed beacon is greater than this threshold. Zero value means that
244 * the Energy change is ignored for beacon filtering, and beacon will
245 * not be forced to be sent to driver regardless of this delta. Typical
247 * @bf_roaming_energy_delta: Used for RSSI filtering, if in 'roaming' state.
248 * Send beacon to driver if delta in Energy values calculated for this
249 * and last passed beacon is greater than this threshold. Zero value
250 * means that the Energy change is ignored for beacon filtering while in
251 * Roaming state, typical energy delta 1dB.
252 * @bf_roaming_state: Used for RSSI filtering. If absolute Energy values
253 * calculated for current beacon is less than the threshold, use
254 * Roaming Energy Delta Threshold, otherwise use normal Energy Delta
255 * Threshold. Typical energy threshold is -72dBm.
256 * @bf_temp_threshold: This threshold determines the type of temperature
257 * filtering (Slow or Fast) that is selected (Units are in Celsuis):
258 * If the current temperature is above this threshold - Fast filter
259 * will be used, If the current temperature is below this threshold -
260 * Slow filter will be used.
261 * @bf_temp_fast_filter: Send Beacon to driver if delta in temperature values
262 * calculated for this and the last passed beacon is greater than this
263 * threshold. Zero value means that the temperature change is ignored for
264 * beacon filtering; beacons will not be forced to be sent to driver
265 * regardless of whether its temerature has been changed.
266 * @bf_temp_slow_filter: Send Beacon to driver if delta in temperature values
267 * calculated for this and the last passed beacon is greater than this
268 * threshold. Zero value means that the temperature change is ignored for
269 * beacon filtering; beacons will not be forced to be sent to driver
270 * regardless of whether its temerature has been changed.
271 * @bf_enable_beacon_filter: 1, beacon filtering is enabled; 0, disabled.
272 * @bf_filter_escape_timer: Send beacons to to driver if no beacons were passed
273 * for a specific period of time. Units: Beacons.
274 * @ba_escape_timer: Fully receive and parse beacon if no beacons were passed
275 * for a longer period of time then this escape-timeout. Units: Beacons.
276 * @ba_enable_beacon_abort: 1, beacon abort is enabled; 0, disabled.
278 struct iwl_beacon_filter_cmd
{
279 __le32 bf_energy_delta
;
280 __le32 bf_roaming_energy_delta
;
281 __le32 bf_roaming_state
;
282 __le32 bf_temp_threshold
;
283 __le32 bf_temp_fast_filter
;
284 __le32 bf_temp_slow_filter
;
285 __le32 bf_enable_beacon_filter
;
286 __le32 bf_debug_flag
;
287 __le32 bf_escape_timer
;
288 __le32 ba_escape_timer
;
289 __le32 ba_enable_beacon_abort
;
292 /* Beacon filtering and beacon abort */
293 #define IWL_BF_ENERGY_DELTA_DEFAULT 5
294 #define IWL_BF_ENERGY_DELTA_MAX 255
295 #define IWL_BF_ENERGY_DELTA_MIN 0
297 #define IWL_BF_ROAMING_ENERGY_DELTA_DEFAULT 1
298 #define IWL_BF_ROAMING_ENERGY_DELTA_MAX 255
299 #define IWL_BF_ROAMING_ENERGY_DELTA_MIN 0
301 #define IWL_BF_ROAMING_STATE_DEFAULT 72
302 #define IWL_BF_ROAMING_STATE_MAX 255
303 #define IWL_BF_ROAMING_STATE_MIN 0
305 #define IWL_BF_TEMP_THRESHOLD_DEFAULT 112
306 #define IWL_BF_TEMP_THRESHOLD_MAX 255
307 #define IWL_BF_TEMP_THRESHOLD_MIN 0
309 #define IWL_BF_TEMP_FAST_FILTER_DEFAULT 1
310 #define IWL_BF_TEMP_FAST_FILTER_MAX 255
311 #define IWL_BF_TEMP_FAST_FILTER_MIN 0
313 #define IWL_BF_TEMP_SLOW_FILTER_DEFAULT 5
314 #define IWL_BF_TEMP_SLOW_FILTER_MAX 255
315 #define IWL_BF_TEMP_SLOW_FILTER_MIN 0
317 #define IWL_BF_ENABLE_BEACON_FILTER_DEFAULT 1
319 #define IWL_BF_DEBUG_FLAG_DEFAULT 0
321 #define IWL_BF_ESCAPE_TIMER_DEFAULT 50
322 #define IWL_BF_ESCAPE_TIMER_MAX 1024
323 #define IWL_BF_ESCAPE_TIMER_MIN 0
325 #define IWL_BA_ESCAPE_TIMER_DEFAULT 6
326 #define IWL_BA_ESCAPE_TIMER_D3 6
327 #define IWL_BA_ESCAPE_TIMER_MAX 1024
328 #define IWL_BA_ESCAPE_TIMER_MIN 0
330 #define IWL_BA_ENABLE_BEACON_ABORT_DEFAULT 1
332 #define IWL_BF_CMD_CONFIG_DEFAULTS \
333 .bf_energy_delta = cpu_to_le32(IWL_BF_ENERGY_DELTA_DEFAULT), \
334 .bf_roaming_energy_delta = \
335 cpu_to_le32(IWL_BF_ROAMING_ENERGY_DELTA_DEFAULT), \
336 .bf_roaming_state = cpu_to_le32(IWL_BF_ROAMING_STATE_DEFAULT), \
337 .bf_temp_threshold = cpu_to_le32(IWL_BF_TEMP_THRESHOLD_DEFAULT), \
338 .bf_temp_fast_filter = cpu_to_le32(IWL_BF_TEMP_FAST_FILTER_DEFAULT), \
339 .bf_temp_slow_filter = cpu_to_le32(IWL_BF_TEMP_SLOW_FILTER_DEFAULT), \
340 .bf_debug_flag = cpu_to_le32(IWL_BF_DEBUG_FLAG_DEFAULT), \
341 .bf_escape_timer = cpu_to_le32(IWL_BF_ESCAPE_TIMER_DEFAULT), \
342 .ba_escape_timer = cpu_to_le32(IWL_BA_ESCAPE_TIMER_DEFAULT)