diff options
| -rw-r--r-- | core/hdd/inc/wlan_hdd_driver_ops.h | 11 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_ioctl.c | 45 |
2 files changed, 28 insertions, 28 deletions
diff --git a/core/hdd/inc/wlan_hdd_driver_ops.h b/core/hdd/inc/wlan_hdd_driver_ops.h index 0b0820fbfa9e..503d7e236998 100644 --- a/core/hdd/inc/wlan_hdd_driver_ops.h +++ b/core/hdd/inc/wlan_hdd_driver_ops.h @@ -60,13 +60,12 @@ void wlan_hdd_unregister_driver(void); /** * wlan_hdd_bus_suspend() - suspend the wlan bus + * @state: power management state * * This function is called by the platform driver to suspend the * wlan bus * - * @state: state - * - * Return: QDF_STATUS + * Return: 0 on success, negative errno on error */ int wlan_hdd_bus_suspend(pm_message_t state); @@ -83,17 +82,17 @@ int wlan_hdd_bus_suspend(pm_message_t state); int wlan_hdd_bus_suspend_noirq(void); /** - * wlan_hdd_bus_resume(): wake up the bus + * wlan_hdd_bus_resume() - wake up the bus * * This function is called by the platform driver to resume wlan * bus * - * Return: void + * Return: 0 for success and negative errno if failure */ int wlan_hdd_bus_resume(void); /** - * wlan_hdd_bus_resume_noirq(): handle bus resume no irq + * wlan_hdd_bus_resume_noirq() - handle bus resume no irq * * This function is called by the platform driver to do bus * resume no IRQ before calling resume callback. Call WMA and HIF diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 2f6a9efb89da..d49733e8350d 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -1935,7 +1935,7 @@ static int hdd_enable_ext_wow(hdd_adapter_t *adapter, tpSirExtWoWParams arg_params) { tSirExtWoWParams params; - QDF_STATUS qdf_ret_status = QDF_STATUS_E_FAILURE; + QDF_STATUS qdf_ret_status; hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(adapter); int rc; @@ -1960,30 +1960,31 @@ static int hdd_enable_ext_wow(hdd_adapter_t *adapter, return -EPERM; } - if (hdd_ctx->ext_wow_should_suspend) { - if (hdd_ctx->config->extWowGotoSuspend) { - pm_message_t state; + if (!hdd_ctx->ext_wow_should_suspend) { + hdd_err("Received ready to ExtWoW failure"); + return -EPERM; + } - state.event = PM_EVENT_SUSPEND; - hdd_debug("Received ready to ExtWoW. Going to suspend"); + if (hdd_ctx->config->extWowGotoSuspend) { + pm_message_t state; - rc = wlan_hdd_cfg80211_suspend_wlan(hdd_ctx->wiphy, NULL); - if (rc < 0) { - hdd_err("wlan_hdd_cfg80211_suspend_wlan failed, error = %d", - rc); - return rc; - } - qdf_ret_status = wlan_hdd_bus_suspend(state); - if (qdf_ret_status != QDF_STATUS_SUCCESS) { - hdd_err("wlan_hdd_suspend failed, status = %d", - qdf_ret_status); - wlan_hdd_cfg80211_resume_wlan(hdd_ctx->wiphy); - return -EPERM; - } + state.event = PM_EVENT_SUSPEND; + hdd_debug("Received ready to ExtWoW. Going to suspend"); + + rc = wlan_hdd_cfg80211_suspend_wlan(hdd_ctx->wiphy, NULL); + if (rc < 0) { + hdd_err("wlan_hdd_cfg80211_suspend_wlan failed, error = %d", + rc); + return rc; + } + + rc = wlan_hdd_bus_suspend(state); + if (rc) { + hdd_err("wlan_hdd_bus_suspend failed, status = %d", + rc); + wlan_hdd_cfg80211_resume_wlan(hdd_ctx->wiphy); + return rc; } - } else { - hdd_err("Received ready to ExtWoW failure"); - return -EPERM; } return 0; |
