From d8194cda042b30b125b68bd2cbadcc7706aeb056 Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Fri, 18 Dec 2020 13:28:39 +0530 Subject: [PATCH] qcacld-3.0: Fix compatibility issue The sequence of roam states info print depends on the sequence of Tlvs coming via WMI_ROAM_STATS_EVENTID event. FW does not send roam trigger, roam scan and btm rsp info to HOST in case of new host and old FW combo. This results in 11v info print miss in kmsg log. Fix is to print tlvs info in a proper sequence. Change-Id: Ic51ceebcbf3846231c2181b0a4a92d59faaaaaff CRs-Fixed: 2841325 --- core/wma/src/wma_scan_roam.c | 78 ++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index a5ffaa5000a3..1f36095bf20d 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -3617,7 +3617,7 @@ wma_get_trigger_detail_str(struct wmi_roam_trigger_info *roam_info, char *buf) return; case WMI_ROAM_TRIGGER_REASON_WTC_BTM: buf_cons = - qdf_snprint(temp, buf_left, "Raoming Mode: %d, Trigger Reason: %d, Sub code:%d, wtc mode:%d, wtc scan mode:%d, wtc rssi th:%d, wtc candi rssi th:%d", + qdf_snprint(temp, buf_left, "Roaming Mode: %d, Trigger Reason: %d, Sub code:%d, wtc mode:%d, wtc scan mode:%d, wtc rssi th:%d, wtc candi rssi th:%d", roam_info->wtc_btm_trig_data.roaming_mode, roam_info->wtc_btm_trig_data.vsie_trigger_reason, roam_info->wtc_btm_trig_data.sub_code, @@ -4055,6 +4055,10 @@ int wma_roam_stats_event_handler(WMA_HANDLE handle, uint8_t *event, return -EINVAL; } + if (roam_info->trigger.present) + wma_rso_print_trigger_info(&roam_info->trigger, + vdev_id); + /* Roam scan related details - Scan channel, scan type .. */ status = wmi_unified_extract_roam_scan_stats( wma->wmi_handle, event, @@ -4069,6 +4073,11 @@ int wma_roam_stats_event_handler(WMA_HANDLE handle, uint8_t *event, num_chan += roam_info->scan.num_chan; num_ap += roam_info->scan.num_ap; + if (roam_info->scan.present && roam_info->trigger.present) + wma_rso_print_scan_info(&roam_info->scan, vdev_id, + roam_info->trigger.trigger_reason, + roam_info->trigger.timestamp); + /* Roam result - Success/Failure status, failure reason */ status = wmi_unified_extract_roam_result_stats( wma->wmi_handle, event, @@ -4079,6 +4088,8 @@ int wma_roam_stats_event_handler(WMA_HANDLE handle, uint8_t *event, qdf_mem_free(roam_info); return -EINVAL; } + if (roam_info->result.present) + wma_rso_print_roam_result(&roam_info->result, vdev_id); /* BTM resp info */ status = wlan_cm_roam_extract_btm_response(wma->wmi_handle, @@ -4091,6 +4102,9 @@ int wma_roam_stats_event_handler(WMA_HANDLE handle, uint8_t *event, qdf_mem_free(roam_info); return -EINVAL; } + if (roam_info->btm_rsp.present) + wma_rso_print_btm_rsp_info(&roam_info->btm_rsp, + vdev_id); /* Initial Roam info */ status = wlan_cm_roam_extract_roam_initial_info( @@ -4102,6 +4116,9 @@ int wma_roam_stats_event_handler(WMA_HANDLE handle, uint8_t *event, qdf_mem_free(roam_info); return -EINVAL; } + if (roam_info->roam_init_info.present) + wma_rso_print_roam_initial_info( + &roam_info->roam_init_info, vdev_id); /* Roam message info */ status = wlan_cm_roam_extract_roam_msg_info( @@ -4113,6 +4130,10 @@ int wma_roam_stats_event_handler(WMA_HANDLE handle, uint8_t *event, qdf_mem_free(roam_info); return -EINVAL; } + if (roam_info->roam_msg_info.present) { + rem_tlv++; + wma_rso_print_roam_msg_info( + &roam_info->roam_msg_info, vdev_id); /* BTM req/resp or Neighbor report/response info */ status = wmi_unified_extract_roam_11kv_stats( @@ -4125,35 +4146,8 @@ int wma_roam_stats_event_handler(WMA_HANDLE handle, uint8_t *event, return -EINVAL; } num_rpt += roam_info->data_11kv.num_freq; - - /* Driver debug logs */ - if (roam_info->trigger.present) - wma_rso_print_trigger_info(&roam_info->trigger, - vdev_id); - - if (roam_info->scan.present && roam_info->trigger.present) - wma_rso_print_scan_info(&roam_info->scan, vdev_id, - roam_info->trigger.trigger_reason, - roam_info->trigger.timestamp); - - if (roam_info->result.present) - wma_rso_print_roam_result(&roam_info->result, vdev_id); - if (roam_info->data_11kv.present) wma_rso_print_11kv_info(&roam_info->data_11kv, vdev_id); - - if (roam_info->btm_rsp.present) - wma_rso_print_btm_rsp_info(&roam_info->btm_rsp, - vdev_id); - - if (roam_info->roam_init_info.present) - wma_rso_print_roam_initial_info( - &roam_info->roam_init_info, vdev_id); - - if (roam_info->roam_msg_info.present) { - rem_tlv++; - wma_rso_print_roam_msg_info( - &roam_info->roam_msg_info, vdev_id); } qdf_mem_free(roam_info); @@ -4172,6 +4166,10 @@ int wma_roam_stats_event_handler(WMA_HANDLE handle, uint8_t *event, qdf_mem_free(roam_info); goto err; } + + if (roam_info->data_11kv.present) + wma_rso_print_11kv_info(&roam_info->data_11kv, vdev_id); + status = wmi_unified_extract_roam_trigger_stats( wma->wmi_handle, event, &roam_info->trigger, 0); @@ -4181,6 +4179,11 @@ int wma_roam_stats_event_handler(WMA_HANDLE handle, uint8_t *event, qdf_mem_free(roam_info); return -EINVAL; } + + if (roam_info->trigger.present) + wma_rso_print_trigger_info(&roam_info->trigger, + vdev_id); + status = wmi_unified_extract_roam_scan_stats(wma->wmi_handle, event, &roam_info->scan, @@ -4191,6 +4194,12 @@ int wma_roam_stats_event_handler(WMA_HANDLE handle, uint8_t *event, qdf_mem_free(roam_info); return -EINVAL; } + + if (roam_info->scan.present && roam_info->trigger.present) + wma_rso_print_scan_info(&roam_info->scan, vdev_id, + roam_info->trigger.trigger_reason, + roam_info->trigger.timestamp); + status = wlan_cm_roam_extract_btm_response(wma->wmi_handle, event, &roam_info->btm_rsp, @@ -4201,17 +4210,10 @@ int wma_roam_stats_event_handler(WMA_HANDLE handle, uint8_t *event, qdf_mem_free(roam_info); return -EINVAL; } - if (roam_info->data_11kv.present) - wma_rso_print_11kv_info(&roam_info->data_11kv, vdev_id); - if (roam_info->trigger.present) - wma_rso_print_trigger_info(&roam_info->trigger, + + if (roam_info->btm_rsp.present) + wma_rso_print_btm_rsp_info(&roam_info->btm_rsp, vdev_id); - if (roam_info->scan.present && roam_info->trigger.present) - wma_rso_print_scan_info(&roam_info->scan, vdev_id, - roam_info->trigger.trigger_reason, - roam_info->trigger.timestamp); - if (roam_info->btm_rsp.present) - wma_rso_print_btm_rsp_info(&roam_info->btm_rsp, vdev_id); qdf_mem_free(roam_info); }