From bee4f78cbe798c6b39e14122df29d32c317005a2 Mon Sep 17 00:00:00 2001 From: Varun Reddy Yeturu Date: Mon, 2 Nov 2015 10:16:05 -0800 Subject: [PATCH] qcacld-3.0: Report roaming events to diag module In case of LFR3.0, report the critical roaming events such as receiving the roam synch indication from firmware, sending the roam synch complete to the firmware, sending Hand Over failure event to the firmware to the DIAG modules for better debug capabilities. CRs-Fixed: 938002 Change-Id: Icfb4972d59dc3b734ed5af37d70834fea470d741 --- core/sme/inc/csr_internal.h | 14 ++++++++- core/sme/src/csr/csr_api_roam.c | 52 +++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index a653df29f9d7..f335b0d99c57 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -265,6 +265,9 @@ typedef enum { eCSR_REASON_DISASSOC, eCSR_REASON_DEAUTH, eCSR_REASON_HANDOFF, + eCSR_REASON_ROAM_SYNCH_IND, + eCSR_REASON_ROAM_SYNCH_CNF, + eCSR_REASON_ROAM_HO_FAIL, } eCsrDiagWlanStatusEventReason; @@ -1363,7 +1366,16 @@ csr_roam_modify_add_ies(tpAniSirGlobal pMac, CDF_STATUS csr_roam_update_add_ies(tpAniSirGlobal pMac, tSirUpdateIE *pUpdateIE, eUpdateIEsType updateType); - +#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR +void csr_roaming_report_diag_event(tpAniSirGlobal mac_ctx, + roam_offload_synch_ind *roam_synch_ind_ptr, + eCsrDiagWlanStatusEventReason reason); +#else +static inline void csr_roaming_report_diag_event(tpAniSirGlobal mac_ctx, + roam_offload_synch_ind *roam_synch_ind_ptr, + eCsrDiagWlanStatusEventReason reason) +{} +#endif #ifdef WLAN_FEATURE_ROAM_OFFLOAD void csr_process_roam_offload_synch_ind(tHalHandle hHal, roam_offload_synch_ind * roam_synch_ind_ptr); diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 45b2b495ba20..2860c034a1ed 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -5572,6 +5572,7 @@ CDF_STATUS csr_roam_offload_send_synch_cnf(tpAniSirGlobal pMac, uint8_t sessionI false; return CDF_STATUS_E_FAILURE; } + csr_roaming_report_diag_event(pMac, NULL, eCSR_REASON_ROAM_SYNCH_CNF); pSession->roamOffloadSynchParams.bRoamSynchInProgress = false; return CDF_STATUS_SUCCESS; } @@ -18377,6 +18378,52 @@ csr_roam_send_chan_sw_ie_request(tpAniSirGlobal mac_ctx, return status; } +#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR +/** + * csr_roaming_report_diag_event() - Diag events for LFR3 + * @mac_ctx: MAC context + * @roam_synch_ind_ptr: Roam Synch Indication Pointer + * @reason: Reason for this event to happen + * + * The major events in the host for LFR3 roaming such as + * roam synch indication, roam synch completion and + * roam synch handoff fail will be indicated to the + * diag framework using this API. + * + * Return: None + */ +void csr_roaming_report_diag_event(tpAniSirGlobal mac_ctx, + roam_offload_synch_ind *roam_synch_ind_ptr, + eCsrDiagWlanStatusEventReason reason) +{ + WLAN_HOST_DIAG_EVENT_DEF(roam_connection, + host_event_wlan_status_payload_type); + cdf_mem_set(&roam_connection, + sizeof(host_event_wlan_status_payload_type), 0); + switch (reason) { + case eCSR_REASON_ROAM_SYNCH_IND: + roam_connection.eventId = eCSR_WLAN_STATUS_CONNECT; + if (roam_synch_ind_ptr) { + roam_connection.rssi = roam_synch_ind_ptr->rssi; + roam_connection.channel = + cds_freq_to_chan(roam_synch_ind_ptr->chan_freq); + } + break; + case eCSR_REASON_ROAM_SYNCH_CNF: + roam_connection.eventId = eCSR_WLAN_STATUS_CONNECT; + break; + case eCSR_REASON_ROAM_HO_FAIL: + roam_connection.eventId = eCSR_WLAN_STATUS_DISCONNECT; + break; + default: + sms_log(mac_ctx, LOGE, + FL("LFR3: Unsupported reason %d"), reason); + return; + } + roam_connection.reason = reason; + WLAN_HOST_DIAG_EVENT_REPORT(&roam_connection, EVENT_WLAN_STATUS); +} +#endif #ifdef WLAN_FEATURE_ROAM_OFFLOAD /*---------------------------------------------------------------------------- @@ -18405,6 +18452,9 @@ void csr_process_roam_offload_synch_ind(tHalHandle hHal, "fail to save roam offload AP to scan cache"); goto err_synch_rsp; } + + csr_roaming_report_diag_event(pMac, roam_synch_ind_ptr, + eCSR_REASON_ROAM_SYNCH_IND); session_ptr->roamOffloadSynchParams.rssi = roam_synch_ind_ptr->rssi; session_ptr->roamOffloadSynchParams.roamReason = roam_synch_ind_ptr->roamReason; @@ -18489,6 +18539,8 @@ void csr_process_ho_fail_ind(tpAniSirGlobal pMac, void *pMsgBuf) return; } csr_roam_synch_clean_up(pMac, sessionId); + csr_roaming_report_diag_event(pMac, NULL, + eCSR_REASON_ROAM_HO_FAIL); CDF_TRACE(CDF_MODULE_ID_SME, CDF_TRACE_LEVEL_ERROR, "LFR3:Issue Disconnect on session %d", sessionId); csr_roam_disconnect(pMac, sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED);