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
This commit is contained in:
Pragaspathi Thilagaraj 2018-10-11 12:54:40 +05:30 committed by nshrivas
parent 295da60909
commit 765a2ee796

View File

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