diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 6429f547bdc7..8c0d2825a26c 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -1342,6 +1342,14 @@ int wma_csa_offload_handler(void *handle, uint8_t *event, uint32_t len) return -EINVAL; } + if (wma->interfaces[vdev_id].roaming_in_progress || + wma->interfaces[vdev_id].roam_synch_in_progress) { + WMA_LOGE("Roaming in progress for vdev %d, ignore csa_offload_event", + vdev_id); + qdf_mem_free(csa_offload_event); + return -EINVAL; + } + qdf_mem_zero(csa_offload_event, sizeof(*csa_offload_event)); qdf_mem_copy(csa_offload_event->bssId, &bssid, IEEE80211_ADDR_LEN); diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index f4f8dcaf69c8..9a137f4e8f51 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -2246,6 +2246,14 @@ int wma_roam_synch_event_handler(void *handle, uint8_t *event, return status; } + /* + * This flag is set during ROAM_START and once this event is being + * executed which is a run to completion, no other event can interrupt + * this in MC thread context. So, it is OK to reset the flag here as + * soon as we receive this event. + */ + wma->interfaces[synch_event->vdev_id].roaming_in_progress = false; + if (synch_event->bcn_probe_rsp_len > param_buf->num_bcn_probe_rsp_frame || synch_event->reassoc_req_len > @@ -5510,6 +5518,8 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf, WMA_LOGE("LFR3:Hand-Off Failed for vdevid %x", wmi_event->vdev_id); wma_roam_ho_fail_handler(wma_handle, wmi_event->vdev_id); + wma_handle->interfaces[wmi_event->vdev_id]. + roaming_in_progress = false; break; #endif case WMI_ROAM_REASON_INVALID: @@ -5518,10 +5528,16 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf, WMA_LOGE("Memory unavailable for roam synch data"); return -ENOMEM; } - if (wmi_event->notif == WMI_ROAM_NOTIF_ROAM_START) + if (wmi_event->notif == WMI_ROAM_NOTIF_ROAM_START) { op_code = SIR_ROAMING_START; - if (wmi_event->notif == WMI_ROAM_NOTIF_ROAM_ABORT) + wma_handle->interfaces[wmi_event->vdev_id]. + roaming_in_progress = true; + } + if (wmi_event->notif == WMI_ROAM_NOTIF_ROAM_ABORT) { op_code = SIR_ROAMING_ABORT; + wma_handle->interfaces[wmi_event->vdev_id]. + roaming_in_progress = false; + } roam_synch_data->roamedVdevId = wmi_event->vdev_id; wma_handle->pe_roam_synch_cb( (tpAniSirGlobal)wma_handle->mac_context, diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index a91146a130dd..48d7f51ff94f 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -4502,6 +4502,7 @@ QDF_STATUS wma_send_vdev_down_to_fw(t_wma_handle *wma, uint8_t vdev_id) QDF_STATUS status; struct wma_txrx_node *vdev = &wma->interfaces[vdev_id]; + wma->interfaces[vdev_id].roaming_in_progress = false; status = wmi_unified_vdev_down_send(wma->wmi_handle, vdev_id); wma_release_wakelock(&vdev->vdev_start_wakelock);