diff options
author | Amarnath Hullur Subramanyam <amarnath@qca.qualcomm.com> | 2015-03-25 12:40:33 -0700 |
---|---|---|
committer | Amarnath Hullur Subramanyam <amarnath@qca.qualcomm.com> | 2015-03-28 18:41:41 +0000 |
commit | 2cae13a872ae25ec37e0302ae9e9ca0e24c61686 (patch) | |
tree | 9b8f3036bf731488e6d814fcfa0aafac8c46e2e0 /include | |
parent | 4c50959717fcf4b5bf10721b4dda0d2c2f423eaf (diff) | |
download | hardware_libhardware_legacy-2cae13a872ae25ec37e0302ae9e9ca0e24c61686.zip hardware_libhardware_legacy-2cae13a872ae25ec37e0302ae9e9ca0e24c61686.tar.gz hardware_libhardware_legacy-2cae13a872ae25ec37e0302ae9e9ca0e24c61686.tar.bz2 |
Preallocating max buffer size for scan_result in wifi_cached_scan_results
Android framework should provide a buffer to the wifihal which needs
to be filled with scan_result. This commit will ensure that would
happen by passing a fixed max buffer size as part of each
wifi_cached_scan_results.
Change-Id: I005dd39f26be62694c46369e16d5f7f89f64021d
Diffstat (limited to 'include')
-rw-r--r-- | include/hardware_legacy/gscan.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/hardware_legacy/gscan.h b/include/hardware_legacy/gscan.h index 3d7d5da..b9b0f61 100644 --- a/include/hardware_legacy/gscan.h +++ b/include/hardware_legacy/gscan.h @@ -23,6 +23,7 @@ const unsigned MAX_SIGNIFICANT_CHANGE_APS = 64; const unsigned MAX_PNO_SSID = 64; const unsigned MAX_HOTLIST_SSID = 8; const unsigned MAX_BLACKLIST_BSSID = 16; +const unsigned MAX_AP_CACHE_PER_SCAN = 32; wifi_error wifi_get_valid_channels(wifi_interface_handle handle, int band, int max_channels, wifi_channel *channels, int *num_channels); @@ -120,7 +121,7 @@ typedef struct { // 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 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 @@ -154,10 +155,11 @@ typedef enum { /* Get the GSCAN cached scan results */ typedef struct { - int scan_id; // a unique identifier for the scan unit - int flags; // a bitmask with additional information about scan - int num_results; // number of bssids retrieved by the scan - wifi_scan_result *results; // scan results - one for each bssid + int scan_id; // a unique identifier for the scan unit + int flags; // a bitmask with additional + // information about scan + int num_results; // number of bssids retrieved by the scan + wifi_scan_result results[MAX_AP_CACHE_PER_SCAN]; // scan results - one for each bssid } wifi_cached_scan_results; wifi_error wifi_get_cached_gscan_results(wifi_interface_handle iface, byte flush, |