From 75814ce428859c243ae53f5ae851cd2c371fe6a1 Mon Sep 17 00:00:00 2001 From: Subhani Shaik Date: Tue, 4 Oct 2016 19:40:38 +0530 Subject: [PATCH] Roaming Enhancement API Roaming enhancements to avoid critical sections between firmware based network selection and framework based network selection. Also remove blacklist_bssid changes from gscan.h to avoid duplication. BUG: 32883971 Test: Build. Change-Id: I4c851e9c1969123427f2a92e729b9a5b6fd5b8d8 Merged-In: I4c851e9c1969123427f2a92e729b9a5b6fd5b8d8 --- include/hardware_legacy/gscan.h | 11 ------- include/hardware_legacy/roam.h | 61 ++++++++++++++++++++++++++++++++++++++ include/hardware_legacy/wifi_hal.h | 15 ++++++++-- 3 files changed, 73 insertions(+), 14 deletions(-) create mode 100644 include/hardware_legacy/roam.h diff --git a/include/hardware_legacy/gscan.h b/include/hardware_legacy/gscan.h index a5ceaba..372f2bd 100644 --- a/include/hardware_legacy/gscan.h +++ b/include/hardware_legacy/gscan.h @@ -21,7 +21,6 @@ typedef enum { #define MAX_SIGNIFICANT_CHANGE_APS 64 #define MAX_EPNO_NETWORKS 64 #define MAX_HOTLIST_SSID 8 -#define MAX_BLACKLIST_BSSID 16 #define MAX_AP_CACHE_PER_SCAN 32 wifi_error wifi_get_valid_channels(wifi_interface_handle handle, @@ -267,16 +266,6 @@ typedef struct { ssid_threshold_param ssid[MAX_HOTLIST_SSID]; // hotlist SSIDs } wifi_ssid_hotlist_params; -/* BSSID blacklist */ -typedef struct { - int num_bssid; // number of blacklisted BSSIDs - mac_addr bssids[MAX_BLACKLIST_BSSID]; // blacklisted BSSIDs -} wifi_bssid_params; - -/* Set the BSSID blacklist */ -wifi_error wifi_set_bssid_blacklist(wifi_request_id id, wifi_interface_handle iface, - wifi_bssid_params params); - /* Significant wifi change */ typedef struct { mac_addr bssid; // BSSID diff --git a/include/hardware_legacy/roam.h b/include/hardware_legacy/roam.h new file mode 100644 index 0000000..13e3cd3 --- /dev/null +++ b/include/hardware_legacy/roam.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __WIFI_HAL_ROAM_H__ +#define __WIFI_HAL_ROAM_H__ + +#include "wifi_hal.h" + +#define MAX_BLACKLIST_BSSID 16 +#define MAX_WHITELIST_SSID 8 +#define MAX_SSID_LENGTH 32 + +typedef struct { + u32 max_blacklist_size; + u32 max_whitelist_size; +} wifi_roaming_capabilities; + +typedef enum { + ROAMING_DISABLE, + ROAMING_ENABLE +} fw_roaming_state_t; + +typedef struct { + u32 length; + char ssid_str[MAX_SSID_LENGTH]; +} ssid_t; + +typedef struct { + u32 num_blacklist_bssid; // Number of bssids valid in blacklist_bssid[]. + mac_addr blacklist_bssid[MAX_BLACKLIST_BSSID]; // List of bssids which should not be considered + // for romaing by firmware/driver. + u32 num_whitelist_ssid; // Number of ssids valid in whitelist_ssid[]. + ssid_t whitelist_ssid[MAX_WHITELIST_SSID]; // List of ssids to which firmware/driver can + // consider to roam to. +} wifi_roaming_config; + +/* Get the chipset roaming capabilities. */ +wifi_error wifi_get_roaming_capabilities(wifi_interface_handle handle, + wifi_roaming_capabilities *caps); +/* Enable/disable firmware roaming */ +wifi_error wifi_enable_firmware_roaming(wifi_interface_handle handle, + fw_roaming_state_t state); + +/* Pass down the blacklist BSSID and whitelist SSID to firmware. */ +wifi_error wifi_configure_roaming(wifi_interface_handle handle, + wifi_roaming_config *roaming_config); + +#endif /* __WIFI_HAL_ROAM_H__ */ diff --git a/include/hardware_legacy/wifi_hal.h b/include/hardware_legacy/wifi_hal.h index c03df22..1bae825 100644 --- a/include/hardware_legacy/wifi_hal.h +++ b/include/hardware_legacy/wifi_hal.h @@ -57,7 +57,8 @@ typedef enum { WIFI_ERROR_INVALID_REQUEST_ID = -6, WIFI_ERROR_TIMED_OUT = -7, WIFI_ERROR_TOO_MANY_REQUESTS = -8, // Too many instances of this request - WIFI_ERROR_OUT_OF_MEMORY = -9 + WIFI_ERROR_OUT_OF_MEMORY = -9, + WIFI_ERROR_BUSY = -10, } wifi_error; typedef unsigned char byte; @@ -115,6 +116,9 @@ void wifi_get_error_info(wifi_error err, const char **msg); // return a pointer #define WIFI_FEATURE_MKEEP_ALIVE 0x100000 // WiFi mkeep_alive #define WIFI_FEATURE_CONFIG_NDO 0x200000 // ND offload configure #define WIFI_FEATURE_TX_TRANSMIT_POWER 0x400000 // Capture Tx transmit power levels +#define WIFI_FEATURE_CONTROL_ROAMING 0x800000 // Enable/Disable firmware roaming +#define WIFI_FEATURE_IE_WHITELIST 0x1000000 // Support Probe IE white listing +#define WIFI_FEATURE_SCAN_RAND 0x2000000 // Support MAC & Probe Sequence Number randomization // Add more features here @@ -215,6 +219,7 @@ typedef struct wlan_driver_wake_reason_cnt_t { #include "wifi_config.h" #include "wifi_nan.h" #include "wifi_offload.h" +#include "roam.h" //wifi HAL function pointer table typedef struct { @@ -292,8 +297,6 @@ typedef struct { 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); wifi_error (* wifi_reset_passpoint_list)(wifi_request_id id, wifi_interface_handle iface); - wifi_error (*wifi_set_bssid_blacklist)(wifi_request_id id, wifi_interface_handle iface, - wifi_bssid_params params); wifi_error (*wifi_set_lci) (wifi_request_id id, wifi_interface_handle iface, wifi_lci_information *lci); wifi_error (*wifi_set_lcr) (wifi_request_id id, wifi_interface_handle iface, @@ -392,6 +395,12 @@ typedef struct {     */ wifi_error (*wifi_set_packet_filter)(wifi_interface_handle handle, const u8 *program, u32 len); + wifi_error (*wifi_get_roaming_capabilities)(wifi_interface_handle handle, + wifi_roaming_capabilities *caps); + wifi_error (*wifi_enable_firmware_roaming)(wifi_interface_handle handle, + fw_roaming_state_t state); + wifi_error (*wifi_configure_roaming)(wifi_interface_handle handle, + wifi_roaming_config *roaming_config); } wifi_hal_fn; wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn); #ifdef __cplusplus -- 2.11.0