diff --git a/mlme/dispatcher/inc/cfg_mlme.h b/mlme/dispatcher/inc/cfg_mlme.h index 5ec0d4243d..29f7aa591e 100644 --- a/mlme/dispatcher/inc/cfg_mlme.h +++ b/mlme/dispatcher/inc/cfg_mlme.h @@ -26,6 +26,7 @@ #include "cfg_mlme_chainmask.h" #include "cfg_mlme_edca_params.h" #include "cfg_mlme_generic.h" +#include "cfg_mlme_acs.h" #include "cfg_mlme_ht_caps.h" #include "cfg_mlme_he_caps.h" #include "cfg_mlme_lfr.h" @@ -46,6 +47,7 @@ /* Please Maintain Alphabetic Order here */ #define CFG_MLME_ALL \ + CFG_ACS_ALL \ CFG_CHAINMASK_ALL \ CFG_EDCA_PARAMS_ALL \ CFG_FEATURE_FLAG_ALL \ @@ -54,18 +56,18 @@ CFG_HE_CAPS_ALL \ CFG_LFR_ALL \ CFG_MBO_ALL \ + CFG_MLME_PRODUCT_DETAILS_ALL \ CFG_OBSS_HT40_ALL \ CFG_OCE_ALL \ CFG_QOS_ALL \ CFG_RATES_ALL \ CFG_SAP_ALL \ - CFG_MLME_PRODUCT_DETAILS_ALL \ CFG_SAP_PROTECTION_ALL \ CFG_SCORING_ALL \ CFG_STA_ALL \ - CFG_VHT_CAPS_ALL \ - CFG_WEP_PARAMS_ALL \ CFG_THRESHOLD_ALL \ - CFG_VHT_CAPS_ALL + CFG_VHT_CAPS_ALL \ + CFG_VHT_CAPS_ALL \ + CFG_WEP_PARAMS_ALL #endif /* __CFG_MLME_H */ diff --git a/mlme/dispatcher/inc/cfg_mlme_acs.h b/mlme/dispatcher/inc/cfg_mlme_acs.h new file mode 100644 index 0000000000..6c5c67ae83 --- /dev/null +++ b/mlme/dispatcher/inc/cfg_mlme_acs.h @@ -0,0 +1,165 @@ +/* + * 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 centralized definitions of converged configuration. + */ + +#ifndef __CFG_MLME_ACS_H +#define __CFG_MLME_ACS_H + +/* + * + * acs_with_more_param- Enable acs calculation with more param. + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to enable acs calculation with more param. + * + * Related: NA + * + * Supported Feature: ACS + * + * Usage: Internal/External + * + * + */ + +#define CFG_ACS_WITH_MORE_PARAM CFG_INI_BOOL( \ + "acs_with_more_param", \ + 0, \ + "Enable ACS with more param") + +/* + * + * AutoChannelSelectWeight - ACS channel weight + * @Min: 0 + * @Max: 0xFFFFFFFF + * @Default: 0x000000FF + * + * This ini is used to adjust weight of factors in + * acs algorithm. + * + * Supported Feature: ACS + * + * Usage: Internal/External + * + * bits 0-3: rssi weight + * bits 4-7: bss count weight + * bits 8-11: noise floor weight + * bits 12-15: channel free weight + * bits 16-19: tx power range weight + * bits 20-23: tx power throughput weight + * bits 24-31: reserved + * + * + */ + +#define CFG_AUTO_CHANNEL_SELECT_WEIGHT CFG_INI_UINT( \ + "AutoChannelSelectWeight", \ + 0, \ + 0xFFFFFFFF, \ + 0x000000FF, \ + CFG_VALUE_OR_DEFAULT, \ + "Adjust weight factor in ACS") + +/* + * + * gvendor_acs_support - vendor based channel selection manager + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * Enabling this parameter will force driver to use user application based + * channel selection algo instead of driver based auto channel selection + * logic. + * + * Supported Feature: ACS + * + * Usage: External/Internal + * + * + */ + +#define CFG_USER_AUTO_CHANNEL_SELECTION CFG_INI_BOOL( \ + "gvendor_acs_support", \ + 0, \ + "Vendor channel selection manager") + +/* + * + * gacs_support_for_dfs_lte_coex - acs support for lte coex and dfs event + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * Enabling this parameter will force driver to use user application based + * channel selection algo for channel selection in case of dfs and lte + * coex event. + * + * Supported Feature: ACS + * + * Usage: Internal + * + * + */ + +#define CFG_USER_ACS_DFS_LTE CFG_INI_BOOL( \ + "gacs_support_for_dfs_lte_coex", \ + 0, \ + "Acs support for lte coex and dfs") + +/* + * + * external_acs_policy - External ACS policy control + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * Values are per enum hdd_external_acs_policy. + * + * This ini is used to control the external ACS policy. + * + * 0 -Preferable for ACS to select a + * channel with non-zero pcl weight. + * 1 -Mandatory for ACS to select a + * channel with non-zero pcl weight. + * + * Related: None + * + * Supported Feature: ACS + * + * Usage: Internal/External + * + * + */ + +#define CFG_EXTERNAL_ACS_POLICY CFG_INI_BOOL( \ + "acs_policy", \ + 0, \ + "External ACS Policy Control") + +#define CFG_ACS_ALL \ + CFG(CFG_ACS_WITH_MORE_PARAM) \ + CFG(CFG_AUTO_CHANNEL_SELECT_WEIGHT) \ + CFG(CFG_USER_AUTO_CHANNEL_SELECTION) \ + CFG(CFG_USER_ACS_DFS_LTE) \ + CFG(CFG_EXTERNAL_ACS_POLICY) + +#endif /* __CFG_MLME_ACS_H */ diff --git a/mlme/dispatcher/inc/wlan_mlme_api.h b/mlme/dispatcher/inc/wlan_mlme_api.h index 9cacb52904..e58f1615bc 100644 --- a/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/mlme/dispatcher/inc/wlan_mlme_api.h @@ -177,6 +177,61 @@ QDF_STATUS wlan_mlme_set_ht_cap_info(struct wlan_objmgr_psoc *psoc, struct mlme_ht_capabilities_info ht_cap_info); +/** + * wlan_mlme_get_acs_with_more_param() - Get the acs_with_more_param flag + * @psoc: pointer to psoc object + * @value: Value that needs to be set from the caller + * + * Return: QDF Status + */ +QDF_STATUS wlan_mlme_get_acs_with_more_param(struct wlan_objmgr_psoc *psoc, + bool *value); + +/** + * wlan_mlme_get_auto_channel_weight() - Get the auto channel weight + * @psoc: pointer to psoc object + * @value: Value that needs to be set from the caller + * + * Return: QDF Status + */ +QDF_STATUS wlan_mlme_get_auto_channel_weight(struct wlan_objmgr_psoc *psoc, + uint32_t *value); + +/** + * wlan_mlme_get_vendor_acs_support() - Get the vendor based channel selece + * @psoc: pointer to psoc object + * @value: Value that needs to be set from the caller + * + * Return: QDF Status + */ + +QDF_STATUS wlan_mlme_get_vendor_acs_support(struct wlan_objmgr_psoc *psoc, + bool *value); + +/** + * wlan_mlme_get_acs_support_for_dfs_ltecoex() - Get the flag for + * acs support for dfs ltecoex + * @psoc: pointer to psoc object + * @value: Value that needs to be set from the caller + * + * Return: QDF Status + */ +QDF_STATUS +wlan_mlme_get_acs_support_for_dfs_ltecoex(struct wlan_objmgr_psoc *psoc, + bool *value); + +/** + * wlan_mlme_get_external_acs_policy() - Get the flag for external acs policy + * + * @psoc: pointer to psoc object + * @value: Value that needs to be set from the caller + * + * Return: QDF Status + */ +QDF_STATUS +wlan_mlme_get_external_acs_policy(struct wlan_objmgr_psoc *psoc, + bool *value); + /** * * wlan_mlme_get_sap_inactivity_override() - Check if sap max inactivity diff --git a/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/mlme/dispatcher/inc/wlan_mlme_public_struct.h index acb2295575..a21cca095e 100644 --- a/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -551,6 +551,22 @@ struct wlan_mlme_product_details_cfg { char manufacture_product_version[WLAN_CFG_MFR_PRODUCT_VERSION_LEN + 1]; }; +/* + * struct wlan_mlme_acs - All acs related cfg items + * @is_acs_with_more_param - to enable acs with more param + * @auto_channel_select_weight - to set acs channel weight + * @is_vendor_acs_support - enable application based channel selection + * @is_acs_support_for_dfs_ltecoex - enable channel for dfs and lte coex + * @is_external_acs_policy - control external policy + */ +struct wlan_mlme_acs { + bool is_acs_with_more_param; + uint32_t auto_channel_select_weight; + bool is_vendor_acs_support; + bool is_acs_support_for_dfs_ltecoex; + bool is_external_acs_policy; +}; + /** * struct wlan_mlme_obss_ht40 - OBSS HT40 config items * @active_dwelltime: obss active dwelltime @@ -887,10 +903,13 @@ struct wlan_mlme_wep_cfg { * @he_caps: HE related cfg items * @lfr: LFR related CFG Items * @obss_ht40:obss ht40 CFG Items - * @vht_cfg: VHT related CFG Items + * @mbo_cfg: Multiband Operation related CFG items + * @vht_caps: VHT related CFG Items * @rates: Rates related cfg items * @product_details: product details related CFG Items * @sap_protection_cfg: SAP erp protection related CFG items + * @acs: ACS related CFG items + * @sap_cfg: sap CFG items * @sta: sta CFG Items * @scoring: BSS Scoring related CFG Items * @threshold: threshold related cfg items @@ -916,6 +935,7 @@ struct wlan_mlme_cfg { struct wlan_mlme_scoring_cfg scoring; struct wlan_mlme_oce oce; struct wlan_mlme_threshold threshold; + struct wlan_mlme_acs acs; struct wlan_mlme_feature_flag feature_flags; struct wlan_mlme_wep_cfg wep_params; }; diff --git a/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index 74cc451d91..6d57c2c16c 100644 --- a/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -149,6 +149,91 @@ QDF_STATUS ucfg_mlme_set_ht_cap_info(struct wlan_objmgr_psoc *psoc, return wlan_mlme_set_ht_cap_info(psoc, ht_cap_info); } +/** + * ucfg_mlme_get_acs_with_more_param() - Get the flag for acs with + * more param + * @psoc: pointer to psoc object + * @value: Value that needs to be set from the caller + * + * Inline UCFG API to be used by HDD/OSIF callers + * + * Return: QDF Status + */ +static inline +QDF_STATUS ucfg_mlme_get_acs_with_more_param(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + return wlan_mlme_get_acs_with_more_param(psoc, value); +} + +/** + * ucfg_mlme_get_auto_channel_weight() - Get the auto channel select weight + * + * @psoc: pointer to psoc object + * @value: Value that needs to be set from the caller + * + * Inline UCFG API to be used by HDD/OSIF callers + * + * Return: QDF Status + */ +static inline +QDF_STATUS ucfg_mlme_get_auto_channel_weight(struct wlan_objmgr_psoc *psoc, + uint32_t *value) +{ + return wlan_mlme_get_auto_channel_weight(psoc, value); +} + +/** + * ucfg_mlme_get_vendor_acs_support() - Get the flag for + * vendor acs support + * @psoc: pointer to psoc object + * @value: Value that needs to be set from the caller + * + * Inline UCFG API to be used by HDD/OSIF callers + * + * Return: QDF Status + */ +static inline +QDF_STATUS ucfg_mlme_get_vendor_acs_support(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + return wlan_mlme_get_vendor_acs_support(psoc, value); +} + +/** + * ucfg_mlme_get_external_acs_policy() - Get flag for external control + * acs policy + * @psoc: pointer to psoc object + * @value: Value that needs to be set from the caller + * + * Inline UCFG API to be used by HDD/OSIF callers + * + * Return: QDF Status + */ +static inline QDF_STATUS +ucfg_mlme_get_external_acs_policy(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + return wlan_mlme_get_external_acs_policy(psoc, value); +} + +/** + * ucfg_mlme_set_ht_cap_info() - Set the HT cap info config + * @psoc: pointer to psoc object + * @value: Value that needs to be set from the caller + * + * Inline UCFG API to be used by HDD/OSIF callers + * + * Return: QDF Status + */ +static inline +QDF_STATUS +ucfg_mlme_get_acs_support_for_dfs_ltecoex(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + return wlan_mlme_get_acs_support_for_dfs_ltecoex(psoc, value); +} + /** * * ucfg_mlme_get_sap_inactivity_override() - Check if sap max inactivity diff --git a/mlme/dispatcher/src/wlan_mlme_api.c b/mlme/dispatcher/src/wlan_mlme_api.c index 29aa9f8111..d9ca187f75 100644 --- a/mlme/dispatcher/src/wlan_mlme_api.c +++ b/mlme/dispatcher/src/wlan_mlme_api.c @@ -103,6 +103,78 @@ void wlan_mlme_get_sap_inactivity_override(struct wlan_objmgr_psoc *psoc, *val = mlme_obj->cfg.qos_mlme_params.sap_max_inactivity_override; } +QDF_STATUS wlan_mlme_get_acs_with_more_param(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + struct wlan_mlme_psoc_obj *mlme_obj = mlme_get_psoc_obj(psoc); + + if (!mlme_obj) { + mlme_err("Failed to get MLME Obj"); + return QDF_STATUS_E_FAILURE; + } + + *value = mlme_obj->cfg.acs.is_acs_with_more_param; + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS wlan_mlme_get_auto_channel_weight(struct wlan_objmgr_psoc *psoc, + uint32_t *value) +{ + struct wlan_mlme_psoc_obj *mlme_obj = mlme_get_psoc_obj(psoc); + + if (!mlme_obj) { + mlme_err("Failed to get MLME Obj"); + return QDF_STATUS_E_FAILURE; + } + + *value = mlme_obj->cfg.acs.auto_channel_select_weight; + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS wlan_mlme_get_vendor_acs_support(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + struct wlan_mlme_psoc_obj *mlme_obj = mlme_get_psoc_obj(psoc); + + if (!mlme_obj) { + mlme_err("Failed to get MLME Obj"); + return QDF_STATUS_E_FAILURE; + } + + *value = mlme_obj->cfg.acs.is_vendor_acs_support; + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +wlan_mlme_get_acs_support_for_dfs_ltecoex(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + struct wlan_mlme_psoc_obj *mlme_obj = mlme_get_psoc_obj(psoc); + + if (!mlme_obj) { + mlme_err("Failed to get MLME Obj"); + return QDF_STATUS_E_FAILURE; + } + + *value = mlme_obj->cfg.acs.is_acs_support_for_dfs_ltecoex; + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS +wlan_mlme_get_external_acs_policy(struct wlan_objmgr_psoc *psoc, + bool *value) +{ + struct wlan_mlme_psoc_obj *mlme_obj = mlme_get_psoc_obj(psoc); + + if (!mlme_obj) { + mlme_err("Failed to get MLME Obj"); + return QDF_STATUS_E_FAILURE; + } + + *value = mlme_obj->cfg.acs.is_external_acs_policy; + return QDF_STATUS_SUCCESS; +} + QDF_STATUS wlan_mlme_get_tx_chainmask_cck(struct wlan_objmgr_psoc *psoc, bool *value) {