OSDN Git Service

clarify comments and complete EPNO API
authorPierre Vandwalle <vandwalle@google.com>
Thu, 12 Feb 2015 00:23:19 +0000 (16:23 -0800)
committerPierre Vandwalle <vandwalle@google.com>
Thu, 12 Feb 2015 00:23:19 +0000 (16:23 -0800)
Change-Id: Ibba242ee3d3c1803a5ffca4cc72625f354527f4a

include/hardware_legacy/gscan.h
include/hardware_legacy/wifi_config.h
include/hardware_legacy/wifi_logger.h

index be783df..2e72130 100644 (file)
@@ -227,6 +227,12 @@ wifi_error wifi_set_scanning_mac_oui(wifi_interface_handle handle, oui scan_oui)
 #define WIFI_PNO_AUTH_CODE_PSK   2 // WPA_PSK or WPA2PSK
 #define WIFI_PNO_AUTH_CODE_EAPOL 4 // any EAPOL
 
+// Enhanced PNO:
+// for each network framework will either specify a ssid or a crc32
+// if ssid is specified (i.e. ssid[0] != 0) then crc32 field shall be ignored.
+// A PNO network shall be reported once, that is, once a network is reported by firmware
+// its entry shall be marked as "done" until framework call wifi_set_epno_list.
+ // Calling wifi_set_epno_list shall reset the "done" status of pno networks in firmware.
 typedef struct {
     char ssid[32];
     char rssi_threshold; // threshold for considering this SSID as found
@@ -235,13 +241,32 @@ typedef struct {
                 // i.e. not passing the whole SSID
                 // in firmware and instead storing a shorter string
     char auth_bit_field; // auth bitfield for matching WPA IE
-} wifi_pno_network;
+} wifi_epno_network;
 
 /* PNO list */
 typedef struct {
-    int num_ssid;                            // number of SSIDs
-    char wifi_pno_network[MAX_PNO_SSID];     // SSIDs
-} wifi_pno_params;
+    int num_networks;                                // number of SSIDs
+    wifi_epno_network networks[];     // PNO networks
+} wifi_epno_params;
+
+typedef struct {
+    int network_index; // index of the network found in the pno list
+    char ssid[32];
+    wifi_channel channel;
+    int rssi;
+} wifi_epno_result;
+
+
+typedef struct {
+    // on results
+    void (*on_network_found)(wifi_request_id id,
+            unsigned num_results, wifi_epno_result *results);
+} wifi_epno_handler;
+
+
+/* Set the PNO list */
+wifi_error wifi_set_epno_list(wifi_request_id id, wifi_interface_handle iface,
+        int num_networks, wifi_epno_network *networks, wifi_epno_handler handler);
 
 #endif
 
index c19099d..88e5286 100644 (file)
@@ -15,6 +15,7 @@ extern "C"
 typedef int wifi_radio;\r
 \r
 // whether the wifi chipset wakes at every dtim beacon or a multiple of the dtim period\r
+// if extended_dtim is set to 3, the STA shall wake up every 3 DTIM beacons\r
 wifi_error wifi_extended_dtim_config_set(wifi_request_id id,\r
         wifi_interface_handle iface, int extended_dtim);\r
 \r
index a201b49..d7b7cfb 100644 (file)
@@ -42,6 +42,7 @@ typedef struct {
 } wifi_ring_per_packet_status_entry;\r
 \r
 \r
+// Below events refer to the wifi_connectivity_event ring and shall be supported\r
 \r
 #define WIFI_EVENT_ASSOCIATION_REQUESTED 0 // driver receive association command from kernel\r
 #define WIFI_EVENT_AUTH_COMPLETE 1\r
@@ -93,6 +94,7 @@ typedef struct {
                         // by the developer only.\r
 } wifi_ring_buffer_driver_connectivity_event;\r
 \r
+static char connectivity_event_ring_name[] = "wifi_connectivity_events"; //ring buffer name for connectivity events ring\r
 \r
 /**\r
  * This structure represent a logger entry within a ring buffer.\r
@@ -117,7 +119,10 @@ typedef struct {
     u8 type; // Per ring specific\r
     u8 resvd;\r
     u64 timestamp; //present if has_timestamp bit is set.\r
-    u8 data[0];\r
+    union {\r
+        u8 data[0];\r
+        wifi_ring_buffer_driver_connectivity_event connectivity_event;\r
+        };\r
 } wifi_ring_buffer_entry;\r
 \r
 #define WIFI_RING_BUFFER_FLAG_HAS_BINARY_ENTRIES         0x00000001     // set if binary entries are present\r
@@ -144,12 +149,12 @@ typedef struct {
 /**\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
+ *  - verbose_level 0 corresponds to no collection\r
+ *  - verbose_level 1+ are TBD, with increasing level of logging\r
  *\r
  * buffer_name represent the name of the ring for which data collection shall start.\r
  */\r
-wifi_error wifi_start_logging(wifi_interface_handle iface, u32 verbose_level, u8 * buffer_name);\r
+wifi_error wifi_set_logging_level(wifi_interface_handle iface, u32 verbose_level, u8 * buffer_name);\r
 \r
 /* callback for reporting ring buffer status */\r
 typedef struct {\r