• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 } fw_roaming_state_t;
35 
36 typedef struct {
37     u32 length;
38     char ssid_str[MAX_SSID_LENGTH];
39 } ssid_t;
40 
41 typedef struct {
42     u32 num_blacklist_bssid;                       // Number of bssids valid in blacklist_bssid[].
43     mac_addr blacklist_bssid[MAX_BLACKLIST_BSSID]; // List of bssids which should not be considered
44                                                    // for romaing by firmware/driver.
45     u32 num_whitelist_ssid;                        // Number of ssids valid in whitelist_ssid[].
46     ssid_t whitelist_ssid[MAX_WHITELIST_SSID];     // List of ssids to which firmware/driver can
47                                                    // consider to roam to.
48 } wifi_roaming_config;
49 
50 /* Get the chipset roaming capabilities. */
51 wifi_error wifi_get_roaming_capabilities(wifi_interface_handle handle,
52                                          wifi_roaming_capabilities *caps);
53 /* Enable/disable firmware roaming */
54 wifi_error wifi_enable_firmware_roaming(wifi_interface_handle handle,
55                                         fw_roaming_state_t state);
56 
57 /* Pass down the blacklist BSSID and whitelist SSID to firmware. */
58 wifi_error wifi_configure_roaming(wifi_interface_handle handle,
59                                   wifi_roaming_config *roaming_config);
60 
61 #endif /* __WIFI_HAL_ROAM_H__ */
62