|
@@ -1701,19 +1701,20 @@ static int wlan_hdd_set_powersave(hdd_adapter_t *adapter,
|
|
|
|
|
|
static void wlan_hdd_print_suspend_fail_stats(hdd_context_t *hdd_ctx)
|
|
static void wlan_hdd_print_suspend_fail_stats(hdd_context_t *hdd_ctx)
|
|
{
|
|
{
|
|
|
|
+ struct suspend_resume_stats *stats = &hdd_ctx->suspend_resume_stats;
|
|
hdd_err("ipa:%d, radar:%d, roam:%d, scan:%d, initial_wakeup:%d",
|
|
hdd_err("ipa:%d, radar:%d, roam:%d, scan:%d, initial_wakeup:%d",
|
|
- hdd_ctx->suspend_fail_stats[SUSPEND_FAIL_IPA],
|
|
|
|
- hdd_ctx->suspend_fail_stats[SUSPEND_FAIL_RADAR],
|
|
|
|
- hdd_ctx->suspend_fail_stats[SUSPEND_FAIL_ROAM],
|
|
|
|
- hdd_ctx->suspend_fail_stats[SUSPEND_FAIL_SCAN],
|
|
|
|
- hdd_ctx->suspend_fail_stats[SUSPEND_FAIL_INITIAL_WAKEUP]);
|
|
|
|
|
|
+ stats->suspend_fail[SUSPEND_FAIL_IPA],
|
|
|
|
+ stats->suspend_fail[SUSPEND_FAIL_RADAR],
|
|
|
|
+ stats->suspend_fail[SUSPEND_FAIL_ROAM],
|
|
|
|
+ stats->suspend_fail[SUSPEND_FAIL_SCAN],
|
|
|
|
+ stats->suspend_fail[SUSPEND_FAIL_INITIAL_WAKEUP]);
|
|
}
|
|
}
|
|
|
|
|
|
void wlan_hdd_inc_suspend_stats(hdd_context_t *hdd_ctx,
|
|
void wlan_hdd_inc_suspend_stats(hdd_context_t *hdd_ctx,
|
|
enum suspend_fail_reason reason)
|
|
enum suspend_fail_reason reason)
|
|
{
|
|
{
|
|
wlan_hdd_print_suspend_fail_stats(hdd_ctx);
|
|
wlan_hdd_print_suspend_fail_stats(hdd_ctx);
|
|
- hdd_ctx->suspend_fail_stats[reason]++;
|
|
|
|
|
|
+ hdd_ctx->suspend_resume_stats.suspend_fail[reason]++;
|
|
wlan_hdd_print_suspend_fail_stats(hdd_ctx);
|
|
wlan_hdd_print_suspend_fail_stats(hdd_ctx);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1732,30 +1733,38 @@ static int __wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy)
|
|
hdd_adapter_t *pAdapter;
|
|
hdd_adapter_t *pAdapter;
|
|
hdd_adapter_list_node_t *pAdapterNode, *pNext;
|
|
hdd_adapter_list_node_t *pAdapterNode, *pNext;
|
|
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
|
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
|
- int result;
|
|
|
|
|
|
+ int exit_code;
|
|
p_cds_sched_context cds_sched_context = get_cds_sched_ctxt();
|
|
p_cds_sched_context cds_sched_context = get_cds_sched_ctxt();
|
|
|
|
|
|
ENTER();
|
|
ENTER();
|
|
|
|
|
|
- if (cds_is_driver_recovering())
|
|
|
|
- return 0;
|
|
|
|
|
|
+ if (cds_is_driver_recovering()) {
|
|
|
|
+ hdd_info("Driver is recovering; Skipping resume");
|
|
|
|
+ exit_code = 0;
|
|
|
|
+ goto exit_with_code;
|
|
|
|
+ }
|
|
|
|
|
|
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
|
|
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
|
|
hdd_err("Command not allowed in FTM mode");
|
|
hdd_err("Command not allowed in FTM mode");
|
|
- return -EINVAL;
|
|
|
|
|
|
+ exit_code = -EINVAL;
|
|
|
|
+ goto exit_with_code;
|
|
}
|
|
}
|
|
|
|
|
|
- result = wlan_hdd_validate_context(pHddCtx);
|
|
|
|
- if (0 != result)
|
|
|
|
- return result;
|
|
|
|
|
|
+ exit_code = wlan_hdd_validate_context(pHddCtx);
|
|
|
|
+ if (exit_code) {
|
|
|
|
+ hdd_err("Invalid HDD context");
|
|
|
|
+ goto exit_with_code;
|
|
|
|
+ }
|
|
|
|
|
|
mutex_lock(&pHddCtx->iface_change_lock);
|
|
mutex_lock(&pHddCtx->iface_change_lock);
|
|
if (pHddCtx->driver_status != DRIVER_MODULES_ENABLED) {
|
|
if (pHddCtx->driver_status != DRIVER_MODULES_ENABLED) {
|
|
mutex_unlock(&pHddCtx->iface_change_lock);
|
|
mutex_unlock(&pHddCtx->iface_change_lock);
|
|
- hdd_info("Driver Module not enabled return success");
|
|
|
|
- return 0;
|
|
|
|
|
|
+ hdd_info("Driver is not enabled; Skipping resume");
|
|
|
|
+ exit_code = 0;
|
|
|
|
+ goto exit_with_code;
|
|
}
|
|
}
|
|
mutex_unlock(&pHddCtx->iface_change_lock);
|
|
mutex_unlock(&pHddCtx->iface_change_lock);
|
|
|
|
+
|
|
pld_request_bus_bandwidth(pHddCtx->parent_dev, PLD_BUS_WIDTH_MEDIUM);
|
|
pld_request_bus_bandwidth(pHddCtx->parent_dev, PLD_BUS_WIDTH_MEDIUM);
|
|
|
|
|
|
/* Resume control path scheduler */
|
|
/* Resume control path scheduler */
|
|
@@ -1780,14 +1789,13 @@ static int __wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy)
|
|
if (true != pHddCtx->isSchedScanUpdatePending) {
|
|
if (true != pHddCtx->isSchedScanUpdatePending) {
|
|
qdf_spin_unlock(&pHddCtx->sched_scan_lock);
|
|
qdf_spin_unlock(&pHddCtx->sched_scan_lock);
|
|
hdd_info("Return resume is not due to PNO indication");
|
|
hdd_info("Return resume is not due to PNO indication");
|
|
- return 0;
|
|
|
|
|
|
+ goto exit_with_success;
|
|
}
|
|
}
|
|
/* Reset flag to avoid updatating cfg80211 data old results again */
|
|
/* Reset flag to avoid updatating cfg80211 data old results again */
|
|
pHddCtx->isSchedScanUpdatePending = false;
|
|
pHddCtx->isSchedScanUpdatePending = false;
|
|
qdf_spin_unlock(&pHddCtx->sched_scan_lock);
|
|
qdf_spin_unlock(&pHddCtx->sched_scan_lock);
|
|
|
|
|
|
status = hdd_get_front_adapter(pHddCtx, &pAdapterNode);
|
|
status = hdd_get_front_adapter(pHddCtx, &pAdapterNode);
|
|
-
|
|
|
|
while (NULL != pAdapterNode && QDF_STATUS_SUCCESS == status) {
|
|
while (NULL != pAdapterNode && QDF_STATUS_SUCCESS == status) {
|
|
pAdapter = pAdapterNode->pAdapter;
|
|
pAdapter = pAdapterNode->pAdapter;
|
|
if ((NULL != pAdapter) &&
|
|
if ((NULL != pAdapter) &&
|
|
@@ -1810,15 +1818,19 @@ static int __wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy)
|
|
}
|
|
}
|
|
|
|
|
|
hdd_info("cfg80211 scan result database updated");
|
|
hdd_info("cfg80211 scan result database updated");
|
|
- EXIT();
|
|
|
|
- return result;
|
|
|
|
|
|
+ goto exit_with_success;
|
|
}
|
|
}
|
|
status = hdd_get_next_adapter(pHddCtx, pAdapterNode, &pNext);
|
|
status = hdd_get_next_adapter(pHddCtx, pAdapterNode, &pNext);
|
|
pAdapterNode = pNext;
|
|
pAdapterNode = pNext;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+exit_with_success:
|
|
|
|
+ pHddCtx->suspend_resume_stats.resumes++;
|
|
|
|
+ exit_code = 0;
|
|
|
|
+
|
|
|
|
+exit_with_code:
|
|
EXIT();
|
|
EXIT();
|
|
- return result;
|
|
|
|
|
|
+ return exit_code;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|