--- /dev/null
+#include "wifi_hal.h"\r
+\r
+#ifndef __WIFI_HAL_LOGGER_H\r
+#define __WIFI_HAL_LOGGER_H\r
+\r
+#ifdef __cplusplus\r
+extern "C"\r
+{\r
+#endif /* __cplusplus */\r
+\r
+#define LOGGER_MAJOR_VERSION 1\r
+#define LOGGER_MINOR_VERSION 0\r
+#define LOGGER_MICRO_VERSION 0\r
+\r
+typedef int wifi_radio;\r
+typedef int wifi_ring_buffer_id;\r
+\r
+/**\r
+ * This structure represent a logger entry within a ring.\r
+ * Binary entries can be used so as to store packet data or vendor specific information.\r
+ */\r
+typedef struct {\r
+ u16 entry_size:13;\r
+ u16 binary:1; //set for binary entries\r
+ u16 has_timestamp:1; //set if 64 bits timestamp is present\r
+ u16 reserved:1;\r
+ u8 type; // Per ring specific\r
+ u8 resvd;\r
+ u64 timestamp; //present if has_timestamp bit is set.\r
+ u8 data[0];\r
+} wifi_ring_buffer_entry;\r
+\r
+#define WIFI_RING_BUFFER_FLAG_HAS_BINARY_ENTRIES 0x00000001 // set if binary entries are present\r
+#define WIFI_RING_BUFFER_FLAG_HAS_ASCII_ENTRIES 0x00000002 // set if ascii entries are present\r
+\r
+/* ring buffer params */\r
+/**\r
+ * written_bytes and read_bytes implement a producer consumer API\r
+ * hence written_bytes >= read_bytes\r
+ * a modulo arithmetic of the buffer size has to be applied to those counters:\r
+ * actual offset into ring buffer = written_bytes % ring_buffer_byte_size\r
+ *\r
+ */\r
+typedef struct {\r
+ u8 name[32];\r
+ u32 flags;\r
+ u64 fd; // linux file descriptor for that buffer\r
+ u32 ring_buffer_byte_size; // total memory size allocated for the buffer\r
+ u32 verbose_level; //\r
+ u32 written_bytes; // number of bytes that was written to the buffer by driver, monotonously increasing integer\r
+ u32 read_bytes; // number of bytes that was read from the buffer by user land, monotonously increasing integer\r
+} wifi_ring_buffer_status;\r
+\r
+/* API to trigger the debug collection.\r
+ Unless his API is invoked - logging is not triggered.\r
+ - verbose_level 0 corresponds to minimal or no collection\r
+ - verbose_level 1+ are TBD\r
+ */\r
+wifi_error wifi_start_logging(wifi_interface_handle iface, u32 verbose_level, u8 * buffer_name);\r
+\r
+/* callback for reporting ring buffer status */\r
+typedef struct {\r
+ void (*on_ring_buffer_status_results) (wifi_request_id id, u32 num_buffers, wifi_ring_buffer_status *status);\r
+} wifi_ring_buffer_status_result_handler;\r
+\r
+/* api to get the status of a ring buffer */\r
+wifi_error wifi_get_ring_buffer_status(wifi_request_id id,\r
+ wifi_interface_handle iface, wifi_ring_buffer_id ring_id, wifi_ring_buffer_status_result_handler handler);\r
+\r
+/* api to collect a firmware memory dump for a given iface */\r
+wifi_error wifi_get_firmware_memory_dump(wifi_request_id id,\r
+ wifi_interface_handle iface, char * buffer, int buffer_size);\r
+\r
+\r
+/* Feature set */\r
+#define WIFI_LOGGER_MEMORY_DUMP_SUPPORTED 1\r
+#define WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_SUPPORTED 2\r
+\r
+wifi_error wifi_get_logger_supported_feature_set(wifi_interface_handle handle, unsigned int *support);\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif /* __cplusplus */\r
+\r
+#endif /*__WIFI_HAL_STATS_ */\r
+\r