840 lines · c
1/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */2/*3 * Copyright (C) 2012-2014, 2018-2024 Intel Corporation4 * Copyright (C) 2013-2014 Intel Mobile Communications GmbH5 * Copyright (C) 2015-2017 Intel Deutschland GmbH6 */7#ifndef __iwl_fw_api_power_h__8#define __iwl_fw_api_power_h__9 10/* Power Management Commands, Responses, Notifications */11 12/**13 * enum iwl_ltr_config_flags - masks for LTR config command flags14 * @LTR_CFG_FLAG_FEATURE_ENABLE: Feature operational status15 * @LTR_CFG_FLAG_HW_DIS_ON_SHADOW_REG_ACCESS: allow LTR change on shadow16 * memory access17 * @LTR_CFG_FLAG_HW_EN_SHRT_WR_THROUGH: allow LTR msg send on ANY LTR18 * reg change19 * @LTR_CFG_FLAG_HW_DIS_ON_D0_2_D3: allow LTR msg send on transition from20 * D0 to D321 * @LTR_CFG_FLAG_SW_SET_SHORT: fixed static short LTR register22 * @LTR_CFG_FLAG_SW_SET_LONG: fixed static short LONG register23 * @LTR_CFG_FLAG_DENIE_C10_ON_PD: allow going into C10 on PD24 * @LTR_CFG_FLAG_UPDATE_VALUES: update config values and short25 * idle timeout26 */27enum iwl_ltr_config_flags {28 LTR_CFG_FLAG_FEATURE_ENABLE = BIT(0),29 LTR_CFG_FLAG_HW_DIS_ON_SHADOW_REG_ACCESS = BIT(1),30 LTR_CFG_FLAG_HW_EN_SHRT_WR_THROUGH = BIT(2),31 LTR_CFG_FLAG_HW_DIS_ON_D0_2_D3 = BIT(3),32 LTR_CFG_FLAG_SW_SET_SHORT = BIT(4),33 LTR_CFG_FLAG_SW_SET_LONG = BIT(5),34 LTR_CFG_FLAG_DENIE_C10_ON_PD = BIT(6),35 LTR_CFG_FLAG_UPDATE_VALUES = BIT(7),36};37 38/**39 * struct iwl_ltr_config_cmd_v1 - configures the LTR40 * @flags: See &enum iwl_ltr_config_flags41 * @static_long: static LTR Long register value.42 * @static_short: static LTR Short register value.43 */44struct iwl_ltr_config_cmd_v1 {45 __le32 flags;46 __le32 static_long;47 __le32 static_short;48} __packed; /* LTR_CAPABLE_API_S_VER_1 */49 50#define LTR_VALID_STATES_NUM 451 52/**53 * struct iwl_ltr_config_cmd - configures the LTR54 * @flags: See &enum iwl_ltr_config_flags55 * @static_long: static LTR Long register value.56 * @static_short: static LTR Short register value.57 * @ltr_cfg_values: LTR parameters table values (in usec) in folowing order:58 * TX, RX, Short Idle, Long Idle. Used only if %LTR_CFG_FLAG_UPDATE_VALUES59 * is set.60 * @ltr_short_idle_timeout: LTR Short Idle timeout (in usec). Used only if61 * %LTR_CFG_FLAG_UPDATE_VALUES is set.62 */63struct iwl_ltr_config_cmd {64 __le32 flags;65 __le32 static_long;66 __le32 static_short;67 __le32 ltr_cfg_values[LTR_VALID_STATES_NUM];68 __le32 ltr_short_idle_timeout;69} __packed; /* LTR_CAPABLE_API_S_VER_2 */70 71/* Radio LP RX Energy Threshold measured in dBm */72#define POWER_LPRX_RSSI_THRESHOLD 7573#define POWER_LPRX_RSSI_THRESHOLD_MAX 9474#define POWER_LPRX_RSSI_THRESHOLD_MIN 3075 76/**77 * enum iwl_power_flags - masks for power table command flags78 * @POWER_FLAGS_POWER_SAVE_ENA_MSK: '1' Allow to save power by turning off79 * receiver and transmitter. '0' - does not allow.80 * @POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK: '0' Driver disables power management,81 * '1' Driver enables PM (use rest of parameters)82 * @POWER_FLAGS_SKIP_OVER_DTIM_MSK: '0' PM have to walk up every DTIM,83 * '1' PM could sleep over DTIM till listen Interval.84 * @POWER_FLAGS_SNOOZE_ENA_MSK: Enable snoozing only if uAPSD is enabled and all85 * access categories are both delivery and trigger enabled.86 * @POWER_FLAGS_BT_SCO_ENA: Enable BT SCO coex only if uAPSD and87 * PBW Snoozing enabled88 * @POWER_FLAGS_ADVANCE_PM_ENA_MSK: Advanced PM (uAPSD) enable mask89 * @POWER_FLAGS_LPRX_ENA_MSK: Low Power RX enable.90 * @POWER_FLAGS_UAPSD_MISBEHAVING_ENA_MSK: AP/GO's uAPSD misbehaving91 * detection enablement92*/93enum iwl_power_flags {94 POWER_FLAGS_POWER_SAVE_ENA_MSK = BIT(0),95 POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK = BIT(1),96 POWER_FLAGS_SKIP_OVER_DTIM_MSK = BIT(2),97 POWER_FLAGS_SNOOZE_ENA_MSK = BIT(5),98 POWER_FLAGS_BT_SCO_ENA = BIT(8),99 POWER_FLAGS_ADVANCE_PM_ENA_MSK = BIT(9),100 POWER_FLAGS_LPRX_ENA_MSK = BIT(11),101 POWER_FLAGS_UAPSD_MISBEHAVING_ENA_MSK = BIT(12),102};103 104#define IWL_POWER_VEC_SIZE 5105 106/**107 * struct iwl_powertable_cmd - legacy power command. Beside old API support this108 * is used also with a new power API for device wide power settings.109 * POWER_TABLE_CMD = 0x77 (command, has simple generic response)110 *111 * @flags: Power table command flags from POWER_FLAGS_*112 * @keep_alive_seconds: Keep alive period in seconds. Default - 25 sec.113 * Minimum allowed:- 3 * DTIM. Keep alive period must be114 * set regardless of power scheme or current power state.115 * FW use this value also when PM is disabled.116 * @debug_flags: debug flags117 * @rx_data_timeout: Minimum time (usec) from last Rx packet for AM to118 * PSM transition - legacy PM119 * @tx_data_timeout: Minimum time (usec) from last Tx packet for AM to120 * PSM transition - legacy PM121 * @sleep_interval: not in use122 * @skip_dtim_periods: Number of DTIM periods to skip if Skip over DTIM flag123 * is set. For example, if it is required to skip over124 * one DTIM, this value need to be set to 2 (DTIM periods).125 * @lprx_rssi_threshold: Signal strength up to which LP RX can be enabled.126 * Default: 80dbm127 */128struct iwl_powertable_cmd {129 /* PM_POWER_TABLE_CMD_API_S_VER_6 */130 __le16 flags;131 u8 keep_alive_seconds;132 u8 debug_flags;133 __le32 rx_data_timeout;134 __le32 tx_data_timeout;135 __le32 sleep_interval[IWL_POWER_VEC_SIZE];136 __le32 skip_dtim_periods;137 __le32 lprx_rssi_threshold;138} __packed;139 140/**141 * enum iwl_device_power_flags - masks for device power command flags142 * @DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK:143 * '1' Allow to save power by turning off144 * receiver and transmitter. '0' - does not allow.145 * @DEVICE_POWER_FLAGS_ALLOW_MEM_RETENTION_MSK:146 * Device Retention indication, '1' indicate retention is enabled.147 * @DEVICE_POWER_FLAGS_NO_SLEEP_TILL_D3_MSK:148 * Prevent power save until entering d3 is completed.149 * @DEVICE_POWER_FLAGS_32K_CLK_VALID_MSK:150 * 32Khz external slow clock valid indication, '1' indicate cloack is151 * valid.152*/153enum iwl_device_power_flags {154 DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK = BIT(0),155 DEVICE_POWER_FLAGS_ALLOW_MEM_RETENTION_MSK = BIT(1),156 DEVICE_POWER_FLAGS_NO_SLEEP_TILL_D3_MSK = BIT(7),157 DEVICE_POWER_FLAGS_32K_CLK_VALID_MSK = BIT(12),158};159 160/**161 * struct iwl_device_power_cmd - device wide power command.162 * DEVICE_POWER_CMD = 0x77 (command, has simple generic response)163 *164 * @flags: Power table command flags from &enum iwl_device_power_flags165 * @reserved: reserved (padding)166 */167struct iwl_device_power_cmd {168 /* PM_POWER_TABLE_CMD_API_S_VER_7 */169 __le16 flags;170 __le16 reserved;171} __packed;172 173/**174 * struct iwl_mac_power_cmd - New power command containing uAPSD support175 * MAC_PM_POWER_TABLE = 0xA9 (command, has simple generic response)176 * @id_and_color: MAC contex identifier, &enum iwl_ctxt_id_and_color177 * @flags: Power table command flags from POWER_FLAGS_*178 * @keep_alive_seconds: Keep alive period in seconds. Default - 25 sec.179 * Minimum allowed:- 3 * DTIM. Keep alive period must be180 * set regardless of power scheme or current power state.181 * FW use this value also when PM is disabled.182 * @rx_data_timeout: Minimum time (usec) from last Rx packet for AM to183 * PSM transition - legacy PM184 * @tx_data_timeout: Minimum time (usec) from last Tx packet for AM to185 * PSM transition - legacy PM186 * @skip_dtim_periods: Number of DTIM periods to skip if Skip over DTIM flag187 * is set. For example, if it is required to skip over188 * one DTIM, this value need to be set to 2 (DTIM periods).189 * @rx_data_timeout_uapsd: Minimum time (usec) from last Rx packet for AM to190 * PSM transition - uAPSD191 * @tx_data_timeout_uapsd: Minimum time (usec) from last Tx packet for AM to192 * PSM transition - uAPSD193 * @lprx_rssi_threshold: Signal strength up to which LP RX can be enabled.194 * Default: 80dbm195 * @snooze_interval: Maximum time between attempts to retrieve buffered data196 * from the AP [msec]197 * @snooze_window: A window of time in which PBW snoozing insures that all198 * packets received. It is also the minimum time from last199 * received unicast RX packet, before client stops snoozing200 * for data. [msec]201 * @snooze_step: TBD202 * @qndp_tid: TID client shall use for uAPSD QNDP triggers203 * @uapsd_ac_flags: Set trigger-enabled and delivery-enabled indication for204 * each corresponding AC.205 * Use IEEE80211_WMM_IE_STA_QOSINFO_AC* for correct values.206 * @uapsd_max_sp: Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct207 * values.208 * @heavy_tx_thld_packets: TX threshold measured in number of packets209 * @heavy_rx_thld_packets: RX threshold measured in number of packets210 * @heavy_tx_thld_percentage: TX threshold measured in load's percentage211 * @heavy_rx_thld_percentage: RX threshold measured in load's percentage212 * @limited_ps_threshold: (unused)213 * @reserved: reserved (padding)214 */215struct iwl_mac_power_cmd {216 /* CONTEXT_DESC_API_T_VER_1 */217 __le32 id_and_color;218 219 /* CLIENT_PM_POWER_TABLE_S_VER_1 */220 __le16 flags;221 __le16 keep_alive_seconds;222 __le32 rx_data_timeout;223 __le32 tx_data_timeout;224 __le32 rx_data_timeout_uapsd;225 __le32 tx_data_timeout_uapsd;226 u8 lprx_rssi_threshold;227 u8 skip_dtim_periods;228 __le16 snooze_interval;229 __le16 snooze_window;230 u8 snooze_step;231 u8 qndp_tid;232 u8 uapsd_ac_flags;233 u8 uapsd_max_sp;234 u8 heavy_tx_thld_packets;235 u8 heavy_rx_thld_packets;236 u8 heavy_tx_thld_percentage;237 u8 heavy_rx_thld_percentage;238 u8 limited_ps_threshold;239 u8 reserved;240} __packed;241 242/*243 * struct iwl_uapsd_misbehaving_ap_notif - FW sends this notification when244 * associated AP is identified as improperly implementing uAPSD protocol.245 * PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78246 * @sta_id: index of station in uCode's station table - associated AP ID in247 * this context.248 */249struct iwl_uapsd_misbehaving_ap_notif {250 __le32 sta_id;251 u8 mac_id;252 u8 reserved[3];253} __packed;254 255/**256 * struct iwl_reduce_tx_power_cmd - TX power reduction command257 * REDUCE_TX_POWER_CMD = 0x9f258 * @flags: (reserved for future implementation)259 * @mac_context_id: id of the mac ctx for which we are reducing TX power.260 * @pwr_restriction: TX power restriction in dBms.261 */262struct iwl_reduce_tx_power_cmd {263 u8 flags;264 u8 mac_context_id;265 __le16 pwr_restriction;266} __packed; /* TX_REDUCED_POWER_API_S_VER_1 */267 268enum iwl_dev_tx_power_cmd_mode {269 IWL_TX_POWER_MODE_SET_MAC = 0,270 IWL_TX_POWER_MODE_SET_DEVICE = 1,271 IWL_TX_POWER_MODE_SET_CHAINS = 2,272 IWL_TX_POWER_MODE_SET_ACK = 3,273 IWL_TX_POWER_MODE_SET_SAR_TIMER = 4,274 IWL_TX_POWER_MODE_SET_SAR_TIMER_DEFAULT_TABLE = 5,275}; /* TX_POWER_REDUCED_FLAGS_TYPE_API_E_VER_5 */;276 277#define IWL_NUM_CHAIN_TABLES 1278#define IWL_NUM_CHAIN_TABLES_V2 2279#define IWL_NUM_CHAIN_LIMITS 2280#define IWL_NUM_SUB_BANDS_V1 5281#define IWL_NUM_SUB_BANDS_V2 11282 283/**284 * struct iwl_dev_tx_power_common - Common part of the TX power reduction cmd285 * @set_mode: see &enum iwl_dev_tx_power_cmd_mode286 * @mac_context_id: id of the mac ctx for which we are reducing TX power.287 * @pwr_restriction: TX power restriction in 1/8 dBms.288 */289struct iwl_dev_tx_power_common {290 __le32 set_mode;291 __le32 mac_context_id;292 __le16 pwr_restriction;293} __packed;294 295/**296 * struct iwl_dev_tx_power_cmd_v3 - TX power reduction command version 3297 * @per_chain: per chain restrictions298 */299struct iwl_dev_tx_power_cmd_v3 {300 __le16 per_chain[IWL_NUM_CHAIN_TABLES][IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V1];301} __packed; /* TX_REDUCED_POWER_API_S_VER_3 */302 303#define IWL_DEV_MAX_TX_POWER 0x7FFF304 305/**306 * struct iwl_dev_tx_power_cmd_v4 - TX power reduction command version 4307 * @per_chain: per chain restrictions308 * @enable_ack_reduction: enable or disable close range ack TX power309 * reduction.310 * @reserved: reserved (padding)311 */312struct iwl_dev_tx_power_cmd_v4 {313 __le16 per_chain[IWL_NUM_CHAIN_TABLES][IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V1];314 u8 enable_ack_reduction;315 u8 reserved[3];316} __packed; /* TX_REDUCED_POWER_API_S_VER_4 */317 318/**319 * struct iwl_dev_tx_power_cmd_v5 - TX power reduction command version 5320 * @per_chain: per chain restrictions321 * @enable_ack_reduction: enable or disable close range ack TX power322 * reduction.323 * @per_chain_restriction_changed: is per_chain_restriction has changed324 * from last command. used if set_mode is325 * IWL_TX_POWER_MODE_SET_SAR_TIMER.326 * note: if not changed, the command is used for keep alive only.327 * @reserved: reserved (padding)328 * @timer_period: timer in milliseconds. if expires FW will change to default329 * BIOS values. relevant if setMode is IWL_TX_POWER_MODE_SET_SAR_TIMER330 */331struct iwl_dev_tx_power_cmd_v5 {332 __le16 per_chain[IWL_NUM_CHAIN_TABLES][IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V1];333 u8 enable_ack_reduction;334 u8 per_chain_restriction_changed;335 u8 reserved[2];336 __le32 timer_period;337} __packed; /* TX_REDUCED_POWER_API_S_VER_5 */338 339/**340 * struct iwl_dev_tx_power_cmd_v6 - TX power reduction command version 6341 * @per_chain: per chain restrictions342 * @enable_ack_reduction: enable or disable close range ack TX power343 * reduction.344 * @per_chain_restriction_changed: is per_chain_restriction has changed345 * from last command. used if set_mode is346 * IWL_TX_POWER_MODE_SET_SAR_TIMER.347 * note: if not changed, the command is used for keep alive only.348 * @reserved: reserved (padding)349 * @timer_period: timer in milliseconds. if expires FW will change to default350 * BIOS values. relevant if setMode is IWL_TX_POWER_MODE_SET_SAR_TIMER351 */352struct iwl_dev_tx_power_cmd_v6 {353 __le16 per_chain[IWL_NUM_CHAIN_TABLES_V2][IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V2];354 u8 enable_ack_reduction;355 u8 per_chain_restriction_changed;356 u8 reserved[2];357 __le32 timer_period;358} __packed; /* TX_REDUCED_POWER_API_S_VER_6 */359 360/**361 * struct iwl_dev_tx_power_cmd_v7 - TX power reduction command version 7362 * @per_chain: per chain restrictions363 * @enable_ack_reduction: enable or disable close range ack TX power364 * reduction.365 * @per_chain_restriction_changed: is per_chain_restriction has changed366 * from last command. used if set_mode is367 * IWL_TX_POWER_MODE_SET_SAR_TIMER.368 * note: if not changed, the command is used for keep alive only.369 * @reserved: reserved (padding)370 * @timer_period: timer in milliseconds. if expires FW will change to default371 * BIOS values. relevant if setMode is IWL_TX_POWER_MODE_SET_SAR_TIMER372 * @flags: reduce power flags.373 */374struct iwl_dev_tx_power_cmd_v7 {375 __le16 per_chain[IWL_NUM_CHAIN_TABLES_V2][IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V2];376 u8 enable_ack_reduction;377 u8 per_chain_restriction_changed;378 u8 reserved[2];379 __le32 timer_period;380 __le32 flags;381} __packed; /* TX_REDUCED_POWER_API_S_VER_7 */382 383/**384 * struct iwl_dev_tx_power_cmd_v8 - TX power reduction command version 8385 * @per_chain: per chain restrictions386 * @enable_ack_reduction: enable or disable close range ack TX power387 * reduction.388 * @per_chain_restriction_changed: is per_chain_restriction has changed389 * from last command. used if set_mode is390 * IWL_TX_POWER_MODE_SET_SAR_TIMER.391 * note: if not changed, the command is used for keep alive only.392 * @reserved: reserved (padding)393 * @timer_period: timer in milliseconds. if expires FW will change to default394 * BIOS values. relevant if setMode is IWL_TX_POWER_MODE_SET_SAR_TIMER395 * @flags: reduce power flags.396 * @tpc_vlp_backoff_level: user backoff of UNII5,7 VLP channels in USA.397 * Not in use.398 */399struct iwl_dev_tx_power_cmd_v8 {400 __le16 per_chain[IWL_NUM_CHAIN_TABLES_V2][IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V2];401 u8 enable_ack_reduction;402 u8 per_chain_restriction_changed;403 u8 reserved[2];404 __le32 timer_period;405 __le32 flags;406 __le32 tpc_vlp_backoff_level;407} __packed; /* TX_REDUCED_POWER_API_S_VER_8 */408 409/*410 * @dev_24: device TX power restriction in 1/8 dBms411 * @dev_52_low: device TX power restriction upper band - low412 * @dev_52_high: device TX power restriction upper band - high413 */414struct iwl_dev_tx_power_cmd_per_band {415 __le16 dev_24;416 __le16 dev_52_low;417 __le16 dev_52_high;418} __packed;419 420/**421 * struct iwl_dev_tx_power_cmd_v3_v8 - TX power reduction command (multiversion)422 * @per_band: per band restrictions423 * @common: common part of the command424 * @v3: version 3 part of the command425 * @v4: version 4 part of the command426 * @v5: version 5 part of the command427 * @v6: version 6 part of the command428 * @v7: version 7 part of the command429 * @v8: version 8 part of the command430 */431struct iwl_dev_tx_power_cmd_v3_v8 {432 struct iwl_dev_tx_power_common common;433 struct iwl_dev_tx_power_cmd_per_band per_band;434 union {435 struct iwl_dev_tx_power_cmd_v3 v3;436 struct iwl_dev_tx_power_cmd_v4 v4;437 struct iwl_dev_tx_power_cmd_v5 v5;438 struct iwl_dev_tx_power_cmd_v6 v6;439 struct iwl_dev_tx_power_cmd_v7 v7;440 struct iwl_dev_tx_power_cmd_v8 v8;441 };442};443 444/**445 * struct iwl_dev_tx_power_cmd_v9 - TX power reduction cmd446 * @reserved: reserved (padding)447 * @per_chain: per chain restrictions448 * @per_chain_restriction_changed: is per_chain_restriction has changed449 * from last command. used if set_mode is450 * IWL_TX_POWER_MODE_SET_SAR_TIMER.451 * note: if not changed, the command is used for keep alive only.452 * @reserved1: reserved (padding)453 * @timer_period: timer in milliseconds. if expires FW will change to default454 * BIOS values. relevant if setMode is IWL_TX_POWER_MODE_SET_SAR_TIMER455 */456struct iwl_dev_tx_power_cmd_v9 {457 __le16 reserved;458 __le16 per_chain[IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V1];459 u8 per_chain_restriction_changed;460 u8 reserved1[3];461 __le32 timer_period;462} __packed; /* TX_REDUCED_POWER_API_S_VER_9 */463 464/**465 * struct iwl_dev_tx_power_cmd_v10 - TX power reduction cmd466 * @per_chain: per chain restrictions467 * @per_chain_restriction_changed: is per_chain_restriction has changed468 * from last command. used if set_mode is469 * IWL_TX_POWER_MODE_SET_SAR_TIMER.470 * note: if not changed, the command is used for keep alive only.471 * @reserved: reserved (padding)472 * @timer_period: timer in milliseconds. if expires FW will change to default473 * BIOS values. relevant if setMode is IWL_TX_POWER_MODE_SET_SAR_TIMER474 * @flags: reduce power flags.475 */476struct iwl_dev_tx_power_cmd_v10 {477 __le16 per_chain[IWL_NUM_CHAIN_TABLES_V2][IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V2];478 u8 per_chain_restriction_changed;479 u8 reserved;480 __le32 timer_period;481 __le32 flags;482} __packed; /* TX_REDUCED_POWER_API_S_VER_10 */483 484/*485 * struct iwl_dev_tx_power_cmd - TX power reduction command (multiversion)486 * @common: common part of the command487 * @v9: version 9 part of the command488 * @v10: version 10 part of the command489 */490struct iwl_dev_tx_power_cmd {491 struct iwl_dev_tx_power_common common;492 union {493 struct iwl_dev_tx_power_cmd_v9 v9;494 struct iwl_dev_tx_power_cmd_v10 v10;495 };496} __packed; /* TX_REDUCED_POWER_API_S_VER_9_VER10 */497 498#define IWL_NUM_GEO_PROFILES 3499#define IWL_NUM_GEO_PROFILES_V3 8500#define IWL_NUM_BANDS_PER_CHAIN_V1 2501#define IWL_NUM_BANDS_PER_CHAIN_V2 3502 503/**504 * enum iwl_geo_per_chain_offset_operation - type of operation505 * @IWL_PER_CHAIN_OFFSET_SET_TABLES: send the tables from the host to the FW.506 * @IWL_PER_CHAIN_OFFSET_GET_CURRENT_TABLE: retrieve the last configured table.507 */508enum iwl_geo_per_chain_offset_operation {509 IWL_PER_CHAIN_OFFSET_SET_TABLES,510 IWL_PER_CHAIN_OFFSET_GET_CURRENT_TABLE,511}; /* PER_CHAIN_OFFSET_OPERATION_E */512 513/**514 * struct iwl_per_chain_offset - embedded struct for PER_CHAIN_LIMIT_OFFSET_CMD.515 * @max_tx_power: maximum allowed tx power.516 * @chain_a: tx power offset for chain a.517 * @chain_b: tx power offset for chain b.518 */519struct iwl_per_chain_offset {520 __le16 max_tx_power;521 u8 chain_a;522 u8 chain_b;523} __packed; /* PER_CHAIN_LIMIT_OFFSET_PER_CHAIN_S_VER_1 */524 525/**526 * struct iwl_geo_tx_power_profiles_cmd_v1 - struct for PER_CHAIN_LIMIT_OFFSET_CMD cmd.527 * @ops: operations, value from &enum iwl_geo_per_chain_offset_operation528 * @table: offset profile per band.529 */530struct iwl_geo_tx_power_profiles_cmd_v1 {531 __le32 ops;532 struct iwl_per_chain_offset table[IWL_NUM_GEO_PROFILES][IWL_NUM_BANDS_PER_CHAIN_V1];533} __packed; /* PER_CHAIN_LIMIT_OFFSET_CMD_VER_1 */534 535/**536 * struct iwl_geo_tx_power_profiles_cmd_v2 - struct for PER_CHAIN_LIMIT_OFFSET_CMD cmd.537 * @ops: operations, value from &enum iwl_geo_per_chain_offset_operation538 * @table: offset profile per band.539 * @table_revision: 0 for not-South Korea, 1 for South Korea (the name is misleading)540 */541struct iwl_geo_tx_power_profiles_cmd_v2 {542 __le32 ops;543 struct iwl_per_chain_offset table[IWL_NUM_GEO_PROFILES][IWL_NUM_BANDS_PER_CHAIN_V1];544 __le32 table_revision;545} __packed; /* PER_CHAIN_LIMIT_OFFSET_CMD_VER_2 */546 547/**548 * struct iwl_geo_tx_power_profiles_cmd_v3 - struct for PER_CHAIN_LIMIT_OFFSET_CMD cmd.549 * @ops: operations, value from &enum iwl_geo_per_chain_offset_operation550 * @table: offset profile per band.551 * @table_revision: 0 for not-South Korea, 1 for South Korea (the name is misleading)552 */553struct iwl_geo_tx_power_profiles_cmd_v3 {554 __le32 ops;555 struct iwl_per_chain_offset table[IWL_NUM_GEO_PROFILES][IWL_NUM_BANDS_PER_CHAIN_V2];556 __le32 table_revision;557} __packed; /* PER_CHAIN_LIMIT_OFFSET_CMD_VER_3 */558 559/**560 * struct iwl_geo_tx_power_profiles_cmd_v4 - struct for PER_CHAIN_LIMIT_OFFSET_CMD cmd.561 * @ops: operations, value from &enum iwl_geo_per_chain_offset_operation562 * @table: offset profile per band.563 * @table_revision: 0 for not-South Korea, 1 for South Korea (the name is misleading)564 */565struct iwl_geo_tx_power_profiles_cmd_v4 {566 __le32 ops;567 struct iwl_per_chain_offset table[IWL_NUM_GEO_PROFILES_V3][IWL_NUM_BANDS_PER_CHAIN_V1];568 __le32 table_revision;569} __packed; /* PER_CHAIN_LIMIT_OFFSET_CMD_VER_4 */570 571/**572 * struct iwl_geo_tx_power_profiles_cmd_v5 - struct for PER_CHAIN_LIMIT_OFFSET_CMD cmd.573 * @ops: operations, value from &enum iwl_geo_per_chain_offset_operation574 * @table: offset profile per band.575 * @table_revision: 0 for not-South Korea, 1 for South Korea (the name is misleading)576 */577struct iwl_geo_tx_power_profiles_cmd_v5 {578 __le32 ops;579 struct iwl_per_chain_offset table[IWL_NUM_GEO_PROFILES_V3][IWL_NUM_BANDS_PER_CHAIN_V2];580 __le32 table_revision;581} __packed; /* PER_CHAIN_LIMIT_OFFSET_CMD_VER_5 */582 583union iwl_geo_tx_power_profiles_cmd {584 struct iwl_geo_tx_power_profiles_cmd_v1 v1;585 struct iwl_geo_tx_power_profiles_cmd_v2 v2;586 struct iwl_geo_tx_power_profiles_cmd_v3 v3;587 struct iwl_geo_tx_power_profiles_cmd_v4 v4;588 struct iwl_geo_tx_power_profiles_cmd_v5 v5;589};590 591/**592 * struct iwl_geo_tx_power_profiles_resp - response to PER_CHAIN_LIMIT_OFFSET_CMD cmd593 * @profile_idx: current geo profile in use594 */595struct iwl_geo_tx_power_profiles_resp {596 __le32 profile_idx;597} __packed; /* PER_CHAIN_LIMIT_OFFSET_RSP */598 599/**600 * enum iwl_ppag_flags - PPAG enable masks601 * @IWL_PPAG_ETSI_MASK: enable PPAG in ETSI602 * @IWL_PPAG_CHINA_MASK: enable PPAG in China603 * @IWL_PPAG_ETSI_LPI_UHB_MASK: enable LPI in ETSI for UHB604 * @IWL_PPAG_ETSI_VLP_UHB_MASK: enable VLP in ETSI for UHB605 * @IWL_PPAG_ETSI_SP_UHB_MASK: enable SP in ETSI for UHB606 * @IWL_PPAG_USA_LPI_UHB_MASK: enable LPI in USA for UHB607 * @IWL_PPAG_USA_VLP_UHB_MASK: enable VLP in USA for UHB608 * @IWL_PPAG_USA_SP_UHB_MASK: enable SP in USA for UHB609 * @IWL_PPAG_CANADA_LPI_UHB_MASK: enable LPI in CANADA for UHB610 * @IWL_PPAG_CANADA_VLP_UHB_MASK: enable VLP in CANADA for UHB611 * @IWL_PPAG_CANADA_SP_UHB_MASK: enable SP in CANADA for UHB612 */613enum iwl_ppag_flags {614 IWL_PPAG_ETSI_MASK = BIT(0),615 IWL_PPAG_CHINA_MASK = BIT(1),616 IWL_PPAG_ETSI_LPI_UHB_MASK = BIT(2),617 IWL_PPAG_ETSI_VLP_UHB_MASK = BIT(3),618 IWL_PPAG_ETSI_SP_UHB_MASK = BIT(4),619 IWL_PPAG_USA_LPI_UHB_MASK = BIT(5),620 IWL_PPAG_USA_VLP_UHB_MASK = BIT(6),621 IWL_PPAG_USA_SP_UHB_MASK = BIT(7),622 IWL_PPAG_CANADA_LPI_UHB_MASK = BIT(8),623 IWL_PPAG_CANADA_VLP_UHB_MASK = BIT(9),624 IWL_PPAG_CANADA_SP_UHB_MASK = BIT(10),625};626 627/**628 * union iwl_ppag_table_cmd - union for all versions of PPAG command629 * @v1: version 1630 * @v2: version 2631 * version 3, 4, 5 and 6 are the same structure as v2,632 * but has a different format of the flags bitmap633 * @v1.flags: values from &enum iwl_ppag_flags634 * @v1.gain: table of antenna gain values per chain and sub-band635 * @v1.reserved: reserved636 * @v2.flags: values from &enum iwl_ppag_flags637 * @v2.gain: table of antenna gain values per chain and sub-band638 * @v2.reserved: reserved639 */640union iwl_ppag_table_cmd {641 struct {642 __le32 flags;643 s8 gain[IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V1];644 s8 reserved[2];645 } v1;646 struct {647 __le32 flags;648 s8 gain[IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V2];649 s8 reserved[2];650 } v2;651} __packed;652 653#define IWL_PPAG_CMD_V4_MASK (IWL_PPAG_ETSI_MASK | IWL_PPAG_CHINA_MASK)654#define IWL_PPAG_CMD_V5_MASK (IWL_PPAG_CMD_V4_MASK | \655 IWL_PPAG_ETSI_LPI_UHB_MASK | \656 IWL_PPAG_USA_LPI_UHB_MASK)657 658#define MCC_TO_SAR_OFFSET_TABLE_ROW_SIZE 26659#define MCC_TO_SAR_OFFSET_TABLE_COL_SIZE 13660 661/**662 * struct iwl_sar_offset_mapping_cmd - struct for SAR_OFFSET_MAPPING_TABLE_CMD663 * @offset_map: mapping a mcc to a geo sar group664 * @reserved: reserved665 */666struct iwl_sar_offset_mapping_cmd {667 u8 offset_map[MCC_TO_SAR_OFFSET_TABLE_ROW_SIZE]668 [MCC_TO_SAR_OFFSET_TABLE_COL_SIZE];669 __le16 reserved;670} __packed; /*SAR_OFFSET_MAPPING_TABLE_CMD_API_S*/671 672/**673 * struct iwl_beacon_filter_cmd674 * REPLY_BEACON_FILTERING_CMD = 0xd2 (command)675 * @bf_energy_delta: Used for RSSI filtering, if in 'normal' state. Send beacon676 * to driver if delta in Energy values calculated for this and last677 * passed beacon is greater than this threshold. Zero value means that678 * the Energy change is ignored for beacon filtering, and beacon will679 * not be forced to be sent to driver regardless of this delta. Typical680 * energy delta 5dB.681 * @bf_roaming_energy_delta: Used for RSSI filtering, if in 'roaming' state.682 * Send beacon to driver if delta in Energy values calculated for this683 * and last passed beacon is greater than this threshold. Zero value684 * means that the Energy change is ignored for beacon filtering while in685 * Roaming state, typical energy delta 1dB.686 * @bf_roaming_state: Used for RSSI filtering. If absolute Energy values687 * calculated for current beacon is less than the threshold, use688 * Roaming Energy Delta Threshold, otherwise use normal Energy Delta689 * Threshold. Typical energy threshold is -72dBm.690 * @bf_temp_threshold: This threshold determines the type of temperature691 * filtering (Slow or Fast) that is selected (Units are in Celsuis):692 * If the current temperature is above this threshold - Fast filter693 * will be used, If the current temperature is below this threshold -694 * Slow filter will be used.695 * @bf_temp_fast_filter: Send Beacon to driver if delta in temperature values696 * calculated for this and the last passed beacon is greater than this697 * threshold. Zero value means that the temperature change is ignored for698 * beacon filtering; beacons will not be forced to be sent to driver699 * regardless of whether its temerature has been changed.700 * @bf_temp_slow_filter: Send Beacon to driver if delta in temperature values701 * calculated for this and the last passed beacon is greater than this702 * threshold. Zero value means that the temperature change is ignored for703 * beacon filtering; beacons will not be forced to be sent to driver704 * regardless of whether its temerature has been changed.705 * @bf_enable_beacon_filter: 1, beacon filtering is enabled; 0, disabled.706 * @bf_debug_flag: beacon filtering debug configuration707 * @bf_escape_timer: Send beacons to to driver if no beacons were passed708 * for a specific period of time. Units: Beacons.709 * @ba_escape_timer: Fully receive and parse beacon if no beacons were passed710 * for a longer period of time then this escape-timeout. Units: Beacons.711 * @ba_enable_beacon_abort: 1, beacon abort is enabled; 0, disabled.712 * @bf_threshold_absolute_low: See below.713 * @bf_threshold_absolute_high: Send Beacon to driver if Energy value calculated714 * for this beacon crossed this absolute threshold. For the 'Increase'715 * direction the bf_energy_absolute_low[i] is used. For the 'Decrease'716 * direction the bf_energy_absolute_high[i] is used. Zero value means717 * that this specific threshold is ignored for beacon filtering, and718 * beacon will not be forced to be sent to driver due to this setting.719 */720struct iwl_beacon_filter_cmd {721 __le32 bf_energy_delta;722 __le32 bf_roaming_energy_delta;723 __le32 bf_roaming_state;724 __le32 bf_temp_threshold;725 __le32 bf_temp_fast_filter;726 __le32 bf_temp_slow_filter;727 __le32 bf_enable_beacon_filter;728 __le32 bf_debug_flag;729 __le32 bf_escape_timer;730 __le32 ba_escape_timer;731 __le32 ba_enable_beacon_abort;732 __le32 bf_threshold_absolute_low[2];733 __le32 bf_threshold_absolute_high[2];734} __packed; /* BEACON_FILTER_CONFIG_API_S_VER_4 */735 736/* Beacon filtering and beacon abort */737#define IWL_BF_ENERGY_DELTA_DEFAULT 5738#define IWL_BF_ENERGY_DELTA_D0I3 20739#define IWL_BF_ENERGY_DELTA_MAX 255740#define IWL_BF_ENERGY_DELTA_MIN 0741 742#define IWL_BF_ROAMING_ENERGY_DELTA_DEFAULT 1743#define IWL_BF_ROAMING_ENERGY_DELTA_D0I3 20744#define IWL_BF_ROAMING_ENERGY_DELTA_MAX 255745#define IWL_BF_ROAMING_ENERGY_DELTA_MIN 0746 747#define IWL_BF_ROAMING_STATE_DEFAULT 72748#define IWL_BF_ROAMING_STATE_D0I3 72749#define IWL_BF_ROAMING_STATE_MAX 255750#define IWL_BF_ROAMING_STATE_MIN 0751 752#define IWL_BF_TEMP_THRESHOLD_DEFAULT 112753#define IWL_BF_TEMP_THRESHOLD_D0I3 112754#define IWL_BF_TEMP_THRESHOLD_MAX 255755#define IWL_BF_TEMP_THRESHOLD_MIN 0756 757#define IWL_BF_TEMP_FAST_FILTER_DEFAULT 1758#define IWL_BF_TEMP_FAST_FILTER_D0I3 1759#define IWL_BF_TEMP_FAST_FILTER_MAX 255760#define IWL_BF_TEMP_FAST_FILTER_MIN 0761 762#define IWL_BF_TEMP_SLOW_FILTER_DEFAULT 5763#define IWL_BF_TEMP_SLOW_FILTER_D0I3 20764#define IWL_BF_TEMP_SLOW_FILTER_MAX 255765#define IWL_BF_TEMP_SLOW_FILTER_MIN 0766 767#define IWL_BF_ENABLE_BEACON_FILTER_DEFAULT 1768 769#define IWL_BF_DEBUG_FLAG_DEFAULT 0770#define IWL_BF_DEBUG_FLAG_D0I3 0771 772#define IWL_BF_ESCAPE_TIMER_DEFAULT 0773#define IWL_BF_ESCAPE_TIMER_D0I3 0774#define IWL_BF_ESCAPE_TIMER_MAX 1024775#define IWL_BF_ESCAPE_TIMER_MIN 0776 777#define IWL_BA_ESCAPE_TIMER_DEFAULT 6778#define IWL_BA_ESCAPE_TIMER_D0I3 6779#define IWL_BA_ESCAPE_TIMER_D3 9780#define IWL_BA_ESCAPE_TIMER_MAX 1024781#define IWL_BA_ESCAPE_TIMER_MIN 0782 783#define IWL_BA_ENABLE_BEACON_ABORT_DEFAULT 1784 785#define IWL_BF_CMD_CONFIG(mode) \786 .bf_energy_delta = cpu_to_le32(IWL_BF_ENERGY_DELTA ## mode), \787 .bf_roaming_energy_delta = \788 cpu_to_le32(IWL_BF_ROAMING_ENERGY_DELTA ## mode), \789 .bf_roaming_state = cpu_to_le32(IWL_BF_ROAMING_STATE ## mode), \790 .bf_temp_threshold = cpu_to_le32(IWL_BF_TEMP_THRESHOLD ## mode), \791 .bf_temp_fast_filter = cpu_to_le32(IWL_BF_TEMP_FAST_FILTER ## mode), \792 .bf_temp_slow_filter = cpu_to_le32(IWL_BF_TEMP_SLOW_FILTER ## mode), \793 .bf_debug_flag = cpu_to_le32(IWL_BF_DEBUG_FLAG ## mode), \794 .bf_escape_timer = cpu_to_le32(IWL_BF_ESCAPE_TIMER ## mode), \795 .ba_escape_timer = cpu_to_le32(IWL_BA_ESCAPE_TIMER ## mode)796 797#define IWL_BF_CMD_CONFIG_DEFAULTS IWL_BF_CMD_CONFIG(_DEFAULT)798#define IWL_BF_CMD_CONFIG_D0I3 IWL_BF_CMD_CONFIG(_D0I3)799 800#define DEFAULT_TPE_TX_POWER 0x7F801 802/*803 * Bandwidth: 20/40/80/(160/80+80)/320804 */805#define IWL_MAX_TX_EIRP_PWR_MAX_SIZE 5806#define IWL_MAX_TX_EIRP_PSD_PWR_MAX_SIZE 16807 808enum iwl_6ghz_ap_type {809 IWL_6GHZ_AP_TYPE_LPI,810 IWL_6GHZ_AP_TYPE_SP,811 IWL_6GHZ_AP_TYPE_VLP,812}; /* PHY_AP_TYPE_API_E_VER_1 */813 814/**815 * struct iwl_txpower_constraints_cmd816 * AP_TX_POWER_CONSTRAINTS_CMD817 * Used for VLP/LPI/AFC Access Point power constraints for 6GHz channels818 * @link_id: linkId819 * @ap_type: see &enum iwl_ap_type820 * @eirp_pwr: 8-bit 2s complement signed integer in the range821 * -64 dBm to 63 dBm with a 0.5 dB step822 * default &DEFAULT_TPE_TX_POWER (no maximum limit)823 * @psd_pwr: 8-bit 2s complement signed integer in the range824 * -63.5 to +63 dBm/MHz with a 0.5 step825 * value - 128 indicates that the corresponding 20826 * MHz channel cannot be used for transmission.827 * value +127 indicates that no maximum PSD limit828 * is specified for the corresponding 20 MHz channel829 * default &DEFAULT_TPE_TX_POWER (no maximum limit)830 * @reserved: reserved (padding)831 */832struct iwl_txpower_constraints_cmd {833 __le16 link_id;834 __le16 ap_type;835 __s8 eirp_pwr[IWL_MAX_TX_EIRP_PWR_MAX_SIZE];836 __s8 psd_pwr[IWL_MAX_TX_EIRP_PSD_PWR_MAX_SIZE];837 u8 reserved[3];838} __packed; /* PHY_AP_TX_POWER_CONSTRAINTS_CMD_API_S_VER_1 */839#endif /* __iwl_fw_api_power_h__ */840