summaryrefslogtreecommitdiff
path: root/include/hardware_legacy/roam.h
blob: dbfd54bed8a2d1c5b2345b054cd1095ee290083b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
 * 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,
    ROAMING_AGGRESSIVE
} 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__ */