From 0100fdd28aeb282c455d89fdb7b0f4ffeaf2f328 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Tue, 11 Jun 2019 10:54:43 +0530 Subject: [PATCH] qcacld-3.0: Get HW mode info from roam fail indication During roam fail, if firmware doesn't have any interface left on 2.4Ghz it moves to SMM from DBS, But doesn't inform to Host, which assume DUT is in DBS mode and thus can send VDEV start on 2.4Ghz without switching to DBS mode. This lead to assert in firmware. To fix this firmware will indicate the new HW mode in ROAM INVOKE FAIL and HO FAIL during roam. so handle the new HW mode indication and update the host HW mode from the new HW mode indication. So that host and firmware remain in sync Change-Id: I854faea17c8eccf212b4efb9443b297cadca62b0 CRs-Fixed: 2473532 --- core/wma/src/wma_scan_roam.c | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 18d30d39c4f2..20068974819a 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -5175,6 +5175,45 @@ static void wma_handle_btm_disassoc_imminent_msg(tp_wma_handle wma_handle, (void *)del_sta_ctx, 0); } +/** + * wma_handle_hw_mode_in_roam_fail() - Fill hw mode info if present in policy + * manager. + * @wma: wma handle + * @param: roam event params + * + * Return: None + */ +static int wma_handle_hw_mode_transition(tp_wma_handle wma, + WMI_ROAM_EVENTID_param_tlvs *param) +{ + struct sir_hw_mode_trans_ind *hw_mode_trans_ind; + + hw_mode_trans_ind = qdf_mem_malloc(sizeof(*hw_mode_trans_ind)); + if (!hw_mode_trans_ind) + return -ENOMEM; + + if (param->hw_mode_transition_fixed_param) { + wma_process_pdev_hw_mode_trans_ind(wma, + param->hw_mode_transition_fixed_param, + param->wmi_pdev_set_hw_mode_response_vdev_mac_mapping, + hw_mode_trans_ind); + + WMA_LOGI(FL("Update HW mode")); + policy_mgr_hw_mode_transition_cb( + hw_mode_trans_ind->old_hw_mode_index, + hw_mode_trans_ind->new_hw_mode_index, + hw_mode_trans_ind->num_vdev_mac_entries, + hw_mode_trans_ind->vdev_mac_map, + wma->psoc); + } else { + WMA_LOGD(FL("hw_mode transition fixed param is NULL")); + } + + qdf_mem_free(hw_mode_trans_ind); + + return 0; +} + /** * wma_roam_event_callback() - roam event callback * @handle: wma handle @@ -5256,6 +5295,7 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf, case WMI_ROAM_REASON_HO_FAILED: WMA_LOGE("LFR3:Hand-Off Failed for vdevid %x", wmi_event->vdev_id); + wma_handle_hw_mode_transition(wma_handle, param_buf); wma_roam_ho_fail_handler(wma_handle, wmi_event->vdev_id); wma_handle->interfaces[wmi_event->vdev_id]. roaming_in_progress = false; @@ -5289,6 +5329,7 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf, wma_rso_cmd_status_event_handler(wmi_event); break; case WMI_ROAM_REASON_INVOKE_ROAM_FAIL: + wma_handle_hw_mode_transition(wma_handle, param_buf); roam_synch_data = qdf_mem_malloc(sizeof(*roam_synch_data)); if (!roam_synch_data) return -ENOMEM;