From 631f7d15a1fc18798b691797fcf436cbb25fe1ba Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Wed, 22 Jul 2020 17:07:40 +0530 Subject: [PATCH] qcacld-3.0: Print info related to WTC BTM roaming Print info related to WTC BTM roaming coming via wmi_roam_trigger_reason_tlv_param. Print timestamp, which indicates the time when btm response is sent to AP, coming via wmi_roam_btm_response_info_tlv_param to HOST. Change-Id: I2c408527739e1e2831015dd7b959ab17299abf6b CRs-Fixed: 2740597 --- .../inc/wlan_cm_roam_public_srtuct.h | 2 ++ components/wmi/inc/wmi_unified_roam_param.h | 2 ++ components/wmi/src/wmi_unified_roam_tlv.c | 4 ++++ core/wma/src/wma_scan_roam.c | 20 +++++++++++++++++-- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_srtuct.h b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_srtuct.h index da2e0e53e2..88130d2e74 100644 --- a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_srtuct.h +++ b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_srtuct.h @@ -282,12 +282,14 @@ enum roam_offload_state { * @btm_status: Btm request status * @target_bssid: AP MAC address * @vsie_reason: Vsie_reason value + * @timestamp: This timestamp indicates the time when btm rsp is sent */ struct roam_btm_response_data { bool present; uint32_t btm_status; struct qdf_mac_addr target_bssid; uint32_t vsie_reason; + uint32_t timestamp; }; /** diff --git a/components/wmi/inc/wmi_unified_roam_param.h b/components/wmi/inc/wmi_unified_roam_param.h index cf4a66026b..174bda5164 100644 --- a/components/wmi/inc/wmi_unified_roam_param.h +++ b/components/wmi/inc/wmi_unified_roam_param.h @@ -409,6 +409,7 @@ struct scoring_param { * ROAM_TRIGGER_REASON_IDLE: Roam triggered due to inactivity of the device. * ROAM_TRIGGER_REASON_STA_KICKOUT: Roam triggered due to sta kickout event. * ROAM_TRIGGER_REASON_ESS_RSSI: Roam triggered due to ess rssi + * ROAM_TRIGGER_REASON_WTC_BTM: Roam triggered due to WTC BTM * ROAM_TRIGGER_REASON_MAX: Maximum number of roam triggers */ enum roam_trigger_reason { @@ -429,6 +430,7 @@ enum roam_trigger_reason { ROAM_TRIGGER_REASON_IDLE, ROAM_TRIGGER_REASON_STA_KICKOUT, ROAM_TRIGGER_REASON_ESS_RSSI, + ROAM_TRIGGER_REASON_WTC_BTM, ROAM_TRIGGER_REASON_MAX, }; diff --git a/components/wmi/src/wmi_unified_roam_tlv.c b/components/wmi/src/wmi_unified_roam_tlv.c index 878ce7e755..fe3c8ca92b 100644 --- a/components/wmi/src/wmi_unified_roam_tlv.c +++ b/components/wmi/src/wmi_unified_roam_tlv.c @@ -1272,6 +1272,9 @@ convert_control_roam_trigger_reason_bitmap(uint32_t trigger_reason_bitmap) if (trigger_reason_bitmap & BIT(ROAM_TRIGGER_REASON_ESS_RSSI)) fw_trigger_bitmap |= BIT(WMI_ROAM_TRIGGER_REASON_ESS_RSSI); + if (trigger_reason_bitmap & BIT(ROAM_TRIGGER_REASON_WTC_BTM)) + fw_trigger_bitmap |= BIT(WMI_ROAM_TRIGGER_REASON_WTC_BTM); + return fw_trigger_bitmap; } @@ -1495,6 +1498,7 @@ extract_roam_btm_response_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf, WMI_MAC_ADDR_TO_CHAR_ARRAY(&src_data->target_bssid, dst->target_bssid.bytes); dst->vsie_reason = src_data->vsie_reason; + dst->timestamp = src_data->timestamp; return QDF_STATUS_SUCCESS; } diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index 023b6a2877..3f11e64324 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -3546,6 +3546,19 @@ wma_get_trigger_detail_str(struct wmi_roam_trigger_info *roam_info, char *buf) temp += buf_cons; buf_left -= buf_cons; 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", + 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, + roam_info->wtc_btm_trig_data.wtc_mode, + roam_info->wtc_btm_trig_data.wtc_scan_mode, + roam_info->wtc_btm_trig_data.wtc_rssi_th, + roam_info->wtc_btm_trig_data.wtc_candi_rssi_th); + temp += buf_cons; + buf_left -= buf_cons; + return; default: return; } @@ -3591,8 +3604,11 @@ static void wma_rso_print_btm_rsp_info(struct roam_btm_response_data *data, uint8_t vdev_id) { - wma_info("[BTM RSP]: VDEV[%d], Status: %d, VSIE reason: %d, BSSID: %pM", - vdev_id, data->btm_status, data->vsie_reason, + char time[TIME_STRING_LEN]; + + mlme_get_converted_timestamp(data->timestamp, time); + wma_info("%s [BTM RSP]: VDEV[%d], Status: %d, VSIE reason: %d, BSSID: %pM", + time, vdev_id, data->btm_status, data->vsie_reason, data->target_bssid.bytes); }