From 8bb46df0d8816c795d38715dd43bbe6e01a9580d Mon Sep 17 00:00:00 2001 From: Gururaj Pandurangi Date: Wed, 9 Nov 2022 14:32:00 -0800 Subject: [PATCH] qcacld-3.0: Set AMSDU/AMPDU caps per vdev from cli In the case of EHT, if the mode is MLO then set AMSDU/AMPDU caps per vdev instead of setting it only on assoc vdev. Change-Id: Iaf480ee6a42cea83e30f412f663f688c0330d246 CRs-Fixed: 3392015 --- .../mlme/dispatcher/inc/cfg_mlme_generic.h | 21 ++++++ .../mlme/dispatcher/inc/wlan_mlme_api.h | 34 +++++++++ .../dispatcher/inc/wlan_mlme_public_struct.h | 2 + .../mlme/dispatcher/inc/wlan_mlme_ucfg_api.h | 38 ++++++++-- .../mlme/dispatcher/src/wlan_mlme_api.c | 28 ++++++++ core/wma/src/wma_main.c | 71 +++++++++++++++++-- 6 files changed, 183 insertions(+), 11 deletions(-) diff --git a/components/mlme/dispatcher/inc/cfg_mlme_generic.h b/components/mlme/dispatcher/inc/cfg_mlme_generic.h index 8db02bbf2f..7095783ff1 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_generic.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_generic.h @@ -57,6 +57,27 @@ enum wlan_wds_mode { WLAN_WDS_MODE_MAX = WLAN_WDS_MODE_LAST - 1, }; +/** + * enum wlan_eht_mode - EHT mode of operation + * @WLAN_EHT_MODE_DISABLED: EHT is disabled + * @WLAN_EHT_MODE_SLO: Single-link operation mode + * @WLAN_EHT_MODE_MLSR: Multi-link Single-Radio mode + * @WLAN_EHT_MODE_MLMR: Multi-link Multi-Radio mode + * @WLAN_EHT_MODE_LAST: last value in enum + * @WLAN_EHT_MODE_MAX: max value supported + * + * This is used for 'type' values in eht_mode + */ +enum wlan_eht_mode { + WLAN_EHT_MODE_DISABLED = 0, + WLAN_EHT_MODE_SLO = 1, + WLAN_EHT_MODE_MLSR = 2, + WLAN_EHT_MODE_MLMR = 3, + /* keep this last */ + WLAN_EHT_MODE_LAST, + WLAN_EHT_MODE_MAX = WLAN_EHT_MODE_LAST - 1, +}; + /** * enum debug_packet_log_type - Debug packet log type * @DEBUG_PKTLOG_TYPE_NONE: Debug packet log is disabled diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h index 10e7640fc4..75cb9ef16a 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -2510,6 +2510,27 @@ wlan_mlme_set_relaxed_6ghz_conn_policy(struct wlan_objmgr_psoc *psoc, #endif #ifdef WLAN_FEATURE_11BE_MLO +/** + * wlan_mlme_get_eht_mode() - Get the EHT mode of operations + * @psoc: psoc context + * @value: EHT mode value ptr + * + * Return: QDF_STATUS + */ +QDF_STATUS +wlan_mlme_get_eht_mode(struct wlan_objmgr_psoc *psoc, + enum wlan_eht_mode *value); + +/** + * wlan_mlme_set_eht_mode() - Set the EHT mode of operation + * @psoc: psoc context + * @value: EHT mode value + * + * Return: QDF_STATUS + */ +QDF_STATUS +wlan_mlme_set_eht_mode(struct wlan_objmgr_psoc *psoc, enum wlan_eht_mode value); + /** * wlan_mlme_get_emlsr_mode_enabled() - Get the eMLSR mode flag * @psoc: psoc context @@ -2575,6 +2596,19 @@ QDF_STATUS wlan_mlme_set_t2lm_negotiation_supported(struct wlan_objmgr_psoc *psoc, uint8_t value); #else +static inline QDF_STATUS +wlan_mlme_get_eht_mode(struct wlan_objmgr_psoc *psoc, enum wlan_eht_mode *value) +{ + *value = WLAN_EHT_MODE_DISABLED; + return QDF_STATUS_SUCCESS; +} + +static inline QDF_STATUS +wlan_mlme_set_eht_mode(struct wlan_objmgr_psoc *psoc, enum wlan_eht_mode value) +{ + return QDF_STATUS_SUCCESS; +} + static inline QDF_STATUS wlan_mlme_get_emlsr_mode_enabled(struct wlan_objmgr_psoc *psoc, bool *value) { diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index b33eb0b291..8d3a0b1f99 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -1388,6 +1388,7 @@ struct wlan_user_mcc_quota { * @mgmt_hw_tx_retry_count: MGMT HW tx retry count for frames * @relaxed_6ghz_conn_policy: 6GHz relaxed connection policy * @std_6ghz_conn_policy: 6GHz standard connection policy + * @eht_mode: EHT mode of operation * @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 @@ -1446,6 +1447,7 @@ struct wlan_mlme_generic { bool std_6ghz_conn_policy; #endif #ifdef WLAN_FEATURE_11BE_MLO + enum wlan_eht_mode eht_mode; bool enable_emlsr_mode; enum t2lm_negotiation_support t2lm_negotiation_support; #endif diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index 0fb6722523..feb724998c 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -2951,18 +2951,33 @@ ucfg_mlme_set_relaxed_6ghz_conn_policy(struct wlan_objmgr_psoc *psoc, } /** - * ucfg_mlme_get_emlsr_mode_enabled() - Get eMLSR mode flag + * ucfg_mlme_set_eht_mode() - Set EHT mode of operation * @psoc: pointer to psoc object - * @value: Value that needs to be set from the caller + * @value: EHT mode 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_emlsr_mode_enabled(struct wlan_objmgr_psoc *psoc, bool *value) +ucfg_mlme_set_eht_mode(struct wlan_objmgr_psoc *psoc, enum wlan_eht_mode value) { - return wlan_mlme_get_emlsr_mode_enabled(psoc, value); + return wlan_mlme_set_eht_mode(psoc, value); +} + +/** + * ucfg_mlme_get_eht_mode() - Get EHT mode of operation + * @psoc: pointer to psoc object + * @value: EHT mode value that is set by the user + * + * Inline UCFG API to be used by HDD/OSIF callers + * + * Return: QDF Status + */ +static inline QDF_STATUS +ucfg_mlme_get_eht_mode(struct wlan_objmgr_psoc *psoc, enum wlan_eht_mode *value) +{ + return wlan_mlme_get_eht_mode(psoc, value); } /** @@ -2980,6 +2995,21 @@ ucfg_mlme_set_emlsr_mode_enabled(struct wlan_objmgr_psoc *psoc, bool value) return wlan_mlme_set_emlsr_mode_enabled(psoc, value); } +/** + * ucfg_mlme_get_emlsr_mode_enabled() - Get eMLSR mode flag + * @psoc: pointer to psoc object + * @value: Value that is set by the user + * + * Inline UCFG API to be used by HDD/OSIF callers + * + * Return: QDF Status + */ +static inline QDF_STATUS +ucfg_mlme_get_emlsr_mode_enabled(struct wlan_objmgr_psoc *psoc, bool *value) +{ + return wlan_mlme_get_emlsr_mode_enabled(psoc, value); +} + /** * ucfg_mlme_get_opr_rate() - Get operational rate set * @vdev: pointer to vdev object diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c index 49493c3f5e..e850ce65eb 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -3406,6 +3406,20 @@ wlan_mlme_set_relaxed_6ghz_conn_policy(struct wlan_objmgr_psoc *psoc, #endif #ifdef WLAN_FEATURE_11BE_MLO +QDF_STATUS +wlan_mlme_get_eht_mode(struct wlan_objmgr_psoc *psoc, enum wlan_eht_mode *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; + + *value = mlme_obj->cfg.gen.eht_mode; + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS wlan_mlme_get_emlsr_mode_enabled(struct wlan_objmgr_psoc *psoc, bool *value) { @@ -3420,6 +3434,20 @@ wlan_mlme_get_emlsr_mode_enabled(struct wlan_objmgr_psoc *psoc, bool *value) return QDF_STATUS_SUCCESS; } +QDF_STATUS +wlan_mlme_set_eht_mode(struct wlan_objmgr_psoc *psoc, enum wlan_eht_mode 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; + + mlme_obj->cfg.gen.eht_mode = value; + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS wlan_mlme_set_emlsr_mode_enabled(struct wlan_objmgr_psoc *psoc, bool value) { diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index f59959010c..121827a2aa 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -120,6 +120,7 @@ #include "wlan_fwol_ucfg_api.h" #include "wlan_tdls_api.h" #include "wlan_twt_cfg_ext_api.h" +#include "wlan_mlo_mgr_sta.h" #define WMA_LOG_COMPLETION_TIMER 500 /* 500 msecs */ #define WMI_TLV_HEADROOM 128 @@ -1195,6 +1196,50 @@ static inline wmi_traffic_ac wma_convert_ac_value(uint32_t ac_value) return WMI_AC_MAX; } +#ifdef WLAN_FEATURE_11BE +/** + * wma_set_per_link_amsdu_cap() - Set AMSDU/AMPDU capability per link to FW. + * @wma: wma handle + * @privcmd: pointer to set command parameters + * @aggr_type: aggregration type + * + * Return: QDF_STATUS_SUCCESS if set command is sent successfully, else + * QDF_STATUS_E_FAILURE + */ +static QDF_STATUS +wma_set_per_link_amsdu_cap(tp_wma_handle wma, wma_cli_set_cmd_t *privcmd, + wmi_vdev_custom_aggr_type_t aggr_type) +{ + uint8_t vdev_id; + uint8_t op_mode; + QDF_STATUS ret = QDF_STATUS_E_FAILURE; + + for (vdev_id = 0; vdev_id < WLAN_MAX_VDEVS; vdev_id++) { + op_mode = wlan_get_opmode_from_vdev_id(wma->pdev, vdev_id); + if (op_mode == QDF_STA_MODE) { + ret = wma_set_tx_rx_aggr_size(vdev_id, + privcmd->param_value, + privcmd->param_value, + aggr_type); + if (QDF_IS_STATUS_ERROR(ret)) { + wma_err("set_aggr_size failed for vdev: %d, ret %d", + vdev_id, ret); + return ret; + } + } + } + + return ret; +} +#else +static inline QDF_STATUS +wma_set_per_link_amsdu_cap(tp_wma_handle wma, wma_cli_set_cmd_t *privcmd, + wmi_vdev_custom_aggr_type_t aggr_type) +{ + return QDF_STATUS_SUCCESS; +} +#endif + /** * wma_process_cli_set_cmd() - set parameters to fw * @wma: wma handle @@ -1213,6 +1258,7 @@ static void wma_process_cli_set_cmd(tp_wma_handle wma, struct pdev_params pdev_param = {0}; void *soc = cds_get_context(QDF_MODULE_ID_SOC); struct target_psoc_info *tgt_hdl; + enum wlan_eht_mode eht_mode; if (!mac) { wma_err("Failed to get mac"); @@ -1318,13 +1364,24 @@ static void wma_process_cli_set_cmd(tp_wma_handle wma, WMI_VDEV_CUSTOM_AGGR_TYPE_AMPDU; } - ret = wma_set_tx_rx_aggr_size(vid, - privcmd->param_value, - privcmd->param_value, - aggr_type); - if (QDF_IS_STATUS_ERROR(ret)) { - wma_err("set_aggr_size failed ret %d", ret); - return; + wlan_mlme_get_eht_mode(wma->psoc, &eht_mode); + if (eht_mode == WLAN_EHT_MODE_MLSR || + eht_mode == WLAN_EHT_MODE_MLMR) { + ret = wma_set_per_link_amsdu_cap(wma, privcmd, + aggr_type); + if (QDF_IS_STATUS_ERROR(ret)) + return; + } else { + ret = wma_set_tx_rx_aggr_size( + vid, + privcmd->param_value, + privcmd->param_value, + aggr_type); + if (QDF_IS_STATUS_ERROR(ret)) { + wma_err("set_aggr_size failed ret %d", + ret); + return; + } } break; case GEN_PARAM_CRASH_INJECT: