From ddc89e5f4179666c22feea220cbe4e8cd4e5128a Mon Sep 17 00:00:00 2001 From: Vignesh Viswanathan Date: Fri, 2 Nov 2018 18:43:42 +0530 Subject: [PATCH] qcacld-3.0: Add additional HT Caps related INI Items to MLME CFG Add the following HT Caps related INI/CFG items to MLME component. gShortPreamble, CFG_HT_AMPDU_PARAMS, CFG_EXT_HT_CAP_INFO, CFG_HT_INFO_FIELD, gEnableAMPDUPS and gMaxAmsduNum. Change-Id: I019961016a2f0e39c7c62066c04788d3bd3d37e7 CRs-Fixed: 2318579 --- components/mlme/core/src/wlan_mlme_main.c | 66 +++++- .../mlme/dispatcher/inc/cfg_mlme_ht_caps.h | 210 +++++++++++++++++- .../mlme/dispatcher/inc/wlan_mlme_api.h | 40 ++++ .../dispatcher/inc/wlan_mlme_public_struct.h | 149 +++++++++++++ .../mlme/dispatcher/inc/wlan_mlme_ucfg_api.h | 56 +++++ .../mlme/dispatcher/src/wlan_mlme_api.c | 74 ++++++ core/hdd/inc/wlan_hdd_cfg.h | 99 --------- core/hdd/src/wlan_hdd_cfg.c | 68 ------ core/hdd/src/wlan_hdd_main.c | 33 +-- core/hdd/src/wlan_hdd_wext.c | 6 +- core/mac/inc/sir_mac_prot_def.h | 55 ----- core/mac/src/cfg/cfg_api.c | 10 +- core/mac/src/pe/lim/lim_api.c | 71 +----- core/mac/src/pe/lim/lim_assoc_utils.c | 10 +- core/mac/src/pe/lim/lim_process_cfg_updates.c | 88 +------- .../src/pe/lim/lim_process_message_queue.c | 73 ++---- .../src/pe/lim/lim_process_mlm_req_messages.c | 6 +- core/mac/src/pe/lim/lim_types.h | 3 - core/mac/src/pe/lim/lim_utils.c | 78 ++----- .../src/sys/legacy/src/utils/src/parser_api.c | 145 +++--------- core/sme/inc/csr_api.h | 4 - core/sme/inc/csr_internal.h | 3 - core/sme/src/common/sme_api.c | 4 +- core/sme/src/csr/csr_api_roam.c | 15 +- core/wma/src/wma_scan_roam.c | 43 +--- 25 files changed, 724 insertions(+), 685 deletions(-) diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index 4bf374ecd2..ff45c8f79c 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -438,21 +438,69 @@ static void mlme_init_ht_cap_in_cfg(struct wlan_objmgr_psoc *psoc, { union { uint16_t val_16; - struct mlme_ht_capabilities_info default_ht_cap_info; - } u; + struct mlme_ht_capabilities_info ht_cap_info; + } u1; - u.val_16 = (uint16_t)cfg_default(CFG_HT_CAP_INFO); + union { + uint16_t val_16; + struct mlme_ht_ext_cap_info ext_cap_info; + } u2; - u.default_ht_cap_info.adv_coding_cap = + union { + uint8_t val_8; + struct mlme_ht_info_field_1 info_field_1; + } u3; + + union { + uint16_t val_16; + struct mlme_ht_info_field_2 info_field_2; + } u4; + + union { + uint16_t val_16; + struct mlme_ht_info_field_3 info_field_3; + } u5; + + /* HT Capabilities - HT Caps Info Field */ + u1.val_16 = (uint16_t)cfg_default(CFG_HT_CAP_INFO); + u1.ht_cap_info.adv_coding_cap = cfg_get(psoc, CFG_RX_LDPC_ENABLE); - u.default_ht_cap_info.rx_stbc = cfg_get(psoc, CFG_RX_STBC_ENABLE); - u.default_ht_cap_info.tx_stbc = cfg_get(psoc, CFG_TX_STBC_ENABLE); - u.default_ht_cap_info.short_gi_20_mhz = + u1.ht_cap_info.rx_stbc = cfg_get(psoc, CFG_RX_STBC_ENABLE); + u1.ht_cap_info.tx_stbc = cfg_get(psoc, CFG_TX_STBC_ENABLE); + u1.ht_cap_info.short_gi_20_mhz = cfg_get(psoc, CFG_SHORT_GI_20MHZ); - u.default_ht_cap_info.short_gi_40_mhz = + u1.ht_cap_info.short_gi_40_mhz = cfg_get(psoc, CFG_SHORT_GI_40MHZ); + ht_caps->ht_cap_info = u1.ht_cap_info; - ht_caps->ht_cap_info = u.default_ht_cap_info; + /* HT Capapabilties - AMPDU Params */ + ht_caps->ampdu_params.max_rx_ampdu_factor = + cfg_get(psoc, CFG_MAX_RX_AMPDU_FACTOR); + ht_caps->ampdu_params.mpdu_density = + cfg_get(psoc, CFG_MPDU_DENSITY); + ht_caps->ampdu_params.reserved = 0; + + /* HT Capabilities - Extended Capabilities field */ + u2.val_16 = (uint16_t)cfg_default(CFG_EXT_HT_CAP_INFO); + ht_caps->ext_cap_info = u2.ext_cap_info; + + /* HT Operation - Information subset 1 of 3 */ + u3.val_8 = (uint8_t)cfg_default(CFG_HT_INFO_FIELD_1); + ht_caps->info_field_1 = u3.info_field_1; + + /* HT Operation - Information subset 2 of 3 */ + u4.val_16 = (uint16_t)cfg_default(CFG_HT_INFO_FIELD_2); + ht_caps->info_field_2 = u4.info_field_2; + + /* HT Operation - Information subset 3 of 3 */ + u5.val_16 = (uint16_t)cfg_default(CFG_HT_INFO_FIELD_3); + ht_caps->info_field_3 = u5.info_field_3; + + ht_caps->short_preamble = cfg_get(psoc, CFG_SHORT_PREAMBLE); + ht_caps->enable_ampdu_ps = cfg_get(psoc, CFG_ENABLE_AMPDUPS); + ht_caps->enable_smps = cfg_get(psoc, CFG_ENABLE_HT_SMPS); + ht_caps->smps = cfg_get(psoc, CFG_HT_SMPS_MODE); + ht_caps->max_num_amsdu = cfg_get(psoc, CFG_MAX_AMSDU_NUM); } static void mlme_init_qos_cfg(struct wlan_objmgr_psoc *psoc, diff --git a/components/mlme/dispatcher/inc/cfg_mlme_ht_caps.h b/components/mlme/dispatcher/inc/cfg_mlme_ht_caps.h index a8a1cdf6e6..f5680c37a6 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_ht_caps.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_ht_caps.h @@ -173,6 +173,203 @@ CFG_VALUE_OR_DEFAULT, \ "HT cap info") +/* + * + * gShortPreamble - Set Short Preamble + * @Min: 0 + * @Max: 1 + * @Default: 1 + * + * This ini is used to set default short Preamble + * + * Related: None + * + * Supported Feature: STA + * + * Usage: Internal/External + * + * + */ +#define CFG_SHORT_PREAMBLE CFG_INI_BOOL( \ + "gShortPreamble", \ + 1, \ + "Short Preamble") + +#define CFG_HT_AMPDU_PARAMS CFG_UINT( \ + "ht_ampdu_params", \ + 0, \ + 255, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "HT AMPDU Params") + +#define CFG_EXT_HT_CAP_INFO CFG_UINT( \ + "ext_ht_cap_info", \ + 0, \ + 65535, \ + 1024, \ + CFG_VALUE_OR_DEFAULT, \ + "HT Ext Cap Info") + +#define CFG_HT_INFO_FIELD_1 CFG_UINT( \ + "ht_info_field_1", \ + 0, \ + 255, \ + 15, \ + CFG_VALUE_OR_DEFAULT, \ + "HT Info Field 1") + +#define CFG_HT_INFO_FIELD_2 CFG_UINT( \ + "ht_info_field_2", \ + 0, \ + 65535, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "HT Info Field 2") + +#define CFG_HT_INFO_FIELD_3 CFG_UINT( \ + "ht_info_field_3", \ + 0, \ + 65535, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "HT Info Field 3") + +/* + * + * gEnableHtSMPS - Enable the SM Power Save + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to enable SM Power Save + * + * Related: None + * + * Supported Feature: STA + * + * Usage: Internal/External + * + * + */ +#define CFG_ENABLE_HT_SMPS CFG_INI_BOOL( \ + "gEnableHtSMPS", \ + 0, \ + "Enable HT SM PowerSave") + +/* + * + * gHtSMPS - SMPS Mode + * @Min: 0 + * @Max: 3 + * @Default: 3 + * + * This ini is used to set default SM Power Save Antenna mode + * 0 - Static + * 1 - Dynamic + * 2 - Reserved/Invalid + * 3 - Disabled + * + * Related: None + * + * Supported Feature: STA + * + * Usage: Internal/External + * + * + */ +#define CFG_HT_SMPS_MODE CFG_INI_UINT( \ + "gHtSMPS", \ + 0, \ + 3, \ + 3, \ + CFG_VALUE_OR_DEFAULT, \ + "HT SM Power Save Config") + +/* + * + * gMaxAmsduNum - Max number of MSDU's in aggregate + * @Min: 0 + * @Max: 3 + * @Default: 1 + * gMaxAmsduNum is the number of MSDU's transmitted in the 11n aggregate + * frame. Setting it to a value larger than 1 enables transmit aggregation. + * It is a PHY parameter that applies to all vdev's in firmware. + * + * Supported Feature: 11n aggregation + * + * Usage: Internal + * + * + */ +#define CFG_MAX_AMSDU_NUM CFG_INI_UINT( \ + "gMaxAmsduNum", \ + 0, \ + 3, \ + 1, \ + CFG_VALUE_OR_DEFAULT, \ + "Max AMSDU Number") + +/* + * + * gMaxRxAmpduFactor - Provide the maximum ampdu factor. + * @Min: 0 + * @Max: 3 + * @Default: 3 + * + * This ini is used to set default maxampdu factor + * + * Related: None + * + * Supported Feature: STA + * + * Usage: Internal/External + * + * + */ +#define CFG_MAX_RX_AMPDU_FACTOR CFG_INI_UINT( \ + "gMaxRxAmpduFactor", \ + 0, \ + 3, \ + 3, \ + CFG_VALUE_OR_DEFAULT, \ + "Max Rx AMPDU Factor") + +/* + * + * ght_mpdu_density - Configuration option for HT MPDU density + * @Min: 0 + * @Max: 7 + * @Default: 7 + * + * This ini is used to set default MDPU Density + * + * Related: None + * + * Supported Feature: STA + * + * Usage: Internal/External + * + * As per (Table 8-125 802.11-2012) + * 0 for no restriction + * 1 for 1/4 micro sec + * 2 for 1/2 micro sec + * 3 for 1 micro sec + * 4 for 2 micro sec + * 5 for 4 micro sec + * 6 for 8 micro sec + * 7 for 16 micro sec + * + * + */ +#define CFG_MPDU_DENSITY CFG_INI_UINT( \ + "ght_mpdu_density", \ + 0, \ + 7, \ + 7, \ + CFG_VALUE_OR_DEFAULT, \ + "MPDU Density") + #define CFG_HT_CAPS_ALL \ CFG(CFG_HT_CAP_INFO) \ CFG(CFG_TX_LDPC_ENABLE) \ @@ -180,6 +377,17 @@ CFG(CFG_TX_STBC_ENABLE) \ CFG(CFG_RX_STBC_ENABLE) \ CFG(CFG_SHORT_GI_20MHZ) \ - CFG(CFG_SHORT_GI_40MHZ) + CFG(CFG_SHORT_GI_40MHZ) \ + CFG(CFG_SHORT_PREAMBLE) \ + CFG(CFG_HT_AMPDU_PARAMS) \ + CFG(CFG_EXT_HT_CAP_INFO) \ + CFG(CFG_HT_INFO_FIELD_1) \ + CFG(CFG_HT_INFO_FIELD_2) \ + CFG(CFG_HT_INFO_FIELD_3) \ + CFG(CFG_ENABLE_HT_SMPS) \ + CFG(CFG_HT_SMPS_MODE) \ + CFG(CFG_MAX_AMSDU_NUM) \ + CFG(CFG_MAX_RX_AMPDU_FACTOR) \ + CFG(CFG_MPDU_DENSITY) #endif /* __CFG_MLME_HT_CAPS_H */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h index 39a3c9ae97..9a6d4e084e 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -177,6 +177,46 @@ QDF_STATUS wlan_mlme_set_ht_cap_info(struct wlan_objmgr_psoc *psoc, struct mlme_ht_capabilities_info ht_cap_info); +/** + * wlan_mlme_get_max_amsdu_num() - get the max amsdu num + * @psoc: pointer to psoc object + * @value: pointer to the value where the max_amsdu num is to be filled + * + * Return: QDF_STATUS + */ +QDF_STATUS wlan_mlme_get_max_amsdu_num(struct wlan_objmgr_psoc *psoc, + uint8_t *value); + +/** + * wlan_mlme_set_max_amsdu_num() - set the max amsdu num + * @psoc: pointer to psoc object + * @value: value to be set for max_amsdu_num + * + * Return: QDF_STATUS + */ +QDF_STATUS wlan_mlme_set_max_amsdu_num(struct wlan_objmgr_psoc *psoc, + uint8_t value); + +/** + * wlan_mlme_get_ht_mpdu_density() - get the ht mpdu density + * @psoc: pointer to psoc object + * @value: pointer to the value where the ht mpdu density is to be filled + * + * Return: QDF_STATUS + */ +QDF_STATUS wlan_mlme_get_ht_mpdu_density(struct wlan_objmgr_psoc *psoc, + uint8_t *value); + +/** + * wlan_mlme_set_ht_mpdu_density() - set the ht mpdu density + * @psoc: pointer to psoc object + * @value: value to be set for ht mpdu density + * + * Return: QDF_STATUS + */ +QDF_STATUS wlan_mlme_set_ht_mpdu_density(struct wlan_objmgr_psoc *psoc, + uint8_t value); + /** * wlan_mlme_get_band_capability() - Get the Band capability config * @psoc: pointer to psoc object diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index e3b4bd0cc6..40d800cf32 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -301,12 +301,161 @@ struct mlme_ht_capabilities_info { } qdf_packed; #endif +/** + * struct mlme_ht_param_info - HT AMPDU Parameters Info + * @reserved: reserved bits + * @mpdu_density: MPDU Density + * @max_rx_ampdu_factor: Max Rx AMPDU Factor + */ +#ifndef ANI_LITTLE_BIT_ENDIAN +struct mlme_ht_param_info { + uint8_t reserved:3; + uint8_t mpdu_density:3; + uint8_t max_rx_ampdu_factor:2; +} qdf_packed; +#else +struct mlme_ht_param_info { + uint8_t max_rx_ampdu_factor:2; + uint8_t mpdu_density:3; + uint8_t reserved:3; +#endif +} qdf_packed; + +/** + * struct mlme_ht_ext_cap_info - Extended HT Capabilities Info + * reserved_2: Reserved Bits + * mcs_feedback: MCS Feedback Capability + * reserved_1: Reserved Bits + * transition_time: Time needed for transition between 20Mhz and 40 Mhz + * pco: PCO (Phased Coexistence Operation) Support + */ +#ifndef ANI_LITTLE_BIT_ENDIAN +struct mlme_ht_ext_cap_info { + uint16_t reserved_2:6; + uint16_t mcs_feedback:2; + uint16_t reserved_1:5; + uint16_t transition_time:2; + uint16_t pco:1; +} qdf_packed; +#else +struct mlme_ht_ext_cap_info { + uint16_t pco:1; + uint16_t transition_time:2; + uint16_t reserved1:5; + uint16_t mcs_feedback:2; + uint16_t reserved2:6; +} qdf_packed; +#endif + +/** + * struct mlme_ht_info_field_1 - Additional HT IE Field1 + * @service_interval_granularity: Shortest Service Interval + * @controlled_access_only: Access Control for assoc requests + * @rifs_mode: Reduced Interframe Spacing mode + * @recommended_tx_width_set: Recommended Tx Channel Width + * @secondary_channel_offset: Secondary Channel Offset + */ +#ifndef ANI_LITTLE_BIT_ENDIAN +struct mlme_ht_info_field_1 { + uint8_t service_interval_granularity:3; + uint8_t controlled_access_only:1; + uint8_t rifs_mode:1; + uint8_t recommended_tx_width_set:1; + uint8_t secondary_channel_offset:2; +} qdf_packed; +#else +struct mlme_ht_info_field_1 { + uint8_t secondary_channel_offset:2; + uint8_t recommended_tx_width_set:1; + uint8_t rifs_mode:1; + uint8_t controlled_access_only:1; + uint8_t service_interval_granularity:3; +} qdf_packed; +#endif + +/* struct mlme_ht_info_field_2 - Additional HT IE Field2 + * @reserved: reserved bits + * @obss_non_ht_sta_present: Protection for non-HT STAs by Overlapping BSS + * @transmit_burst_limit: Transmit Burst Limit + * @non_gf_devices_present: Non Greenfield devices present + * @op_mode: Operation Mode + */ +#ifndef ANI_LITTLE_BIT_ENDIAN +struct mlme_ht_info_field_2 { + uint16_t reserved:11; + uint16_t obss_non_ht_sta_present:1; + uint16_t transmit_burst_limit:1; + uint16_t non_gf_devices_present:1; + uint16_t op_mode:2; +} qdf_packed; +#else +struct mlme_ht_info_field_2 { + uint16_t op_mode:2; + uint16_t nonGFDevicesPresent:1; + uint16_t transmit_burst_limit:1; + uint16_t obss_non_ht_sta_present:1; + uint16_t reserved:11; +} qdf_packed; +#endif + +/** + * struct mlme_ht_info_field_3 - Additional HT IE Field3 + * @reserved: reserved bits + * @pco_phase: PCO Phase + * @pco_active: PCO state + * @lsig_txop_protection_full_support: L-Sig TXOP Protection Full Support + * @secondary_beacon: Beacon ID + * @dual_cts_protection: Dual CTS protection Required + * @basic_stbc_mcs: Basic STBC MCS + */ +#ifndef ANI_LITTLE_BIT_ENDIAN +struct mlme_ht_info_field_3 { + uint16_t reserved:4; + uint16_t pco_phase:1; + uint16_t pco_active:1; + uint16_t lsig_txop_protection_full_support:1; + uint16_t secondary_beacon:1; + uint16_t dual_cts_protection:1; + uint16_t basic_stbc_mcs:7; +} qdf_packed; +#else +struct mlme_ht_info_field_3 { + uint16_t basic_stbc_mcs:7; + uint16_t dual_cts_protection:1; + uint16_t secondary_beacon:1; + uint16_t lsig_txop_protection_full_support:1; + uint16_t pco_active:1; + uint16_t pco_phase:1; + uint16_t reserved:4; +} qdf_packed; +#endif + /** * struct wlan_mlme_ht_caps - HT Capabilities related config items * @ht_cap_info: HT capabilities Info Structure + * @ampdu_params: AMPDU parameters + * @ext_cap_info: HT EXT capabilities info + * @info_field_1: HT Information Subset 1 + * @info_field_2: HT Information Subset 2 + * @info_field_3: HT Information Subset 3 + * @short_preamble: Short Preamble support + * @enable_ampdu_ps: Enable AMPDU Power Save + * @enable_smps: Enabled SM Power Save + * @smps : SM Power Save mode + * @max_num_amsdu: Max number of AMSDU */ struct wlan_mlme_ht_caps { struct mlme_ht_capabilities_info ht_cap_info; + struct mlme_ht_param_info ampdu_params; + struct mlme_ht_ext_cap_info ext_cap_info; + struct mlme_ht_info_field_1 info_field_1; + struct mlme_ht_info_field_2 info_field_2; + struct mlme_ht_info_field_3 info_field_3; + bool short_preamble; + bool enable_ampdu_ps; + bool enable_smps; + uint8_t smps; + uint8_t max_num_amsdu; }; /* diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index 1ad51b486d..fa2e8e5a16 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -149,6 +149,62 @@ 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_max_amsdu_num() - get the max amsdu num + * @psoc: pointer to psoc object + * @value: pointer to the value where the max_amsdu num is to be filled + * + * Return: QDF_STATUS + */ +static inline +QDF_STATUS ucfg_mlme_get_max_amsdu_num(struct wlan_objmgr_psoc *psoc, + uint8_t *value) +{ + return wlan_mlme_get_max_amsdu_num(psoc, value); +} + +/** + * ucfg_mlme_set_max_amsdu_num() - set the max amsdu num + * @psoc: pointer to psoc object + * @value: value to be set for max_amsdu_num + * + * Return: QDF_STATUS + */ +static inline +QDF_STATUS ucfg_mlme_set_max_amsdu_num(struct wlan_objmgr_psoc *psoc, + uint8_t value) +{ + return wlan_mlme_set_max_amsdu_num(psoc, value); +} + +/** + * ucfg_mlme_get_ht_mpdu_density() - get the ht mpdu density + * @psoc: pointer to psoc object + * @value: pointer to the value where the ht mpdu density is to be filled + * + * Return: QDF_STATUS + */ +static inline +QDF_STATUS ucfg_mlme_get_ht_mpdu_density(struct wlan_objmgr_psoc *psoc, + uint8_t *value) +{ + return wlan_mlme_get_ht_mpdu_density(psoc, value); +} + +/** + * ucfg_mlme_set_ht_mpdu_density() - set the ht mpdu density + * @psoc: pointer to psoc object + * @value: value to be set for ht mpdu density + * + * Return: QDF_STATUS + */ +static inline +QDF_STATUS ucfg_mlme_set_ht_mpdu_density(struct wlan_objmgr_psoc *psoc, + uint8_t value) +{ + return wlan_mlme_set_ht_mpdu_density(psoc, value); +} + /** * ucfg_mlme_get_band_capability() - Get the Band capability config * @psoc: pointer to psoc object diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c index bbd4375ab3..cd7fcdd255 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -90,6 +90,80 @@ QDF_STATUS wlan_mlme_set_ht_cap_info(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +QDF_STATUS wlan_mlme_get_max_amsdu_num(struct wlan_objmgr_psoc *psoc, + uint8_t *value) +{ + struct wlan_mlme_psoc_obj *mlme_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.ht_caps.max_num_amsdu; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS wlan_mlme_set_max_amsdu_num(struct wlan_objmgr_psoc *psoc, + uint8_t value) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + mlme_err("Failed to get MLME Obj"); + return QDF_STATUS_E_FAILURE; + } + + if (!cfg_in_range(CFG_MAX_AMSDU_NUM, value)) { + mlme_err("Error in setting Max AMSDU Num"); + return QDF_STATUS_E_INVAL; + } + + mlme_obj->cfg.ht_caps.max_num_amsdu = value; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS wlan_mlme_get_ht_mpdu_density(struct wlan_objmgr_psoc *psoc, + uint8_t *value) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + mlme_err("Failed to get MLME Obj"); + return QDF_STATUS_E_FAILURE; + } + + *value = (uint8_t)mlme_obj->cfg.ht_caps.ampdu_params.mpdu_density; + + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS wlan_mlme_set_ht_mpdu_density(struct wlan_objmgr_psoc *psoc, + uint8_t value) +{ + struct wlan_mlme_psoc_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_obj(psoc); + if (!mlme_obj) { + mlme_err("Failed to get MLME Obj"); + return QDF_STATUS_E_FAILURE; + } + + if (!cfg_in_range(CFG_MPDU_DENSITY, value)) { + mlme_err("Invalid value %d", value); + return QDF_STATUS_E_INVAL; + } + + mlme_obj->cfg.ht_caps.ampdu_params.mpdu_density = value; + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS wlan_mlme_get_band_capability(struct wlan_objmgr_psoc *psoc, uint8_t *band_capability) { diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index c26424e3c0..7be7b35fed 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -178,44 +178,6 @@ struct hdd_context; #define CFG_COUNTRY_CODE_PRIORITY_MAX (1) #define CFG_COUNTRY_CODE_PRIORITY_DEFAULT (0) -/* - * - * gMaxRxAmpduFactor - Provide the maximum ampdu factor. - * @Min: 0 - * @Max: 3 - * @Default: 3 - * - * This ini is used to set default maxampdu factor - * - * Related: None - * - * Supported Feature: STA - * - * Usage: Internal/External - * - * - */ - -#define CFG_MAX_RX_AMPDU_FACTOR_NAME "gMaxRxAmpduFactor" -#define CFG_MAX_RX_AMPDU_FACTOR_MIN WNI_CFG_MAX_RX_AMPDU_FACTOR_STAMIN -#define CFG_MAX_RX_AMPDU_FACTOR_MAX WNI_CFG_MAX_RX_AMPDU_FACTOR_STAMAX -#define CFG_MAX_RX_AMPDU_FACTOR_DEFAULT WNI_CFG_MAX_RX_AMPDU_FACTOR_STADEF - -/* Configuration option for HT MPDU density (Table 8-125 802.11-2012) - * 0 for no restriction - * 1 for 1/4 micro sec - * 2 for 1/2 micro sec - * 3 for 1 micro sec - * 4 for 2 micro sec - * 5 for 4 micro sec - * 6 for 8 micro sec - * 7 for 16 micro sec - */ -#define CFG_HT_MPDU_DENSITY_NAME "ght_mpdu_density" -#define CFG_HT_MPDU_DENSITY_MIN WNI_CFG_MPDU_DENSITY_STAMIN -#define CFG_HT_MPDU_DENSITY_MAX WNI_CFG_MPDU_DENSITY_STAMAX -#define CFG_HT_MPDU_DENSITY_DEFAULT WNI_CFG_MPDU_DENSITY_STADEF - #define CFG_REG_CHANGE_DEF_COUNTRY_NAME "gRegulatoryChangeCountry" #define CFG_REG_CHANGE_DEF_COUNTRY_DEFAULT (0) #define CFG_REG_CHANGE_DEF_COUNTRY_MIN (0) @@ -1611,29 +1573,6 @@ enum hdd_dot11_mode { #define CFG_ROAM_FORCE_RSSI_TRIGGER_MAX (1) #define CFG_ROAM_FORCE_RSSI_TRIGGER_DEFAULT (1) -/* - * - * gShortPreamble - Set Short Preamble - * @Min: 0 - * @Max: 1 - * @Default: 1 - * - * This ini is used to set default short Preamble - * - * Related: None - * - * Supported Feature: STA - * - * Usage: Internal/External - * - * - */ - -#define CFG_SHORT_PREAMBLE_NAME "gShortPreamble" -#define CFG_SHORT_PREAMBLE_MIN WNI_CFG_SHORT_PREAMBLE_STAMIN -#define CFG_SHORT_PREAMBLE_MAX WNI_CFG_SHORT_PREAMBLE_STAMAX -#define CFG_SHORT_PREAMBLE_DEFAULT WNI_CFG_SHORT_PREAMBLE_STADEF - /* * * gIbssBssid - Default IBSS BSSID if BSSID is not provided by supplicant @@ -3078,16 +3017,6 @@ enum hdd_link_speed_rpt_type { #define CFG_VDEV_TYPE_NSS_5G_MAX (0xAAAA) #define CFG_VDEV_TYPE_NSS_5G_DEFAULT (0xAAAA) -#define CFG_HT_ENABLE_SMPS_CAP_FEATURE "gEnableHtSMPS" -#define CFG_HT_ENABLE_SMPS_CAP_FEATURE_MIN (0) -#define CFG_HT_ENABLE_SMPS_CAP_FEATURE_MAX (1) -#define CFG_HT_ENABLE_SMPS_CAP_FEATURE_DEFAULT (0) - -#define CFG_HT_SMPS_CAP_FEATURE "gHtSMPS" -#define CFG_HT_SMPS_CAP_FEATURE_MIN (0) -#define CFG_HT_SMPS_CAP_FEATURE_MAX (3) -#define CFG_HT_SMPS_CAP_FEATURE_DEFAULT (3) - /* * * gDisableDFSChSwitch - Disable channel switch if radar is found @@ -3965,27 +3894,6 @@ enum hdd_link_speed_rpt_type { #define CFG_ENABLE_MEMORY_DEBUG_DEFAULT (1) #endif -/* - * - * gMaxAmsduNum - Max number of MSDU's in aggregate - * @Min: 0 - * @Max: 3 - * @Default: 1 - * gMaxAmsduNum is the number of MSDU's transmitted in the 11n aggregate - * frame. Setting it to a value larger than 1 enables transmit aggregation. - * It is a PHY parameter that applies to all vdev's in firmware. - * - * Supported Feature: 11n aggregation - * - * Usage: Internal - * - * - */ -#define CFG_MAX_AMSDU_NUM_NAME "gMaxAmsduNum" -#define CFG_MAX_AMSDU_NUM_MIN (0) -#define CFG_MAX_AMSDU_NUM_MAX (3) -#define CFG_MAX_AMSDU_NUM_DEFAULT (1) - /* * * gInitialDwellTime - Used to set initial dwell time @@ -6488,10 +6396,8 @@ struct hdd_config { uint32_t nChannelBondingMode24GHz; bool override_ht20_40_24g; uint32_t nChannelBondingMode5GHz; - uint32_t MaxRxAmpduFactor; uint32_t ScanResultAgeCount; uint8_t nRssiCatGap; - bool fIsShortPreamble; struct qdf_mac_addr IbssBssid; uint32_t AdHocChannel5G; uint32_t AdHocChannel24G; @@ -6681,9 +6587,6 @@ struct hdd_config { #endif uint32_t vdev_type_nss_2g; uint32_t vdev_type_nss_5g; - uint8_t enableAmpduPs; - uint8_t enableHtSmps; - uint8_t htSmps; bool enableFirstScan2GOnly; uint8_t enable_tx_ldpc; uint8_t enable_rx_ldpc; @@ -6699,7 +6602,6 @@ struct hdd_config { uint32_t configPNOScanTimerRepeatValue; uint32_t pno_slow_scan_multiplier; #endif - uint8_t max_amsdu_num; uint8_t isCoalesingInIBSSAllowed; /* IBSS Power Save related parameters */ @@ -6777,7 +6679,6 @@ struct hdd_config { int8_t early_stop_scan_min_threshold; int8_t early_stop_scan_max_threshold; int8_t first_scan_bucket_threshold; - uint8_t ht_mpdu_density; #ifdef FEATURE_LFR_SUBNET_DETECTION bool enable_lfr_subnet_detection; #endif diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index ea3323224a..eec61825a1 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -490,20 +490,6 @@ struct reg_table_entry g_registry_table[] = { CFG_CHANNEL_BONDING_MODE_MIN, CFG_CHANNEL_BONDING_MODE_MAX), - REG_VARIABLE(CFG_MAX_RX_AMPDU_FACTOR_NAME, WLAN_PARAM_Integer, - struct hdd_config, MaxRxAmpduFactor, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK, - CFG_MAX_RX_AMPDU_FACTOR_DEFAULT, - CFG_MAX_RX_AMPDU_FACTOR_MIN, - CFG_MAX_RX_AMPDU_FACTOR_MAX), - - REG_VARIABLE(CFG_HT_MPDU_DENSITY_NAME, WLAN_PARAM_Integer, - struct hdd_config, ht_mpdu_density, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK, - CFG_HT_MPDU_DENSITY_DEFAULT, - CFG_HT_MPDU_DENSITY_MIN, - CFG_HT_MPDU_DENSITY_MAX), - REG_VARIABLE(CFG_SCAN_RESULT_AGE_COUNT_NAME, WLAN_PARAM_Integer, struct hdd_config, ScanResultAgeCount, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK, @@ -518,13 +504,6 @@ struct reg_table_entry g_registry_table[] = { CFG_RSSI_CATEGORY_GAP_MIN, CFG_RSSI_CATEGORY_GAP_MAX), - REG_VARIABLE(CFG_SHORT_PREAMBLE_NAME, WLAN_PARAM_Integer, - struct hdd_config, fIsShortPreamble, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_SHORT_PREAMBLE_DEFAULT, - CFG_SHORT_PREAMBLE_MIN, - CFG_SHORT_PREAMBLE_MAX), - REG_VARIABLE_STRING(CFG_IBSS_BSSID_NAME, WLAN_PARAM_MacAddr, struct hdd_config, IbssBssid, VAR_FLAGS_OPTIONAL, @@ -557,7 +536,6 @@ struct reg_table_entry g_registry_table[] = { CFG_AP_QOS_UAPSD_MODE_MIN, CFG_AP_QOS_UAPSD_MODE_MAX), - REG_VARIABLE(CFG_AP_ENABLE_RANDOM_BSSID_NAME, WLAN_PARAM_Integer, struct hdd_config, apRandomBssidEnabled, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -1443,21 +1421,6 @@ struct reg_table_entry g_registry_table[] = { CFG_VDEV_TYPE_NSS_5G_MIN, CFG_VDEV_TYPE_NSS_5G_MAX), - - REG_VARIABLE(CFG_HT_ENABLE_SMPS_CAP_FEATURE, WLAN_PARAM_Integer, - struct hdd_config, enableHtSmps, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_HT_ENABLE_SMPS_CAP_FEATURE_DEFAULT, - CFG_HT_ENABLE_SMPS_CAP_FEATURE_MIN, - CFG_HT_ENABLE_SMPS_CAP_FEATURE_MAX), - - REG_VARIABLE(CFG_HT_SMPS_CAP_FEATURE, WLAN_PARAM_Integer, - struct hdd_config, htSmps, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_HT_SMPS_CAP_FEATURE_DEFAULT, - CFG_HT_SMPS_CAP_FEATURE_MIN, - CFG_HT_SMPS_CAP_FEATURE_MAX), - REG_VARIABLE(CFG_DISABLE_DFS_CH_SWITCH, WLAN_PARAM_Integer, struct hdd_config, disableDFSChSwitch, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -1580,13 +1543,6 @@ struct reg_table_entry g_registry_table[] = { CFG_PNO_SLOW_SCAN_MULTIPLIER_MIN, CFG_PNO_SLOW_SCAN_MULTIPLIER_MAX), #endif - REG_VARIABLE(CFG_MAX_AMSDU_NUM_NAME, WLAN_PARAM_Integer, - struct hdd_config, max_amsdu_num, - VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, - CFG_MAX_AMSDU_NUM_DEFAULT, - CFG_MAX_AMSDU_NUM_MIN, - CFG_MAX_AMSDU_NUM_MAX), - REG_VARIABLE(CFG_COALESING_IN_IBSS_NAME, WLAN_PARAM_Integer, struct hdd_config, isCoalesingInIBSSAllowed, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -3840,26 +3796,6 @@ bool hdd_update_config_cfg(struct hdd_context *hdd_ctx) mac_handle = hdd_ctx->mac_handle; - if (sme_cfg_set_int(mac_handle, WNI_CFG_MAX_RX_AMPDU_FACTOR, - config->MaxRxAmpduFactor) == - QDF_STATUS_E_FAILURE) { - status = false; - hdd_err("Couldn't pass on WNI_CFG_HT_AMPDU_PARAMS_MAX_RX_AMPDU_FACTOR to CFG"); - } - - if (sme_cfg_set_int(mac_handle, WNI_CFG_MPDU_DENSITY, - config->ht_mpdu_density) == - QDF_STATUS_E_FAILURE) { - status = false; - hdd_err("Couldn't pass on WNI_CFG_MPDU_DENSITY to CFG"); - } - - if (sme_cfg_set_int(mac_handle, WNI_CFG_SHORT_PREAMBLE, - config->fIsShortPreamble) == QDF_STATUS_E_FAILURE) { - status = false; - hdd_err("Couldn't pass on WNI_CFG_SHORT_PREAMBLE to CFG"); - } - if (sme_cfg_set_int(mac_handle, WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME, config->nPassiveMaxChnTime) @@ -4124,8 +4060,6 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx) /* Remaining config params not obtained from registry * On RF EVB beacon using channel 1. */ - smeConfig->csrConfig.enableHtSmps = pConfig->enableHtSmps; - smeConfig->csrConfig.htSmps = pConfig->htSmps; /* This param cannot be configured from INI */ smeConfig->csrConfig.send_smps_action = true; smeConfig->csrConfig.AdHocChannel5G = pConfig->AdHocChannel5G; @@ -4236,8 +4170,6 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx) smeConfig->csrConfig.enable_tx_ldpc = pConfig->enable_tx_ldpc; smeConfig->csrConfig.enable_rx_ldpc = pConfig->enable_rx_ldpc; - smeConfig->csrConfig.max_amsdu_num = pConfig->max_amsdu_num; - smeConfig->csrConfig.isCoalesingInIBSSAllowed = hdd_ctx->config->isCoalesingInIBSSAllowed; /* update SSR config */ diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 0a263cd245..57184d98e0 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1430,17 +1430,16 @@ static void hdd_update_tgt_ht_cap(struct hdd_context *hdd_ctx, QDF_STATUS status; qdf_size_t value_len; uint32_t value; + uint8_t mpdu_density; struct mlme_ht_capabilities_info ht_cap_info; uint8_t mcs_set[SIZE_OF_SUPPORTED_MCS_SET]; - mac_handle_t mac_handle = hdd_ctx->mac_handle; bool b_enable1x1; /* get the MPDU density */ - status = sme_cfg_get_int(mac_handle, WNI_CFG_MPDU_DENSITY, &value); - - if (status != QDF_STATUS_SUCCESS) { - hdd_err("could not get MPDU DENSITY"); - value = 0; + status = ucfg_mlme_get_ht_mpdu_density(hdd_ctx->psoc, &mpdu_density); + if (QDF_IS_STATUS_ERROR(status)) { + hdd_err("could not get HT MPDU Density"); + return; } /* @@ -1448,12 +1447,11 @@ static void hdd_update_tgt_ht_cap(struct hdd_context *hdd_ctx, * override user's setting if value is larger * than the one supported by target */ - if (value > cfg->mpdu_density) { - status = sme_cfg_set_int(mac_handle, WNI_CFG_MPDU_DENSITY, - cfg->mpdu_density); - - if (status == QDF_STATUS_E_FAILURE) - hdd_err("could not set MPDU DENSITY to CCM"); + if (mpdu_density > cfg->mpdu_density) { + status = ucfg_mlme_set_ht_mpdu_density(hdd_ctx->psoc, + cfg->mpdu_density); + if (QDF_IS_STATUS_ERROR(status)) + hdd_err("could not set HT capability to CCM"); } /* get the HT capability info */ @@ -4497,6 +4495,7 @@ int hdd_set_fw_params(struct hdd_adapter *adapter) QDF_STATUS status; struct hdd_context *hdd_ctx; bool bval = false; + uint8_t max_amsdu_len; hdd_enter_dev(adapter->dev); @@ -4642,11 +4641,17 @@ int hdd_set_fw_params(struct hdd_adapter *adapter) goto error; } - hdd_debug("SET AMSDU num %d", hdd_ctx->config->max_amsdu_num); + status = ucfg_mlme_get_max_amsdu_num(hdd_ctx->psoc, &max_amsdu_len); + if (QDF_IS_STATUS_ERROR(status)) { + hdd_err("Failed to get Max AMSDU Num"); + goto error; + } + + hdd_debug("SET AMSDU num %d", max_amsdu_len); ret = wma_cli_set_command(adapter->session_id, GEN_VDEV_PARAM_AMSDU, - hdd_ctx->config->max_amsdu_num, + max_amsdu_len, GEN_CMD); if (ret != 0) { hdd_err("GEN_VDEV_PARAM_AMSDU set failed %d", ret); diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 8304f4ceb1..e9795a5fc0 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -4452,6 +4452,7 @@ static int hdd_we_set_amsdu(struct hdd_adapter *adapter, int amsdu) struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); mac_handle_t mac_handle = hdd_ctx->mac_handle; int errno; + QDF_STATUS status; hdd_debug("AMSDU %d", amsdu); @@ -4473,7 +4474,10 @@ static int hdd_we_set_amsdu(struct hdd_adapter *adapter, int amsdu) return errno; } - hdd_ctx->config->max_amsdu_num = amsdu; + status = ucfg_mlme_set_max_amsdu_num(hdd_ctx->psoc, + amsdu); + if (QDF_IS_STATUS_ERROR(status)) + hdd_err("Failed to set Max AMSDU Num to cfg"); return 0; } diff --git a/core/mac/inc/sir_mac_prot_def.h b/core/mac/inc/sir_mac_prot_def.h index 1c2d5f5501..5307a606bc 100644 --- a/core/mac/inc/sir_mac_prot_def.h +++ b/core/mac/inc/sir_mac_prot_def.h @@ -1871,61 +1871,6 @@ typedef struct sSirMacASCapabilityInfo { #endif } qdf_packed tSirMacASCapabilityInfo; -/* Additional HT IE Field1 */ -typedef struct sSirMacHTInfoField1 { -#ifndef ANI_LITTLE_BIT_ENDIAN - uint8_t serviceIntervalGranularity:3; /* Dynamic state */ - uint8_t controlledAccessOnly:1; /* Static via CFG */ - uint8_t rifsMode:1; /* Dynamic state */ - uint8_t recommendedTxWidthSet:1; /* Dynamic state */ - uint8_t secondaryChannelOffset:2; /* Dynamic state */ -#else - uint8_t secondaryChannelOffset:2; - uint8_t recommendedTxWidthSet:1; - uint8_t rifsMode:1; - uint8_t controlledAccessOnly:1; - uint8_t serviceIntervalGranularity:3; -#endif -} qdf_packed tSirMacHTInfoField1; - -/* Additional HT IE Field2 */ -typedef struct sSirMacHTInfoField2 { -#ifndef ANI_LITTLE_BIT_ENDIAN - uint16_t reserved:11; - uint16_t obssNonHTStaPresent:1; /*added for Obss */ - uint16_t transmitBurstLimit:1; - uint16_t nonGFDevicesPresent:1; - uint16_t opMode:2; /* Dynamic state */ -#else - uint16_t opMode:2; - uint16_t nonGFDevicesPresent:1; - uint16_t transmitBurstLimit:1; - uint16_t obssNonHTStaPresent:1; /*added for Obss */ - uint16_t reserved:11; -#endif -} qdf_packed tSirMacHTInfoField2; - -/* Additional HT IE Field3 */ -typedef struct sSirMacHTInfoField3 { -#ifndef ANI_LITTLE_BIT_ENDIAN - uint16_t reserved:4; - uint16_t pcoPhase:1; /* Dynamic state */ - uint16_t pcoActive:1; /* Dynamic state */ - uint16_t lsigTXOPProtectionFullSupport:1; /* Dynamic state */ - uint16_t secondaryBeacon:1; /* Dynamic state */ - uint16_t dualCTSProtection:1; /* Dynamic state */ - uint16_t basicSTBCMCS:7; /* Dynamic state */ -#else - uint16_t basicSTBCMCS:7; - uint16_t dualCTSProtection:1; - uint16_t secondaryBeacon:1; - uint16_t lsigTXOPProtectionFullSupport:1; - uint16_t pcoActive:1; - uint16_t pcoPhase:1; - uint16_t reserved:4; -#endif -} qdf_packed tSirMacHTInfoField3; - typedef struct sSirMacProbeReqFrame { tSirMacSSidIE ssIdIE; tSirMacRateSetIE rateSetIE; diff --git a/core/mac/src/cfg/cfg_api.c b/core/mac/src/cfg/cfg_api.c index 6ba00e2932..78db2a88d8 100644 --- a/core/mac/src/cfg/cfg_api.c +++ b/core/mac/src/cfg/cfg_api.c @@ -707,13 +707,9 @@ QDF_STATUS cfg_get_capability_info(tpAniSirGlobal pMac, uint16_t *pCap, pCapInfo->privacy = 1; /* Short preamble bit */ - if (wlan_cfg_get_int(pMac, WNI_CFG_SHORT_PREAMBLE, &val) != - QDF_STATUS_SUCCESS) { - pe_err("cfg get WNI_CFG_SHORT_PREAMBLE failed"); - return QDF_STATUS_E_FAILURE; - } - if (val) - pCapInfo->shortPreamble = 1; + if (pMac->mlme_cfg->ht_caps.short_preamble) + pCapInfo->shortPreamble = + pMac->mlme_cfg->ht_caps.short_preamble; /* PBCC bit */ pCapInfo->pbcc = 0; diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c index d98135474e..fb245f4c42 100644 --- a/core/mac/src/pe/lim/lim_api.c +++ b/core/mac/src/pe/lim/lim_api.c @@ -265,46 +265,27 @@ static void __lim_init_ht_vars(tpAniSirGlobal pMac) static QDF_STATUS __lim_init_config(tpAniSirGlobal pMac) { - uint32_t val1, val2, val3; - uint16_t val16; - uint8_t val8; + uint32_t val1; bool valb; struct mlme_ht_capabilities_info *ht_cap_info; QDF_STATUS status; - tSirMacHTInfoField1 *pHTInfoField1; - tSirMacHTParametersInfo *pAmpduParamInfo; /* Read all the CFGs here that were updated before pe_start is called */ /* All these CFG READS/WRITES are only allowed in init, at start when there is no session * and they will be used throughout when there is no session */ - - val1 = pMac->mlme_cfg->sap_cfg.assoc_sta_limit; - pMac->lim.gLimIbssStaLimit = val1; + pMac->lim.gLimIbssStaLimit = pMac->mlme_cfg->sap_cfg.assoc_sta_limit; ht_cap_info = &pMac->mlme_cfg->ht_caps.ht_cap_info; - val2 = pMac->mlme_cfg->feature_flags.channel_bonding_mode; - /* channel bonding mode could be set to anything from 0 to 4(Titan had these */ /* modes But for Taurus we have only two modes: enable(>0) or disable(=0) */ - ht_cap_info->supported_channel_width_set = val2 ? - WNI_CFG_CHANNEL_BONDING_MODE_ENABLE : - WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; + ht_cap_info->supported_channel_width_set = + pMac->mlme_cfg->feature_flags.channel_bonding_mode ? + WNI_CFG_CHANNEL_BONDING_MODE_ENABLE : + WNI_CFG_CHANNEL_BONDING_MODE_DISABLE; - if (wlan_cfg_get_int(pMac, WNI_CFG_HT_INFO_FIELD1, &val1) != QDF_STATUS_SUCCESS) { - pe_err("could not retrieve HT INFO Field1 CFG"); - return QDF_STATUS_E_FAILURE; - } - - val8 = (uint8_t) val1; - pHTInfoField1 = (tSirMacHTInfoField1 *) &val8; - pHTInfoField1->recommendedTxWidthSet = - ht_cap_info->supported_channel_width_set; - if (cfg_set_int(pMac, WNI_CFG_HT_INFO_FIELD1, *(uint8_t *) pHTInfoField1) - != QDF_STATUS_SUCCESS) { - pe_err("could not update HT Info Field"); - return QDF_STATUS_E_FAILURE; - } + pMac->mlme_cfg->ht_caps.info_field_1.recommended_tx_width_set = + ht_cap_info->supported_channel_width_set; if (!pMac->mlme_cfg->timeouts.heart_beat_threshold) { pMac->sys.gSysEnableLinkMonitorMode = 0; @@ -313,42 +294,6 @@ static QDF_STATUS __lim_init_config(tpAniSirGlobal pMac) pMac->sys.gSysEnableLinkMonitorMode = 1; } - /* WNI_CFG_MAX_RX_AMPDU_FACTOR */ - - if (wlan_cfg_get_int(pMac, WNI_CFG_HT_AMPDU_PARAMS, &val1) != - QDF_STATUS_SUCCESS) { - pe_err("could not retrieve HT AMPDU Param"); - return QDF_STATUS_E_FAILURE; - } - if (wlan_cfg_get_int(pMac, WNI_CFG_MAX_RX_AMPDU_FACTOR, &val2) != - QDF_STATUS_SUCCESS) { - pe_err("could not retrieve AMPDU Factor CFG"); - return QDF_STATUS_E_FAILURE; - } - if (wlan_cfg_get_int(pMac, WNI_CFG_MPDU_DENSITY, &val3) != - QDF_STATUS_SUCCESS) { - pe_err("could not retrieve MPDU Density CFG"); - return QDF_STATUS_E_FAILURE; - } - - val16 = (uint16_t) val1; - pAmpduParamInfo = (tSirMacHTParametersInfo *) &val16; - pAmpduParamInfo->maxRxAMPDUFactor = (uint8_t) val2; - pAmpduParamInfo->mpduDensity = (uint8_t)val3; - if (cfg_set_int - (pMac, WNI_CFG_HT_AMPDU_PARAMS, - *(uint8_t *) pAmpduParamInfo) != QDF_STATUS_SUCCESS) { - pe_err("cfg get short preamble failed"); - return QDF_STATUS_E_FAILURE; - } - - /* WNI_CFG_SHORT_PREAMBLE - this one is not updated in - lim_handle_cf_gparam_update do we want to update this? */ - if (wlan_cfg_get_int(pMac, WNI_CFG_SHORT_PREAMBLE, &val1) != QDF_STATUS_SUCCESS) { - pe_err("cfg get short preamble failed"); - return QDF_STATUS_E_FAILURE; - } - /* WNI_CFG_PROBE_RSP_BCN_ADDNIE_DATA - not needed */ /* This was initially done after resume notification from HAL. Now, DAL is diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c index 375d75d8a9..f8d79fa70d 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.c +++ b/core/mac/src/pe/lim/lim_assoc_utils.c @@ -2720,7 +2720,6 @@ lim_add_sta_self(tpAniSirGlobal pMac, uint16_t staIdx, uint8_t updateSta, * responsibility of SME to evict the selfSta and reissue a new AddStaSelf * command.*/ uint32_t selfStaDot11Mode = 0, selfTxWidth = 0; - uint32_t val; wlan_cfg_get_int(pMac, WNI_CFG_DOT11_MODE, &selfStaDot11Mode); wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO_SUPPORTED_CHAN_WIDTH_SET, @@ -2760,13 +2759,8 @@ lim_add_sta_self(tpAniSirGlobal pMac, uint16_t staIdx, uint8_t updateSta, pAddStaParams->staIdx = staIdx; pAddStaParams->updateSta = updateSta; - if (wlan_cfg_get_int(pMac, WNI_CFG_SHORT_PREAMBLE, &val) != - QDF_STATUS_SUCCESS) { - pe_err("Couldn't get SHORT_PREAMBLE, set default"); - pAddStaParams->shortPreambleSupported = 1; - } else { - pAddStaParams->shortPreambleSupported = val; - } + pAddStaParams->shortPreambleSupported = + pMac->mlme_cfg->ht_caps.short_preamble; lim_populate_own_rate_set(pMac, &pAddStaParams->supportedRates, NULL, false, psessionEntry, NULL, NULL); diff --git a/core/mac/src/pe/lim/lim_process_cfg_updates.c b/core/mac/src/pe/lim/lim_process_cfg_updates.c index 819f3e55ae..9eeda5f11d 100644 --- a/core/mac/src/pe/lim/lim_process_cfg_updates.c +++ b/core/mac/src/pe/lim/lim_process_cfg_updates.c @@ -137,89 +137,6 @@ void lim_handle_param_update(tpAniSirGlobal pMac, eUpdateIEsType cfgId) } } -/** - * lim_handle_cf_gparam_update() - * - ***FUNCTION: - * This function is called by lim_process_messages() to - * whenever SIR_CFG_PARAM_UPDATE_IND message is posted - * to LIM (due to a set operation on a CFG parameter). - * - ***PARAMS: - * - ***LOGIC: - * - ***ASSUMPTIONS: - * NA - * - ***NOTE: - * - * @param pMac - Pointer to Global MAC structure - * @param cfgId - ID of CFG parameter that got updated - * @return None - */ - -void lim_handle_cf_gparam_update(tpAniSirGlobal pMac, uint32_t cfgId) -{ - uint32_t val1, val2; - uint16_t val16; - tSirMacHTParametersInfo *pAmpduParamInfo; - - pe_debug("Handling CFG parameter id %X update", cfgId); - - switch (cfgId) { - case WNI_CFG_MPDU_DENSITY: - if (wlan_cfg_get_int(pMac, WNI_CFG_HT_AMPDU_PARAMS, &val1) != - QDF_STATUS_SUCCESS) { - pe_err("could not retrieve HT AMPDU Param CFG"); - break; - } - if (wlan_cfg_get_int(pMac, WNI_CFG_MPDU_DENSITY, &val2) != - QDF_STATUS_SUCCESS) { - pe_err("could not retrieve MPDU Density CFG"); - break; - } - val16 = (uint16_t) val1; - pAmpduParamInfo = (tSirMacHTParametersInfo *) &val16; - pAmpduParamInfo->mpduDensity = (uint8_t) val2; - if (cfg_set_int - (pMac, WNI_CFG_HT_AMPDU_PARAMS, - *(uint8_t *) pAmpduParamInfo) != QDF_STATUS_SUCCESS) - pe_err("could not update HT AMPDU Param CFG"); - break; - case WNI_CFG_MAX_RX_AMPDU_FACTOR: - if (wlan_cfg_get_int(pMac, WNI_CFG_HT_AMPDU_PARAMS, &val1) != - QDF_STATUS_SUCCESS) { - pe_err("could not retrieve HT AMPDU Param CFG"); - break; - } - if (wlan_cfg_get_int(pMac, WNI_CFG_MAX_RX_AMPDU_FACTOR, &val2) != - QDF_STATUS_SUCCESS) { - pe_err("could not retrieve AMPDU Factor CFG"); - break; - } - val16 = (uint16_t) val1; - pAmpduParamInfo = (tSirMacHTParametersInfo *) &val16; - pAmpduParamInfo->maxRxAMPDUFactor = (uint8_t) val2; - if (cfg_set_int - (pMac, WNI_CFG_HT_AMPDU_PARAMS, - *(uint8_t *) pAmpduParamInfo) != QDF_STATUS_SUCCESS) - pe_err("could not update HT AMPDU Param CFG"); - break; - - case WNI_CFG_DOT11_MODE: - if (wlan_cfg_get_int(pMac, WNI_CFG_DOT11_MODE, &val1) != - QDF_STATUS_SUCCESS) { - pe_err("could not retrieve Dot11 Mode CFG"); - break; - } - break; - - default: - break; - } -} /*** end lim_handle_cf_gparam_update() ***/ - /** * lim_apply_configuration() * @@ -299,9 +216,8 @@ static void lim_update_config(tpAniSirGlobal pMac, tpPESession psessionEntry) uint32_t val; bool enabled; - if (wlan_cfg_get_int(pMac, WNI_CFG_SHORT_PREAMBLE, &val) != QDF_STATUS_SUCCESS) - pe_err("cfg get short preamble failed"); - psessionEntry->beaconParams.fShortPreamble = (val) ? 1 : 0; + psessionEntry->beaconParams.fShortPreamble = + pMac->mlme_cfg->ht_caps.short_preamble; /* In STA case this parameter is filled during the join request */ if (LIM_IS_AP_ROLE(psessionEntry) || diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c index 3e988c1938..5a8f9ca024 100644 --- a/core/mac/src/pe/lim/lim_process_message_queue.c +++ b/core/mac/src/pe/lim/lim_process_message_queue.c @@ -1513,10 +1513,8 @@ static void lim_process_messages(tpAniSirGlobal mac_ctx, lim_update_beacon(mac_ctx); break; case SIR_CFG_PARAM_UPDATE_IND: - if (!lim_is_system_in_scan_state(mac_ctx)) { - lim_handle_cf_gparam_update(mac_ctx, msg->bodyval); + if (!lim_is_system_in_scan_state(mac_ctx)) break; - } /* System is in DFS (Learn) mode. * Defer processing this message */ @@ -2216,12 +2214,6 @@ handle_ht_capabilityand_ht_info(struct sAniSirGlobal *pMac, tpPESession psessionEntry) { struct mlme_ht_capabilities_info *ht_cap_info; - tSirMacHTParametersInfo macHTParametersInfo; - tSirMacHTInfoField1 macHTInfoField1; - tSirMacHTInfoField2 macHTInfoField2; - tSirMacHTInfoField3 macHTInfoField3; - uint32_t cfgValue; - uint8_t *ptr; ht_cap_info = &pMac->mlme_cfg->ht_caps.ht_cap_info; pMac->lim.gHTLsigTXOPProtection = @@ -2237,54 +2229,32 @@ handle_ht_capabilityand_ht_info(struct sAniSirGlobal *pMac, pMac->lim.gHTDsssCckRate40MHzSupport = (uint8_t)ht_cap_info->dsss_cck_mode_40_mhz; - if (wlan_cfg_get_int(pMac, WNI_CFG_HT_AMPDU_PARAMS, &cfgValue) != - QDF_STATUS_SUCCESS) { - pe_err("Fail to retrieve WNI_CFG_HT_PARAM_INFO value"); - return; - } - ptr = (uint8_t *) &macHTParametersInfo; - *ptr = (uint8_t) (cfgValue & 0xff); - pMac->lim.gHTAMpduDensity = (uint8_t) macHTParametersInfo.mpduDensity; + pMac->lim.gHTAMpduDensity = + (uint8_t)pMac->mlme_cfg->ht_caps.ampdu_params.mpdu_density; pMac->lim.gHTMaxRxAMpduFactor = - (uint8_t) macHTParametersInfo.maxRxAMPDUFactor; + (uint8_t)pMac->mlme_cfg->ht_caps.ampdu_params. + max_rx_ampdu_factor; /* Get HT IE Info */ - if (wlan_cfg_get_int(pMac, WNI_CFG_HT_INFO_FIELD1, &cfgValue) != - QDF_STATUS_SUCCESS) { - pe_err("Fail to retrieve WNI_CFG_HT_INFO_FIELD1 value"); - return; - } - ptr = (uint8_t *) &macHTInfoField1; - *((uint8_t *) ptr) = (uint8_t) (cfgValue & 0xff); pMac->lim.gHTServiceIntervalGranularity = - (uint8_t) macHTInfoField1.serviceIntervalGranularity; + (uint8_t)pMac->mlme_cfg->ht_caps.info_field_1. + service_interval_granularity; pMac->lim.gHTControlledAccessOnly = - (uint8_t) macHTInfoField1.controlledAccessOnly; - pMac->lim.gHTRifsMode = (uint8_t) macHTInfoField1.rifsMode; + (uint8_t)pMac->mlme_cfg->ht_caps.info_field_1. + controlled_access_only; + pMac->lim.gHTRifsMode = (uint8_t)pMac->mlme_cfg->ht_caps.info_field_1. + rifs_mode; - if (wlan_cfg_get_int(pMac, WNI_CFG_HT_INFO_FIELD2, &cfgValue) != - QDF_STATUS_SUCCESS) { - pe_err("Fail to retrieve WNI_CFG_HT_INFO_FIELD2 value"); - return; - } - ptr = (uint8_t *) &macHTInfoField2; - *((uint16_t *) ptr) = (uint16_t) (cfgValue & 0xffff); - pMac->lim.gHTOperMode = (tSirMacHTOperatingMode) macHTInfoField2.opMode; - - if (wlan_cfg_get_int(pMac, WNI_CFG_HT_INFO_FIELD3, &cfgValue) != - QDF_STATUS_SUCCESS) { - pe_err("Fail to retrieve WNI_CFG_HT_INFO_FIELD3 value"); - return; - } - ptr = (uint8_t *) &macHTInfoField3; - *((uint16_t *) ptr) = (uint16_t) (cfgValue & 0xffff); - pMac->lim.gHTPCOActive = (uint8_t) macHTInfoField3.pcoActive; - pMac->lim.gHTPCOPhase = (uint8_t) macHTInfoField3.pcoPhase; + pMac->lim.gHTPCOActive = (uint8_t)pMac->mlme_cfg->ht_caps.info_field_3. + pco_active; + pMac->lim.gHTPCOPhase = (uint8_t)pMac->mlme_cfg->ht_caps.info_field_3. + pco_phase; pMac->lim.gHTSecondaryBeacon = - (uint8_t) macHTInfoField3.secondaryBeacon; - pMac->lim.gHTDualCTSProtection = - (uint8_t) macHTInfoField3.dualCTSProtection; - pMac->lim.gHTSTBCBasicMCS = (uint8_t) macHTInfoField3.basicSTBCMCS; + (uint8_t)pMac->mlme_cfg->ht_caps.info_field_3.secondary_beacon; + pMac->lim.gHTDualCTSProtection = (uint8_t)pMac->mlme_cfg->ht_caps. + info_field_3.dual_cts_protection; + pMac->lim.gHTSTBCBasicMCS = (uint8_t)pMac->mlme_cfg->ht_caps. + info_field_3.basic_stbc_mcs; /* The lim globals for channelwidth and secondary chnl have been removed and should not be used during no session; * instead direct cfg is read and used when no session for transmission of mgmt frames (same as old); @@ -2295,7 +2265,8 @@ handle_ht_capabilityand_ht_info(struct sAniSirGlobal *pMac, psessionEntry->htCapability = IS_DOT11_MODE_HT(psessionEntry->dot11mode); psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport = - (uint8_t) macHTInfoField3.lsigTXOPProtectionFullSupport; + (uint8_t)pMac->mlme_cfg->ht_caps.info_field_3. + lsig_txop_protection_full_support; lim_init_obss_params(pMac, psessionEntry); } } diff --git a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c index 0f64acbec0..e477f3b4b0 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c @@ -341,10 +341,8 @@ static void mlm_add_sta(tpAniSirGlobal mac_ctx, tpAddStaParams sta_param, val = mac_ctx->mlme_cfg->sap_cfg.listen_interval; sta_param->listenInterval = (uint16_t) val; - if (QDF_STATUS_SUCCESS != wlan_cfg_get_int(mac_ctx, WNI_CFG_SHORT_PREAMBLE, - &val)) - pe_warn("Couldn't get SHORT_PREAMBLE"); - sta_param->shortPreambleSupported = (uint8_t) val; + sta_param->shortPreambleSupported = + mac_ctx->mlme_cfg->ht_caps.short_preamble; sta_param->assocId = 0; /* Is SMAC OK with this? */ sta_param->wmmEnabled = 0; diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h index ddf852e52d..20938aa792 100644 --- a/core/mac/src/pe/lim/lim_types.h +++ b/core/mac/src/pe/lim/lim_types.h @@ -436,9 +436,6 @@ void lim_get_random_bssid(tpAniSirGlobal pMac, uint8_t *data); void handle_ht_capabilityand_ht_info(struct sAniSirGlobal *pMac, tpPESession psessionEntry); -/* Function to handle CFG parameter updates */ -void lim_handle_cf_gparam_update(tpAniSirGlobal, uint32_t); - void lim_handle_param_update(tpAniSirGlobal pMac, eUpdateIEsType cfgId); /* Function to apply CFG parameters before join/reassoc/start BSS */ diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 862a73fdaa..78748841a7 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -2742,8 +2742,6 @@ uint8_t lim_get_ht_capability(tpAniSirGlobal pMac, uint8_t retVal = 0; uint8_t *ptr; uint32_t cfgValue; - struct mlme_ht_capabilities_info ht_cap_info = { 0 }; - tSirMacExtendedHTCapabilityInfo macExtHTCapabilityInfo = { 0 }; tSirMacTxBFCapabilityInfo macTxBFCapabilityInfo = { 0 }; tSirMacASCapabilityInfo macASCapabilityInfo = { 0 }; @@ -2759,39 +2757,14 @@ uint8_t lim_get_ht_capability(tpAniSirGlobal pMac, cfgValue = 0; ptr = (uint8_t *) &macASCapabilityInfo; *((uint8_t *) ptr) = (uint8_t) (cfgValue & 0xff); - } else { - if (htCap >= eHT_TX_BEAMFORMING && - htCap < eHT_ANTENNA_SELECTION) { - /* Get Transmit Beam Forming HT Capabilities */ - if (QDF_STATUS_SUCCESS != - wlan_cfg_get_int(pMac, WNI_CFG_TX_BF_CAP, &cfgValue)) - cfgValue = 0; - ptr = (uint8_t *) &macTxBFCapabilityInfo; - *((uint32_t *) ptr) = (uint32_t) (cfgValue); - } else { - if (htCap >= eHT_PCO && htCap < eHT_TX_BEAMFORMING) { - /* Get Extended HT Capabilities */ - if (QDF_STATUS_SUCCESS != - wlan_cfg_get_int(pMac, - WNI_CFG_EXT_HT_CAP_INFO, - &cfgValue)) - cfgValue = 0; - ptr = (uint8_t *) &macExtHTCapabilityInfo; - *((uint16_t *) ptr) = - (uint16_t) (cfgValue & 0xffff); - } else { - if (htCap < eHT_MAX_RX_AMPDU_FACTOR) { - /* Get HT Capabilities */ - cfgValue = *(uint32_t *) - &pMac->mlme_cfg->ht_caps. - ht_cap_info; - ptr = (uint8_t *)&ht_cap_info; - /* CR 265282 MDM SoftAP 2.4PL: SoftAP boot up crash in 2.4 PL builds while same WLAN SU is working on 2.1 PL */ - *ptr++ = cfgValue & 0xff; - *ptr = (cfgValue >> 8) & 0xff; - } - } - } + } else if (htCap >= eHT_TX_BEAMFORMING && + htCap < eHT_ANTENNA_SELECTION) { + /* Get Transmit Beam Forming HT Capabilities */ + if (QDF_STATUS_SUCCESS != + wlan_cfg_get_int(pMac, WNI_CFG_TX_BF_CAP, &cfgValue)) + cfgValue = 0; + ptr = (uint8_t *)&macTxBFCapabilityInfo; + *((uint32_t *)ptr) = (uint32_t)(cfgValue); } switch (htCap) { @@ -2800,7 +2773,8 @@ uint8_t lim_get_ht_capability(tpAniSirGlobal pMac, break; case eHT_STBC_CONTROL_FRAME: - retVal = (uint8_t)ht_cap_info.stbc_control_frame; + retVal = (uint8_t)pMac->mlme_cfg->ht_caps.ht_cap_info. + stbc_control_frame; break; case eHT_PSMP: @@ -2812,7 +2786,8 @@ uint8_t lim_get_ht_capability(tpAniSirGlobal pMac, break; case eHT_MAX_AMSDU_LENGTH: - retVal = (uint8_t)ht_cap_info.maximal_amsdu_size; + retVal = (uint8_t)pMac->mlme_cfg->ht_caps.ht_cap_info. + maximal_amsdu_size; break; case eHT_MAX_AMSDU_NUM: @@ -2828,17 +2803,18 @@ uint8_t lim_get_ht_capability(tpAniSirGlobal pMac, break; case eHT_SHORT_GI_40MHZ: - retVal = (uint8_t) (psessionEntry->htConfig.ht_sgi40) ? - ht_cap_info.short_gi_40_mhz : 0; + retVal = (uint8_t)(psessionEntry->htConfig.ht_sgi40) ? + pMac->mlme_cfg->ht_caps.ht_cap_info.short_gi_40_mhz : 0; break; case eHT_SHORT_GI_20MHZ: - retVal = (uint8_t) (psessionEntry->htConfig.ht_sgi20) ? - ht_cap_info.short_gi_20_mhz : 0; + retVal = (uint8_t)(psessionEntry->htConfig.ht_sgi20) ? + pMac->mlme_cfg->ht_caps.ht_cap_info.short_gi_20_mhz : 0; break; case eHT_GREENFIELD: - retVal = (uint8_t)ht_cap_info.green_field; + retVal = (uint8_t)pMac->mlme_cfg->ht_caps.ht_cap_info. + green_field; break; case eHT_MIMO_POWER_SAVE: @@ -2862,15 +2838,17 @@ uint8_t lim_get_ht_capability(tpAniSirGlobal pMac, break; case eHT_PCO: - retVal = (uint8_t) macExtHTCapabilityInfo.pco; + retVal = (uint8_t)pMac->mlme_cfg->ht_caps.ext_cap_info.pco; break; case eHT_TRANSITION_TIME: - retVal = (uint8_t) macExtHTCapabilityInfo.transitionTime; + retVal = (uint8_t)pMac->mlme_cfg->ht_caps.ext_cap_info. + transition_time; break; case eHT_MCS_FEEDBACK: - retVal = (uint8_t) macExtHTCapabilityInfo.mcsFeedback; + retVal = (uint8_t)pMac->mlme_cfg->ht_caps.ext_cap_info. + mcs_feedback; break; case eHT_TX_BEAMFORMING: @@ -4156,15 +4134,7 @@ lim_enable_short_preamble(tpAniSirGlobal pMac, uint8_t enable, tpUpdateBeaconParams pBeaconParams, tpPESession psessionEntry) { - uint32_t val; - - if (wlan_cfg_get_int(pMac, WNI_CFG_SHORT_PREAMBLE, &val) != QDF_STATUS_SUCCESS) { - /* Could not get short preamble enabled flag from CFG. Log error. */ - pe_err("could not retrieve short preamble flag"); - return QDF_STATUS_E_FAILURE; - } - - if (!val) + if (!pMac->mlme_cfg->ht_caps.short_preamble) return QDF_STATUS_SUCCESS; /* 11G short preamble switching is disabled. */ diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index b4cfaa9ad3..13ade4df28 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -612,12 +612,7 @@ populate_dot11f_ht_caps(tpAniSirGlobal pMac, uint8_t nCfgValue8; qdf_size_t ncfglen; QDF_STATUS nSirStatus; - tSirMacHTParametersInfo *pHTParametersInfo; uint8_t disable_high_ht_mcs_2x2 = 0; - union { - uint16_t nCfgValue16; - tSirMacExtendedHTCapabilityInfo extHtCapInfo; - } uHTCapabilityInfo; tSirMacTxBFCapabilityInfo *pTxBFCapabilityInfo; tSirMacASCapabilityInfo *pASCapabilityInfo; @@ -659,14 +654,11 @@ populate_dot11f_ht_caps(tpAniSirGlobal pMac, pDot11f->shortGI40MHz = 0; } - CFG_GET_INT(nSirStatus, pMac, WNI_CFG_HT_AMPDU_PARAMS, nCfgValue); - - nCfgValue8 = (uint8_t) nCfgValue; - pHTParametersInfo = (tSirMacHTParametersInfo *) &nCfgValue8; - - pDot11f->maxRxAMPDUFactor = pHTParametersInfo->maxRxAMPDUFactor; - pDot11f->mpduDensity = pHTParametersInfo->mpduDensity; - pDot11f->reserved1 = pHTParametersInfo->reserved; + pDot11f->maxRxAMPDUFactor = + pMac->mlme_cfg->ht_caps.ampdu_params.max_rx_ampdu_factor; + pDot11f->mpduDensity = + pMac->mlme_cfg->ht_caps.ampdu_params.mpdu_density; + pDot11f->reserved1 = pMac->mlme_cfg->ht_caps.ampdu_params.reserved; ncfglen = SIZE_OF_SUPPORTED_MCS_SET; nSirStatus = wlan_mlme_get_cfg_str( @@ -709,13 +701,11 @@ populate_dot11f_ht_caps(tpAniSirGlobal pMac, pDot11f->mimoPowerSave = psessionEntry->htSmpsvalue; } - CFG_GET_INT(nSirStatus, pMac, WNI_CFG_EXT_HT_CAP_INFO, nCfgValue); - - uHTCapabilityInfo.nCfgValue16 = nCfgValue & 0xFFFF; - - pDot11f->pco = uHTCapabilityInfo.extHtCapInfo.pco; - pDot11f->transitionTime = uHTCapabilityInfo.extHtCapInfo.transitionTime; - pDot11f->mcsFeedback = uHTCapabilityInfo.extHtCapInfo.mcsFeedback; + pDot11f->pco = pMac->mlme_cfg->ht_caps.ext_cap_info.pco; + pDot11f->transitionTime = + pMac->mlme_cfg->ht_caps.ext_cap_info.transition_time; + pDot11f->mcsFeedback = + pMac->mlme_cfg->ht_caps.ext_cap_info.mcs_feedback; CFG_GET_INT(nSirStatus, pMac, WNI_CFG_TX_BF_CAP, nCfgValue); @@ -1155,23 +1145,8 @@ QDF_STATUS populate_dot11f_ht_info(tpAniSirGlobal pMac, tDot11fIEHTInfo *pDot11f, tpPESession psessionEntry) { - uint32_t nCfgValue; qdf_size_t ncfglen; - uint8_t htInfoField1; - uint16_t htInfoField2; QDF_STATUS nSirStatus; - tSirMacHTInfoField1 *pHTInfoField1; - tSirMacHTInfoField2 *pHTInfoField2; - union { - uint16_t nCfgValue16; - tSirMacHTInfoField3 infoField3; - } uHTInfoField; - union { - uint16_t nCfgValue16; - tSirMacHTInfoField2 infoField2; - } uHTInfoField2 = { - 0 - }; if (NULL == psessionEntry) { pe_err("Invalid session entry"); @@ -1180,84 +1155,39 @@ populate_dot11f_ht_info(tpAniSirGlobal pMac, pDot11f->primaryChannel = psessionEntry->currentOperChannel; - CFG_GET_INT(nSirStatus, pMac, WNI_CFG_HT_INFO_FIELD1, nCfgValue); - - htInfoField1 = (uint8_t) nCfgValue; - - pHTInfoField1 = (tSirMacHTInfoField1 *) &htInfoField1; - pHTInfoField1->rifsMode = psessionEntry->beaconParams.fRIFSMode; - pHTInfoField1->serviceIntervalGranularity = + pDot11f->secondaryChannelOffset = + psessionEntry->htSecondaryChannelOffset; + pDot11f->recommendedTxWidthSet = + psessionEntry->htRecommendedTxWidthSet; + pDot11f->rifsMode = psessionEntry->beaconParams.fRIFSMode; + pDot11f->controlledAccessOnly = + pMac->mlme_cfg->ht_caps.info_field_1.controlled_access_only; + pDot11f->serviceIntervalGranularity = pMac->lim.gHTServiceIntervalGranularity; - pHTInfoField1->secondaryChannelOffset = - psessionEntry->htSecondaryChannelOffset; - pHTInfoField1->recommendedTxWidthSet = - psessionEntry->htRecommendedTxWidthSet; - - if ((psessionEntry) && LIM_IS_AP_ROLE(psessionEntry)) { - CFG_GET_INT(nSirStatus, pMac, WNI_CFG_HT_INFO_FIELD2, - nCfgValue); - - uHTInfoField2.nCfgValue16 = nCfgValue & 0xFFFF; /* this is added for fixing CRs on MDM9K platform - 257951, 259577 */ - - uHTInfoField2.infoField2.opMode = psessionEntry->htOperMode; - uHTInfoField2.infoField2.nonGFDevicesPresent = + if (LIM_IS_AP_ROLE(psessionEntry)) { + pDot11f->opMode = psessionEntry->htOperMode; + pDot11f->nonGFDevicesPresent = psessionEntry->beaconParams.llnNonGFCoexist; - uHTInfoField2.infoField2.obssNonHTStaPresent = psessionEntry->beaconParams.gHTObssMode; /*added for Obss */ - - uHTInfoField2.infoField2.reserved = 0; - + pDot11f->obssNonHTStaPresent = + psessionEntry->beaconParams.gHTObssMode; + pDot11f->reserved = 0; } else { - CFG_GET_INT(nSirStatus, pMac, WNI_CFG_HT_INFO_FIELD2, - nCfgValue); - - htInfoField2 = (uint16_t) nCfgValue; - - pHTInfoField2 = (tSirMacHTInfoField2 *) &htInfoField2; - pHTInfoField2->opMode = pMac->lim.gHTOperMode; - pHTInfoField2->nonGFDevicesPresent = - pMac->lim.gHTNonGFDevicesPresent; - pHTInfoField2->obssNonHTStaPresent = pMac->lim.gHTObssMode; /*added for Obss */ - - pHTInfoField2->reserved = 0; + pDot11f->opMode = 0; + pDot11f->nonGFDevicesPresent = 0; + pDot11f->obssNonHTStaPresent = 0; + pDot11f->reserved = 0; } - CFG_GET_INT(nSirStatus, pMac, WNI_CFG_HT_INFO_FIELD3, nCfgValue); - - uHTInfoField.nCfgValue16 = nCfgValue & 0xFFFF; - - uHTInfoField.infoField3.basicSTBCMCS = pMac->lim.gHTSTBCBasicMCS; - uHTInfoField.infoField3.dualCTSProtection = - pMac->lim.gHTDualCTSProtection; - uHTInfoField.infoField3.secondaryBeacon = pMac->lim.gHTSecondaryBeacon; - uHTInfoField.infoField3.lsigTXOPProtectionFullSupport = - psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport; - uHTInfoField.infoField3.pcoActive = pMac->lim.gHTPCOActive; - uHTInfoField.infoField3.pcoPhase = pMac->lim.gHTPCOPhase; - uHTInfoField.infoField3.reserved = 0; - - pDot11f->secondaryChannelOffset = pHTInfoField1->secondaryChannelOffset; - pDot11f->recommendedTxWidthSet = pHTInfoField1->recommendedTxWidthSet; - pDot11f->rifsMode = pHTInfoField1->rifsMode; - pDot11f->controlledAccessOnly = pHTInfoField1->controlledAccessOnly; - pDot11f->serviceIntervalGranularity = - pHTInfoField1->serviceIntervalGranularity; - - pDot11f->opMode = uHTInfoField2.infoField2.opMode; - pDot11f->nonGFDevicesPresent = - uHTInfoField2.infoField2.nonGFDevicesPresent; - pDot11f->obssNonHTStaPresent = - uHTInfoField2.infoField2.obssNonHTStaPresent; - pDot11f->reserved = uHTInfoField2.infoField2.reserved; - - pDot11f->basicSTBCMCS = uHTInfoField.infoField3.basicSTBCMCS; - pDot11f->dualCTSProtection = uHTInfoField.infoField3.dualCTSProtection; - pDot11f->secondaryBeacon = uHTInfoField.infoField3.secondaryBeacon; + pDot11f->basicSTBCMCS = pMac->lim.gHTSTBCBasicMCS; + pDot11f->dualCTSProtection = pMac->lim.gHTDualCTSProtection; + pDot11f->secondaryBeacon = pMac->lim.gHTSecondaryBeacon; pDot11f->lsigTXOPProtectionFullSupport = - uHTInfoField.infoField3.lsigTXOPProtectionFullSupport; - pDot11f->pcoActive = uHTInfoField.infoField3.pcoActive; - pDot11f->pcoPhase = uHTInfoField.infoField3.pcoPhase; - pDot11f->reserved2 = uHTInfoField.infoField3.reserved; + psessionEntry->beaconParams.fLsigTXOPProtectionFullSupport; + pDot11f->pcoActive = pMac->lim.gHTPCOActive; + pDot11f->pcoPhase = pMac->lim.gHTPCOPhase; + pDot11f->reserved2 = 0; + ncfglen = SIZE_OF_BASIC_MCS_SET; nSirStatus = wlan_mlme_get_cfg_str(pDot11f->basicMCSSet, &pMac->mlme_cfg->rates.basic_mcs_set, @@ -5931,8 +5861,7 @@ populate_dot11f_timing_advert_frame(tpAniSirGlobal mac_ctx, if (val) frame->Capabilities.privacy = 1; - wlan_cfg_get_int(mac_ctx, WNI_CFG_SHORT_PREAMBLE, &val); - if (val) + if (mac_ctx->mlme_cfg->ht_caps.short_preamble) frame->Capabilities.shortPreamble = 1; wlan_cfg_get_int(mac_ctx, WNI_CFG_11H_ENABLED, &val); diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 96092c30ce..c337734bee 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -1137,9 +1137,6 @@ typedef struct tagCsrConfigParam { bool fScanTwice; bool enableVhtFor24GHz; bool vendor_vht_sap; - uint8_t enableAmpduPs; - uint8_t enableHtSmps; - uint8_t htSmps; bool send_smps_action; /* * To enable/disable scanning only 2.4Ghz channels on first scan @@ -1156,7 +1153,6 @@ typedef struct tagCsrConfigParam { uint8_t enable_tx_ldpc; uint8_t enable_rx_ldpc; uint8_t disable_high_ht_mcs_2x2; - uint8_t max_amsdu_num; uint32_t ho_delay_for_rx; uint32_t min_delay_btw_roam_scans; uint32_t roam_trigger_reason_bitmask; diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index a7d85c3329..6a8a3c9200 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -488,8 +488,6 @@ struct csr_config { /* To enable scanning 2g channels twice on single scan req from HDD */ bool fScanTwice; uint32_t nVhtChannelWidth; - uint8_t enableHtSmps; - uint8_t htSmps; bool send_smps_action; uint8_t tx_ldpc_enable; uint8_t rx_ldpc_enable; @@ -498,7 +496,6 @@ struct csr_config { * Enable/Disable heartbeat offload */ bool enableHeartBeatOffload; - uint8_t max_amsdu_num; uint32_t ho_delay_for_rx; uint32_t min_delay_btw_roam_scans; uint32_t roam_trigger_reason_bitmask; diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 6de523a9ec..408a114ca7 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -13670,9 +13670,9 @@ QDF_STATUS sme_update_mimo_power_save(tHalHandle hal, sme_debug("SMPS enable: %d mode: %d send action: %d", is_ht_smps_enabled, ht_smps_mode, send_smps_action); - mac_ctx->roam.configParam.enableHtSmps = + mac_ctx->mlme_cfg->ht_caps.enable_smps = is_ht_smps_enabled; - mac_ctx->roam.configParam.htSmps = ht_smps_mode; + mac_ctx->mlme_cfg->ht_caps.smps = ht_smps_mode; mac_ctx->roam.configParam.send_smps_action = send_smps_action; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index f43dae335b..76e383fe89 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -2966,16 +2966,12 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac, /* Remove this code once SLM_Sessionization is supported */ /* BMPS_WORKAROUND_NOT_NEEDED */ pMac->roam.configParam.doBMPSWorkaround = 0; - pMac->roam.configParam.enableHtSmps = pParam->enableHtSmps; - pMac->roam.configParam.htSmps = pParam->htSmps; pMac->roam.configParam.send_smps_action = pParam->send_smps_action; pMac->roam.configParam.tx_ldpc_enable = pParam->enable_tx_ldpc; pMac->roam.configParam.rx_ldpc_enable = pParam->enable_rx_ldpc; pMac->roam.configParam.disable_high_ht_mcs_2x2 = pParam->disable_high_ht_mcs_2x2; - pMac->roam.configParam.max_amsdu_num = - pParam->max_amsdu_num; pMac->roam.configParam.ho_delay_for_rx = pParam->ho_delay_for_rx; pMac->roam.configParam.min_delay_btw_roam_scans = @@ -3190,7 +3186,6 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam) pParam->enable_rx_ldpc = cfg_params->rx_ldpc_enable; pParam->wep_tkip_in_he = cfg_params->wep_tkip_in_he; pParam->disable_high_ht_mcs_2x2 = cfg_params->disable_high_ht_mcs_2x2; - pParam->max_amsdu_num = cfg_params->max_amsdu_num; pParam->ho_delay_for_rx = cfg_params->ho_delay_for_rx; pParam->min_delay_btw_roam_scans = cfg_params->min_delay_btw_roam_scans; pParam->roam_trigger_reason_bitmask = @@ -3239,8 +3234,6 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam) pMac->sme.ps_global_info.auto_bmps_timer_val; pParam->f_sta_miracast_mcc_rest_time_val = pMac->f_sta_miracast_mcc_rest_time_val; - pParam->enableHtSmps = pMac->roam.configParam.enableHtSmps; - pParam->htSmps = pMac->roam.configParam.htSmps; pParam->send_smps_action = pMac->roam.configParam.send_smps_action; pParam->sta_roam_policy_params.dfs_mode = pMac->roam.configParam.sta_roam_policy.dfs_mode; @@ -15785,17 +15778,17 @@ QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId, pMac->mlme_cfg->vht_caps.vht_cap_info.enable_gid; csr_join_req->enableAmpduPs = - (uint8_t)pMac->mlme_cfg->feature_flags.enable_ampdu; + (uint8_t)pMac->mlme_cfg->ht_caps.enable_ampdu_ps; csr_join_req->enableHtSmps = - (uint8_t) pMac->roam.configParam.enableHtSmps; + (uint8_t)pMac->mlme_cfg->ht_caps.enable_smps; - csr_join_req->htSmps = (uint8_t) pMac->roam.configParam.htSmps; + csr_join_req->htSmps = (uint8_t)pMac->mlme_cfg->ht_caps.smps; csr_join_req->send_smps_action = pMac->roam.configParam.send_smps_action; csr_join_req->max_amsdu_num = - (uint8_t) pMac->roam.configParam.max_amsdu_num; + (uint8_t)pMac->mlme_cfg->ht_caps.max_num_amsdu; if (pMac->roam.roamSession[sessionId].fWMMConnection) csr_join_req->isWMEenabled = true; diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index ed6ed28e3b..d26a7767b8 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -2655,11 +2655,6 @@ QDF_STATUS wma_roam_scan_fill_self_caps(tp_wma_handle wma_handle, uint16_t *pCfgValue16; uint8_t nCfgValue8, *pCfgValue8; tSirMacQosInfoStation macQosInfoSta; - union { - uint16_t nCfgValue16; - struct mlme_ht_capabilities_info htCapInfo; - tSirMacExtendedHTCapabilityInfo extHtCapInfo; - } uHTCapabilityInfo; qdf_mem_set(&macQosInfoSta, sizeof(tSirMacQosInfoStation), 0); /* Roaming is done only for INFRA STA type. @@ -2678,13 +2673,8 @@ QDF_STATUS wma_roam_scan_fill_self_caps(tp_wma_handle wma_handle, val = pMac->mlme_cfg->wep_params.is_privacy_enabled; if (val) selfCaps.privacy = 1; - if (wlan_cfg_get_int(pMac, WNI_CFG_SHORT_PREAMBLE, &val) != - QDF_STATUS_SUCCESS) { - QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_ERROR, - "Failed to get WNI_CFG_SHORT_PREAMBLE"); - return QDF_STATUS_E_FAILURE; - } - if (val) + + if (pMac->mlme_cfg->ht_caps.short_preamble) selfCaps.shortPreamble = 1; selfCaps.pbcc = 0; @@ -2735,19 +2725,14 @@ QDF_STATUS wma_roam_scan_fill_self_caps(tp_wma_handle wma_handle, roam_offload_params->capability <<= RSN_CAPS_SHIFT; roam_offload_params->capability |= ((*pCfgValue16) & 0xFFFF); - nCfgValue = *(uint32_t *)&pMac->mlme_cfg->ht_caps.ht_cap_info; - uHTCapabilityInfo.nCfgValue16 = nCfgValue & 0xFFFF; roam_offload_params->ht_caps_info = - uHTCapabilityInfo.nCfgValue16 & 0xFFFF; - if (wlan_cfg_get_int(pMac, WNI_CFG_HT_AMPDU_PARAMS, &nCfgValue) != - QDF_STATUS_SUCCESS) { - QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_ERROR, - "Failed to get WNI_CFG_HT_AMPDU_PARAMS"); - return QDF_STATUS_E_FAILURE; - } - /* tSirMacHTParametersInfo */ - nCfgValue8 = (uint8_t) nCfgValue; - roam_offload_params->ampdu_param = (nCfgValue8) & 0xFF; + *(uint32_t *)&pMac->mlme_cfg->ht_caps.ht_cap_info; + + roam_offload_params->ampdu_param = + *(uint32_t *)&pMac->mlme_cfg->ht_caps.ampdu_params; + + roam_offload_params->ht_ext_cap = + *(uint32_t *)&pMac->mlme_cfg->ht_caps.ext_cap_info; val_len = ROAM_OFFLOAD_NUM_MCS_SET; if (wlan_mlme_get_cfg_str((uint8_t *)roam_offload_params->mcsset, @@ -2757,16 +2742,6 @@ QDF_STATUS wma_roam_scan_fill_self_caps(tp_wma_handle wma_handle, "Failed to get CFG_SUPPORTED_MCS_SET"); return QDF_STATUS_E_FAILURE; } - if (wlan_cfg_get_int(pMac, WNI_CFG_EXT_HT_CAP_INFO, &nCfgValue) != - QDF_STATUS_SUCCESS) { - QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_ERROR, - "Failed to get WNI_CFG_EXT_HT_CAP_INFO"); - return QDF_STATUS_E_FAILURE; - } - /* uHTCapabilityInfo.extHtCapInfo */ - uHTCapabilityInfo.nCfgValue16 = nCfgValue & 0xFFFF; - roam_offload_params->ht_ext_cap = - uHTCapabilityInfo.nCfgValue16 & 0xFFFF; if (wlan_cfg_get_int(pMac, WNI_CFG_TX_BF_CAP, &nCfgValue) != QDF_STATUS_SUCCESS) {