diff --git a/mlme/core/src/wlan_mlme_main.c b/mlme/core/src/wlan_mlme_main.c index 1ab1ffe471..66c7ea7b17 100644 --- a/mlme/core/src/wlan_mlme_main.c +++ b/mlme/core/src/wlan_mlme_main.c @@ -1835,6 +1835,14 @@ static void mlme_init_wps_params_cfg(struct wlan_objmgr_psoc *psoc, wps_params->wps_version = cfg_default(CFG_WPS_VERSION); } +static void mlme_init_btm_cfg(struct wlan_mlme_btm *btm) +{ + btm->btm_offload_config = cfg_default(CFG_BTM_ENABLE); + btm->btm_solicited_timeout = cfg_default(CFG_BTM_SOLICITED_TIMEOUT); + btm->btm_max_attempt_cnt = cfg_default(CFG_BTM_MAX_ATTEMPT_CNT); + btm->btm_sticky_time = cfg_default(CFG_BTM_STICKY_TIME); +} + QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc) { struct wlan_mlme_psoc_obj *mlme_obj; @@ -1877,6 +1885,7 @@ QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc) mlme_init_wep_cfg(&mlme_cfg->wep_params); mlme_init_wifi_pos_cfg(psoc, &mlme_cfg->wifi_pos_cfg); mlme_init_wps_params_cfg(psoc, &mlme_cfg->wps_params); + mlme_init_btm_cfg(&mlme_cfg->btm); return status; } diff --git a/mlme/dispatcher/inc/cfg_mlme.h b/mlme/dispatcher/inc/cfg_mlme.h index 8b8292bb64..9b428e188e 100644 --- a/mlme/dispatcher/inc/cfg_mlme.h +++ b/mlme/dispatcher/inc/cfg_mlme.h @@ -51,10 +51,12 @@ #include "cfg_mlme_feature_flag.h" #include "cfg_mlme_wep_params.h" #include "cfg_mlme_wifi_pos.h" +#include "cfg_mlme_btm.h" /* Please Maintain Alphabetic Order here */ #define CFG_MLME_ALL \ CFG_ACS_ALL \ + CFG_BTM_ALL \ CFG_CHAINMASK_ALL \ CFG_DFS_ALL \ CFG_EDCA_PARAMS_ALL \ diff --git a/mlme/dispatcher/inc/cfg_mlme_btm.h b/mlme/dispatcher/inc/cfg_mlme_btm.h new file mode 100644 index 0000000000..f49a7fcc2e --- /dev/null +++ b/mlme/dispatcher/inc/cfg_mlme_btm.h @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/** + * DOC: This file contains MLME BTM related CFG/INI Items. + */ + +#ifndef CFG_MLME_BTM_H_ +#define CFG_MLME_BTM_H_ + +/* + * + * btm_offload_config - Configure BTM + * @Min: 0x00000000 + * @Max: 0xFFFFFFFF + * @Default: 0x00000001 + * + * This ini is used to configure BTM + * + * Bit 0: Enable/Disable the BTM offload. Set this to 1 will + * enable and 0 will disable BTM offload. + * + * BIT 2, 1: Action on non matching candidate with cache. If a BTM request + * is received from AP then the candidate AP's may/may-not be present in + * the firmware scan cache . Based on below config firmware will decide + * whether to forward BTM frame to host or consume with firmware and proceed + * with Roaming to candidate AP. + * 00 scan and consume + * 01 no scan and forward to host + * 10, 11 reserved + * + * BIT 5, 4, 3: Roaming handoff decisions on multiple candidates match + * 000 match if exact BSSIDs are found + * 001 match if at least one top priority BSSID only + * 010, 011, 100, 101, 110, 111 reserved + * + * BIT 6: Set this to 1 will send BTM query frame and 0 not sent. + * + * BIT 7-31: Reserved + * + * Supported Feature: STA + * + * Usage: External + * + * + */ +#define CFG_BTM_ENABLE CFG_INI_UINT( \ + "btm_offload_config", \ + 0x00000000, \ + 0xffffffff, \ + 0x00000001, \ + CFG_VALUE_OR_DEFAULT, \ + "configure btm offload") + +/* + * + * btm_solicited_timeout - timeout value for waiting BTM request + * @Min: 1 + * @Max: 10000 + * @Default: 100 + * + * This ini is used to configure timeout value for waiting BTM request. + * Unit: millionsecond + * + * Supported Feature: STA + * + * Usage: External + * + * + */ +#define CFG_BTM_SOLICITED_TIMEOUT CFG_INI_UINT( \ + "btm_solicited_timeout", \ + 1, \ + 10000, \ + 100, \ + CFG_VALUE_OR_DEFAULT, \ + "configure timeout value for waiting BTM request") + +/* + * + * btm_max_attempt_cnt - Maximum attempt for sending BTM query to ESS + * @Min: 1 + * @Max: 0xFFFFFFFF + * @Default: 3 + * + * This ini is used to configure maximum attempt for sending BTM query to ESS. + * + * Supported Feature: STA + * + * Usage: External + * + * + */ +#define CFG_BTM_MAX_ATTEMPT_CNT CFG_INI_UINT( \ + "btm_max_attempt_cnt", \ + 1, \ + 0xFFFFFFFF, \ + 3, \ + CFG_VALUE_OR_DEFAULT, \ + "configure maximum attempt for sending BTM query to ESS") + +/* + * + * btm_sticky_time - Stick time after roaming to new AP by BTM + * @Min: 0 + * @Max: 0x0000FFFF + * @Default: 300 + * + * This ini is used to configure Stick time after roaming to new AP by BTM. + * Unit: seconds + * + * Supported Feature: STA + * + * Usage: External + * + * + */ +#define CFG_BTM_STICKY_TIME CFG_INI_UINT( \ + "btm_sticky_time", \ + 0, \ + 0x0000FFFF, \ + 300, \ + CFG_VALUE_OR_DEFAULT, \ + "configure Stick time after roaming to new AP by BTM") + +#define CFG_BTM_ALL \ + CFG(CFG_BTM_ENABLE) \ + CFG(CFG_BTM_SOLICITED_TIMEOUT) \ + CFG(CFG_BTM_MAX_ATTEMPT_CNT) \ + CFG(CFG_BTM_STICKY_TIME) + +#endif /* CFG_MLME_BTM_H_ */ diff --git a/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 65df894c29..d171c955f0 100644 --- a/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -1662,6 +1662,20 @@ struct wlan_mlme_wifi_pos_cfg { uint32_t fine_time_meas_cap; }; +/* + * struct wlan_mlme_btm - BTM related configs + * @btm_offload_config: configure btm offload + * @btm_solicited_timeout: configure timeout value for waiting BTM request + * @btm_max_attempt_cnt: configure maximum attempt for sending BTM query to ESS + * @btm_sticky_time: configure Stick time after roaming to new AP by BTM + */ +struct wlan_mlme_btm { + uint32_t btm_offload_config; + uint32_t btm_solicited_timeout; + uint32_t btm_max_attempt_cnt; + uint32_t btm_sticky_time; +}; + /** * struct wlan_mlme_cfg - MLME config items * @chainmask_cfg: VHT chainmask related cfg items @@ -1693,6 +1707,7 @@ struct wlan_mlme_wifi_pos_cfg { * @wifi_pos_cfg: WIFI POS config * @wmm_params: WMM related CFG & INI Items * @wps_params: WPS related CFG itmes + * @btm: BTM related CFG itmes */ struct wlan_mlme_cfg { struct wlan_mlme_chainmask chainmask_cfg; @@ -1726,6 +1741,7 @@ struct wlan_mlme_cfg { struct wlan_mlme_wifi_pos_cfg wifi_pos_cfg; struct wlan_mlme_wmm_params wmm_params; struct wlan_mlme_wps_params wps_params; + struct wlan_mlme_btm btm; }; #endif