OSDN Git Service

Merge "Merge commit '4c50959717fcf4b5bf10721b4dda0d2c2f423eaf' into merge"
authorEtan Cohen <etancohen@google.com>
Thu, 2 Apr 2015 03:07:28 +0000 (03:07 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Thu, 2 Apr 2015 03:07:55 +0000 (03:07 +0000)
include/hardware_legacy/gscan.h
include/hardware_legacy/wifi_logger.h

index 9dfceb1..3d7d5da 100644 (file)
@@ -20,7 +20,7 @@ const unsigned MAX_CHANNELS                = 16;
 const unsigned MAX_BUCKETS                 = 16;
 const unsigned MAX_HOTLIST_APS             = 128;
 const unsigned MAX_SIGNIFICANT_CHANGE_APS  = 64;
-const unsigned MAX_PNO_SSID                = 128;
+const unsigned MAX_PNO_SSID                = 64;
 const unsigned MAX_HOTLIST_SSID            = 8;
 const unsigned MAX_BLACKLIST_BSSID         = 16;
 
@@ -422,5 +422,31 @@ typedef struct {
 wifi_error wifi_set_bssid_preference(wifi_request_id id, wifi_interface_handle iface,
                                     int num_bssid, wifi_bssid_preference *prefs);
 
+typedef struct {
+    int  id;                            // identifier of this network block, report this in event
+    char realm[256];                    // null terminated UTF8 encoded realm, 0 if unspecified
+    int64_t roamingConsortiumIds[16];   // roaming consortium ids to match, 0s if unspecified
+    byte plmn[3];                       // mcc/mnc combination as per rules, 0s if unspecified
+} wifi_passpoint_network;
+
+typedef struct {
+    void (*on_passpoint_network_found)(
+            wifi_request_id id,
+            int net_id,                        // network block identifier for the matched network
+            wifi_scan_result *result,          // scan result, with channel and beacon information
+            int anqp_len,                      // length of ANQP blob
+            byte *anqp                         // ANQP data, in the information_element format
+            );
+} wifi_passpoint_event_handler;
+
+/* Sets a list for passpoint networks for PNO purposes; it should be matched
+ * against any passpoint networks (designated by Interworking element) found
+ * during regular PNO scan. */
+wifi_error wifi_set_passpoint_list(wifi_request_id id, wifi_interface_handle iface, int num,
+        wifi_passpoint_network *networks, wifi_passpoint_event_handler handler);
+
+/* Reset passpoint network list - no Passpoint networks should be matched after this */
+wifi_error wifi_reset_passpoint_list(wifi_request_id id, wifi_interface_handle iface);
+
 #endif
 
index 089f138..69326da 100644 (file)
@@ -162,7 +162,7 @@ typedef struct {
 typedef struct {\r
     u16 event;\r
     tlv_log tlvs[0];\r
-} wifi_power_event __attribute__((packed));\r
+} __attribute__((packed)) wifi_power_event;\r
 \r
 static char power_event_ring_name[] = "wifi_power_events";\r
 \r
@@ -181,21 +181,24 @@ static char power_event_ring_name[] = "wifi_power_events";
  * data logged by drivers into their ring buffer, store the data into log files and include\r
  * the logs into android bugreports.\r
  */\r
-\r
-#define RING_BUFFER_ENTRY_FLAGS_HAS_BINARY 1 // set for binary entries\r
-#define RING_BUFFER_ENTRY_FLAGS_HAS_TIMESTAMP 2 // set if 64 bits timestamp is present\r
+enum {\r
+    RING_BUFFER_ENTRY_FLAGS_HAS_BINARY = (1 << (0)), // set for binary entries\r
+    RING_BUFFER_ENTRY_FLAGS_HAS_TIMESTAMP = (1 << (1)) // set if 64 bits timestamp is present\r
+};\r
+\r
+enum {\r
+    ENTRY_TYPE_CONNECT_EVENT = 1,\r
+    ENTRY_TYPE_PKT,\r
+    ENTRY_TYPE_WAKE_LOCK,\r
+    ENTRY_TYPE_POWER_EVENT,\r
+    ENTRY_TYPE_DATA\r
+};\r
 \r
 typedef struct {\r
-    u16 entry_size;\r
+    u16 entry_size; // the size of payload excluding the header.\r
     u8 flags;\r
-    u8 type; // Per ring specific\r
+    u8 type; // Entry type\r
     u64 timestamp; //present if has_timestamp bit is set.\r
-    union {\r
-        u8 data[0];\r
-        wifi_ring_buffer_driver_connectivity_event connectivity_event;\r
-        wifi_ring_per_packet_status_entry packet_status;\r
-        wifi_power_event power_event;\r
-        };\r
 } __attribute__((packed)) wifi_ring_buffer_entry;\r
 \r
 #define WIFI_RING_BUFFER_FLAG_HAS_BINARY_ENTRIES 0x00000001     // set if binary entries are present\r
@@ -263,34 +266,41 @@ wifi_error wifi_get_ring_data(wifi_request_id id,
  * 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_request_id id, 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
 \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_buffers, wifi_ring_buffer_status *status);\r
+        wifi_interface_handle iface, u32 *num_rings, 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
+} 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, char ** buffer, int *buffer_size);\r
+        wifi_interface_handle iface, 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_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
-\r
-\r
-/* api to collect driver records */\r
-wifi_error wifi_get_ringdata(wifi_request_id id,\r
-        wifi_interface_handle iface, wifi_ring_buffer_id ring_id);\r
+        wifi_interface_handle iface, char **buffer, int *buffer_size);\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
+enum {\r
+    WIFI_LOGGER_MEMORY_DUMP_SUPPORTED = (1 << (0)), // Memory dump of FW\r
+    WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_SUPPORTED = (1 << (1)), // PKT status\r
+    WIFI_LOGGER_CONNECT_EVENT_SUPPORTED = (1 << (2)), // Connectivity event\r
+    WIFI_LOGGER_POWER_EVENT_SUPPORTED = (1 << (3)), // POWER of Driver\r
+    WIFI_LOGGER_WAKE_LOCK_SUPPORTED = (1 << (4)), // WAKE LOCK of Driver\r
+    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
 \r
 \r
 #ifdef __cplusplus\r