diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index bd9dba10e6..1f9ac1359e 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -1899,6 +1899,7 @@ static void mlme_init_power_cfg(struct wlan_objmgr_psoc *psoc, power->local_power_constraint = (uint8_t)cfg_default(CFG_LOCAL_POWER_CONSTRAINT); power->use_local_tpe = cfg_get(psoc, CFG_USE_LOCAL_TPE); + power->skip_tpe = cfg_get(psoc, CFG_SKIP_TPE_CONSIDERATION); } static void mlme_init_roam_scoring_cfg(struct wlan_objmgr_psoc *psoc, diff --git a/components/mlme/dispatcher/inc/cfg_mlme_power.h b/components/mlme/dispatcher/inc/cfg_mlme_power.h index 4aad3c5ead..a132299fcc 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_power.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_power.h @@ -167,6 +167,31 @@ #define CFG_USE_LOCAL_TPE CFG_INI_BOOL("use_local_tpe", false, \ "use local or regulatory TPE") +/* + * + * skip_tpe_consideration - honoring TPE IE value in tx power calculation for + * 2G/5G bands + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is to determine if the TPE IE should be considered in the Tx power + * calculation. If the ini is set, host will consider TPE IE in case of 6GHz + * only (skip over in 2GHz or 5GHz case). If the ini is not set, honor the TPE + * IE values in all bands. + * + * Related: None + * + * Supported Feature: Transmit power calculation (TPC) + * + * Usage: External + * + * + */ +#define CFG_SKIP_TPE_CONSIDERATION CFG_INI_BOOL("skip_tpe_consideration", \ + false, \ + "consider TPE IE in tx power") + #define CFG_MLME_POWER_ALL \ CFG(CFG_MAX_TX_POWER_2_4) \ CFG(CFG_MAX_TX_POWER_5) \ @@ -175,6 +200,7 @@ CFG(CFG_SET_TXPOWER_LIMIT5G) \ CFG(CFG_CURRENT_TX_POWER_LEVEL) \ CFG(CFG_LOCAL_POWER_CONSTRAINT) \ - CFG(CFG_USE_LOCAL_TPE) + CFG(CFG_USE_LOCAL_TPE) \ + CFG(CFG_SKIP_TPE_CONSIDERATION) #endif /* __CFG_MLME_POWER_H */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h index 1c673fdb05..63ec8699d1 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -3190,6 +3190,16 @@ mlme_is_twt_enabled(struct wlan_objmgr_psoc *psoc) */ bool wlan_mlme_is_local_tpe_pref(struct wlan_objmgr_psoc *psoc); +/** + * wlan_mlme_skip_tpe() - Get preference to not consider TPE in 2G/5G case + * + * @psoc: pointer to psoc object + * + * Return: True if host should not consider TPE IE in TX power calculation when + * operating in 2G/5G bands, false if host should always consider TPE IE values + */ +bool wlan_mlme_skip_tpe(struct wlan_objmgr_psoc *psoc); + /** * wlan_mlme_is_data_stall_recovery_fw_supported() - Check if data stall * recovery is supported by fw diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 4a80703ccd..70ae27cce7 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -2200,6 +2200,7 @@ struct mlme_power_usage { * @current_tx_power_level: current tx power level * @local_power_constraint: local power constraint * @use_local_tpe: preference to use local or regulatory TPE + * @skip_tpe: option to not consider TPE values in 2.4G/5G bands */ struct wlan_mlme_power { struct mlme_max_tx_power_24 max_tx_power_24; @@ -2212,6 +2213,7 @@ struct wlan_mlme_power { uint8_t current_tx_power_level; uint8_t local_power_constraint; bool use_local_tpe; + bool skip_tpe; }; /* diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c index b5c63d827d..ba08902349 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -4896,6 +4896,17 @@ bool wlan_mlme_is_local_tpe_pref(struct wlan_objmgr_psoc *psoc) return mlme_obj->cfg.power.use_local_tpe; } +bool wlan_mlme_skip_tpe(struct wlan_objmgr_psoc *psoc) +{ + struct wlan_mlme_psoc_ext_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_ext_obj(psoc); + if (!mlme_obj) + return false; + + return mlme_obj->cfg.power.skip_tpe; +} + #ifdef WLAN_FEATURE_11BE QDF_STATUS mlme_cfg_get_eht_caps(struct wlan_objmgr_psoc *psoc, tDot11fIEeht_cap *eht_cap)