From 29b934833a69240116f4c29f00c9e69a9bb410a6 Mon Sep 17 00:00:00 2001 From: xinhe Date: Mon, 23 Mar 2015 16:25:00 -0700 Subject: add Framework for set country code through HAL Bug:19896389 Change-Id: I14cd2f039bda08f72dd8386e43ce8b65ce417614 --- include/hardware_legacy/wifi_config.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/hardware_legacy/wifi_config.h b/include/hardware_legacy/wifi_config.h index 88e5286..8ad14f4 100644 --- a/include/hardware_legacy/wifi_config.h +++ b/include/hardware_legacy/wifi_config.h @@ -20,8 +20,7 @@ wifi_error wifi_extended_dtim_config_set(wifi_request_id id, wifi_interface_handle iface, int extended_dtim); //set the country code to driver -wifi_error wifi_set_country_code(wifi_request_id id, wifi_interface_handle iface, - const char* country_code); +wifi_error wifi_set_country_code(wifi_interface_handle iface, const char* country_code); //set the wifi_iface stats averaging factor used to calculate // statistics like average the TSF offset or average number of frame leaked -- cgit v1.1 From 37eb61d1a89ae1578bf5d89c8f4c7811018e376e Mon Sep 17 00:00:00 2001 From: Pierre Vandwalle Date: Wed, 25 Mar 2015 08:50:26 -0700 Subject: adjust gscan and wifi_logger headers Change-Id: I43105fe14b1a5511045998ea1cbf4e275a6faf36 --- include/hardware_legacy/gscan.h | 2 +- include/hardware_legacy/wifi_logger.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hardware_legacy/gscan.h b/include/hardware_legacy/gscan.h index 9dfceb1..463c4c1 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; diff --git a/include/hardware_legacy/wifi_logger.h b/include/hardware_legacy/wifi_logger.h index f5e1a3b..0f9ec0a 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"; -- cgit v1.1 From 3e778d3b8acf9ec3ce76d32255ae2b1aec3ac7d1 Mon Sep 17 00:00:00 2001 From: "eccopark@broadcom.com" Date: Wed, 25 Mar 2015 10:47:43 -0700 Subject: net: wireless change the Header for Logger 1) define entry type for parsing the data easily. 2) the payload will be attached at end of the wifi_ring_buffer_entry 3) added the feature set 4) remove duplicate wifi_get_ring_data 5) add request_id in wifi_start_logging 6) change the pointer of buffer to double pointer of buffer in wifi_get_ring_buffers_status and wifi_get_firmware_memory_dump wifi_get_firmware_version and wifi_get_driver_version to indicate the buffer supplied by Application layer Change-Id: I5dc2811155e7efa058a0c3414036461de3e45d98 Signed-off-by: eccopark@broadcom.com --- include/hardware_legacy/wifi_logger.h | 52 +++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/include/hardware_legacy/wifi_logger.h b/include/hardware_legacy/wifi_logger.h index 0f9ec0a..daa099e 100644 --- a/include/hardware_legacy/wifi_logger.h +++ b/include/hardware_legacy/wifi_logger.h @@ -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,35 @@ 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); /* 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, char **buffer, int *buffer_size); /* 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 - +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_interface_handle handle, unsigned int *support); -- cgit v1.1 From 3fabb28c4b19ea110aee0fde881c7dc315980b16 Mon Sep 17 00:00:00 2001 From: "eccopark@broadcom.com" Date: Wed, 25 Mar 2015 17:21:26 -0700 Subject: net: wireless change the header of Logger 1) add the request_id in wifi_get_logger_supported_feature_set 2) Change the wifi_get_firmware_memory_dump API 1) Normally the size of firmware dump is 700KB. Thus, Driver cannot send the data in one time because of limitation of skb length. In order to send such big data from kernel Driver, we need to send data using event continuously until we send the memory dump completely. In the event handler of hal, it will allocate the big buffer to store the data. Once event handler copy the data completely, event handler will call the function callback(on_firmware_memory_dump). So, upper layer has to free the buffer after handling the buffer. Change-Id: If80b03ec8bd9349d952743e17a001c04096aac95 Signed-off-by: eccopark@broadcom.com --- include/hardware_legacy/wifi_logger.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/hardware_legacy/wifi_logger.h b/include/hardware_legacy/wifi_logger.h index daa099e..fb4edbb 100644 --- a/include/hardware_legacy/wifi_logger.h +++ b/include/hardware_legacy/wifi_logger.h @@ -195,7 +195,7 @@ enum { }; typedef struct { - u16 entry_size; // the size of payload excluding the header. + u16 entry_size; // the size of payload excluding the header. u8 flags; u8 type; // Entry type u64 timestamp; //present if has_timestamp bit is set. @@ -272,9 +272,15 @@ wifi_error wifi_start_logging(wifi_request_id id, wifi_interface_handle iface, u wifi_error wifi_get_ring_buffers_status(wifi_request_id id, 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, @@ -295,7 +301,7 @@ enum { 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_interface_handle handle, unsigned int *support); +wifi_error wifi_get_logger_supported_feature_set(wifi_request_id id, wifi_interface_handle iface, unsigned int *support); #ifdef __cplusplus -- cgit v1.1 From 28e08ed5cf06ac99ccd4e0213664e5c33bdaf099 Mon Sep 17 00:00:00 2001 From: Vinit Deshpande Date: Wed, 11 Mar 2015 14:41:31 -0700 Subject: HAL API to offload passpoint match to wifi chipset This change introduces wifi_set_passpoint_list and wifi_reset_passpoint_list which implement the functionality of offloading passpoint match to the chipset firmware. Change-Id: I8a3730d4e23891b1dce47b8cf877e9b3c04ac279 --- include/hardware_legacy/gscan.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/include/hardware_legacy/gscan.h b/include/hardware_legacy/gscan.h index 463c4c1..3d7d5da 100644 --- a/include/hardware_legacy/gscan.h +++ b/include/hardware_legacy/gscan.h @@ -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 -- cgit v1.1