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
This commit is contained in:
Agrawal Ashish 2017-05-30 15:19:54 +05:30 • committed by snandini
commit 42a1dc0596
2 changed files with 13 additions and 7 deletions

View file

@ -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,

View file

@ -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;