summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEtan Cohen <etancohen@google.com>2015-04-02 03:07:28 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-04-02 03:07:55 +0000
commit408f8f2978f262007f879d63c3e31f03a91ddf09 (patch)
treea37a6c69fede64a1f77805a9a9ca29fe429bab35
parentb329b2499de1ba3459c724e53fd0f6532845282a (diff)
parent546cfd47e74d4a537329ae32db7cf8d7d929855c (diff)
downloadhardware_libhardware_legacy-408f8f2978f262007f879d63c3e31f03a91ddf09.zip
hardware_libhardware_legacy-408f8f2978f262007f879d63c3e31f03a91ddf09.tar.gz
hardware_libhardware_legacy-408f8f2978f262007f879d63c3e31f03a91ddf09.tar.bz2
Merge "Merge commit '4c50959717fcf4b5bf10721b4dda0d2c2f423eaf' into merge"
-rw-r--r--include/hardware_legacy/gscan.h28
-rw-r--r--include/hardware_legacy/wifi_logger.h62
2 files changed, 63 insertions, 27 deletions
diff --git a/include/hardware_legacy/gscan.h b/include/hardware_legacy/gscan.h
index 9dfceb1..3d7d5da 100644
--- a/include/hardware_legacy/gscan.h
+++ b/include/hardware_legacy/gscan.h
@@ -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
diff --git a/include/hardware_legacy/wifi_logger.h b/include/hardware_legacy/wifi_logger.h
index 089f138..69326da 100644
--- a/include/hardware_legacy/wifi_logger.h
+++ b/include/hardware_legacy/wifi_logger.h
@@ -162,7 +162,7 @@ typedef struct {
typedef struct {
u16 event;
tlv_log tlvs[0];
-} wifi_power_event __attribute__((packed));
+} __attribute__((packed)) wifi_power_event;
static char power_event_ring_name[] = "wifi_power_events";
@@ -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
* the logs into android bugreports.
*/
-
-#define RING_BUFFER_ENTRY_FLAGS_HAS_BINARY 1 // set for binary entries
-#define RING_BUFFER_ENTRY_FLAGS_HAS_TIMESTAMP 2 // set if 64 bits timestamp is present
+enum {
+ RING_BUFFER_ENTRY_FLAGS_HAS_BINARY = (1 << (0)), // set for binary entries
+ RING_BUFFER_ENTRY_FLAGS_HAS_TIMESTAMP = (1 << (1)) // set if 64 bits timestamp is present
+};
+
+enum {
+ ENTRY_TYPE_CONNECT_EVENT = 1,
+ ENTRY_TYPE_PKT,
+ ENTRY_TYPE_WAKE_LOCK,
+ ENTRY_TYPE_POWER_EVENT,
+ ENTRY_TYPE_DATA
+};
typedef struct {
- u16 entry_size;
+ u16 entry_size; // the size of payload excluding the header.
u8 flags;
- u8 type; // Per ring specific
+ u8 type; // Entry type
u64 timestamp; //present if has_timestamp bit is set.
- union {
- u8 data[0];
- wifi_ring_buffer_driver_connectivity_event connectivity_event;
- wifi_ring_per_packet_status_entry packet_status;
- wifi_power_event power_event;
- };
} __attribute__((packed)) wifi_ring_buffer_entry;
#define WIFI_RING_BUFFER_FLAG_HAS_BINARY_ENTRIES 0x00000001 // set if binary entries are present
@@ -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
*/
-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);
+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);
/* api to get the status of all ring buffers supported by driver */
wifi_error wifi_get_ring_buffers_status(wifi_request_id id,
- wifi_interface_handle iface, u32 num_buffers, wifi_ring_buffer_status *status);
+ wifi_interface_handle iface, u32 *num_rings, wifi_ring_buffer_status **status);
+
+/* Upper layer has to free the memory indicated by buffer pointer */
+typedef struct {
+ void (*on_firmware_memory_dump) (wifi_request_id id, char *buffer, int buffer_size);
+} wifi_firmware_memory_dump_handler;
+
/* api to collect a firmware memory dump for a given iface */
wifi_error wifi_get_firmware_memory_dump(wifi_request_id id,
- wifi_interface_handle iface, char ** buffer, int *buffer_size);
+ wifi_interface_handle iface, wifi_firmware_memory_dump_handler handler);
/* api to collect a firmware version string */
wifi_error wifi_get_firmware_version(wifi_request_id id,
- wifi_interface_handle iface, char *buffer, int buffer_size);
+ wifi_interface_handle iface, char **buffer, int *buffer_size);
/* api to collect a driver version string */
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);
+ wifi_interface_handle iface, char **buffer, int *buffer_size);
/* Feature set */
-#define WIFI_LOGGER_MEMORY_DUMP_SUPPORTED 1
-#define WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_SUPPORTED 2
-
-wifi_error wifi_get_logger_supported_feature_set(wifi_interface_handle handle, unsigned int *support);
+enum {
+ WIFI_LOGGER_MEMORY_DUMP_SUPPORTED = (1 << (0)), // Memory dump of FW
+ WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_SUPPORTED = (1 << (1)), // PKT status
+ WIFI_LOGGER_CONNECT_EVENT_SUPPORTED = (1 << (2)), // Connectivity event
+ WIFI_LOGGER_POWER_EVENT_SUPPORTED = (1 << (3)), // POWER of Driver
+ WIFI_LOGGER_WAKE_LOCK_SUPPORTED = (1 << (4)), // WAKE LOCK of Driver
+ WIFI_LOGGER_VERBOSE_SUPPORTED = (1 << (5)), // verbose log of FW
+ WIFI_LOGGER_WATCHDOG_TIMER_SUPPORTED = (1 << (6)) // monitor the health of FW
+};
+wifi_error wifi_get_logger_supported_feature_set(wifi_request_id id, wifi_interface_handle iface, unsigned int *support);
#ifdef __cplusplus