summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorVinit Deshpande <vinitd@google.com>2015-03-14 22:10:09 -0700
committerVinit Deshpande <vinitd@google.com>2015-03-14 22:10:09 -0700
commit2e2afb1f0a8e6525c572f006172b4796c3e9d0a9 (patch)
tree8a6a1b82c622f2f8d25a27f23c3826b7f41df17b /include
parent3cfe658a8371fb3144f55e8aa5cd77fb1ffd4863 (diff)
parent73212d153fe67a85189b30e2cc1d1c2918e4938e (diff)
downloadhardware_libhardware_legacy-2e2afb1f0a8e6525c572f006172b4796c3e9d0a9.zip
hardware_libhardware_legacy-2e2afb1f0a8e6525c572f006172b4796c3e9d0a9.tar.gz
hardware_libhardware_legacy-2e2afb1f0a8e6525c572f006172b4796c3e9d0a9.tar.bz2
am "Wifi hal headers: PNO thru g-scan and g-scan exponential channel buckets"
merged from goog/mirror-m-wireless-internal-release 73212d1 Wifi hal headers: PNO thru g-scan and g-scan exponential channel buckets Change-Id: Ie352da4ae47dea61a8335b556c32482ca4f7487e
Diffstat (limited to 'include')
-rw-r--r--include/hardware_legacy/gscan.h48
-rw-r--r--include/hardware_legacy/wifi_hal.h1
-rw-r--r--include/hardware_legacy/wifi_logger.h8
3 files changed, 53 insertions, 4 deletions
diff --git a/include/hardware_legacy/gscan.h b/include/hardware_legacy/gscan.h
index fed7c0e..fe92b12 100644
--- a/include/hardware_legacy/gscan.h
+++ b/include/hardware_legacy/gscan.h
@@ -20,6 +20,7 @@ typedef enum {
#define MAX_BUCKETS 16
#define MAX_HOTLIST_APS 128
#define MAX_SIGNIFICANT_CHANGE_APS 64
+#define MAX_PNO_SSID 128;
wifi_error wifi_get_valid_channels(wifi_interface_handle handle,
int band, int max_channels, wifi_channel *channels, int *num_channels);
@@ -97,7 +98,8 @@ typedef struct {
wifi_band band; // when UNSPECIFIED, use channel list
int period; // desired period, in millisecond; if this is too
// low, the firmware should choose to generate results as
- // fast as it can instead of failing the command
+ // fast as it can instead of failing the command.
+ // for exponential backoff bucket this is the min_period
/* report_events semantics -
* 0 => report only when scan history is % full
* 1 => same as 0 + report a scan completion event after scanning this bucket
@@ -106,9 +108,18 @@ typedef struct {
supplicant as well (optional) .
*/
byte report_events;
+ int max_period; // if max_period is non zero or different than period, then this bucket is
+ // an exponential backoff bucket and the scan period will grow exponentially
+ // as per formula: actual_period(N) = period ^ (N/(step_count+1))
+ // to a maximum period of max_period
+ int exponent; // for exponential back off bucket: multiplier: new_period = old_period * exponent
+ int step_count; // for exponential back off bucket, number of scans performed at a given
+ // period and until the exponent is applied
int num_channels;
- wifi_scan_channel_spec channels[MAX_CHANNELS]; // channels to scan; these may include DFS channels
+ // channels to scan; these may include DFS channels
+ // Note that a given channel may appear in multiple buckets
+ wifi_scan_channel_spec channels[MAX_CHANNELS];
} wifi_scan_bucket_spec;
typedef struct {
@@ -156,7 +167,6 @@ typedef struct {
mac_addr bssid; // AP BSSID
wifi_rssi low; // low threshold
wifi_rssi high; // high threshold
- wifi_channel channel; // channel hint
} ap_threshold_param;
typedef struct {
@@ -172,7 +182,7 @@ wifi_error wifi_set_bssid_hotlist(wifi_request_id id, wifi_interface_handle ifac
/* Clear the BSSID Hotlist */
wifi_error wifi_reset_bssid_hotlist(wifi_request_id id, wifi_interface_handle iface);
-/* Significant wifi change*/
+/* Significant wifi change */
typedef struct {
mac_addr bssid; // BSSID
wifi_channel channel; // channel frequency in MHz
@@ -185,6 +195,11 @@ typedef struct {
unsigned num_results, wifi_significant_change_result **results);
} wifi_significant_change_handler;
+// The sample size parameters in the wifi_significant_change_params structure
+// represent the number of occurence of a g-scan where the BSSID was seen and RSSI was
+// collected for that BSSID, or, the BSSID was expected to be seen and didn't.
+// for instance: lost_ap_sample_size : number of time a g-scan was performed on the
+// channel the BSSID was seen last, and the BSSID was not seen during those g-scans
typedef struct {
int rssi_sample_size; // number of samples for averaging RSSI
int lost_ap_sample_size; // number of samples to confirm AP loss
@@ -203,5 +218,30 @@ wifi_error wifi_reset_significant_change_handler(wifi_request_id id, wifi_interf
/* Random MAC OUI for PNO */
wifi_error wifi_set_scanning_mac_oui(wifi_interface_handle handle, oui scan_oui);
+
+#define WIFI_PNO_FLAG_DIRECTED_SCAN = 1 // whether directed scan needs to be performed (for hidden SSIDs)
+#define WIFI_PNO_FLAG_HASH_PROVIDED = 2 // whether a crc32 hash of the ssid is provided instead of the ssid
+
+// Code for matching the beacon AUTH IE - additional codes TBD
+#define WIFI_PNO_AUTH_CODE_OPEN 1 // open
+#define WIFI_PNO_AUTH_CODE_PSK 2 // WPA_PSK or WPA2PSK
+#define WIFI_PNO_AUTH_CODE_EAPOL 4 // any EAPOL
+
+typedef struct {
+ char ssid[32];
+ char rssi_threshold; // threshold for considering this SSID as found
+ char flags;
+ int crc32; // crc32 of the SSID, this allows for memory size optimization
+ // 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;
+
+/* PNO list */
+typedef struct {
+ int num_ssid; // number of SSIDs
+ char wifi_pno_network[MAX_PNO_SSID]; // SSIDs
+} wifi_pno_params;
+
#endif
diff --git a/include/hardware_legacy/wifi_hal.h b/include/hardware_legacy/wifi_hal.h
index b318e57..5e445ae 100644
--- a/include/hardware_legacy/wifi_hal.h
+++ b/include/hardware_legacy/wifi_hal.h
@@ -83,6 +83,7 @@ void wifi_get_error_info(wifi_error err, const char **msg); // return a pointer
#define WIFI_FEATURE_AP_STA 0x8000 // Support for AP STA Concurrency
#define WIFI_FEATURE_LINK_LAYER_STATS 0x10000 // Link layer stats collection
#define WIFI_FEATURE_LOGGER 0x20000 // WiFi Logger
+#define WIFI_FEATURE_HAL_EPNO 0x40000 // WiFi PNO enhanced
// Add more features here
diff --git a/include/hardware_legacy/wifi_logger.h b/include/hardware_legacy/wifi_logger.h
index 9a9deb9..a9e694f 100644
--- a/include/hardware_legacy/wifi_logger.h
+++ b/include/hardware_legacy/wifi_logger.h
@@ -71,6 +71,14 @@ wifi_error wifi_get_ring_buffer_status(wifi_request_id id,
wifi_error wifi_get_firmware_memory_dump(wifi_request_id id,
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);
+
+/* 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);
+
/* Feature set */
#define WIFI_LOGGER_MEMORY_DUMP_SUPPORTED 1