diff options
| author | Hanumanth Reddy Pothula <c_hpothu@codeaurora.org> | 2016-09-30 15:06:57 +0530 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2016-10-04 18:58:41 -0700 |
| commit | 9f4048fff7d0e1a9283d9d29fd0fe623bcd10a7a (patch) | |
| tree | d0ba157cb7ab5e7c518082b6caabeda15c2a71be | |
| parent | 5667e8d78720340870d8c17d0729bda510046261 (diff) | |
qcacld-3.0: During con mode change stop netif queues
If user triggers con_mode change, while data transmissions are
happening, there is possibility of device crash, as data queues
are not stopped during con_mode change.
In con_mode handler, stop data queues before stopping modules.
Change-Id: I348d0da707ea4b706edfcd396adee32502180e3e
CRs-Fixed: 1070008
| -rw-r--r-- | core/hdd/inc/wlan_hdd_main.h | 1 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 35 |
2 files changed, 35 insertions, 1 deletions
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 109cd03a0cb8..577f1f9d84e0 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1553,6 +1553,7 @@ QDF_STATUS hdd_close_adapter(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, bool rtnl_held); QDF_STATUS hdd_close_all_adapters(hdd_context_t *pHddCtx, bool rtnl_held); QDF_STATUS hdd_stop_all_adapters(hdd_context_t *pHddCtx); +void hdd_deinit_all_adapters(hdd_context_t *hdd_ctx, bool rtnl_held); QDF_STATUS hdd_reset_all_adapters(hdd_context_t *pHddCtx); QDF_STATUS hdd_start_all_adapters(hdd_context_t *pHddCtx); hdd_adapter_t *hdd_get_adapter_by_vdev(hdd_context_t *pHddCtx, diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 9aeee9107f74..356c86841843 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1827,6 +1827,10 @@ int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, hdd_alert("adapter is Null"); goto close; } + if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { + hdd_err("in ftm mode, no need to configure cds modules"); + break; + } if (hdd_configure_cds(hdd_ctx, adapter)) { hdd_err("Failed to Enable cds modules"); goto close; @@ -3615,6 +3619,32 @@ QDF_STATUS hdd_stop_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, return QDF_STATUS_SUCCESS; } +/** + * hdd_deinit_all_adapters - deinit all adapters + * @hdd_ctx: HDD context + * @rtnl_held: True if RTNL lock held + * + */ +void hdd_deinit_all_adapters(hdd_context_t *hdd_ctx, bool rtnl_held) +{ + hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL; + QDF_STATUS status; + hdd_adapter_t *adapter; + + ENTER(); + + status = hdd_get_front_adapter(hdd_ctx, &adapter_node); + + while (NULL != adapter_node && QDF_STATUS_SUCCESS == status) { + adapter = adapter_node->pAdapter; + hdd_deinit_adapter(hdd_ctx, adapter, rtnl_held); + status = hdd_get_next_adapter(hdd_ctx, adapter_node, &next); + adapter_node = next; + } + + EXIT(); +} + QDF_STATUS hdd_stop_all_adapters(hdd_context_t *hdd_ctx) { hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL; @@ -9057,7 +9087,7 @@ static enum tQDF_ADAPTER_MODE hdd_get_adpter_mode( case QDF_GLOBAL_MONITOR_MODE: return QDF_MONITOR_MODE; case QDF_GLOBAL_FTM_MODE: - return QDF_MONITOR_MODE; + return QDF_FTM_MODE; case QDF_GLOBAL_EPPING_MODE: return QDF_EPPING_MODE; case QDF_GLOBAL_QVIT_MODE: @@ -9118,6 +9148,9 @@ static int con_mode_handler(const char *kmessage, struct kernel_param *kp) return -EINVAL; } + hdd_stop_all_adapters(hdd_ctx); + hdd_deinit_all_adapters(hdd_ctx, false); + ret = hdd_wlan_stop_modules(hdd_ctx, false); if (ret) { hdd_err("Stop wlan modules failed"); |
