|
@@ -109,6 +109,8 @@ DEFINE_RATELIMIT_STATE(panic_wifilog_ratelimit,
|
|
PANIC_WIFILOG_PRINT_RATE_LIMIT_PERIOD,
|
|
PANIC_WIFILOG_PRINT_RATE_LIMIT_PERIOD,
|
|
PANIC_WIFILOG_PRINT_RATE_LIMIT_BURST_DEFAULT);
|
|
PANIC_WIFILOG_PRINT_RATE_LIMIT_BURST_DEFAULT);
|
|
|
|
|
|
|
|
+#define FLUSH_LOG_COMPLETION_TIMEOUT 3000
|
|
|
|
+
|
|
struct log_msg {
|
|
struct log_msg {
|
|
struct list_head node;
|
|
struct list_head node;
|
|
unsigned int radio;
|
|
unsigned int radio;
|
|
@@ -192,6 +194,8 @@ struct wlan_logging {
|
|
bool is_flush_timer_initialized;
|
|
bool is_flush_timer_initialized;
|
|
uint32_t flush_timer_period;
|
|
uint32_t flush_timer_period;
|
|
qdf_spinlock_t flush_timer_lock;
|
|
qdf_spinlock_t flush_timer_lock;
|
|
|
|
+
|
|
|
|
+ qdf_event_t flush_log_completion;
|
|
};
|
|
};
|
|
|
|
|
|
/* This global variable is intentionally not marked static because it
|
|
/* This global variable is intentionally not marked static because it
|
|
@@ -765,6 +769,20 @@ static void send_flush_completion_to_user(uint8_t ring_id)
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+static void wlan_logging_set_flush_log_completion(void)
|
|
|
|
+{
|
|
|
|
+ qdf_event_set(&gwlan_logging.flush_log_completion);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+QDF_STATUS wlan_logging_wait_for_flush_log_completion(void)
|
|
|
|
+{
|
|
|
|
+ qdf_event_reset(&gwlan_logging.flush_log_completion);
|
|
|
|
+
|
|
|
|
+ return qdf_wait_for_event_completion(
|
|
|
|
+ &gwlan_logging.flush_log_completion,
|
|
|
|
+ FLUSH_LOG_COMPLETION_TIMEOUT);
|
|
|
|
+}
|
|
|
|
+
|
|
static void setup_flush_timer(void)
|
|
static void setup_flush_timer(void)
|
|
{
|
|
{
|
|
qdf_spin_lock(&gwlan_logging.flush_timer_lock);
|
|
qdf_spin_lock(&gwlan_logging.flush_timer_lock);
|
|
@@ -850,6 +868,7 @@ static int wlan_logging_thread(void *Arg)
|
|
send_flush_completion_to_user(
|
|
send_flush_completion_to_user(
|
|
RING_ID_DRIVER_DEBUG);
|
|
RING_ID_DRIVER_DEBUG);
|
|
#endif
|
|
#endif
|
|
|
|
+ wlan_logging_set_flush_log_completion();
|
|
} else {
|
|
} else {
|
|
gwlan_logging.is_flush_complete = true;
|
|
gwlan_logging.is_flush_complete = true;
|
|
/* Flush all current host logs*/
|
|
/* Flush all current host logs*/
|
|
@@ -1064,6 +1083,7 @@ int wlan_logging_sock_init_svc(void)
|
|
{
|
|
{
|
|
int i = 0, j, pkt_stats_size;
|
|
int i = 0, j, pkt_stats_size;
|
|
unsigned long irq_flag;
|
|
unsigned long irq_flag;
|
|
|
|
+ QDF_STATUS status;
|
|
|
|
|
|
spin_lock_init(&gwlan_logging.spin_lock);
|
|
spin_lock_init(&gwlan_logging.spin_lock);
|
|
spin_lock_init(&gwlan_logging.pkt_stats_lock);
|
|
spin_lock_init(&gwlan_logging.pkt_stats_lock);
|
|
@@ -1147,6 +1167,12 @@ int wlan_logging_sock_init_svc(void)
|
|
gwlan_logging.is_active = true;
|
|
gwlan_logging.is_active = true;
|
|
gwlan_logging.is_flush_complete = false;
|
|
gwlan_logging.is_flush_complete = false;
|
|
|
|
|
|
|
|
+ status = qdf_event_create(&gwlan_logging.flush_log_completion);
|
|
|
|
+ if (!QDF_IS_STATUS_SUCCESS(status)) {
|
|
|
|
+ qdf_err("Flush log completion event init failed");
|
|
|
|
+ goto err3;
|
|
|
|
+ }
|
|
|
|
+
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
err3:
|
|
err3:
|
|
@@ -1178,6 +1204,8 @@ int wlan_logging_sock_deinit_svc(void)
|
|
if (!gwlan_logging.pcur_node)
|
|
if (!gwlan_logging.pcur_node)
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
|
|
+ qdf_event_destroy(&gwlan_logging.flush_log_completion);
|
|
|
|
+
|
|
INIT_COMPLETION(gwlan_logging.shutdown_comp);
|
|
INIT_COMPLETION(gwlan_logging.shutdown_comp);
|
|
gwlan_logging.exit = true;
|
|
gwlan_logging.exit = true;
|
|
gwlan_logging.is_active = false;
|
|
gwlan_logging.is_active = false;
|