qcacld-3.0: Add support for recovery in FTM mode

While the driver is in FTM state, if a PDR is encountered
the driver is not allowed to recover.

Allow the recovery of the driver after PDR in FTM mode.

Change-Id: Ib4ee3970067a9fde5ba12d4dd954774a16ef0255
CRs-Fixed: 2181509
This commit is contained in:
Sourav Mohapatra
2018-02-05 10:03:10 +05:30
committed by nshrivas
parent b9b6d6422d
commit 92ea8d67eb
4 changed files with 29 additions and 32 deletions

View File

@@ -1889,6 +1889,20 @@ enum QDF_GLOBAL_MODE hdd_get_conparam(void);
void crda_regulatory_entry_default(uint8_t *countryCode, int domain_id); void crda_regulatory_entry_default(uint8_t *countryCode, int domain_id);
void wlan_hdd_reset_prob_rspies(struct hdd_adapter *adapter); void wlan_hdd_reset_prob_rspies(struct hdd_adapter *adapter);
void hdd_prevent_suspend(uint32_t reason); void hdd_prevent_suspend(uint32_t reason);
/*
* hdd_get_first_valid_adapter() - Get the first valid adapter from adapter list
*
* This function is used to fetch the first valid adapter from the adapter
* list. If there is no valid adapter then it returns NULL
*
* @hdd_ctx: HDD context handler
*
* Return: NULL if no valid adapter found in the adapter list
*
*/
struct hdd_adapter *hdd_get_first_valid_adapter(struct hdd_context *hdd_ctx);
void hdd_allow_suspend(uint32_t reason); void hdd_allow_suspend(uint32_t reason);
void hdd_prevent_suspend_timeout(uint32_t timeout, uint32_t reason); void hdd_prevent_suspend_timeout(uint32_t timeout, uint32_t reason);

View File

@@ -531,12 +531,6 @@ static void wlan_hdd_shutdown(void)
{ {
void *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); void *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
if (hdd_get_conparam() == QDF_GLOBAL_FTM_MODE) {
hdd_err("Crash recovery is not allowed in FTM mode");
QDF_BUG(0);
return;
}
if (!hif_ctx) { if (!hif_ctx) {
hdd_err("Failed to get HIF context, ignore SSR shutdown"); hdd_err("Failed to get HIF context, ignore SSR shutdown");
return; return;

View File

@@ -6670,6 +6670,18 @@ QDF_STATUS hdd_post_cds_enable_config(struct hdd_context *hdd_ctx)
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
struct hdd_adapter *hdd_get_first_valid_adapter(struct hdd_context *hdd_ctx)
{
struct hdd_adapter *adapter;
hdd_for_each_adapter(hdd_ctx, adapter) {
if (adapter && adapter->magic == WLAN_HDD_ADAPTER_MAGIC)
return adapter;
}
return NULL;
}
/* wake lock APIs for HDD */ /* wake lock APIs for HDD */
void hdd_prevent_suspend(uint32_t reason) void hdd_prevent_suspend(uint32_t reason)
{ {

View File

@@ -1365,23 +1365,9 @@ QDF_STATUS hdd_wlan_re_init(void)
} }
bug_on_reinit_failure = hdd_ctx->config->bug_on_reinit_failure; bug_on_reinit_failure = hdd_ctx->config->bug_on_reinit_failure;
/* The driver should always be initialized in STA mode after SSR */ adapter = hdd_get_first_valid_adapter(hdd_ctx);
hdd_set_conparam(0); if (!adapter)
/* Try to get an adapter from mode ID */ hdd_err("Failed to get adapter");
adapter = hdd_get_adapter(hdd_ctx, QDF_STA_MODE);
if (!adapter) {
adapter = hdd_get_adapter(hdd_ctx, QDF_SAP_MODE);
if (!adapter) {
adapter = hdd_get_adapter(hdd_ctx, QDF_IBSS_MODE);
if (!adapter) {
adapter = hdd_get_adapter(hdd_ctx,
QDF_MONITOR_MODE);
if (!adapter)
hdd_err("Failed to get Adapter!");
}
}
}
if (hdd_ctx->config->enable_dp_trace) if (hdd_ctx->config->enable_dp_trace)
hdd_dp_trace_init(hdd_ctx->config); hdd_dp_trace_init(hdd_ctx->config);
@@ -1418,21 +1404,12 @@ QDF_STATUS hdd_wlan_re_init(void)
sme_set_chip_pwr_save_fail_cb(hdd_ctx->hHal, sme_set_chip_pwr_save_fail_cb(hdd_ctx->hHal,
hdd_chip_pwr_save_fail_detected_cb); hdd_chip_pwr_save_fail_detected_cb);
ret = hdd_register_cb(hdd_ctx);
if (ret) {
hdd_err("Failed to register HDD callbacks!");
goto err_cds_disable;
}
hdd_lpass_notify_start(hdd_ctx); hdd_lpass_notify_start(hdd_ctx);
hdd_send_default_scan_ies(hdd_ctx); hdd_send_default_scan_ies(hdd_ctx);
hdd_info("WLAN host driver reinitiation completed!"); hdd_info("WLAN host driver reinitiation completed!");
goto success; goto success;
err_cds_disable:
hdd_wlan_stop_modules(hdd_ctx, false);
err_re_init: err_re_init:
/* Allow the phone to go to sleep */ /* Allow the phone to go to sleep */
hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT); hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT);