qcacld-3.0: Fix return status in wlan_hdd_set_powersave

Return correct status in wlan_hdd_set_powersave.

Change-Id: I20226e903cd4f3f3e4197b7a3bc30775e3c30890
CRs-Fixed: 2305859
This commit is contained in:
Bala Venkatesh 2018-08-29 15:43:43 +05:30 • committed by Nitesh Shrivastav
commit a0cd1f14e2
2 changed files with 33 additions and 14 deletions

View file

@ -1393,6 +1393,7 @@ int wlan_hdd_set_powersave(struct hdd_adapter *adapter,
{
mac_handle_t mac_handle;
struct hdd_context *hdd_ctx;
QDF_STATUS status = QDF_STATUS_SUCCESS;
if (NULL == adapter) {
hdd_err("Adapter NULL");
@ -1424,8 +1425,10 @@ int wlan_hdd_set_powersave(struct hdd_adapter *adapter,
if (QDF_STA_MODE == adapter->device_mode ||
QDF_P2P_CLIENT_MODE == adapter->device_mode) {
hdd_debug("Disabling Auto Power save timer");
sme_ps_disable_auto_ps_timer(mac_handle,
adapter->session_id);
status = sme_ps_disable_auto_ps_timer(mac_handle,
adapter->session_id);
if (status != QDF_STATUS_SUCCESS)
goto end;
}
if (hdd_ctx->config && hdd_ctx->config->is_ps_enabled) {
@ -1435,14 +1438,19 @@ int wlan_hdd_set_powersave(struct hdd_adapter *adapter,
* Enter Power Save command received from GUI
* this means DHCP is completed
*/
if (timeout)
sme_ps_enable_auto_ps_timer(mac_handle,
if (timeout) {
status = sme_ps_enable_auto_ps_timer(mac_handle,
adapter->session_id,
timeout);
else
sme_ps_enable_disable(mac_handle,
adapter->session_id,
SME_PS_ENABLE);
if (status != QDF_STATUS_SUCCESS)
goto end;
} else {
status = sme_ps_enable_disable(mac_handle,
adapter->session_id,
SME_PS_ENABLE);
if (status != QDF_STATUS_SUCCESS)
goto end;
}
} else {
hdd_debug("Power Save is not enabled in the cfg");
}
@ -1453,13 +1461,16 @@ int wlan_hdd_set_powersave(struct hdd_adapter *adapter,
* Enter Full power command received from GUI
* this means we are disconnected
*/
sme_ps_disable_auto_ps_timer(mac_handle,
adapter->session_id);
sme_ps_enable_disable(mac_handle, adapter->session_id,
SME_PS_DISABLE);
status = sme_ps_disable_auto_ps_timer(mac_handle,
adapter->session_id);
if (status != QDF_STATUS_SUCCESS)
goto end;
status = sme_ps_enable_disable(mac_handle, adapter->session_id,
SME_PS_DISABLE);
}
return 0;
end:
return qdf_status_to_os_return(status);
}
static void wlan_hdd_print_suspend_fail_stats(struct hdd_context *hdd_ctx)

View file

@ -381,8 +381,16 @@ QDF_STATUS sme_ps_enable_disable(tHalHandle hal_ctx, uint32_t session_id,
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_ctx);
status = sme_enable_sta_ps_check(mac_ctx, session_id);
if (status != QDF_STATUS_SUCCESS)
if (status != QDF_STATUS_SUCCESS) {
/*
* In non associated state ps state will be disabled in FW.
* Hence, return success if ps disable is requested
* in disconnected state.
*/
if (command == SME_PS_DISABLE)
status = QDF_STATUS_SUCCESS;
return status;
}
status = sme_ps_process_command(mac_ctx, session_id, command);
return status;
}