From 8fe39d1742ae3a9d077296dd0cc44072244f51b2 Mon Sep 17 00:00:00 2001 From: Pierre Vandwalle Date: Fri, 27 Feb 2015 16:20:30 -0800 Subject: fix wifi logger API new roam apis Change-Id: Ic4dce5b1367c8de0446fa53b3ada96a425ddd48d --- include/hardware_legacy/wifi_logger.h | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'include/hardware_legacy/wifi_logger.h') diff --git a/include/hardware_legacy/wifi_logger.h b/include/hardware_legacy/wifi_logger.h index d7b7cfb..f24545c 100644 --- a/include/hardware_legacy/wifi_logger.h +++ b/include/hardware_legacy/wifi_logger.h @@ -41,6 +41,7 @@ typedef struct { // packet, or packet headers only (up to TCP or RTP/UDP headers) will be copied into the ring } wifi_ring_per_packet_status_entry; +static char per_packet_status_ring_name[] = "wifi_per_packet_status"; // Ring buffer name for per-packet status ring // Below events refer to the wifi_connectivity_event ring and shall be supported @@ -121,7 +122,8 @@ typedef struct { u64 timestamp; //present if has_timestamp bit is set. union { u8 data[0]; - wifi_ring_buffer_driver_connectivity_event connectivity_event; + wifi_ring_buffer_driver_connectivity_event connectivity_event[0]; + wifi_ring_per_packet_status_entry packet_status[0]; }; } wifi_ring_buffer_entry; @@ -139,14 +141,31 @@ typedef struct { typedef struct { u8 name[32]; u32 flags; - u64 fd; // linux file descriptor for that buffer + wifi_ring_buffer_id ring_id; // unique integer representing the ring u32 ring_buffer_byte_size; // total memory size allocated for the buffer u32 verbose_level; // u32 written_bytes; // number of bytes that was written to the buffer by driver, monotonously increasing integer u32 read_bytes; // number of bytes that was read from the buffer by user land, monotonously increasing integer + u32 written_records; // number of records that was written to the buffer by driver, monotonously increasing integer + } wifi_ring_buffer_status; /** + * Callback for reporting ring data + * + * The ring buffer data collection supports 2 modes: + * - polling : framework periodically calls wifi_get_ringdata() + * - event based: driver calls on_ring_buffer_data when new records are available + * + * The callback is called by driver whenever new data is + */ +typedef struct { + void (*on_ring_buffer_data) (wifi_request_id id, wifi_ring_buffer_id ring_id, char * buffer, int buffer_size, wifi_ring_buffer_status *status); +} wifi_ring_buffer_data_handler; + + + +/** * API to trigger the debug collection. * Unless his API is invoked - logging is not triggered. * - verbose_level 0 corresponds to no collection @@ -154,7 +173,7 @@ typedef struct { * * buffer_name represent the name of the ring for which data collection shall start. */ -wifi_error wifi_set_logging_level(wifi_interface_handle iface, u32 verbose_level, u8 * buffer_name); +wifi_error wifi_set_logging_level(wifi_interface_handle iface, u32 verbose_level, u8 * buffer_name, wifi_ring_buffer_data_handler handler); /* callback for reporting ring buffer status */ typedef struct { @@ -178,6 +197,11 @@ wifi_error wifi_get_driver_version(wifi_request_id id, wifi_interface_handle iface, char * buffer, int buffer_size); +/* api to collect driver records */ +wifi_error wifi_get_ringdata(wifi_request_id id, + wifi_interface_handle iface, wifi_ring_buffer_id ring_id, char * buffer, int buffer_size, wifi_ring_buffer_status *status); + + /* Feature set */ #define WIFI_LOGGER_MEMORY_DUMP_SUPPORTED 1 #define WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_SUPPORTED 2 -- cgit v1.1