diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index 7457641f8d..15cf920119 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -80,6 +80,40 @@ out: return status; } +static void mlme_init_chainmask_cfg(struct wlan_objmgr_psoc *psoc, + struct wlan_mlme_chainmask *chainmask_info) +{ + chainmask_info->txchainmask1x1 = + cfg_get(psoc, CFG_VHT_ENABLE_1x1_TX_CHAINMASK); + + chainmask_info->rxchainmask1x1 = + cfg_get(psoc, CFG_VHT_ENABLE_1x1_RX_CHAINMASK); + + chainmask_info->tx_chain_mask_cck = + cfg_get(psoc, CFG_TX_CHAIN_MASK_CCK); + + chainmask_info->tx_chain_mask_1ss = + cfg_get(psoc, CFG_TX_CHAIN_MASK_1SS); + + chainmask_info->num_11b_tx_chains = + cfg_get(psoc, CFG_11B_NUM_TX_CHAIN); + + chainmask_info->num_11ag_tx_chains = + cfg_get(psoc, CFG_11AG_NUM_TX_CHAIN); + + chainmask_info->tx_chain_mask_2g = + cfg_get(psoc, CFG_TX_CHAIN_MASK_2G); + + chainmask_info->rx_chain_mask_2g = + cfg_get(psoc, CFG_RX_CHAIN_MASK_2G); + + chainmask_info->tx_chain_mask_5g = + cfg_get(psoc, CFG_TX_CHAIN_MASK_5G); + + chainmask_info->rx_chain_mask_5g = + cfg_get(psoc, CFG_RX_CHAIN_MASK_5G); +} + static void mlme_update_ht_cap_in_cfg(struct wlan_objmgr_psoc *psoc, struct mlme_ht_capabilities_info *ht_cap_info) @@ -145,6 +179,7 @@ QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc) mlme_update_ht_cap_in_cfg(psoc, &mlme_cfg->ht_caps.ht_cap_info); mlme_update_rates_in_cfg(psoc, &mlme_cfg->rates); mlme_update_sap_protection_cfg(psoc, &mlme_cfg->sap_protection_cfg); + mlme_init_chainmask_cfg(psoc, &mlme_cfg->chainmask_cfg); return status; } diff --git a/components/mlme/dispatcher/inc/cfg_mlme.h b/components/mlme/dispatcher/inc/cfg_mlme.h index 41fed81d6b..f876a92a21 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme.h +++ b/components/mlme/dispatcher/inc/cfg_mlme.h @@ -23,16 +23,17 @@ #include "cfg_converged.h" #include "qdf_types.h" +#include "cfg_mlme_chainmask.h" #include "cfg_mlme_ht_caps.h" #include "cfg_mlme_vht_caps.h" #include "cfg_mlme_rates.h" #include "cfg_sap_protection.h" #define CFG_MLME_ALL \ + CFG_CHAINMASK_ALL \ CFG_HT_CAPS_ALL \ CFG_VHT_CAPS_ALL \ CFG_RATES_ALL \ CFG_SAP_PROTECTION_ALL #endif /* __CFG_MLME_H */ - diff --git a/components/mlme/dispatcher/inc/cfg_mlme_chainmask.h b/components/mlme/dispatcher/inc/cfg_mlme_chainmask.h new file mode 100644 index 0000000000..21d8c96bd4 --- /dev/null +++ b/components/mlme/dispatcher/inc/cfg_mlme_chainmask.h @@ -0,0 +1,333 @@ +/* + * 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_CHAINMASK_H +#define __CFG_CHAINMASK_H + +/* + * + * gSetTxChainmask1x1 - Sets Transmit chain mask. + * @Min: 1 + * @Max: 3 + * @Default: 0 + * + * This ini Sets Transmit chain mask. + * + * If gEnable2x2 is disabled, gSetTxChainmask1x1 and gSetRxChainmask1x1 values + * are taken into account. If chainmask value exceeds the maximum number of + * chains supported by target, the max number of chains is used. By default, + * chain0 is selected for both Tx and Rx. + * gSetTxChainmask1x1=1 or gSetRxChainmask1x1=1 to select chain0. + * gSetTxChainmask1x1=2 or gSetRxChainmask1x1=2 to select chain1. + * gSetTxChainmask1x1=3 or gSetRxChainmask1x1=3 to select both chains. + * + * Supported Feature: 11AC + * + * Usage: External + * + * + */ +#define CFG_VHT_ENABLE_1x1_TX_CHAINMASK CFG_INI_UINT( \ + "gSetTxChainmask1x1", \ + 0, \ + 3, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "1x1 VHT Tx Chainmask") + +/* + * + * gSetRxChainmask1x1 - Sets Receive chain mask. + * @Min: 1 + * @Max: 3 + * @Default: 0 + * + * This ini is used to set Receive chain mask. + * + * If gEnable2x2 is disabled, gSetTxChainmask1x1 and gSetRxChainmask1x1 values + * are taken into account. If chainmask value exceeds the maximum number of + * chains supported by target, the max number of chains is used. By default, + * chain0 is selected for both Tx and Rx. + * gSetTxChainmask1x1=1 or gSetRxChainmask1x1=1 to select chain0. + * gSetTxChainmask1x1=2 or gSetRxChainmask1x1=2 to select chain1. + * gSetTxChainmask1x1=3 or gSetRxChainmask1x1=3 to select both chains. + * + * Supported Feature: 11AC + * + * Usage: External + * + * + */ +#define CFG_VHT_ENABLE_1x1_RX_CHAINMASK CFG_INI_UINT( \ + "gSetRxChainmask1x1", \ + 0, \ + 3, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "1x1 VHT Rx Chainmask") + +/* + * + * gCckChainMaskEnable - Used to enable/disable Cck ChainMask + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to set default Cck ChainMask + * 0: disable the cck tx chain mask (default) + * 1: enable the cck tx chain mask + * + * Related: None + * + * Supported Feature: STA + * + * Usage: Internal/External + * + * + */ +#define CFG_TX_CHAIN_MASK_CCK CFG_INI_BOOL( \ + "gCckChainMaskEnable", \ + 0, \ + "Set default CCK Tx Chainmask") + +/* + * + * gTxChainMask1ss - Enables/disables tx chain Mask1ss + * @Min: 0 + * @Max: 3 + * @Default: 1 + * + * This ini is used to set default tx chain Mask1ss + * + * Related: None + * + * Supported Feature: STA + * + * Usage: Internal/External + * + * + */ +#define CFG_TX_CHAIN_MASK_1SS CFG_INI_UINT( \ + "gTxChainMask1ss", \ + 0, \ + 3, \ + 1, \ + CFG_VALUE_OR_DEFAULT, \ + "1SS Tx Chainmask") + +/* + * + * g11bNumTxChains - Number of Tx Chanins in 11b mode + * @Min: 0 + * @Max: 2 + * @Default: 0 + * + * Number of Tx Chanins in 11b mode + * + * + * Related: None + * + * Supported Feature: connection + * + * Usage: External + * + * + */ +#define CFG_11B_NUM_TX_CHAIN CFG_INI_UINT( \ + "g11bNumTxChains", \ + 0, \ + 2, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "11b Num Tx chains") + +/* + * + * g11agNumTxChains - Number of Tx Chanins in 11ag mode + * @Min: 0 + * @Max: 2 + * @Default: 0 + * + * Number of Tx Chanins in 11ag mode + * + * + * Related: None + * + * Supported Feature: connection + * + * Usage: External + * + * + */ +#define CFG_11AG_NUM_TX_CHAIN CFG_INI_UINT( \ + "g11agNumTxChains", \ + 0, \ + 2, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "11ag Num Tx chains") + +/* + * + * tx_chain_mask_2g - tx chain mask for 2g + * @Min: 0 + * @Max: 3 + * @Default: 0 + * + * This ini will set tx chain mask for 2g. To use the ini, make sure: + * gSetTxChainmask1x1/gSetRxChainmask1x1 = 0, + * gDualMacFeatureDisable = 1 + * gEnable2x2 = 0 + * + * tx_chain_mask_2g=0 : don't care + * tx_chain_mask_2g=1 : for 2g tx use chain 0 + * tx_chain_mask_2g=2 : for 2g tx use chain 1 + * tx_chain_mask_2g=3 : for 2g tx can use either chain + * + * Related: None + * + * Supported Feature: All profiles + * + * Usage: External + * + * + */ +#define CFG_TX_CHAIN_MASK_2G CFG_INI_UINT( \ + "tx_chain_mask_2g", \ + 0, \ + 3, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "2.4G Tx Chainmask") + +/* + * + * rx_chain_mask_2g - rx chain mask for 2g + * @Min: 0 + * @Max: 3 + * @Default: 0 + * + * This ini will set rx chain mask for 2g. To use the ini, make sure: + * gSetTxChainmask1x1/gSetRxChainmask1x1 = 0, + * gDualMacFeatureDisable = 1 + * gEnable2x2 = 0 + * + * rx_chain_mask_2g=0 : don't care + * rx_chain_mask_2g=1 : for 2g rx use chain 0 + * rx_chain_mask_2g=2 : for 2g rx use chain 1 + * rx_chain_mask_2g=3 : for 2g rx can use either chain + * + * Related: None + * + * Supported Feature: All profiles + * + * Usage: External + * + * + */ +#define CFG_RX_CHAIN_MASK_2G CFG_INI_UINT( \ + "rx_chain_mask_2g", \ + 0, \ + 3, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "2.4G Rx Chainmask") + +/* + * + * tx_chain_mask_5g - tx chain mask for 5g + * @Min: 0 + * @Max: 3 + * @Default: 0 + * + * This ini will set tx chain mask for 5g. To use the ini, make sure: + * gSetTxChainmask1x1/gSetRxChainmask1x1 = 0, + * gDualMacFeatureDisable = 1 + * gEnable2x2 = 0 + * + * tx_chain_mask_5g=0 : don't care + * tx_chain_mask_5g=1 : for 5g tx use chain 0 + * tx_chain_mask_5g=2 : for 5g tx use chain 1 + * tx_chain_mask_5g=3 : for 5g tx can use either chain + * + * Related: None + * + * Supported Feature: All profiles + * + * Usage: External + * + * + */ +#define CFG_TX_CHAIN_MASK_5G CFG_INI_UINT( \ + "tx_chain_mask_5g", \ + 0, \ + 3, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "5Ghz Tx Chainmask") + +/* + * + * rx_chain_mask_5g - rx chain mask for 5g + * @Min: 0 + * @Max: 3 + * @Default: 0 + * + * This ini will set rx chain mask for 5g. To use the ini, make sure: + * gSetTxChainmask1x1/gSetRxChainmask1x1 = 0, + * gDualMacFeatureDisable = 1 + * gEnable2x2 = 0 + * + * rx_chain_mask_5g=0 : don't care + * rx_chain_mask_5g=1 : for 5g rx use chain 0 + * rx_chain_mask_5g=2 : for 5g rx use chain 1 + * rx_chain_mask_5g=3 : for 5g rx can use either chain + * + * Related: None + * + * Supported Feature: All profiles + * + * Usage: External + * + * + */ +#define CFG_RX_CHAIN_MASK_5G CFG_INI_UINT( \ + "rx_chain_mask_5g", \ + 0, \ + 3, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "5Ghz Tx Chainmask") + +#define CFG_CHAINMASK_ALL \ + CFG(CFG_VHT_ENABLE_1x1_TX_CHAINMASK) \ + CFG(CFG_VHT_ENABLE_1x1_RX_CHAINMASK) \ + CFG(CFG_TX_CHAIN_MASK_CCK) \ + CFG(CFG_TX_CHAIN_MASK_1SS) \ + CFG(CFG_11B_NUM_TX_CHAIN) \ + CFG(CFG_11AG_NUM_TX_CHAIN) \ + CFG(CFG_TX_CHAIN_MASK_2G) \ + CFG(CFG_RX_CHAIN_MASK_2G) \ + CFG(CFG_TX_CHAIN_MASK_5G) \ + CFG(CFG_RX_CHAIN_MASK_5G) + +#endif /* __CFG_CHAINMASK_H */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index d10e7cf09c..318542da0e 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -123,6 +123,33 @@ struct wlan_mlme_sap_protection { bool ignore_peer_ht_mode; }; +/* + * struct wlan_mlme_chainmask - All chainmask related cfg items + * + * @txchainmask1x1 - to set transmit chainmask + * @rxchainmask1x1 - to set rx chainmask + * @tx_chain_mask_cck - Used to enable/disable Cck ChainMask + * @tx_chain_mask_1ss - Enables/disables tx chain Mask1ss + * @num_11b_tx_chains - Number of Tx Chains in 11b mode + * @num_11ag_tx_chains - Number of Tx Chains in 11ag mode + * @tx_chain_mask_2g - tx chain mask for 2g + * @rx_chain_mask_2g - rx chain mask for 2g + * @tx_chain_mask_5g - tx chain mask for 5g + * @rx_chain_mask_5g - rx chain mask for 5g + */ +struct wlan_mlme_chainmask { + uint8_t txchainmask1x1; + uint8_t rxchainmask1x1; + bool tx_chain_mask_cck; + uint8_t tx_chain_mask_1ss; + uint16_t num_11b_tx_chains; + uint16_t num_11ag_tx_chains; + uint8_t tx_chain_mask_2g; + uint8_t rx_chain_mask_2g; + uint8_t tx_chain_mask_5g; + uint8_t rx_chain_mask_5g; +}; + /** * struct wlan_mlme_cfg - MLME config items * @ht_cfg: HT related CFG Items @@ -135,6 +162,7 @@ struct wlan_mlme_cfg { struct wlan_mlme_vht_caps vht_caps; struct wlan_mlme_rates rates; struct wlan_mlme_sap_protection sap_protection_cfg; + struct wlan_mlme_chainmask chainmask_cfg; }; #endif