diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index a999480c9a..6ab2732c73 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -1612,6 +1612,8 @@ static void mlme_init_sap_cfg(struct wlan_objmgr_psoc *psoc, cfg_get(psoc, CFG_6G_SAP_FILS_DISCOVERY_ENABLED); sap_cfg->disable_bcn_prot = cfg_get(psoc, CFG_DISABLE_SAP_BCN_PROT); + sap_cfg->sap_ps_with_twt_enable = + cfg_get(psoc, CFG_SAP_PS_WITH_TWT); } static void mlme_init_obss_ht40_cfg(struct wlan_objmgr_psoc *psoc, diff --git a/components/mlme/dispatcher/inc/cfg_mlme_sap.h b/components/mlme/dispatcher/inc/cfg_mlme_sap.h index 913c4643ed..f2a0689a2a 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_sap.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_sap.h @@ -768,6 +768,31 @@ "disable_sap_bcn_prot", \ "0", \ "Disable beacon protection for SAP") + +/* + * + * g_sap_ps_with_twt_enable - enable/disable power save between successive TWT + * SPs for SAP + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to enable/disable power save between successive + * TWT SPs for SAP + * + * Related: None + * + * Supported Feature: SAP + * + * Usage: External + * + * + */ +#define CFG_SAP_PS_WITH_TWT CFG_INI_BOOL(\ + "g_sap_ps_with_twt_enable", \ + "0", \ + "Enable/Disable SAP power save with twt") + #define CFG_SAP_ALL \ CFG_SAP_SAE \ CFG(CFG_AP_ENABLE_RANDOM_BSSID) \ @@ -803,6 +828,7 @@ CFG(CFG_IS_SAP_BCAST_DEAUTH_ENABLED) \ CFG(CFG_6G_SAP_FILS_DISCOVERY_ENABLED) \ CFG(CFG_DISABLE_MCS13_SUPPORT) \ - CFG(CFG_DISABLE_SAP_BCN_PROT) + CFG(CFG_DISABLE_SAP_BCN_PROT) \ + CFG(CFG_SAP_PS_WITH_TWT) #endif /* __CFG_MLME_SAP_H */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h index d3fdadd639..3e9edcbdb0 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -4257,4 +4257,15 @@ wlan_mlme_is_bcn_prot_disabled_for_sap(struct wlan_objmgr_psoc *psoc); */ uint8_t * wlan_mlme_get_src_addr_from_frame(struct element_info *frame); + +/* + * wlan_mlme_get_sap_ps_with_twt() - power save with twt config enabled/disabled + * for SAP interface + * + * @psoc: pointer to psoc object + * + * Return: power save enabled/disabled + */ +bool +wlan_mlme_get_sap_ps_with_twt(struct wlan_objmgr_psoc *psoc); #endif /* _WLAN_MLME_API_H_ */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 6e0b97fb08..6abd604ea3 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -743,6 +743,7 @@ struct wlan_mlme_wps_params { * @is_sap_bcast_deauth_enabled: enable bcast deauth for sap * @is_6g_sap_fd_enabled: enable fils discovery on sap * @disable_bcn_prot: disable beacon protection for sap + * @sap_ps_with_twt_enable: SAP power save with TWT */ struct wlan_mlme_cfg_sap { uint16_t beacon_interval; @@ -779,6 +780,7 @@ struct wlan_mlme_cfg_sap { bool is_sap_bcast_deauth_enabled; bool is_6g_sap_fd_enabled; bool disable_bcn_prot; + bool sap_ps_with_twt_enable; }; /** diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c index b84279cf6a..f6d87a0825 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -6747,3 +6747,15 @@ uint8_t *wlan_mlme_get_src_addr_from_frame(struct element_info *frame) return hdr->i_addr2; } + +bool +wlan_mlme_get_sap_ps_with_twt(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 cfg_default(CFG_SAP_PS_WITH_TWT); + + return mlme_obj->cfg.sap_cfg.sap_ps_with_twt_enable; +}