power.h 20 KB

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