|
@@ -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)
|