OSDN Git Service

change wifi_logger header file
authoreccopark@broadcom.com <eccopark@broadcom.com>
Fri, 10 Apr 2015 21:52:29 +0000 (14:52 -0700)
committerPierre Vandwalle <vandwalle@google.com>
Sat, 11 Apr 2015 01:05:11 +0000 (18:05 -0700)
1) add wifi_set_alert_handler for the alert case
2) add wifi_set_log_handler for the ring data
3) remove unnecessary wifi_request_id for set commands
4) change to use ring_name instead of ring_id.
5) add wifi_reset_alert_handler
   add wifi_reset_log_handler

Change-Id: Ia9aaba050196af6684191cdcdfb0c1d21e917ed2
Signed-off-by: eccopark@broadcom.com <eccopark@broadcom.com>
include/hardware_legacy/wifi_hal.h
include/hardware_legacy/wifi_logger.h

index fa0aff0..4a290d9 100644 (file)
@@ -196,8 +196,7 @@ typedef struct {
             mac_addr[]);
     wifi_error (* wifi_get_rtt_capabilities)(wifi_interface_handle, wifi_rtt_capabilities *);
     wifi_error (* wifi_set_nodfs_flag)(wifi_interface_handle, u32);
-    wifi_error (* wifi_start_logging)(wifi_interface_handle, u32, u32, u32, u32, u8 *,
-            wifi_ring_buffer_data_handler);
+    wifi_error (* wifi_start_logging)(wifi_interface_handle, u32, u32, u32, u32, char *);
     wifi_error (* wifi_set_epno_list)(int, wifi_interface_info *, int, wifi_epno_network *,
             wifi_epno_handler);
     wifi_error (* wifi_set_country_code)(wifi_interface_handle, const char *);
index e34dee7..b91bfa2 100644 (file)
@@ -64,7 +64,6 @@ typedef struct {
                 // packet, or packet headers only (up to TCP or RTP/UDP headers) will be copied into the ring\r
 } __attribute__((packed)) wifi_ring_per_packet_status_entry;\r
 \r
-static char per_packet_status_ring_name[] = "wifi_per_packet_status"; // Ring buffer name for per-packet status ring\r
 \r
 // Below events refer to the wifi_connectivity_event ring and shall be supported\r
 \r
@@ -147,8 +146,6 @@ typedef struct {
                         // understood by the developer only.\r
 } __attribute__((packed)) wifi_ring_buffer_driver_connectivity_event;\r
 \r
-// Ring buffer name for connectivity events ring\r
-static char connectivity_event_ring_name[] = "wifi_connectivity_events";\r
 \r
 // Ring buffer name for power events ring. note that power event are extremely frequents\r
 // and thus should be stored in their own ring/file so as not to clobber connectivity events\r
@@ -164,8 +161,6 @@ typedef struct {
     tlv_log tlvs[0];\r
 } __attribute__((packed)) wifi_power_event;\r
 \r
-static char power_event_ring_name[] = "wifi_power_events";\r
-\r
 /**\r
  * This structure represent a logger entry within a ring buffer.\r
  * Wifi driver are responsible to manage the ring buffer and write the debug\r
@@ -241,13 +236,33 @@ typedef struct {
  * The callback is called by driver whenever new data is\r
  */\r
 typedef struct {\r
-  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);\r
+  void (*on_ring_buffer_data) (char *ring_name, char *buffer, int buffer_size,\r
+        wifi_ring_buffer_status *status);\r
 } wifi_ring_buffer_data_handler;\r
 \r
+/* api to set the log handler for getting ring data  */\r
+wifi_error wifi_set_log_handler(wifi_request_id id, wifi_interface_handle iface,\r
+    wifi_ring_buffer_data_handler handler);\r
+\r
+/* api to reset the log handler */\r
+wifi_error wifi_reset_log_handler(wifi_request_id id, wifi_interface_handle iface);\r
+\r
+\r
+typedef struct {\r
+   void (*on_alert) (wifi_request_id id, char *buffer, int buffer_size, int err_code);\r
+} wifi_alert_handler;\r
+\r
+/* api to set the alert handler for the alert case in Wi-Fi Chip */\r
+wifi_error wifi_set_alert_handler(wifi_request_id id, wifi_interface_handle iface,\r
+    wifi_alert_handler handler);\r
+\r
+\r
+/* api to reset the alert handler */\r
+wifi_error wifi_reset_alert_handler(wifi_request_id id, wifi_interface_handle iface);\r
+\r
 \r
 /* api for framework to indicate driver has to upload and drain all data of a given ring */\r
