From 7a4d17a2de88c6d511d6cb66d9f067f968a47f68 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Thu, 12 Sep 2019 09:07:36 +0530 Subject: [PATCH] qcacld-3.0: Fix Vdev start failure handling in SAP and STA Vdev start failure handling in SAP and STA and not handled properly and thus VDEV SM doesn't move to INIT state and lead to asserts. Change-Id: I5ea09f9c6e84a2e1c7f9254319aaa1a11e2f97e8 CRs-Fixed: 2526179 --- core/wma/inc/wma_internal.h | 10 ++++++++++ core/wma/src/wma_dev_if.c | 13 ++----------- core/wma/src/wma_scan_roam.c | 3 ++- core/wma/src/wma_utils.c | 20 +++++++++----------- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/core/wma/inc/wma_internal.h b/core/wma/inc/wma_internal.h index b7404bd074..d51a2ff3ca 100644 --- a/core/wma/inc/wma_internal.h +++ b/core/wma/inc/wma_internal.h @@ -1574,6 +1574,16 @@ void wma_send_vdev_down(tp_wma_handle wma, struct del_bss_resp *req); int wma_cold_boot_cal_event_handler(void *wma_ctx, uint8_t *event_buff, uint32_t len); +/** + * wma_handle_channel_switch_resp() - handle channel switch resp + * @wma: wma handle + * @rsp: response for channel switch + * + * Return: QDF_STATUS + */ +QDF_STATUS wma_handle_channel_switch_resp(tp_wma_handle wma, + struct vdev_start_response *rsp); + /** * wma_set_roam_triggers() - Send roam trigger bitmap to WMI * @wma_handle: wma handle diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index ca59f98aac..14c9e5c04b 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -1025,17 +1025,8 @@ static void wma_handle_hidden_ssid_restart(tp_wma_handle wma, 0, NULL); } -/** - * wma_handle_channel_switch_resp() - handle channel switch resp - * @wma: wma handle - * @resp_event: response from firmware - * @req: target req - * - * Return: QDF_STATUS - */ -static QDF_STATUS -wma_handle_channel_switch_resp(tp_wma_handle wma, - struct vdev_start_response *rsp) +QDF_STATUS wma_handle_channel_switch_resp(tp_wma_handle wma, + struct vdev_start_response *rsp) { enum wlan_vdev_sm_evt event; struct wma_txrx_node *iface; diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 5e89364126..8e58748c66 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -3639,7 +3639,8 @@ send_resp: __func__, status); rsp.status = status; rsp.vdev_id = vdev_id; - lim_process_switch_channel_rsp(wma->mac_context, &rsp); + + wma_handle_channel_switch_resp(wma, &rsp); } #ifdef FEATURE_WLAN_ESE diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index 8b2cdaa7a5..ccb37b207b 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -4127,12 +4127,15 @@ wma_mlme_vdev_notify_down_complete(struct vdev_mlme_obj *vdev_mlme, uint32_t vdev_stop_type; struct del_bss_resp *resp = (struct del_bss_resp *)data; - if (mlme_is_connection_fail(vdev_mlme->vdev)) { + if (mlme_is_connection_fail(vdev_mlme->vdev) || + mlme_get_vdev_start_failed(vdev_mlme->vdev)) { WMA_LOGD("%s Vdev start req failed, no action required", __func__); mlme_set_connection_fail(vdev_mlme->vdev, false); + mlme_set_vdev_start_failed(vdev_mlme->vdev, false); return QDF_STATUS_SUCCESS; } + wma = cds_get_context(QDF_MODULE_ID_WMA); if (!wma) { WMA_LOGE("%s wma handle is NULL", __func__); @@ -4155,17 +4158,12 @@ wma_mlme_vdev_notify_down_complete(struct vdev_mlme_obj *vdev_mlme, return QDF_STATUS_SUCCESS; } - if (!mlme_get_vdev_start_failed(vdev_mlme->vdev)) { - if (vdev_stop_type == WMA_SET_LINK_STATE) { - lim_join_result_callback( - wma->mac_context, - wlan_vdev_get_id(vdev_mlme->vdev)); - } else { - wma_send_del_bss_response(wma, resp); - return QDF_STATUS_SUCCESS; - } + if (vdev_stop_type == WMA_SET_LINK_STATE) { + lim_join_result_callback(wma->mac_context, + wlan_vdev_get_id(vdev_mlme->vdev)); } else { - mlme_set_vdev_start_failed(vdev_mlme->vdev, false); + wma_send_del_bss_response(wma, resp); + return QDF_STATUS_SUCCESS; } end: