Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 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 | * |
Emmanuel Grumbach | 51368bf | 2013-12-30 13:15:54 +0200 | [diff] [blame] | 8 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
Johannes Berg | 8b4139d | 2014-07-24 14:05:26 +0200 | [diff] [blame] | 9 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH |
Johannes Berg | da03f02 | 2015-08-18 15:15:36 +0200 | [diff] [blame] | 10 | * Copyright(c) 2015 Intel Deutschland GmbH |
Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 11 | * |
| 12 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of version 2 of the GNU General Public License as |
| 14 | * published by the Free Software Foundation. |
| 15 | * |
| 16 | * This program is distributed in the hope that it will be useful, but |
| 17 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 19 | * General Public License for more details. |
| 20 | * |
| 21 | * You should have received a copy of the GNU General Public License |
| 22 | * along with this program; if not, write to the Free Software |
| 23 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, |
| 24 | * USA |
| 25 | * |
| 26 | * The full GNU General Public License is included in this distribution |
Emmanuel Grumbach | 410dc5a | 2013-02-18 09:22:28 +0200 | [diff] [blame] | 27 | * in the file called COPYING. |
Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 28 | * |
| 29 | * Contact Information: |
Emmanuel Grumbach | d01c536 | 2015-11-17 15:39:56 +0200 | [diff] [blame] | 30 | * Intel Linux Wireless <linuxwifi@intel.com> |
Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 31 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 |
| 32 | * |
| 33 | * BSD LICENSE |
| 34 | * |
Emmanuel Grumbach | 51368bf | 2013-12-30 13:15:54 +0200 | [diff] [blame] | 35 | * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
Johannes Berg | 8b4139d | 2014-07-24 14:05:26 +0200 | [diff] [blame] | 36 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH |
Johannes Berg | da03f02 | 2015-08-18 15:15:36 +0200 | [diff] [blame] | 37 | * Copyright(c) 2015 Intel Deutschland GmbH |
Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 38 | * All rights reserved. |
| 39 | * |
| 40 | * Redistribution and use in source and binary forms, with or without |
| 41 | * modification, are permitted provided that the following conditions |
| 42 | * are met: |
| 43 | * |
| 44 | * * Redistributions of source code must retain the above copyright |
| 45 | * notice, this list of conditions and the following disclaimer. |
| 46 | * * Redistributions in binary form must reproduce the above copyright |
| 47 | * notice, this list of conditions and the following disclaimer in |
| 48 | * the documentation and/or other materials provided with the |
| 49 | * distribution. |
| 50 | * * Neither the name Intel Corporation nor the names of its |
| 51 | * contributors may be used to endorse or promote products derived |
| 52 | * from this software without specific prior written permission. |
| 53 | * |
| 54 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 55 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 56 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 57 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 58 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 59 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 60 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 61 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 62 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 63 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 64 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 65 | * |
| 66 | *****************************************************************************/ |
| 67 | |
| 68 | #ifndef __fw_api_power_h__ |
| 69 | #define __fw_api_power_h__ |
| 70 | |
| 71 | /* Power Management Commands, Responses, Notifications */ |
| 72 | |
Emmanuel Grumbach | 9180ac5 | 2014-09-23 23:02:41 +0300 | [diff] [blame] | 73 | /** |
| 74 | * enum iwl_ltr_config_flags - masks for LTR config command flags |
| 75 | * @LTR_CFG_FLAG_FEATURE_ENABLE: Feature operational status |
| 76 | * @LTR_CFG_FLAG_HW_DIS_ON_SHADOW_REG_ACCESS: allow LTR change on shadow |
| 77 | * memory access |
| 78 | * @LTR_CFG_FLAG_HW_EN_SHRT_WR_THROUGH: allow LTR msg send on ANY LTR |
| 79 | * reg change |
| 80 | * @LTR_CFG_FLAG_HW_DIS_ON_D0_2_D3: allow LTR msg send on transition from |
| 81 | * D0 to D3 |
| 82 | * @LTR_CFG_FLAG_SW_SET_SHORT: fixed static short LTR register |
| 83 | * @LTR_CFG_FLAG_SW_SET_LONG: fixed static short LONG register |
| 84 | * @LTR_CFG_FLAG_DENIE_C10_ON_PD: allow going into C10 on PD |
| 85 | */ |
| 86 | enum iwl_ltr_config_flags { |
| 87 | LTR_CFG_FLAG_FEATURE_ENABLE = BIT(0), |
| 88 | LTR_CFG_FLAG_HW_DIS_ON_SHADOW_REG_ACCESS = BIT(1), |
| 89 | LTR_CFG_FLAG_HW_EN_SHRT_WR_THROUGH = BIT(2), |
| 90 | LTR_CFG_FLAG_HW_DIS_ON_D0_2_D3 = BIT(3), |
| 91 | LTR_CFG_FLAG_SW_SET_SHORT = BIT(4), |
| 92 | LTR_CFG_FLAG_SW_SET_LONG = BIT(5), |
| 93 | LTR_CFG_FLAG_DENIE_C10_ON_PD = BIT(6), |
| 94 | }; |
| 95 | |
| 96 | /** |
Emmanuel Grumbach | 84bfffa | 2015-01-13 10:16:30 +0200 | [diff] [blame] | 97 | * struct iwl_ltr_config_cmd_v1 - configures the LTR |
| 98 | * @flags: See %enum iwl_ltr_config_flags |
| 99 | */ |
| 100 | struct iwl_ltr_config_cmd_v1 { |
| 101 | __le32 flags; |
| 102 | __le32 static_long; |
| 103 | __le32 static_short; |
| 104 | } __packed; /* LTR_CAPABLE_API_S_VER_1 */ |
| 105 | |
| 106 | #define LTR_VALID_STATES_NUM 4 |
| 107 | |
| 108 | /** |
Emmanuel Grumbach | 9180ac5 | 2014-09-23 23:02:41 +0300 | [diff] [blame] | 109 | * struct iwl_ltr_config_cmd - configures the LTR |
| 110 | * @flags: See %enum iwl_ltr_config_flags |
Emmanuel Grumbach | 84bfffa | 2015-01-13 10:16:30 +0200 | [diff] [blame] | 111 | * @static_long: |
| 112 | * @static_short: |
| 113 | * @ltr_cfg_values: |
| 114 | * @ltr_short_idle_timeout: |
Emmanuel Grumbach | 9180ac5 | 2014-09-23 23:02:41 +0300 | [diff] [blame] | 115 | */ |
| 116 | struct iwl_ltr_config_cmd { |
| 117 | __le32 flags; |
| 118 | __le32 static_long; |
| 119 | __le32 static_short; |
Emmanuel Grumbach | 84bfffa | 2015-01-13 10:16:30 +0200 | [diff] [blame] | 120 | __le32 ltr_cfg_values[LTR_VALID_STATES_NUM]; |
| 121 | __le32 ltr_short_idle_timeout; |
| 122 | } __packed; /* LTR_CAPABLE_API_S_VER_2 */ |
Emmanuel Grumbach | 9180ac5 | 2014-09-23 23:02:41 +0300 | [diff] [blame] | 123 | |
Alexander Bondar | bd4ace2 | 2013-03-21 17:14:14 +0200 | [diff] [blame] | 124 | /* Radio LP RX Energy Threshold measured in dBm */ |
| 125 | #define POWER_LPRX_RSSI_THRESHOLD 75 |
| 126 | #define POWER_LPRX_RSSI_THRESHOLD_MAX 94 |
| 127 | #define POWER_LPRX_RSSI_THRESHOLD_MIN 30 |
| 128 | |
Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 129 | /** |
Emmanuel Grumbach | 9180ac5 | 2014-09-23 23:02:41 +0300 | [diff] [blame] | 130 | * enum iwl_power_flags - masks for power table command flags |
Alexander Bondar | 83bdad5 | 2013-02-03 21:26:44 +0200 | [diff] [blame] | 131 | * @POWER_FLAGS_POWER_SAVE_ENA_MSK: '1' Allow to save power by turning off |
| 132 | * receiver and transmitter. '0' - does not allow. |
Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 133 | * @POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK: '0' Driver disables power management, |
| 134 | * '1' Driver enables PM (use rest of parameters) |
Alexander Bondar | f4a3e2f | 2013-03-05 13:47:04 +0200 | [diff] [blame] | 135 | * @POWER_FLAGS_SKIP_OVER_DTIM_MSK: '0' PM have to walk up every DTIM, |
Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 136 | * '1' PM could sleep over DTIM till listen Interval. |
Alexander Bondar | e811ada | 2013-03-10 15:29:44 +0200 | [diff] [blame] | 137 | * @POWER_FLAGS_SNOOZE_ENA_MSK: Enable snoozing only if uAPSD is enabled and all |
| 138 | * access categories are both delivery and trigger enabled. |
| 139 | * @POWER_FLAGS_BT_SCO_ENA: Enable BT SCO coex only if uAPSD and |
| 140 | * PBW Snoozing enabled |
Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 141 | * @POWER_FLAGS_ADVANCE_PM_ENA_MSK: Advanced PM (uAPSD) enable mask |
Alexander Bondar | 83bdad5 | 2013-02-03 21:26:44 +0200 | [diff] [blame] | 142 | * @POWER_FLAGS_LPRX_ENA_MSK: Low Power RX enable. |
Alexander Bondar | 175a70b | 2013-04-14 20:59:37 +0300 | [diff] [blame] | 143 | * @POWER_FLAGS_AP_UAPSD_MISBEHAVING_ENA_MSK: AP/GO's uAPSD misbehaving |
| 144 | * detection enablement |
Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 145 | */ |
| 146 | enum iwl_power_flags { |
Alexander Bondar | 83bdad5 | 2013-02-03 21:26:44 +0200 | [diff] [blame] | 147 | POWER_FLAGS_POWER_SAVE_ENA_MSK = BIT(0), |
| 148 | POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK = BIT(1), |
Alexander Bondar | f4a3e2f | 2013-03-05 13:47:04 +0200 | [diff] [blame] | 149 | POWER_FLAGS_SKIP_OVER_DTIM_MSK = BIT(2), |
Alexander Bondar | e811ada | 2013-03-10 15:29:44 +0200 | [diff] [blame] | 150 | POWER_FLAGS_SNOOZE_ENA_MSK = BIT(5), |
| 151 | POWER_FLAGS_BT_SCO_ENA = BIT(8), |
Alexander Bondar | 83bdad5 | 2013-02-03 21:26:44 +0200 | [diff] [blame] | 152 | POWER_FLAGS_ADVANCE_PM_ENA_MSK = BIT(9), |
| 153 | POWER_FLAGS_LPRX_ENA_MSK = BIT(11), |
Alexander Bondar | 175a70b | 2013-04-14 20:59:37 +0300 | [diff] [blame] | 154 | POWER_FLAGS_UAPSD_MISBEHAVING_ENA_MSK = BIT(12), |
Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 155 | }; |
| 156 | |
Alexander Bondar | 83bdad5 | 2013-02-03 21:26:44 +0200 | [diff] [blame] | 157 | #define IWL_POWER_VEC_SIZE 5 |
| 158 | |
Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 159 | /** |
Alexander Bondar | e811ada | 2013-03-10 15:29:44 +0200 | [diff] [blame] | 160 | * struct iwl_powertable_cmd - legacy power command. Beside old API support this |
| 161 | * is used also with a new power API for device wide power settings. |
Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 162 | * POWER_TABLE_CMD = 0x77 (command, has simple generic response) |
| 163 | * |
Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 164 | * @flags: Power table command flags from POWER_FLAGS_* |
| 165 | * @keep_alive_seconds: Keep alive period in seconds. Default - 25 sec. |
Alexander Bondar | e16cf7e | 2013-03-05 14:01:27 +0200 | [diff] [blame] | 166 | * Minimum allowed:- 3 * DTIM. Keep alive period must be |
| 167 | * set regardless of power scheme or current power state. |
| 168 | * FW use this value also when PM is disabled. |
Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 169 | * @rx_data_timeout: Minimum time (usec) from last Rx packet for AM to |
| 170 | * PSM transition - legacy PM |
| 171 | * @tx_data_timeout: Minimum time (usec) from last Tx packet for AM to |
| 172 | * PSM transition - legacy PM |
Alexander Bondar | 83bdad5 | 2013-02-03 21:26:44 +0200 | [diff] [blame] | 173 | * @sleep_interval: not in use |
Alexander Bondar | 1bd2d17 | 2013-05-21 14:49:09 +0300 | [diff] [blame] | 174 | * @skip_dtim_periods: Number of DTIM periods to skip if Skip over DTIM flag |
| 175 | * is set. For example, if it is required to skip over |
| 176 | * one DTIM, this value need to be set to 2 (DTIM periods). |
Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 177 | * @lprx_rssi_threshold: Signal strength up to which LP RX can be enabled. |
| 178 | * Default: 80dbm |
Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 179 | */ |
| 180 | struct iwl_powertable_cmd { |
Alexander Bondar | 5b1dbfc | 2013-04-23 13:32:35 +0300 | [diff] [blame] | 181 | /* PM_POWER_TABLE_CMD_API_S_VER_6 */ |
Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 182 | __le16 flags; |
Alexander Bondar | 83bdad5 | 2013-02-03 21:26:44 +0200 | [diff] [blame] | 183 | u8 keep_alive_seconds; |
| 184 | u8 debug_flags; |
Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 185 | __le32 rx_data_timeout; |
| 186 | __le32 tx_data_timeout; |
Alexander Bondar | 83bdad5 | 2013-02-03 21:26:44 +0200 | [diff] [blame] | 187 | __le32 sleep_interval[IWL_POWER_VEC_SIZE]; |
Alexander Bondar | 1bd2d17 | 2013-05-21 14:49:09 +0300 | [diff] [blame] | 188 | __le32 skip_dtim_periods; |
Alexander Bondar | 83bdad5 | 2013-02-03 21:26:44 +0200 | [diff] [blame] | 189 | __le32 lprx_rssi_threshold; |
Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 190 | } __packed; |
| 191 | |
Hila Gonen | 7df15b1 | 2012-12-12 11:16:19 +0200 | [diff] [blame] | 192 | /** |
Alexander Bondar | 64b928c | 2013-09-03 14:18:03 +0300 | [diff] [blame] | 193 | * enum iwl_device_power_flags - masks for device power command flags |
| 194 | * @DEVIC_POWER_FLAGS_POWER_SAVE_ENA_MSK: '1' Allow to save power by turning off |
Johannes Berg | ceef91c | 2015-09-04 11:27:25 +0200 | [diff] [blame] | 195 | * receiver and transmitter. '0' - does not allow. |
Alexander Bondar | 64b928c | 2013-09-03 14:18:03 +0300 | [diff] [blame] | 196 | */ |
| 197 | enum iwl_device_power_flags { |
| 198 | DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK = BIT(0), |
Alexander Bondar | 64b928c | 2013-09-03 14:18:03 +0300 | [diff] [blame] | 199 | }; |
| 200 | |
| 201 | /** |
| 202 | * struct iwl_device_power_cmd - device wide power command. |
| 203 | * DEVICE_POWER_CMD = 0x77 (command, has simple generic response) |
| 204 | * |
| 205 | * @flags: Power table command flags from DEVICE_POWER_FLAGS_* |
| 206 | */ |
| 207 | struct iwl_device_power_cmd { |
| 208 | /* PM_POWER_TABLE_CMD_API_S_VER_6 */ |
| 209 | __le16 flags; |
| 210 | __le16 reserved; |
| 211 | } __packed; |
| 212 | |
| 213 | /** |
Alexander Bondar | e811ada | 2013-03-10 15:29:44 +0200 | [diff] [blame] | 214 | * struct iwl_mac_power_cmd - New power command containing uAPSD support |
| 215 | * MAC_PM_POWER_TABLE = 0xA9 (command, has simple generic response) |
| 216 | * @id_and_color: MAC contex identifier |
| 217 | * @flags: Power table command flags from POWER_FLAGS_* |
| 218 | * @keep_alive_seconds: Keep alive period in seconds. Default - 25 sec. |
| 219 | * Minimum allowed:- 3 * DTIM. Keep alive period must be |
| 220 | * set regardless of power scheme or current power state. |
| 221 | * FW use this value also when PM is disabled. |
| 222 | * @rx_data_timeout: Minimum time (usec) from last Rx packet for AM to |
| 223 | * PSM transition - legacy PM |
| 224 | * @tx_data_timeout: Minimum time (usec) from last Tx packet for AM to |
| 225 | * PSM transition - legacy PM |
| 226 | * @sleep_interval: not in use |
| 227 | * @skip_dtim_periods: Number of DTIM periods to skip if Skip over DTIM flag |
| 228 | * is set. For example, if it is required to skip over |
| 229 | * one DTIM, this value need to be set to 2 (DTIM periods). |
| 230 | * @rx_data_timeout_uapsd: Minimum time (usec) from last Rx packet for AM to |
| 231 | * PSM transition - uAPSD |
| 232 | * @tx_data_timeout_uapsd: Minimum time (usec) from last Tx packet for AM to |
| 233 | * PSM transition - uAPSD |
| 234 | * @lprx_rssi_threshold: Signal strength up to which LP RX can be enabled. |
| 235 | * Default: 80dbm |
| 236 | * @num_skip_dtim: Number of DTIMs to skip if Skip over DTIM flag is set |
Alexander Bondar | 8971634 | 2013-08-04 17:52:23 +0300 | [diff] [blame] | 237 | * @snooze_interval: Maximum time between attempts to retrieve buffered data |
| 238 | * from the AP [msec] |
| 239 | * @snooze_window: A window of time in which PBW snoozing insures that all |
| 240 | * packets received. It is also the minimum time from last |
| 241 | * received unicast RX packet, before client stops snoozing |
| 242 | * for data. [msec] |
Alexander Bondar | e811ada | 2013-03-10 15:29:44 +0200 | [diff] [blame] | 243 | * @snooze_step: TBD |
| 244 | * @qndp_tid: TID client shall use for uAPSD QNDP triggers |
| 245 | * @uapsd_ac_flags: Set trigger-enabled and delivery-enabled indication for |
| 246 | * each corresponding AC. |
| 247 | * Use IEEE80211_WMM_IE_STA_QOSINFO_AC* for correct values. |
| 248 | * @uapsd_max_sp: Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct |
| 249 | * values. |
Alexander Bondar | e3c588e | 2013-04-07 14:08:59 +0300 | [diff] [blame] | 250 | * @heavy_tx_thld_packets: TX threshold measured in number of packets |
| 251 | * @heavy_rx_thld_packets: RX threshold measured in number of packets |
| 252 | * @heavy_tx_thld_percentage: TX threshold measured in load's percentage |
| 253 | * @heavy_rx_thld_percentage: RX threshold measured in load's percentage |
Alexander Bondar | e811ada | 2013-03-10 15:29:44 +0200 | [diff] [blame] | 254 | * @limited_ps_threshold: |
| 255 | */ |
| 256 | struct iwl_mac_power_cmd { |
| 257 | /* CONTEXT_DESC_API_T_VER_1 */ |
| 258 | __le32 id_and_color; |
| 259 | |
| 260 | /* CLIENT_PM_POWER_TABLE_S_VER_1 */ |
| 261 | __le16 flags; |
| 262 | __le16 keep_alive_seconds; |
| 263 | __le32 rx_data_timeout; |
| 264 | __le32 tx_data_timeout; |
| 265 | __le32 rx_data_timeout_uapsd; |
| 266 | __le32 tx_data_timeout_uapsd; |
| 267 | u8 lprx_rssi_threshold; |
| 268 | u8 skip_dtim_periods; |
| 269 | __le16 snooze_interval; |
| 270 | __le16 snooze_window; |
| 271 | u8 snooze_step; |
| 272 | u8 qndp_tid; |
| 273 | u8 uapsd_ac_flags; |
| 274 | u8 uapsd_max_sp; |
Alexander Bondar | e3c588e | 2013-04-07 14:08:59 +0300 | [diff] [blame] | 275 | u8 heavy_tx_thld_packets; |
| 276 | u8 heavy_rx_thld_packets; |
| 277 | u8 heavy_tx_thld_percentage; |
| 278 | u8 heavy_rx_thld_percentage; |
Alexander Bondar | e811ada | 2013-03-10 15:29:44 +0200 | [diff] [blame] | 279 | u8 limited_ps_threshold; |
| 280 | u8 reserved; |
| 281 | } __packed; |
| 282 | |
Alexander Bondar | 175a70b | 2013-04-14 20:59:37 +0300 | [diff] [blame] | 283 | /* |
| 284 | * struct iwl_uapsd_misbehaving_ap_notif - FW sends this notification when |
| 285 | * associated AP is identified as improperly implementing uAPSD protocol. |
| 286 | * PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78 |
| 287 | * @sta_id: index of station in uCode's station table - associated AP ID in |
| 288 | * this context. |
| 289 | */ |
| 290 | struct iwl_uapsd_misbehaving_ap_notif { |
| 291 | __le32 sta_id; |
| 292 | u8 mac_id; |
| 293 | u8 reserved[3]; |
| 294 | } __packed; |
| 295 | |
Alexander Bondar | e811ada | 2013-03-10 15:29:44 +0200 | [diff] [blame] | 296 | /** |
Avri Altman | d44c3fe | 2015-04-18 22:16:42 +0300 | [diff] [blame] | 297 | * struct iwl_reduce_tx_power_cmd - TX power reduction command |
| 298 | * REDUCE_TX_POWER_CMD = 0x9f |
| 299 | * @flags: (reserved for future implementation) |
| 300 | * @mac_context_id: id of the mac ctx for which we are reducing TX power. |
| 301 | * @pwr_restriction: TX power restriction in dBms. |
| 302 | */ |
| 303 | struct iwl_reduce_tx_power_cmd { |
| 304 | u8 flags; |
| 305 | u8 mac_context_id; |
| 306 | __le16 pwr_restriction; |
| 307 | } __packed; /* TX_REDUCED_POWER_API_S_VER_1 */ |
| 308 | |
Johannes Berg | da03f02 | 2015-08-18 15:15:36 +0200 | [diff] [blame] | 309 | enum iwl_dev_tx_power_cmd_mode { |
| 310 | IWL_TX_POWER_MODE_SET_MAC = 0, |
| 311 | IWL_TX_POWER_MODE_SET_DEVICE = 1, |
| 312 | IWL_TX_POWER_MODE_SET_CHAINS = 2, |
| 313 | }; /* TX_POWER_REDUCED_FLAGS_TYPE_API_E_VER_2 */; |
| 314 | |
Avri Altman | d44c3fe | 2015-04-18 22:16:42 +0300 | [diff] [blame] | 315 | /** |
Johannes Berg | da03f02 | 2015-08-18 15:15:36 +0200 | [diff] [blame] | 316 | * struct iwl_dev_tx_power_cmd_v2 - TX power reduction command |
| 317 | * @set_mode: see &enum iwl_dev_tx_power_cmd_mode |
Avri Altman | d44c3fe | 2015-04-18 22:16:42 +0300 | [diff] [blame] | 318 | * @mac_context_id: id of the mac ctx for which we are reducing TX power. |
| 319 | * @pwr_restriction: TX power restriction in 1/8 dBms. |
| 320 | * @dev_24: device TX power restriction in 1/8 dBms |
| 321 | * @dev_52_low: device TX power restriction upper band - low |
| 322 | * @dev_52_high: device TX power restriction upper band - high |
| 323 | */ |
Johannes Berg | da03f02 | 2015-08-18 15:15:36 +0200 | [diff] [blame] | 324 | struct iwl_dev_tx_power_cmd_v2 { |
Avri Altman | d44c3fe | 2015-04-18 22:16:42 +0300 | [diff] [blame] | 325 | __le32 set_mode; |
| 326 | __le32 mac_context_id; |
| 327 | __le16 pwr_restriction; |
| 328 | __le16 dev_24; |
| 329 | __le16 dev_52_low; |
| 330 | __le16 dev_52_high; |
| 331 | } __packed; /* TX_REDUCED_POWER_API_S_VER_2 */ |
| 332 | |
Johannes Berg | da03f02 | 2015-08-18 15:15:36 +0200 | [diff] [blame] | 333 | #define IWL_NUM_CHAIN_LIMITS 2 |
| 334 | #define IWL_NUM_SUB_BANDS 5 |
| 335 | |
| 336 | /** |
| 337 | * struct iwl_dev_tx_power_cmd - TX power reduction command |
| 338 | * @v2: version 2 of the command, embedded here for easier software handling |
| 339 | * @per_chain_restriction: per chain restrictions |
| 340 | */ |
| 341 | struct iwl_dev_tx_power_cmd { |
| 342 | /* v3 is just an extension of v2 - keep this here */ |
| 343 | struct iwl_dev_tx_power_cmd_v2 v2; |
| 344 | __le16 per_chain_restriction[IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS]; |
| 345 | } __packed; /* TX_REDUCED_POWER_API_S_VER_3 */ |
| 346 | |
Avri Altman | d44c3fe | 2015-04-18 22:16:42 +0300 | [diff] [blame] | 347 | #define IWL_DEV_MAX_TX_POWER 0x7FFF |
| 348 | |
| 349 | /** |
Hila Gonen | 7df15b1 | 2012-12-12 11:16:19 +0200 | [diff] [blame] | 350 | * struct iwl_beacon_filter_cmd |
| 351 | * REPLY_BEACON_FILTERING_CMD = 0xd2 (command) |
| 352 | * @id_and_color: MAC contex identifier |
| 353 | * @bf_energy_delta: Used for RSSI filtering, if in 'normal' state. Send beacon |
| 354 | * to driver if delta in Energy values calculated for this and last |
| 355 | * passed beacon is greater than this threshold. Zero value means that |
| 356 | * the Energy change is ignored for beacon filtering, and beacon will |
| 357 | * not be forced to be sent to driver regardless of this delta. Typical |
| 358 | * energy delta 5dB. |
| 359 | * @bf_roaming_energy_delta: Used for RSSI filtering, if in 'roaming' state. |
| 360 | * Send beacon to driver if delta in Energy values calculated for this |
| 361 | * and last passed beacon is greater than this threshold. Zero value |
| 362 | * means that the Energy change is ignored for beacon filtering while in |
| 363 | * Roaming state, typical energy delta 1dB. |
| 364 | * @bf_roaming_state: Used for RSSI filtering. If absolute Energy values |
| 365 | * calculated for current beacon is less than the threshold, use |
| 366 | * Roaming Energy Delta Threshold, otherwise use normal Energy Delta |
| 367 | * Threshold. Typical energy threshold is -72dBm. |
Hila Gonen | 5dca7c2 | 2013-07-16 11:15:35 +0300 | [diff] [blame] | 368 | * @bf_temp_threshold: This threshold determines the type of temperature |
| 369 | * filtering (Slow or Fast) that is selected (Units are in Celsuis): |
| 370 | * If the current temperature is above this threshold - Fast filter |
| 371 | * will be used, If the current temperature is below this threshold - |
| 372 | * Slow filter will be used. |
| 373 | * @bf_temp_fast_filter: Send Beacon to driver if delta in temperature values |
| 374 | * calculated for this and the last passed beacon is greater than this |
| 375 | * threshold. Zero value means that the temperature change is ignored for |
Hila Gonen | 7df15b1 | 2012-12-12 11:16:19 +0200 | [diff] [blame] | 376 | * beacon filtering; beacons will not be forced to be sent to driver |
| 377 | * regardless of whether its temerature has been changed. |
Hila Gonen | 5dca7c2 | 2013-07-16 11:15:35 +0300 | [diff] [blame] | 378 | * @bf_temp_slow_filter: Send Beacon to driver if delta in temperature values |
| 379 | * calculated for this and the last passed beacon is greater than this |
| 380 | * threshold. Zero value means that the temperature change is ignored for |
| 381 | * beacon filtering; beacons will not be forced to be sent to driver |
| 382 | * regardless of whether its temerature has been changed. |
Hila Gonen | 7df15b1 | 2012-12-12 11:16:19 +0200 | [diff] [blame] | 383 | * @bf_enable_beacon_filter: 1, beacon filtering is enabled; 0, disabled. |
| 384 | * @bf_filter_escape_timer: Send beacons to to driver if no beacons were passed |
| 385 | * for a specific period of time. Units: Beacons. |
| 386 | * @ba_escape_timer: Fully receive and parse beacon if no beacons were passed |
| 387 | * for a longer period of time then this escape-timeout. Units: Beacons. |
| 388 | * @ba_enable_beacon_abort: 1, beacon abort is enabled; 0, disabled. |
| 389 | */ |
| 390 | struct iwl_beacon_filter_cmd { |
Hila Gonen | 5dca7c2 | 2013-07-16 11:15:35 +0300 | [diff] [blame] | 391 | __le32 bf_energy_delta; |
| 392 | __le32 bf_roaming_energy_delta; |
| 393 | __le32 bf_roaming_state; |
| 394 | __le32 bf_temp_threshold; |
| 395 | __le32 bf_temp_fast_filter; |
| 396 | __le32 bf_temp_slow_filter; |
| 397 | __le32 bf_enable_beacon_filter; |
| 398 | __le32 bf_debug_flag; |
Hila Gonen | 7df15b1 | 2012-12-12 11:16:19 +0200 | [diff] [blame] | 399 | __le32 bf_escape_timer; |
| 400 | __le32 ba_escape_timer; |
Hila Gonen | 5dca7c2 | 2013-07-16 11:15:35 +0300 | [diff] [blame] | 401 | __le32 ba_enable_beacon_abort; |
Hila Gonen | 7df15b1 | 2012-12-12 11:16:19 +0200 | [diff] [blame] | 402 | } __packed; |
| 403 | |
| 404 | /* Beacon filtering and beacon abort */ |
| 405 | #define IWL_BF_ENERGY_DELTA_DEFAULT 5 |
Eliad Peller | 3dd37d0 | 2014-01-07 14:00:24 +0200 | [diff] [blame] | 406 | #define IWL_BF_ENERGY_DELTA_D0I3 20 |
Hila Gonen | 7df15b1 | 2012-12-12 11:16:19 +0200 | [diff] [blame] | 407 | #define IWL_BF_ENERGY_DELTA_MAX 255 |
| 408 | #define IWL_BF_ENERGY_DELTA_MIN 0 |
| 409 | |
| 410 | #define IWL_BF_ROAMING_ENERGY_DELTA_DEFAULT 1 |
Eliad Peller | 3dd37d0 | 2014-01-07 14:00:24 +0200 | [diff] [blame] | 411 | #define IWL_BF_ROAMING_ENERGY_DELTA_D0I3 20 |
Hila Gonen | 7df15b1 | 2012-12-12 11:16:19 +0200 | [diff] [blame] | 412 | #define IWL_BF_ROAMING_ENERGY_DELTA_MAX 255 |
| 413 | #define IWL_BF_ROAMING_ENERGY_DELTA_MIN 0 |
| 414 | |
| 415 | #define IWL_BF_ROAMING_STATE_DEFAULT 72 |
Eliad Peller | 3dd37d0 | 2014-01-07 14:00:24 +0200 | [diff] [blame] | 416 | #define IWL_BF_ROAMING_STATE_D0I3 72 |
Hila Gonen | 7df15b1 | 2012-12-12 11:16:19 +0200 | [diff] [blame] | 417 | #define IWL_BF_ROAMING_STATE_MAX 255 |
| 418 | #define IWL_BF_ROAMING_STATE_MIN 0 |
| 419 | |
Hila Gonen | 5dca7c2 | 2013-07-16 11:15:35 +0300 | [diff] [blame] | 420 | #define IWL_BF_TEMP_THRESHOLD_DEFAULT 112 |
Eliad Peller | 3dd37d0 | 2014-01-07 14:00:24 +0200 | [diff] [blame] | 421 | #define IWL_BF_TEMP_THRESHOLD_D0I3 112 |
Hila Gonen | 5dca7c2 | 2013-07-16 11:15:35 +0300 | [diff] [blame] | 422 | #define IWL_BF_TEMP_THRESHOLD_MAX 255 |
| 423 | #define IWL_BF_TEMP_THRESHOLD_MIN 0 |
| 424 | |
| 425 | #define IWL_BF_TEMP_FAST_FILTER_DEFAULT 1 |
Eliad Peller | 3dd37d0 | 2014-01-07 14:00:24 +0200 | [diff] [blame] | 426 | #define IWL_BF_TEMP_FAST_FILTER_D0I3 1 |
Hila Gonen | 5dca7c2 | 2013-07-16 11:15:35 +0300 | [diff] [blame] | 427 | #define IWL_BF_TEMP_FAST_FILTER_MAX 255 |
| 428 | #define IWL_BF_TEMP_FAST_FILTER_MIN 0 |
| 429 | |
| 430 | #define IWL_BF_TEMP_SLOW_FILTER_DEFAULT 5 |
Gregory Greenman | f739c39 | 2015-07-22 15:46:37 +0300 | [diff] [blame] | 431 | #define IWL_BF_TEMP_SLOW_FILTER_D0I3 20 |
Hila Gonen | 5dca7c2 | 2013-07-16 11:15:35 +0300 | [diff] [blame] | 432 | #define IWL_BF_TEMP_SLOW_FILTER_MAX 255 |
| 433 | #define IWL_BF_TEMP_SLOW_FILTER_MIN 0 |
Hila Gonen | 7df15b1 | 2012-12-12 11:16:19 +0200 | [diff] [blame] | 434 | |
| 435 | #define IWL_BF_ENABLE_BEACON_FILTER_DEFAULT 1 |
| 436 | |
| 437 | #define IWL_BF_DEBUG_FLAG_DEFAULT 0 |
Eliad Peller | 3dd37d0 | 2014-01-07 14:00:24 +0200 | [diff] [blame] | 438 | #define IWL_BF_DEBUG_FLAG_D0I3 0 |
Hila Gonen | 7df15b1 | 2012-12-12 11:16:19 +0200 | [diff] [blame] | 439 | |
Eliad Peller | fb68e1a | 2014-11-19 13:57:52 +0200 | [diff] [blame] | 440 | #define IWL_BF_ESCAPE_TIMER_DEFAULT 0 |
Eliad Peller | 5067536 | 2014-06-15 11:12:38 +0300 | [diff] [blame] | 441 | #define IWL_BF_ESCAPE_TIMER_D0I3 0 |
Hila Gonen | 7df15b1 | 2012-12-12 11:16:19 +0200 | [diff] [blame] | 442 | #define IWL_BF_ESCAPE_TIMER_MAX 1024 |
| 443 | #define IWL_BF_ESCAPE_TIMER_MIN 0 |
| 444 | |
Alexander Bondar | 8434925 | 2013-07-22 15:39:26 +0300 | [diff] [blame] | 445 | #define IWL_BA_ESCAPE_TIMER_DEFAULT 6 |
Eliad Peller | 3dd37d0 | 2014-01-07 14:00:24 +0200 | [diff] [blame] | 446 | #define IWL_BA_ESCAPE_TIMER_D0I3 6 |
Alexander Bondar | b34b912 | 2013-08-18 16:22:52 +0300 | [diff] [blame] | 447 | #define IWL_BA_ESCAPE_TIMER_D3 9 |
Hila Gonen | 7df15b1 | 2012-12-12 11:16:19 +0200 | [diff] [blame] | 448 | #define IWL_BA_ESCAPE_TIMER_MAX 1024 |
| 449 | #define IWL_BA_ESCAPE_TIMER_MIN 0 |
| 450 | |
| 451 | #define IWL_BA_ENABLE_BEACON_ABORT_DEFAULT 1 |
| 452 | |
Eliad Peller | 3dd37d0 | 2014-01-07 14:00:24 +0200 | [diff] [blame] | 453 | #define IWL_BF_CMD_CONFIG(mode) \ |
| 454 | .bf_energy_delta = cpu_to_le32(IWL_BF_ENERGY_DELTA ## mode), \ |
| 455 | .bf_roaming_energy_delta = \ |
| 456 | cpu_to_le32(IWL_BF_ROAMING_ENERGY_DELTA ## mode), \ |
| 457 | .bf_roaming_state = cpu_to_le32(IWL_BF_ROAMING_STATE ## mode), \ |
| 458 | .bf_temp_threshold = cpu_to_le32(IWL_BF_TEMP_THRESHOLD ## mode), \ |
| 459 | .bf_temp_fast_filter = cpu_to_le32(IWL_BF_TEMP_FAST_FILTER ## mode), \ |
| 460 | .bf_temp_slow_filter = cpu_to_le32(IWL_BF_TEMP_SLOW_FILTER ## mode), \ |
| 461 | .bf_debug_flag = cpu_to_le32(IWL_BF_DEBUG_FLAG ## mode), \ |
| 462 | .bf_escape_timer = cpu_to_le32(IWL_BF_ESCAPE_TIMER ## mode), \ |
| 463 | .ba_escape_timer = cpu_to_le32(IWL_BA_ESCAPE_TIMER ## mode) |
Alexander Bondar | 071d4990 | 2013-05-06 13:03:59 +0300 | [diff] [blame] | 464 | |
Eliad Peller | 3dd37d0 | 2014-01-07 14:00:24 +0200 | [diff] [blame] | 465 | #define IWL_BF_CMD_CONFIG_DEFAULTS IWL_BF_CMD_CONFIG(_DEFAULT) |
| 466 | #define IWL_BF_CMD_CONFIG_D0I3 IWL_BF_CMD_CONFIG(_D0I3) |
Johannes Berg | 8ca151b | 2013-01-24 14:25:36 +0100 | [diff] [blame] | 467 | #endif |