-wifi_error wifi_get_ring_data(wifi_request_id id,\r
-        wifi_interface_handle iface, wifi_ring_buffer_id ring_id);\r
+wifi_error wifi_get_ring_data(wifi_interface_handle iface, char *ring_name);\r
 \r
 \r
 /**\r
@@ -259,36 +274,34 @@ wifi_error wifi_get_ring_data(wifi_request_id id,
  *     can be impacted but device should not otherwise be significantly impacted\r
  *  - verbose_level 3+ are used when trying to actively debug a problem\r
  *\r
- * buffer_name represent the name of the ring for which data collection shall start.\r
+ * ring_name represent the name of the ring for which data collection shall start.\r
  *\r
  * flags: TBD parameter used to enable/disable specific events on a ring\r
  * max_interval: maximum interval in seconds for driver to invoke on_ring_buffer_data, ignore if zero\r
  * min_data_size: minimum data size in buffer for driver to invoke on_ring_buffer_data, ignore if zero\r
  */\r
 \r
-wifi_error wifi_start_logging(wifi_interface_handle iface, u32 verbose_level, u32 flags, u32 max_interval_sec, u32 min_data_size, u8 *buffer_name, wifi_ring_buffer_data_handler handler);\r
+wifi_error wifi_start_logging(wifi_interface_handle iface, u32 verbose_level, u32 flags,\r
+    u32 max_interval_sec, u32 min_data_size, char *ring_name);\r
 \r
 /* api to get the status of all ring buffers supported by driver */\r
-wifi_error wifi_get_ring_buffers_status(wifi_request_id id,\r
-        wifi_interface_handle iface, u32 *num_rings, wifi_ring_buffer_status **status);\r
+wifi_error wifi_get_ring_buffers_status(wifi_interface_handle iface, u32 *num_rings,\r
+    wifi_ring_buffer_status **status);\r
 \r
-/* Upper layer has to free the memory indicated by buffer pointer */\r
 typedef struct {\r
-   void (*on_firmware_memory_dump) (wifi_request_id id, char *buffer, int buffer_size);\r
+   void (*on_firmware_memory_dump) (char *buffer, int buffer_size);\r
 } wifi_firmware_memory_dump_handler;\r
 \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, wifi_firmware_memory_dump_handler handler);\r
+wifi_error wifi_get_firmware_memory_dump(wifi_interface_handle iface,\r
+    wifi_firmware_memory_dump_handler handler);\r
 \r
 /* api to collect a firmware version string */\r
-wifi_error wifi_get_firmware_version(wifi_request_id id,\r
-        wifi_interface_handle iface, char **buffer, int *buffer_size);\r
+wifi_error wifi_get_firmware_version(wifi_interface_handle iface, char **buffer, int *buffer_size);\r
 \r
 /* api to collect a driver version string */\r
-wifi_error wifi_get_driver_version(wifi_request_id id,\r
-        wifi_interface_handle iface, char **buffer, int *buffer_size);\r
+wifi_error wifi_get_driver_version(wifi_interface_handle iface, char **buffer, int *buffer_size);\r
 \r
 \r
 /* Feature set */\r
@@ -301,7 +314,7 @@ enum {
     WIFI_LOGGER_VERBOSE_SUPPORTED = (1 << (5)), // verbose log of FW\r
     WIFI_LOGGER_WATCHDOG_TIMER_SUPPORTED = (1 << (6)) // monitor the health of FW\r
 };\r
-wifi_error wifi_get_logger_supported_feature_set(wifi_request_id id, wifi_interface_handle iface, unsigned int *support);\r
+wifi_error wifi_get_logger_supported_feature_set(wifi_interface_handle iface, unsigned int *support);\r
 \r
 \r
 #ifdef __cplusplus\r