blob: 3369e3e3e0eda7832b00f24ab7f0a7c168db6eb3 [file] [log] [blame]
Nate Jiang7a7fd842022-12-06 17:11:13 -08001/*
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
26typedef struct {
27 u32 max_blacklist_size;
28 u32 max_whitelist_size;
29} wifi_roaming_capabilities;
30
31typedef enum { ROAMING_DISABLE, ROAMING_ENABLE } fw_roaming_state_t;
32
33typedef struct {
34 u32 length;
35 char ssid_str[MAX_SSID_LENGTH];
36} ssid_t;
37
38typedef struct {
39 u32 num_blacklist_bssid; // Number of bssids valid in blacklist_bssid[].
40 mac_addr blacklist_bssid[MAX_BLACKLIST_BSSID]; // List of bssids which should not be considered
41 // for romaing by firmware/driver.
42 u32 num_whitelist_ssid; // Number of ssids valid in whitelist_ssid[].
43 ssid_t whitelist_ssid[MAX_WHITELIST_SSID]; // List of ssids to which firmware/driver can
44 // consider to roam to.
45} wifi_roaming_config;
46
47/* Get the chipset roaming capabilities. */
48wifi_error wifi_get_roaming_capabilities(wifi_interface_handle handle,
49 wifi_roaming_capabilities* caps);
50/* Enable/disable firmware roaming */
51wifi_error wifi_enable_firmware_roaming(wifi_interface_handle handle, fw_roaming_state_t state);
52
53/* Pass down the blacklist BSSID and whitelist SSID to firmware. */
54wifi_error wifi_configure_roaming(wifi_interface_handle handle,
55 wifi_roaming_config* roaming_config);
56
57#endif /* __WIFI_HAL_ROAM_H__ */