From 42a1dc059687ed4e98ed180308b7c393d286f837 Mon Sep 17 00:00:00 2001 From: Agrawal Ashish Date: Tue, 30 May 2017 15:19:54 +0530 Subject: [PATCH] qcacmn: Trigger copy of pktlogs to SD Card on basis of ring ID For fatal events , driver sends EVENT_WLAN_LOG_COMPLETE to userspace. But there can be multiple events for each ring id like connectivity, driver , frimware, wakelock etc. Cnss diag has to trigger copy of pkt log to /sdcard only for one bug report, so send ring id in log complete event so that it can trigger copy for driver ring id. Change-Id: I3b06bed52509e58ac4d79698c95ba5eb1baa3bb3 CRs-Fixed: 2053770 --- utils/logging/inc/wlan_logging_sock_svc.h | 3 ++- utils/logging/src/wlan_logging_sock_svc.c | 17 +++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/utils/logging/inc/wlan_logging_sock_svc.h b/utils/logging/inc/wlan_logging_sock_svc.h index b08e32d50551..e08098864a22 100644 --- a/utils/logging/inc/wlan_logging_sock_svc.h +++ b/utils/logging/inc/wlan_logging_sock_svc.h @@ -63,7 +63,8 @@ static inline void wlan_logging_set_fw_flush_complete(void) #ifdef FEATURE_WLAN_DIAG_SUPPORT void wlan_report_log_completion(uint32_t is_fatal, uint32_t indicator, - uint32_t reason_code); + uint32_t reason_code, + uint8_t ring_id); #else static inline void wlan_report_log_completion(uint32_t is_fatal, uint32_t indicator, diff --git a/utils/logging/src/wlan_logging_sock_svc.c b/utils/logging/src/wlan_logging_sock_svc.c index f3ca821dddd8..5a1dfac2c08a 100644 --- a/utils/logging/src/wlan_logging_sock_svc.c +++ b/utils/logging/src/wlan_logging_sock_svc.c @@ -680,6 +680,7 @@ static int send_filled_buffers_to_user(void) * @is_fatal: Type of event, fatal or not * @indicator: Source of bug report, framework/host/firmware * @reason_code: Reason for triggering bug report + * @ring_id: Ring id of logging entities * * This function is used to report the bug report completion to userspace * @@ -687,7 +688,8 @@ static int send_filled_buffers_to_user(void) */ void wlan_report_log_completion(uint32_t is_fatal, uint32_t indicator, - uint32_t reason_code) + uint32_t reason_code, + uint8_t ring_id) { WLAN_HOST_DIAG_EVENT_DEF(wlan_diag_event, struct host_event_wlan_log_complete); @@ -695,7 +697,7 @@ void wlan_report_log_completion(uint32_t is_fatal, wlan_diag_event.is_fatal = is_fatal; wlan_diag_event.indicator = indicator; wlan_diag_event.reason_code = reason_code; - wlan_diag_event.reserved = 0; + wlan_diag_event.reserved = ring_id; WLAN_HOST_DIAG_EVENT_REPORT(&wlan_diag_event, EVENT_WLAN_LOG_COMPLETE); } @@ -704,12 +706,13 @@ void wlan_report_log_completion(uint32_t is_fatal, #ifdef CONFIG_MCL /** * send_flush_completion_to_user() - Indicate flush completion to the user + * @ring_id: Ring id of logging entities * * This function is used to send the flush completion message to user space * * Return: None */ -static void send_flush_completion_to_user(void) +static void send_flush_completion_to_user(uint8_t ring_id) { uint32_t is_fatal, indicator, reason_code; bool recovery_needed; @@ -721,7 +724,7 @@ static void send_flush_completion_to_user(void) LOGGING_TRACE(QDF_TRACE_LEVEL_DEBUG, "%s: Sending flush done to userspace", __func__); - wlan_report_log_completion(is_fatal, indicator, reason_code); + wlan_report_log_completion(is_fatal, indicator, reason_code, ring_id); if (recovery_needed) cds_trigger_recovery(false); @@ -775,7 +778,8 @@ static int wlan_logging_thread(void *Arg) #ifdef CONFIG_MCL if (WLAN_LOG_INDICATOR_HOST_ONLY == cds_get_log_indicator()) { - send_flush_completion_to_user(); + send_flush_completion_to_user( + RING_ID_DRIVER_DEBUG); } #endif } @@ -797,7 +801,8 @@ static int wlan_logging_thread(void *Arg) if (gwlan_logging.is_flush_complete == true) { gwlan_logging.is_flush_complete = false; #ifdef CONFIG_MCL - send_flush_completion_to_user(); + send_flush_completion_to_user( + RING_ID_DRIVER_DEBUG); #endif } else { gwlan_logging.is_flush_complete = true;