diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index ed45963c10..c9aa79c045 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -527,6 +527,34 @@ out: } +/** + * hdd_send_ps_config_to_fw() - Check user pwr save config set/reset PS + * @adapter: pointer to hdd adapter + * + * This function checks the power save configuration saved in MAC context + * and sends power save config to FW. + * + * Return: None + */ +static void hdd_send_ps_config_to_fw(struct hdd_adapter *adapter) +{ + struct mac_context *mac_ctx; + struct hdd_context *hdd_ctx; + + if (hdd_validate_adapter(adapter)) + return; + + hdd_ctx = WLAN_HDD_GET_CTX(adapter); + mac_ctx = MAC_CONTEXT(hdd_ctx->mac_handle); + + if (mac_ctx->usr_cfg_ps_enable) + sme_ps_enable_disable(hdd_ctx->mac_handle, adapter->vdev_id, + SME_PS_ENABLE); + else + sme_ps_enable_disable(hdd_ctx->mac_handle, adapter->vdev_id, + SME_PS_DISABLE); +} + /** * __hdd_ipv6_notifier_work_queue() - IPv6 notification work function * @adapter: adapter whose IP address changed @@ -556,6 +584,7 @@ static void __hdd_ipv6_notifier_work_queue(struct hdd_adapter *adapter) hdd_enable_ns_offload(adapter, pmo_ipv6_change_notify); + hdd_send_ps_config_to_fw(adapter); exit: hdd_exit(); } @@ -920,6 +949,7 @@ static void __hdd_ipv4_notifier_work_queue(struct hdd_adapter *adapter) if (ifa && hdd_ctx->is_fils_roaming_supported) sme_send_hlp_ie_info(hdd_ctx->mac_handle, adapter->vdev_id, roam_profile, ifa->ifa_local); + hdd_send_ps_config_to_fw(adapter); exit: hdd_exit(); } diff --git a/core/sme/src/common/sme_power_save.c b/core/sme/src/common/sme_power_save.c index d3ba3ab8fb..403b76d830 100644 --- a/core/sme/src/common/sme_power_save.c +++ b/core/sme/src/common/sme_power_save.c @@ -391,8 +391,6 @@ QDF_STATUS sme_ps_enable_disable(mac_handle_t mac_handle, uint32_t session_id, * In non associated state driver wont handle the power save * But kernel expects return status success even * in the disconnected state. - * TODO: If driver to remember the ps state to further use - * after connection. */ if (!csr_is_conn_state_connected_infra(mac_ctx, session_id)) status = QDF_STATUS_SUCCESS;