From ad7dfc2ab64fc9f5582ff35682c82988cce426eb Mon Sep 17 00:00:00 2001 From: Amruta Kulkarni Date: Wed, 29 Jun 2022 17:39:47 -0700 Subject: [PATCH] qcacld-3.0: Add cfg for t2lm negotiation supported Changes to add cfg item for t2lm negotiation support Change-Id: I94992f5bc8142325434223c59ebbcedd86aa0ff9 CRs-Fixed: 3236628 --- components/mlme/core/src/wlan_mlme_main.c | 19 ++++++ .../mlme/dispatcher/inc/cfg_mlme_generic.h | 60 ++++++++++++++++++- .../mlme/dispatcher/inc/wlan_mlme_api.h | 35 +++++++++++ .../dispatcher/inc/wlan_mlme_public_struct.h | 2 + .../mlme/dispatcher/src/wlan_mlme_api.c | 32 ++++++++++ .../src/sys/legacy/src/utils/src/parser_api.c | 11 +++- 6 files changed, 155 insertions(+), 4 deletions(-) diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index 84d90d29eb..a38db82e7f 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -527,11 +527,29 @@ static void mlme_init_emlsr_mode(struct wlan_objmgr_psoc *psoc, { gen->enable_emlsr_mode = cfg_default(CFG_EMLSR_MODE_ENABLE); } + +/** + * mlme_init_tl2m_negotiation_support() - initialize t2lm support + * @psoc: Pointer to PSOC + * @gen: pointer to generic CFG items + * + * Return: None + */ +static void mlme_init_tl2m_negotiation_support(struct wlan_objmgr_psoc *psoc, + struct wlan_mlme_generic *gen) +{ + gen->t2lm_negotiation_support = cfg_default(CFG_T2LM_NEGOTIATION_SUPPORT); +} #else static void mlme_init_emlsr_mode(struct wlan_objmgr_psoc *psoc, struct wlan_mlme_generic *gen) { } + +static void mlme_init_tl2m_negotiation_support(struct wlan_objmgr_psoc *psoc, + struct wlan_mlme_generic *gen) +{ +} #endif #if defined(WLAN_FEATURE_SR) @@ -622,6 +640,7 @@ static void mlme_init_generic_cfg(struct wlan_objmgr_psoc *psoc, mlme_init_mgmt_hw_tx_retry_count_cfg(psoc, gen); mlme_init_relaxed_6ghz_conn_policy(psoc, gen); mlme_init_emlsr_mode(psoc, gen); + mlme_init_tl2m_negotiation_support(psoc, gen); } static void mlme_init_edca_ani_cfg(struct wlan_objmgr_psoc *psoc, diff --git a/components/mlme/dispatcher/inc/cfg_mlme_generic.h b/components/mlme/dispatcher/inc/cfg_mlme_generic.h index fa56c1e4ad..bbe7fed651 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_generic.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_generic.h @@ -31,6 +31,8 @@ * enum monitor_mode_concurrency - Monitor mode concurrency * @MONITOR_MODE_CONC_NO_SUPPORT: No concurrency supported with monitor mode * @MONITOR_MODE_CONC_STA_SCAN_MON: STA + monitor mode concurrency is supported + * @MONITOR_MODE_CONC_AFTER_LAST: last value in enum + * @MONITOR_MODE_CONC_MAX: max value supported */ enum monitor_mode_concurrency { MONITOR_MODE_CONC_NO_SUPPORT, @@ -43,7 +45,8 @@ enum monitor_mode_concurrency { * enum wds_mode_type: wds mode * @WLAN_WDS_MODE_DISABLED: WDS is disabled * @WLAN_WDS_MODE_REPEATER: WDS repeater mode - * + * @WLAN_WDS_MODE_LAST: last value in enum + * @WLAN_WDS_MODE_MAX: max value supported * This is used for 'type' values in wds_mode */ enum wlan_wds_mode { @@ -71,6 +74,28 @@ enum debug_packet_log_type { DEBUG_PKTLOG_TYPE_ARP = 0x10, }; +/** + * enum t2lm_negotiation_support: t2lm negotiation supported + * @T2LM_NEGOTIATION_DISABLED: T2LM is disabled + * @T2LM_NEGOTIATION_ALL_TIDS_TO_SUBSET_OF_LINKS: supports the mapping + * of all TIDs to the same link set both DL and UL. + * @T2LM_NEGOTIATION_RESERVED: + * this mapping value is reserved. + * @T2LM_NEGOTIATION_DISJOINT_MAPPING: supports the mapping of + * each TID to the same or different link set. + * @T2LM_NEGOTIATION_LAST: last value in enum + * @T2LM_NEGOTIATION_MAX: max value supported + */ +enum t2lm_negotiation_support { + T2LM_NEGOTIATION_DISABLED = 0, + T2LM_NEGOTIATION_ALL_TIDS_TO_SUBSET_OF_LINKS = 1, + T2LM_NEGOTIATION_RESERVED = 2, + T2LM_NEGOTIATION_DISJOINT_MAPPING = 3, + T2LM_NEGOTIATION_LAST, + /* keep this last */ + T2LM_NEGOTIATION_MAX = T2LM_NEGOTIATION_LAST - 1, +}; + /* * pmfSaQueryMaxRetries - Control PMF SA query retries for SAP * @Min: 0 @@ -1058,6 +1083,36 @@ enum debug_packet_log_type { #define CFG_SR_ENABLE_MODES_ALL #endif +#ifdef WLAN_FEATURE_11BE_MLO +/* + * t2lm_negotiation_support - T2LM negotiation support by STA + * @Min: 0 + * @Max: 3 + * @Default: 1 + * + * This cfg is used to define t2lm negotiation supported value by STA + * If 0 - t2lm negotiation is not supported + * If 1 - supports the mapping of all TIDs to the same link set both DL and UL. + * If 2 - reserved + * If 3 - supports the mapping of each TID to the same or different link set. + * + * Related: None + * + * Supported Feature: STA + */ +#define CFG_T2LM_NEGOTIATION_SUPPORT CFG_UINT( \ + "t2lm_negotiation_supported", \ + T2LM_NEGOTIATION_DISABLED, \ + T2LM_NEGOTIATION_DISJOINT_MAPPING, \ + T2LM_NEGOTIATION_ALL_TIDS_TO_SUBSET_OF_LINKS, \ + CFG_VALUE_OR_DEFAULT, \ + "T2LM negotiation supported value") + +#define CFG_T2LM_NEGOTIATION_SUPPORTED CFG(CFG_T2LM_NEGOTIATION_SUPPORT) +#else +#define CFG_T2LM_NEGOTIATION_SUPPORTED +#endif + #define CFG_GENERIC_ALL \ CFG(CFG_ENABLE_DEBUG_PACKET_LOG) \ CFG(CFG_PMF_SA_QUERY_MAX_RETRIES) \ @@ -1098,5 +1153,6 @@ enum debug_packet_log_type { CFG(CFG_MGMT_FRAME_HW_TX_RETRY_COUNT) \ CFG_RELAX_6GHZ_CONN_POLICY \ CFG_EMLSR_MODE_ENABLED \ - CFG_SR_ENABLE_MODES_ALL + CFG_SR_ENABLE_MODES_ALL \ + CFG_T2LM_NEGOTIATION_SUPPORTED #endif /* __CFG_MLME_GENERIC_H */ diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h index 32077eaec7..d1cd97e2dd 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -2519,6 +2519,28 @@ wlan_mlme_set_eml_params(struct wlan_objmgr_psoc *psoc, void wlan_mlme_get_eml_params(struct wlan_objmgr_psoc *psoc, struct wlan_mlo_eml_cap *cap); + +/** + * wlan_mlme_get_t2lm_negotiation_supported() - Get the T2LM + * negotiation supported value + * @psoc: psoc context + * + * Return: t2lm negotiation supported value + */ +enum t2lm_negotiation_support +wlan_mlme_get_t2lm_negotiation_supported(struct wlan_objmgr_psoc *psoc); + +/** + * wlan_mlme_set_t2lm_negotiation_supported() - Set the T2LM + * negotiation supported value + * @psoc: psoc context + * @value: t2lm negotiation supported value + * + * Return: qdf status + */ +QDF_STATUS +wlan_mlme_set_t2lm_negotiation_supported(struct wlan_objmgr_psoc *psoc, + uint8_t value); #else static inline QDF_STATUS wlan_mlme_get_emlsr_mode_enabled(struct wlan_objmgr_psoc *psoc, bool *value) @@ -2544,6 +2566,19 @@ wlan_mlme_get_eml_params(struct wlan_objmgr_psoc *psoc, struct wlan_mlo_eml_cap *cap) { } + +static inline enum t2lm_negotiation_support +wlan_mlme_get_t2lm_negotiation_supported(struct wlan_objmgr_psoc *psoc) +{ + return T2LM_NEGOTIATION_DISABLED; +} + +static inline QDF_STATUS +wlan_mlme_set_t2lm_negotiation_supported(struct wlan_objmgr_psoc *psoc, + uint8_t value) +{ + return QDF_STATUS_E_NOSUPPORT; +} #endif /** diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index 8f8d28725c..f7c59b581e 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -1344,6 +1344,7 @@ struct wlan_user_mcc_quota { * @tx_retry_multiplier: TX xretry extension parameter * @mgmt_hw_tx_retry_count: MGMT HW tx retry count for frames * @relaxed_6ghz_conn_policy: 6GHz relaxed connection policy + * @t2lm_negotiation_support: T2LM negotiation supported enum value * @enable_emlsr_mode: 11BE eMLSR mode support * @safe_mode_enable: safe mode to bypass some strict 6 GHz checks for * connection, bypass strict power levels @@ -1401,6 +1402,7 @@ struct wlan_mlme_generic { #endif #ifdef WLAN_FEATURE_11BE_MLO bool enable_emlsr_mode; + enum t2lm_negotiation_support t2lm_negotiation_support; #endif #ifdef WLAN_FEATURE_MCC_QUOTA struct wlan_user_mcc_quota user_mcc_quota; diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c index 4288dbdb93..7bab11d356 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -3409,6 +3409,38 @@ wlan_mlme_get_eml_params(struct wlan_objmgr_psoc *psoc, cap->emlsr_trans_delay = mlme_obj->cfg.eml_cap.emlsr_trans_delay; cap->emlmr_supp = mlme_obj->cfg.eml_cap.emlmr_supp; } + +enum t2lm_negotiation_support +wlan_mlme_get_t2lm_negotiation_supported(struct wlan_objmgr_psoc *psoc) +{ + struct wlan_mlme_psoc_ext_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_ext_obj(psoc); + if (!mlme_obj) + return T2LM_NEGOTIATION_DISABLED; + + return mlme_obj->cfg.gen.t2lm_negotiation_support; +} + +QDF_STATUS +wlan_mlme_set_t2lm_negotiation_supported(struct wlan_objmgr_psoc *psoc, + uint8_t value) +{ + struct wlan_mlme_psoc_ext_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_ext_obj(psoc); + if (!mlme_obj) + return QDF_STATUS_E_FAILURE; + + if (value > T2LM_NEGOTIATION_MAX) { + mlme_err("Invalid value %d", value); + return QDF_STATUS_E_INVAL; + } + + mlme_obj->cfg.gen.t2lm_negotiation_support = value; + + return QDF_STATUS_SUCCESS; +} #endif QDF_STATUS 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 b740875b0a..eef8a6b497 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 @@ -10016,9 +10016,11 @@ populate_dot11f_mlo_caps(struct mac_context *mac_ctx, mlo_ie->eml_capab_present = 0; } - mlo_ie->mld_capab_and_op_present = 1; common_info_len += WLAN_ML_BV_CINFO_MLDCAPANDOP_SIZE; mlo_ie->mld_id_present = 0; + mlo_ie->mld_capab_and_op_present = 1; + mlo_ie->mld_capab_and_op_info.tid_link_map_supported = + wlan_mlme_get_t2lm_negotiation_supported(mac_ctx->psoc); mlo_ie->reserved = 0; mlo_ie->reserved_1 = 0; mlo_ie->common_info_length = common_info_len; @@ -11096,7 +11098,8 @@ QDF_STATUS populate_dot11f_assoc_req_mlo_ie(struct mac_context *mac_ctx, pe_debug("max_simultaneous_link_num %d", mlo_ie->mld_capab_and_op_info.max_simultaneous_link_num); mlo_ie->mld_capab_and_op_info.srs_support = 0; - mlo_ie->mld_capab_and_op_info.tid_link_map_supported = 0; + mlo_ie->mld_capab_and_op_info.tid_link_map_supported = + wlan_mlme_get_t2lm_negotiation_supported(mac_ctx->psoc); mlo_ie->mld_capab_and_op_info.str_freq_separation = 0; mlo_ie->mld_capab_and_op_info.aar_support = 0; } @@ -11188,6 +11191,10 @@ QDF_STATUS populate_dot11f_assoc_req_mlo_ie(struct mac_context *mac_ctx, WLAN_ML_BV_CINFO_MLDCAPANDOP_MAXSIMULLINKS_IDX, WLAN_ML_BV_CINFO_MLDCAPANDOP_MAXSIMULLINKS_BITS, mlo_ie->mld_capab_and_op_info.max_simultaneous_link_num); + QDF_SET_BITS(*(uint16_t *)p_ml_ie, + WLAN_ML_BV_CINFO_MLDCAPANDOP_TIDTOLINKMAPNEGSUPPORT_IDX, + WLAN_ML_BV_CINFO_MLDCAPANDOP_TIDTOLINKMAPNEGSUPPORT_BITS, + mlo_ie->mld_capab_and_op_info.tid_link_map_supported); p_ml_ie += WLAN_ML_BV_CINFO_MLDCAPANDOP_SIZE; len_remaining -= WLAN_ML_BV_CINFO_MLDCAPANDOP_SIZE; }