1 /* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef __WIFI_HAL_ROAM_H__ 18 #define __WIFI_HAL_ROAM_H__ 19 20 #include "wifi_hal.h" 21 22 #define MAX_BLACKLIST_BSSID 16 23 #define MAX_WHITELIST_SSID 8 24 #define MAX_SSID_LENGTH 32 25 26 typedef struct { 27 u32 max_blacklist_size; 28 u32 max_whitelist_size; 29 } wifi_roaming_capabilities; 30 31 typedef enum { 32 ROAMING_DISABLE, 33 ROAMING_ENABLE, 34 ROAMING_AGGRESSIVE 35 } fw_roaming_state_t; 36 37 typedef struct { 38 u32 length; 39 char ssid_str[MAX_SSID_LENGTH]; 40 } ssid_t; 41 42 typedef struct { 43 u32 num_blacklist_bssid; // Number of bssids valid in blacklist_bssid[]. 44 mac_addr blacklist_bssid[MAX_BLACKLIST_BSSID]; // List of bssids which should not be considered 45 // for romaing by firmware/driver. 46 u32 num_whitelist_ssid; // Number of ssids valid in whitelist_ssid[]. 47 ssid_t whitelist_ssid[MAX_WHITELIST_SSID]; // List of ssids to which firmware/driver can 48 // consider to roam to. 49 } wifi_roaming_config; 50 51 /* Get the chipset roaming capabilities. */ 52 wifi_error wifi_get_roaming_capabilities(wifi_interface_handle handle, 53 wifi_roaming_capabilities *caps); 54 /* Enable/disable firmware roaming */ 55 wifi_error wifi_enable_firmware_roaming(wifi_interface_handle handle, 56 fw_roaming_state_t state); 57 58 /* Pass down the blacklist BSSID and whitelist SSID to firmware. */ 59 wifi_error wifi_configure_roaming(wifi_interface_handle handle, 60 wifi_roaming_config *roaming_config); 61 62 #endif /* __WIFI_HAL_ROAM_H__ */ 63