From 765a2ee796d5e035be9d3230d54099a42a70dcd8 Mon Sep 17 00:00:00 2001 From: Pragaspathi Thilagaraj Date: Thu, 11 Oct 2018 12:54:40 +0530 Subject: [PATCH] qcacld-3.0: Dont send vdev up if vdev restart failed during CSA When vdev restart response is received for channel switch during CSA, we set the phy mode in firmware and then send vdev up. But even if the restart request has failed host sends vdev up. This is wrong as firmware expects vdev up only after vdev start is successful. If vdev restart is rejected don't send vdev up to firmware. Instead send WMA_SWITCH_CHANNEL_RSP with failure status. Change-Id: I1f1ba860abeb0d25e90fd9b9977f02153aca81af CRs-Fixed: 2331485 --- core/wma/src/wma_dev_if.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index 2162ed7f1ac8..785be73e2520 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -1247,8 +1247,7 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info, if (!params) { WMA_LOGE("%s: channel switch params is NULL for vdev %d", __func__, resp_event->vdev_id); - policy_mgr_set_do_hw_mode_change_flag( - wma->psoc, false); + policy_mgr_set_do_hw_mode_change_flag(wma->psoc, false); return -EINVAL; } @@ -1267,11 +1266,12 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info, false; } #endif - if (((resp_event->resp_type == WMI_VDEV_RESTART_RESP_EVENT) && - ((iface->type == WMI_VDEV_TYPE_STA) || - (iface->type == WMI_VDEV_TYPE_MONITOR))) || - ((resp_event->resp_type == WMI_VDEV_START_RESP_EVENT) && - (iface->type == WMI_VDEV_TYPE_MONITOR))) { + if ((QDF_IS_STATUS_SUCCESS(resp_event->status) && + (resp_event->resp_type == WMI_VDEV_RESTART_RESP_EVENT) && + ((iface->type == WMI_VDEV_TYPE_STA) || + (iface->type == WMI_VDEV_TYPE_MONITOR))) || + ((resp_event->resp_type == WMI_VDEV_START_RESP_EVENT) && + (iface->type == WMI_VDEV_TYPE_MONITOR))) { /* for CSA case firmware expects phymode before ch_wd */ err = wma_set_peer_param(wma, iface->bssid, WMI_PEER_PHYMODE, iface->chanmode,