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
This commit is contained in:
Hanumanth Reddy Pothula
2016-09-30 15:06:57 +05:30
committad av qcabuildsw
förälder 5667e8d787
incheckning 9f4048fff7
2 ändrade filer med 35 tillägg och 1 borttagningar

Visa fil

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

Visa fil

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