From 31973145c8ba365b61684cc96db990812f2bbac6 Mon Sep 17 00:00:00 2001 From: Manjunathappa Prakash Date: Wed, 28 Nov 2018 11:21:47 -0800 Subject: [PATCH] qcacld-3.0: Takecare to stop and down vdev in monitor mode In monitor mode there is no disconnect, so vdev stop and down is not handled. Make sure to stop and down the vdev before vdev delete. Change-Id: I25f5a0e01deda8f2e16e102113b10f32e89b3e38 CRs-Fixed: 2357047 --- core/wma/src/wma_dev_if.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index 75a04a18bd09..4e4724b561b1 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -724,6 +724,28 @@ wma_release_vdev_ref(tp_wma_handle wma_handle, uint8_t vdev_id) wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_WMA_ID); } +/** + * wma_handle_monitor_mode_vdev_detach() - Stop and down monitor mode vdev + * @wma_handle: wma handle + * @vdev_id: used to get wma interface txrx node + * + * Monitor mode is unconneted mode, so do explicit vdev stop and down + * + * Return: None + */ +static void wma_handle_monitor_mode_vdev_detach(tp_wma_handle wma, + uint8_t vdev_id) +{ + if (wma_send_vdev_stop_to_fw(wma, vdev_id)) { + WMA_LOGE("%s: %d Failed to send vdev stop", __func__, __LINE__); + wma_remove_vdev_req(wma, vdev_id, + WMA_TARGET_REQ_TYPE_VDEV_STOP); + } + + if (wma_send_vdev_down_to_fw(wma, vdev_id) != QDF_STATUS_SUCCESS) + WMA_LOGE("Failed to send vdev down cmd: vdev %d", vdev_id); +} + static QDF_STATUS wma_handle_vdev_detach(tp_wma_handle wma_handle, struct del_sta_self_params *del_sta_self_req_param, uint8_t generate_rsp) @@ -740,6 +762,9 @@ static QDF_STATUS wma_handle_vdev_detach(tp_wma_handle wma_handle, goto out; } + if (cds_get_conparam() == QDF_GLOBAL_MONITOR_MODE) + wma_handle_monitor_mode_vdev_detach(wma_handle, vdev_id); + status = wmi_unified_vdev_delete_send(wma_handle->wmi_handle, vdev_id); if (QDF_IS_STATUS_ERROR(status)) { WMA_LOGE("Unable to remove an interface"); @@ -2268,6 +2293,10 @@ __wma_vdev_stop_resp_handler(wmi_vdev_stopped_event_fixed_param *resp_event) return QDF_STATUS_E_INVAL; } + /* Ignore stop_response in Monitor mode */ + if (cds_get_conparam() == QDF_GLOBAL_MONITOR_MODE) + return QDF_STATUS_SUCCESS; + iface = &wma->interfaces[resp_event->vdev_id]; /* vdev in stopped state, no more waiting for key */