Path: blob/main/sys/contrib/dev/iwlwifi/fw/api/power.h
48425 views
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */1/*2* Copyright (C) 2012-2014, 2018-2025 Intel Corporation3* Copyright (C) 2013-2014 Intel Mobile Communications GmbH4* Copyright (C) 2015-2017 Intel Deutschland GmbH5*/6#ifndef __iwl_fw_api_power_h__7#define __iwl_fw_api_power_h__89#include "nvm-reg.h"1011/* Power Management Commands, Responses, Notifications */1213/**14* enum iwl_ltr_config_flags - masks for LTR config command flags15* @LTR_CFG_FLAG_FEATURE_ENABLE: Feature operational status16* @LTR_CFG_FLAG_HW_DIS_ON_SHADOW_REG_ACCESS: allow LTR change on shadow17* memory access18* @LTR_CFG_FLAG_HW_EN_SHRT_WR_THROUGH: allow LTR msg send on ANY LTR19* reg change20* @LTR_CFG_FLAG_HW_DIS_ON_D0_2_D3: allow LTR msg send on transition from21* D0 to D322* @LTR_CFG_FLAG_SW_SET_SHORT: fixed static short LTR register23* @LTR_CFG_FLAG_SW_SET_LONG: fixed static short LONG register24* @LTR_CFG_FLAG_DENIE_C10_ON_PD: allow going into C10 on PD25* @LTR_CFG_FLAG_UPDATE_VALUES: update config values and short26* idle timeout27*/28enum iwl_ltr_config_flags {29LTR_CFG_FLAG_FEATURE_ENABLE = BIT(0),30LTR_CFG_FLAG_HW_DIS_ON_SHADOW_REG_ACCESS = BIT(1),31LTR_CFG_FLAG_HW_EN_SHRT_WR_THROUGH = BIT(2),32LTR_CFG_FLAG_HW_DIS_ON_D0_2_D3 = BIT(3),33LTR_CFG_FLAG_SW_SET_SHORT = BIT(4),34LTR_CFG_FLAG_SW_SET_LONG = BIT(5),35LTR_CFG_FLAG_DENIE_C10_ON_PD = BIT(6),36LTR_CFG_FLAG_UPDATE_VALUES = BIT(7),37};3839/**40* struct iwl_ltr_config_cmd_v1 - configures the LTR41* @flags: See &enum iwl_ltr_config_flags42* @static_long: static LTR Long register value.43* @static_short: static LTR Short register value.44*/45struct iwl_ltr_config_cmd_v1 {46__le32 flags;47__le32 static_long;48__le32 static_short;49} __packed; /* LTR_CAPABLE_API_S_VER_1 */5051#define LTR_VALID_STATES_NUM 45253/**54* struct iwl_ltr_config_cmd - configures the LTR55* @flags: See &enum iwl_ltr_config_flags56* @static_long: static LTR Long register value.57* @static_short: static LTR Short register value.58* @ltr_cfg_values: LTR parameters table values (in usec) in following order:59* TX, RX, Short Idle, Long Idle. Used only if %LTR_CFG_FLAG_UPDATE_VALUES60* is set.61* @ltr_short_idle_timeout: LTR Short Idle timeout (in usec). Used only if62* %LTR_CFG_FLAG_UPDATE_VALUES is set.63*/64struct iwl_ltr_config_cmd {65__le32 flags;66__le32 static_long;67__le32 static_short;68__le32 ltr_cfg_values[LTR_VALID_STATES_NUM];69__le32 ltr_short_idle_timeout;70} __packed; /* LTR_CAPABLE_API_S_VER_2 */7172/* Radio LP RX Energy Threshold measured in dBm */73#define POWER_LPRX_RSSI_THRESHOLD 7574#define POWER_LPRX_RSSI_THRESHOLD_MAX 9475#define POWER_LPRX_RSSI_THRESHOLD_MIN 307677/**78* enum iwl_power_flags - masks for power table command flags79* @POWER_FLAGS_POWER_SAVE_ENA_MSK: '1' Allow to save power by turning off80* receiver and transmitter. '0' - does not allow.81* @POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK: '0' Driver disables power management,82* '1' Driver enables PM (use rest of parameters)83* @POWER_FLAGS_SKIP_OVER_DTIM_MSK: '0' PM have to walk up every DTIM,84* '1' PM could sleep over DTIM till listen Interval.85* @POWER_FLAGS_SNOOZE_ENA_MSK: Enable snoozing only if uAPSD is enabled and all86* access categories are both delivery and trigger enabled.87* @POWER_FLAGS_BT_SCO_ENA: Enable BT SCO coex only if uAPSD and88* PBW Snoozing enabled89* @POWER_FLAGS_ADVANCE_PM_ENA_MSK: Advanced PM (uAPSD) enable mask90* @POWER_FLAGS_LPRX_ENA_MSK: Low Power RX enable.91* @POWER_FLAGS_UAPSD_MISBEHAVING_ENA_MSK: AP/GO's uAPSD misbehaving92* detection enablement93* @POWER_FLAGS_ENABLE_SMPS_MSK: SMPS is allowed for this vif94*/95enum iwl_power_flags {96POWER_FLAGS_POWER_SAVE_ENA_MSK = BIT(0),97POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK = BIT(1),98POWER_FLAGS_SKIP_OVER_DTIM_MSK = BIT(2),99POWER_FLAGS_SNOOZE_ENA_MSK = BIT(5),100POWER_FLAGS_BT_SCO_ENA = BIT(8),101POWER_FLAGS_ADVANCE_PM_ENA_MSK = BIT(9),102POWER_FLAGS_LPRX_ENA_MSK = BIT(11),103POWER_FLAGS_UAPSD_MISBEHAVING_ENA_MSK = BIT(12),104POWER_FLAGS_ENABLE_SMPS_MSK = BIT(14),105};106107#define IWL_POWER_VEC_SIZE 5108109/**110* struct iwl_powertable_cmd - legacy power command. Beside old API support this111* is used also with a new power API for device wide power settings.112* POWER_TABLE_CMD = 0x77 (command, has simple generic response)113*114* @flags: Power table command flags from POWER_FLAGS_*115* @keep_alive_seconds: Keep alive period in seconds. Default - 25 sec.116* Minimum allowed:- 3 * DTIM. Keep alive period must be117* set regardless of power scheme or current power state.118* FW use this value also when PM is disabled.119* @debug_flags: debug flags120* @rx_data_timeout: Minimum time (usec) from last Rx packet for AM to121* PSM transition - legacy PM122* @tx_data_timeout: Minimum time (usec) from last Tx packet for AM to123* PSM transition - legacy PM124* @sleep_interval: not in use125* @skip_dtim_periods: Number of DTIM periods to skip if Skip over DTIM flag126* is set. For example, if it is required to skip over127* one DTIM, this value need to be set to 2 (DTIM periods).128* @lprx_rssi_threshold: Signal strength up to which LP RX can be enabled.129* Default: 80dbm130*/131struct iwl_powertable_cmd {132/* PM_POWER_TABLE_CMD_API_S_VER_6 */133__le16 flags;134u8 keep_alive_seconds;135u8 debug_flags;136__le32 rx_data_timeout;137__le32 tx_data_timeout;138__le32 sleep_interval[IWL_POWER_VEC_SIZE];139__le32 skip_dtim_periods;140__le32 lprx_rssi_threshold;141} __packed;142143/**144* enum iwl_device_power_flags - masks for device power command flags145* @DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK:146* '1' Allow to save power by turning off147* receiver and transmitter. '0' - does not allow.148* @DEVICE_POWER_FLAGS_ALLOW_MEM_RETENTION_MSK:149* Device Retention indication, '1' indicate retention is enabled.150* @DEVICE_POWER_FLAGS_NO_SLEEP_TILL_D3_MSK:151* Prevent power save until entering d3 is completed.152* @DEVICE_POWER_FLAGS_32K_CLK_VALID_MSK:153* 32Khz external slow clock valid indication, '1' indicate cloack is154* valid.155*/156enum iwl_device_power_flags {157DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK = BIT(0),158DEVICE_POWER_FLAGS_ALLOW_MEM_RETENTION_MSK = BIT(1),159DEVICE_POWER_FLAGS_NO_SLEEP_TILL_D3_MSK = BIT(7),160DEVICE_POWER_FLAGS_32K_CLK_VALID_MSK = BIT(12),161};162163/**164* struct iwl_device_power_cmd - device wide power command.165* DEVICE_POWER_CMD = 0x77 (command, has simple generic response)166*167* @flags: Power table command flags from &enum iwl_device_power_flags168* @reserved: reserved (padding)169*/170struct iwl_device_power_cmd {171/* PM_POWER_TABLE_CMD_API_S_VER_7 */172__le16 flags;173__le16 reserved;174} __packed;175176/**177* struct iwl_mac_power_cmd - New power command containing uAPSD support178* MAC_PM_POWER_TABLE = 0xA9 (command, has simple generic response)179* @id_and_color: MAC contex identifier, &enum iwl_ctxt_id_and_color180* @flags: Power table command flags from POWER_FLAGS_*181* @keep_alive_seconds: Keep alive period in seconds. Default - 25 sec.182* Minimum allowed:- 3 * DTIM. Keep alive period must be183* set regardless of power scheme or current power state.184* FW use this value also when PM is disabled.185* @rx_data_timeout: Minimum time (usec) from last Rx packet for AM to186* PSM transition - legacy PM187* @tx_data_timeout: Minimum time (usec) from last Tx packet for AM to188* PSM transition - legacy PM189* @skip_dtim_periods: Number of DTIM periods to skip if Skip over DTIM flag190* is set. For example, if it is required to skip over191* one DTIM, this value need to be set to 2 (DTIM periods).192* @rx_data_timeout_uapsd: Minimum time (usec) from last Rx packet for AM to193* PSM transition - uAPSD194* @tx_data_timeout_uapsd: Minimum time (usec) from last Tx packet for AM to195* PSM transition - uAPSD196* @lprx_rssi_threshold: Signal strength up to which LP RX can be enabled.197* Default: 80dbm198* @snooze_interval: Maximum time between attempts to retrieve buffered data199* from the AP [msec]200* @snooze_window: A window of time in which PBW snoozing insures that all201* packets received. It is also the minimum time from last202* received unicast RX packet, before client stops snoozing203* for data. [msec]204* @snooze_step: TBD205* @qndp_tid: TID client shall use for uAPSD QNDP triggers206* @uapsd_ac_flags: Set trigger-enabled and delivery-enabled indication for207* each corresponding AC.208* Use IEEE80211_WMM_IE_STA_QOSINFO_AC* for correct values.209* @uapsd_max_sp: Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct210* values.211* @heavy_tx_thld_packets: TX threshold measured in number of packets212* @heavy_rx_thld_packets: RX threshold measured in number of packets213* @heavy_tx_thld_percentage: TX threshold measured in load's percentage214* @heavy_rx_thld_percentage: RX threshold measured in load's percentage215* @limited_ps_threshold: (unused)216* @reserved: reserved (padding)217*/218struct iwl_mac_power_cmd {219/* CONTEXT_DESC_API_T_VER_1 */220__le32 id_and_color;221222__le16 flags;223__le16 keep_alive_seconds;224__le32 rx_data_timeout;225__le32 tx_data_timeout;226__le32 rx_data_timeout_uapsd;227__le32 tx_data_timeout_uapsd;228u8 lprx_rssi_threshold;229u8 skip_dtim_periods;230__le16 snooze_interval;231__le16 snooze_window;232u8 snooze_step;233u8 qndp_tid;234u8 uapsd_ac_flags;235u8 uapsd_max_sp;236u8 heavy_tx_thld_packets;237u8 heavy_rx_thld_packets;238u8 heavy_tx_thld_percentage;239u8 heavy_rx_thld_percentage;240u8 limited_ps_threshold;241u8 reserved;242} __packed; /* CLIENT_PM_POWER_TABLE_S_VER_1, VER_2 */243244/*245* struct iwl_uapsd_misbehaving_ap_notif - FW sends this notification when246* associated AP is identified as improperly implementing uAPSD protocol.247* PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78248* @sta_id: index of station in uCode's station table - associated AP ID in249* this context.250*/251struct iwl_uapsd_misbehaving_ap_notif {252__le32 sta_id;253u8 mac_id;254u8 reserved[3];255} __packed;256257enum iwl_dev_tx_power_cmd_mode {258IWL_TX_POWER_MODE_SET_LINK = 0,259IWL_TX_POWER_MODE_SET_DEVICE = 1,260IWL_TX_POWER_MODE_SET_CHAINS = 2,261IWL_TX_POWER_MODE_SET_ACK = 3,262IWL_TX_POWER_MODE_SET_SAR_TIMER = 4,263IWL_TX_POWER_MODE_SET_SAR_TIMER_DEFAULT_TABLE = 5,264}; /* TX_POWER_REDUCED_FLAGS_TYPE_API_E_VER_5 */;265266#define IWL_NUM_CHAIN_TABLES 1267#define IWL_NUM_CHAIN_TABLES_V2 2268#define IWL_NUM_CHAIN_LIMITS 2269#define IWL_NUM_SUB_BANDS_V1 5270#define IWL_NUM_SUB_BANDS_V2 11271272/**273* struct iwl_dev_tx_power_common - Common part of the TX power reduction cmd274* @set_mode: see &enum iwl_dev_tx_power_cmd_mode275* @link_id: id of the link ctx for which we are reducing TX power.276* For version 9 / 10, this is the link id. For earlier versions, it is277* the mac id.278* @pwr_restriction: TX power restriction in 1/8 dBms.279*/280struct iwl_dev_tx_power_common {281__le32 set_mode;282__le32 link_id;283__le16 pwr_restriction;284} __packed;285286/**287* struct iwl_dev_tx_power_cmd_v3 - TX power reduction command version 3288* @per_chain: per chain restrictions289*/290struct iwl_dev_tx_power_cmd_v3 {291__le16 per_chain[IWL_NUM_CHAIN_TABLES][IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V1];292} __packed; /* TX_REDUCED_POWER_API_S_VER_3 */293294#define IWL_DEV_MAX_TX_POWER 0x7FFF295296/**297* struct iwl_dev_tx_power_cmd_v4 - TX power reduction command version 4298* @per_chain: per chain restrictions299* @enable_ack_reduction: enable or disable close range ack TX power300* reduction.301* @reserved: reserved (padding)302*/303struct iwl_dev_tx_power_cmd_v4 {304__le16 per_chain[IWL_NUM_CHAIN_TABLES][IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V1];305u8 enable_ack_reduction;306u8 reserved[3];307} __packed; /* TX_REDUCED_POWER_API_S_VER_4 */308309/**310* struct iwl_dev_tx_power_cmd_v5 - TX power reduction command version 5311* @per_chain: per chain restrictions312* @enable_ack_reduction: enable or disable close range ack TX power313* reduction.314* @per_chain_restriction_changed: is per_chain_restriction has changed315* from last command. used if set_mode is316* IWL_TX_POWER_MODE_SET_SAR_TIMER.317* note: if not changed, the command is used for keep alive only.318* @reserved: reserved (padding)319* @timer_period: timer in milliseconds. if expires FW will change to default320* BIOS values. relevant if setMode is IWL_TX_POWER_MODE_SET_SAR_TIMER321*/322struct iwl_dev_tx_power_cmd_v5 {323__le16 per_chain[IWL_NUM_CHAIN_TABLES][IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V1];324u8 enable_ack_reduction;325u8 per_chain_restriction_changed;326u8 reserved[2];327__le32 timer_period;328} __packed; /* TX_REDUCED_POWER_API_S_VER_5 */329330/**331* struct iwl_dev_tx_power_cmd_v8 - TX power reduction command version 8332* @per_chain: per chain restrictions333* @enable_ack_reduction: enable or disable close range ack TX power334* reduction.335* @per_chain_restriction_changed: is per_chain_restriction has changed336* from last command. used if set_mode is337* IWL_TX_POWER_MODE_SET_SAR_TIMER.338* note: if not changed, the command is used for keep alive only.339* @reserved: reserved (padding)340* @timer_period: timer in milliseconds. if expires FW will change to default341* BIOS values. relevant if setMode is IWL_TX_POWER_MODE_SET_SAR_TIMER342* @flags: reduce power flags.343* @tpc_vlp_backoff_level: user backoff of UNII5,7 VLP channels in USA.344* Not in use.345*/346struct iwl_dev_tx_power_cmd_v8 {347__le16 per_chain[IWL_NUM_CHAIN_TABLES_V2][IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V2];348u8 enable_ack_reduction;349u8 per_chain_restriction_changed;350u8 reserved[2];351__le32 timer_period;352__le32 flags;353__le32 tpc_vlp_backoff_level;354} __packed; /* TX_REDUCED_POWER_API_S_VER_8 */355356/*357* @dev_24: device TX power restriction in 1/8 dBms358* @dev_52_low: device TX power restriction upper band - low359* @dev_52_high: device TX power restriction upper band - high360*/361struct iwl_dev_tx_power_cmd_per_band {362__le16 dev_24;363__le16 dev_52_low;364__le16 dev_52_high;365} __packed;366367/**368* struct iwl_dev_tx_power_cmd_v3_v8 - TX power reduction command (multiversion)369* @per_band: per band restrictions370* @common: common part of the command371* @v3: version 3 part of the command372* @v4: version 4 part of the command373* @v5: version 5 part of the command374* @v8: version 8 part of the command375*/376struct iwl_dev_tx_power_cmd_v3_v8 {377struct iwl_dev_tx_power_common common;378struct iwl_dev_tx_power_cmd_per_band per_band;379union {380struct iwl_dev_tx_power_cmd_v3 v3;381struct iwl_dev_tx_power_cmd_v4 v4;382struct iwl_dev_tx_power_cmd_v5 v5;383struct iwl_dev_tx_power_cmd_v8 v8;384};385};386387/**388* struct iwl_dev_tx_power_cmd_v9 - TX power reduction cmd389* @reserved: reserved (padding)390* @per_chain: per chain restrictions391* @per_chain_restriction_changed: is per_chain_restriction has changed392* from last command. used if set_mode is393* IWL_TX_POWER_MODE_SET_SAR_TIMER.394* note: if not changed, the command is used for keep alive only.395* @reserved1: reserved (padding)396* @timer_period: timer in milliseconds. if expires FW will change to default397* BIOS values. relevant if setMode is IWL_TX_POWER_MODE_SET_SAR_TIMER398*/399struct iwl_dev_tx_power_cmd_v9 {400__le16 reserved;401__le16 per_chain[IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V1];402u8 per_chain_restriction_changed;403u8 reserved1[3];404__le32 timer_period;405} __packed; /* TX_REDUCED_POWER_API_S_VER_9 */406407/**408* struct iwl_dev_tx_power_cmd_v10 - TX power reduction cmd409* @per_chain: per chain restrictions410* @per_chain_restriction_changed: is per_chain_restriction has changed411* from last command. used if set_mode is412* IWL_TX_POWER_MODE_SET_SAR_TIMER.413* note: if not changed, the command is used for keep alive only.414* @reserved: reserved (padding)415* @timer_period: timer in milliseconds. if expires FW will change to default416* BIOS values. relevant if setMode is IWL_TX_POWER_MODE_SET_SAR_TIMER417* @flags: reduce power flags.418*/419struct iwl_dev_tx_power_cmd_v10 {420__le16 per_chain[IWL_NUM_CHAIN_TABLES_V2][IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V2];421u8 per_chain_restriction_changed;422u8 reserved;423__le32 timer_period;424__le32 flags;425} __packed; /* TX_REDUCED_POWER_API_S_VER_10 */426427/*428* struct iwl_dev_tx_power_cmd - TX power reduction command (multiversion)429* @common: common part of the command430* @v9: version 9 part of the command431* @v10: version 10 part of the command432*/433struct iwl_dev_tx_power_cmd {434struct iwl_dev_tx_power_common common;435union {436struct iwl_dev_tx_power_cmd_v9 v9;437struct iwl_dev_tx_power_cmd_v10 v10;438};439} __packed; /* TX_REDUCED_POWER_API_S_VER_9_VER10 */440441#define IWL_NUM_GEO_PROFILES 3442#define IWL_NUM_GEO_PROFILES_V3 8443#define IWL_NUM_BANDS_PER_CHAIN_V1 2444#define IWL_NUM_BANDS_PER_CHAIN_V2 3445446/**447* enum iwl_geo_per_chain_offset_operation - type of operation448* @IWL_PER_CHAIN_OFFSET_SET_TABLES: send the tables from the host to the FW.449* @IWL_PER_CHAIN_OFFSET_GET_CURRENT_TABLE: retrieve the last configured table.450*/451enum iwl_geo_per_chain_offset_operation {452IWL_PER_CHAIN_OFFSET_SET_TABLES,453IWL_PER_CHAIN_OFFSET_GET_CURRENT_TABLE,454}; /* PER_CHAIN_OFFSET_OPERATION_E */455456/**457* struct iwl_per_chain_offset - embedded struct for PER_CHAIN_LIMIT_OFFSET_CMD.458* @max_tx_power: maximum allowed tx power.459* @chain_a: tx power offset for chain a.460* @chain_b: tx power offset for chain b.461*/462struct iwl_per_chain_offset {463__le16 max_tx_power;464u8 chain_a;465u8 chain_b;466} __packed; /* PER_CHAIN_LIMIT_OFFSET_PER_CHAIN_S_VER_1 */467468/**469* struct iwl_geo_tx_power_profiles_cmd_v1 - struct for PER_CHAIN_LIMIT_OFFSET_CMD cmd.470* @ops: operations, value from &enum iwl_geo_per_chain_offset_operation471* @table: offset profile per band.472*/473struct iwl_geo_tx_power_profiles_cmd_v1 {474__le32 ops;475struct iwl_per_chain_offset table[IWL_NUM_GEO_PROFILES][IWL_NUM_BANDS_PER_CHAIN_V1];476} __packed; /* PER_CHAIN_LIMIT_OFFSET_CMD_VER_1 */477478/**479* struct iwl_geo_tx_power_profiles_cmd_v2 - struct for PER_CHAIN_LIMIT_OFFSET_CMD cmd.480* @ops: operations, value from &enum iwl_geo_per_chain_offset_operation481* @table: offset profile per band.482* @table_revision: 0 for not-South Korea, 1 for South Korea (the name is misleading)483*/484struct iwl_geo_tx_power_profiles_cmd_v2 {485__le32 ops;486struct iwl_per_chain_offset table[IWL_NUM_GEO_PROFILES][IWL_NUM_BANDS_PER_CHAIN_V1];487__le32 table_revision;488} __packed; /* PER_CHAIN_LIMIT_OFFSET_CMD_VER_2 */489490/**491* struct iwl_geo_tx_power_profiles_cmd_v3 - struct for PER_CHAIN_LIMIT_OFFSET_CMD cmd.492* @ops: operations, value from &enum iwl_geo_per_chain_offset_operation493* @table: offset profile per band.494* @table_revision: 0 for not-South Korea, 1 for South Korea (the name is misleading)495*/496struct iwl_geo_tx_power_profiles_cmd_v3 {497__le32 ops;498struct iwl_per_chain_offset table[IWL_NUM_GEO_PROFILES][IWL_NUM_BANDS_PER_CHAIN_V2];499__le32 table_revision;500} __packed; /* PER_CHAIN_LIMIT_OFFSET_CMD_VER_3 */501502/**503* struct iwl_geo_tx_power_profiles_cmd_v4 - struct for PER_CHAIN_LIMIT_OFFSET_CMD cmd.504* @ops: operations, value from &enum iwl_geo_per_chain_offset_operation505* @table: offset profile per band.506* @table_revision: 0 for not-South Korea, 1 for South Korea (the name is misleading)507*/508struct iwl_geo_tx_power_profiles_cmd_v4 {509__le32 ops;510struct iwl_per_chain_offset table[IWL_NUM_GEO_PROFILES_V3][IWL_NUM_BANDS_PER_CHAIN_V1];511__le32 table_revision;512} __packed; /* PER_CHAIN_LIMIT_OFFSET_CMD_VER_4 */513514/**515* struct iwl_geo_tx_power_profiles_cmd_v5 - struct for PER_CHAIN_LIMIT_OFFSET_CMD cmd.516* @ops: operations, value from &enum iwl_geo_per_chain_offset_operation517* @table: offset profile per band.518* @table_revision: 0 for not-South Korea, 1 for South Korea (the name is misleading)519*/520struct iwl_geo_tx_power_profiles_cmd_v5 {521__le32 ops;522struct iwl_per_chain_offset table[IWL_NUM_GEO_PROFILES_V3][IWL_NUM_BANDS_PER_CHAIN_V2];523__le32 table_revision;524} __packed; /* PER_CHAIN_LIMIT_OFFSET_CMD_VER_5 */525526union iwl_geo_tx_power_profiles_cmd {527struct iwl_geo_tx_power_profiles_cmd_v1 v1;528struct iwl_geo_tx_power_profiles_cmd_v2 v2;529struct iwl_geo_tx_power_profiles_cmd_v3 v3;530struct iwl_geo_tx_power_profiles_cmd_v4 v4;531struct iwl_geo_tx_power_profiles_cmd_v5 v5;532};533534/**535* struct iwl_geo_tx_power_profiles_resp - response to PER_CHAIN_LIMIT_OFFSET_CMD cmd536* @profile_idx: current geo profile in use537*/538struct iwl_geo_tx_power_profiles_resp {539__le32 profile_idx;540} __packed; /* PER_CHAIN_LIMIT_OFFSET_RSP */541542/**543* enum iwl_ppag_flags - PPAG enable masks544* @IWL_PPAG_ETSI_MASK: enable PPAG in ETSI545* @IWL_PPAG_CHINA_MASK: enable PPAG in China546* @IWL_PPAG_ETSI_LPI_UHB_MASK: enable LPI in ETSI for UHB547* @IWL_PPAG_ETSI_VLP_UHB_MASK: enable VLP in ETSI for UHB548* @IWL_PPAG_ETSI_SP_UHB_MASK: enable SP in ETSI for UHB549* @IWL_PPAG_USA_LPI_UHB_MASK: enable LPI in USA for UHB550* @IWL_PPAG_USA_VLP_UHB_MASK: enable VLP in USA for UHB551* @IWL_PPAG_USA_SP_UHB_MASK: enable SP in USA for UHB552* @IWL_PPAG_CANADA_LPI_UHB_MASK: enable LPI in CANADA for UHB553* @IWL_PPAG_CANADA_VLP_UHB_MASK: enable VLP in CANADA for UHB554* @IWL_PPAG_CANADA_SP_UHB_MASK: enable SP in CANADA for UHB555*/556enum iwl_ppag_flags {557IWL_PPAG_ETSI_MASK = BIT(0),558IWL_PPAG_CHINA_MASK = BIT(1),559IWL_PPAG_ETSI_LPI_UHB_MASK = BIT(2),560IWL_PPAG_ETSI_VLP_UHB_MASK = BIT(3),561IWL_PPAG_ETSI_SP_UHB_MASK = BIT(4),562IWL_PPAG_USA_LPI_UHB_MASK = BIT(5),563IWL_PPAG_USA_VLP_UHB_MASK = BIT(6),564IWL_PPAG_USA_SP_UHB_MASK = BIT(7),565IWL_PPAG_CANADA_LPI_UHB_MASK = BIT(8),566IWL_PPAG_CANADA_VLP_UHB_MASK = BIT(9),567IWL_PPAG_CANADA_SP_UHB_MASK = BIT(10),568};569570/**571* union iwl_ppag_table_cmd - union for all versions of PPAG command572* @v1: command version 1 structure.573* @v2: command version from 2 to 6 are same structure as v2.574* but has a different format of the flags bitmap575* @v3: command version 7 structure.576* @v1.flags: values from &enum iwl_ppag_flags577* @v1.gain: table of antenna gain values per chain and sub-band578* @v1.reserved: reserved579* @v2.flags: values from &enum iwl_ppag_flags580* @v2.gain: table of antenna gain values per chain and sub-band581* @v3.ppag_config_info: see @struct bios_value_u32582* @v3.gain: table of antenna gain values per chain and sub-band583* @v3.reserved: reserved584*/585union iwl_ppag_table_cmd {586struct {587__le32 flags;588s8 gain[IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V1];589s8 reserved[2];590} __packed v1; /* PER_PLAT_ANTENNA_GAIN_CMD_API_S_VER_1 */591struct {592__le32 flags;593s8 gain[IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V2];594s8 reserved[2];595} __packed v2; /* PER_PLAT_ANTENNA_GAIN_CMD_API_S_VER_2, VER3, VER4,596* VER5, VER6597*/598struct {599struct bios_value_u32 ppag_config_info;600s8 gain[IWL_NUM_CHAIN_LIMITS][IWL_NUM_SUB_BANDS_V2];601s8 reserved[2];602} __packed v3; /* PER_PLAT_ANTENNA_GAIN_CMD_API_S_VER_7 */603} __packed;604605#define IWL_PPAG_CMD_V4_MASK (IWL_PPAG_ETSI_MASK | IWL_PPAG_CHINA_MASK)606#define IWL_PPAG_CMD_V5_MASK (IWL_PPAG_CMD_V4_MASK | \607IWL_PPAG_ETSI_LPI_UHB_MASK | \608IWL_PPAG_USA_LPI_UHB_MASK)609610#define IWL_PPAG_CMD_V6_MASK (IWL_PPAG_CMD_V5_MASK | \611IWL_PPAG_ETSI_VLP_UHB_MASK | \612IWL_PPAG_ETSI_SP_UHB_MASK | \613IWL_PPAG_USA_VLP_UHB_MASK | \614IWL_PPAG_USA_SP_UHB_MASK | \615IWL_PPAG_CANADA_LPI_UHB_MASK | \616IWL_PPAG_CANADA_VLP_UHB_MASK | \617IWL_PPAG_CANADA_SP_UHB_MASK)618619#define MCC_TO_SAR_OFFSET_TABLE_ROW_SIZE 26620#define MCC_TO_SAR_OFFSET_TABLE_COL_SIZE 13621622/**623* struct iwl_sar_offset_mapping_cmd - struct for SAR_OFFSET_MAPPING_TABLE_CMD624* @offset_map: mapping a mcc to a geo sar group625* @reserved: reserved626*/627struct iwl_sar_offset_mapping_cmd {628u8 offset_map[MCC_TO_SAR_OFFSET_TABLE_ROW_SIZE]629[MCC_TO_SAR_OFFSET_TABLE_COL_SIZE];630__le16 reserved;631} __packed; /*SAR_OFFSET_MAPPING_TABLE_CMD_API_S*/632633/**634* struct iwl_beacon_filter_cmd635* REPLY_BEACON_FILTERING_CMD = 0xd2 (command)636* @bf_energy_delta: Used for RSSI filtering, if in 'normal' state. Send beacon637* to driver if delta in Energy values calculated for this and last638* passed beacon is greater than this threshold. Zero value means that639* the Energy change is ignored for beacon filtering, and beacon will640* not be forced to be sent to driver regardless of this delta. Typical641* energy delta 5dB.642* @bf_roaming_energy_delta: Used for RSSI filtering, if in 'roaming' state.643* Send beacon to driver if delta in Energy values calculated for this644* and last passed beacon is greater than this threshold. Zero value645* means that the Energy change is ignored for beacon filtering while in646* Roaming state, typical energy delta 1dB.647* @bf_roaming_state: Used for RSSI filtering. If absolute Energy values648* calculated for current beacon is less than the threshold, use649* Roaming Energy Delta Threshold, otherwise use normal Energy Delta650* Threshold. Typical energy threshold is -72dBm.651* @bf_temp_threshold: This threshold determines the type of temperature652* filtering (Slow or Fast) that is selected (Units are in Celsius):653* If the current temperature is above this threshold - Fast filter654* will be used, If the current temperature is below this threshold -655* Slow filter will be used.656* @bf_temp_fast_filter: Send Beacon to driver if delta in temperature values657* calculated for this and the last passed beacon is greater than this658* threshold. Zero value means that the temperature change is ignored for659* beacon filtering; beacons will not be forced to be sent to driver660* regardless of whether its temperature has been changed.661* @bf_temp_slow_filter: Send Beacon to driver if delta in temperature values662* calculated for this and the last passed beacon is greater than this663* threshold. Zero value means that the temperature change is ignored for664* beacon filtering; beacons will not be forced to be sent to driver665* regardless of whether its temperature has been changed.666* @bf_enable_beacon_filter: 1, beacon filtering is enabled; 0, disabled.667* @bf_debug_flag: beacon filtering debug configuration668* @bf_escape_timer: Send beacons to to driver if no beacons were passed669* for a specific period of time. Units: Beacons.670* @ba_escape_timer: Fully receive and parse beacon if no beacons were passed671* for a longer period of time then this escape-timeout. Units: Beacons.672* @ba_enable_beacon_abort: 1, beacon abort is enabled; 0, disabled.673* @bf_threshold_absolute_low: See below.674* @bf_threshold_absolute_high: Send Beacon to driver if Energy value calculated675* for this beacon crossed this absolute threshold. For the 'Increase'676* direction the bf_energy_absolute_low[i] is used. For the 'Decrease'677* direction the bf_energy_absolute_high[i] is used. Zero value means678* that this specific threshold is ignored for beacon filtering, and679* beacon will not be forced to be sent to driver due to this setting.680*/681struct iwl_beacon_filter_cmd {682__le32 bf_energy_delta;683__le32 bf_roaming_energy_delta;684__le32 bf_roaming_state;685__le32 bf_temp_threshold;686__le32 bf_temp_fast_filter;687__le32 bf_temp_slow_filter;688__le32 bf_enable_beacon_filter;689__le32 bf_debug_flag;690__le32 bf_escape_timer;691__le32 ba_escape_timer;692__le32 ba_enable_beacon_abort;693__le32 bf_threshold_absolute_low[2];694__le32 bf_threshold_absolute_high[2];695} __packed; /* BEACON_FILTER_CONFIG_API_S_VER_4 */696697/* Beacon filtering and beacon abort */698#define IWL_BF_ENERGY_DELTA_DEFAULT 5699#define IWL_BF_ENERGY_DELTA_D0I3 20700#define IWL_BF_ENERGY_DELTA_MAX 255701#define IWL_BF_ENERGY_DELTA_MIN 0702703#define IWL_BF_ROAMING_ENERGY_DELTA_DEFAULT 1704#define IWL_BF_ROAMING_ENERGY_DELTA_D0I3 20705#define IWL_BF_ROAMING_ENERGY_DELTA_MAX 255706#define IWL_BF_ROAMING_ENERGY_DELTA_MIN 0707708#define IWL_BF_ROAMING_STATE_DEFAULT 72709#define IWL_BF_ROAMING_STATE_D0I3 72710#define IWL_BF_ROAMING_STATE_MAX 255711#define IWL_BF_ROAMING_STATE_MIN 0712713#define IWL_BF_TEMP_THRESHOLD_DEFAULT 112714#define IWL_BF_TEMP_THRESHOLD_D0I3 112715#define IWL_BF_TEMP_THRESHOLD_MAX 255716#define IWL_BF_TEMP_THRESHOLD_MIN 0717718#define IWL_BF_TEMP_FAST_FILTER_DEFAULT 1719#define IWL_BF_TEMP_FAST_FILTER_D0I3 1720#define IWL_BF_TEMP_FAST_FILTER_MAX 255721#define IWL_BF_TEMP_FAST_FILTER_MIN 0722723#define IWL_BF_TEMP_SLOW_FILTER_DEFAULT 5724#define IWL_BF_TEMP_SLOW_FILTER_D0I3 20725#define IWL_BF_TEMP_SLOW_FILTER_MAX 255726#define IWL_BF_TEMP_SLOW_FILTER_MIN 0727728#define IWL_BF_ENABLE_BEACON_FILTER_DEFAULT 1729730#define IWL_BF_DEBUG_FLAG_DEFAULT 0731#define IWL_BF_DEBUG_FLAG_D0I3 0732733#define IWL_BF_ESCAPE_TIMER_DEFAULT 0734#define IWL_BF_ESCAPE_TIMER_D0I3 0735#define IWL_BF_ESCAPE_TIMER_MAX 1024736#define IWL_BF_ESCAPE_TIMER_MIN 0737738#define IWL_BA_ESCAPE_TIMER_DEFAULT 6739#define IWL_BA_ESCAPE_TIMER_D0I3 6740#define IWL_BA_ESCAPE_TIMER_D3 9741#define IWL_BA_ESCAPE_TIMER_MAX 1024742#define IWL_BA_ESCAPE_TIMER_MIN 0743744#define IWL_BA_ENABLE_BEACON_ABORT_DEFAULT 1745746#define IWL_BF_CMD_CONFIG(mode) \747.bf_energy_delta = cpu_to_le32(IWL_BF_ENERGY_DELTA ## mode), \748.bf_roaming_energy_delta = \749cpu_to_le32(IWL_BF_ROAMING_ENERGY_DELTA ## mode), \750.bf_roaming_state = cpu_to_le32(IWL_BF_ROAMING_STATE ## mode), \751.bf_temp_threshold = cpu_to_le32(IWL_BF_TEMP_THRESHOLD ## mode), \752.bf_temp_fast_filter = cpu_to_le32(IWL_BF_TEMP_FAST_FILTER ## mode), \753.bf_temp_slow_filter = cpu_to_le32(IWL_BF_TEMP_SLOW_FILTER ## mode), \754.bf_debug_flag = cpu_to_le32(IWL_BF_DEBUG_FLAG ## mode), \755.bf_escape_timer = cpu_to_le32(IWL_BF_ESCAPE_TIMER ## mode), \756.ba_escape_timer = cpu_to_le32(IWL_BA_ESCAPE_TIMER ## mode)757758#define IWL_BF_CMD_CONFIG_DEFAULTS IWL_BF_CMD_CONFIG(_DEFAULT)759#define IWL_BF_CMD_CONFIG_D0I3 IWL_BF_CMD_CONFIG(_D0I3)760761#define DEFAULT_TPE_TX_POWER 0x7F762763/*764* Bandwidth: 20/40/80/(160/80+80)/320765*/766#define IWL_MAX_TX_EIRP_PWR_MAX_SIZE 5767#define IWL_MAX_TX_EIRP_PSD_PWR_MAX_SIZE 16768769enum iwl_6ghz_ap_type {770IWL_6GHZ_AP_TYPE_LPI,771IWL_6GHZ_AP_TYPE_SP,772IWL_6GHZ_AP_TYPE_VLP,773}; /* PHY_AP_TYPE_API_E_VER_1 */774775/**776* struct iwl_txpower_constraints_cmd777* AP_TX_POWER_CONSTRAINTS_CMD778* Used for VLP/LPI/AFC Access Point power constraints for 6GHz channels779* @link_id: linkId780* @ap_type: see &enum iwl_ap_type781* @eirp_pwr: 8-bit 2s complement signed integer in the range782* -64 dBm to 63 dBm with a 0.5 dB step783* default &DEFAULT_TPE_TX_POWER (no maximum limit)784* @psd_pwr: 8-bit 2s complement signed integer in the range785* -63.5 to +63 dBm/MHz with a 0.5 step786* value - 128 indicates that the corresponding 20787* MHz channel cannot be used for transmission.788* value +127 indicates that no maximum PSD limit789* is specified for the corresponding 20 MHz channel790* default &DEFAULT_TPE_TX_POWER (no maximum limit)791* @reserved: reserved (padding)792*/793struct iwl_txpower_constraints_cmd {794__le16 link_id;795__le16 ap_type;796__s8 eirp_pwr[IWL_MAX_TX_EIRP_PWR_MAX_SIZE];797__s8 psd_pwr[IWL_MAX_TX_EIRP_PSD_PWR_MAX_SIZE];798u8 reserved[3];799} __packed; /* PHY_AP_TX_POWER_CONSTRAINTS_CMD_API_S_VER_1 */800#endif /* __iwl_fw_api_power_h__ */801802803