From a6b063fa617f88e1b62bbf1c334bac1495b422c7 Mon Sep 17 00:00:00 2001 From: Jianmin Zhu Date: Sun, 11 Apr 2021 14:12:47 +0800 Subject: [PATCH] qcacld-3.0: Disable TX_AGGREGATION_SIZE ini for HSP HSP doesn't support TX_AGGREGATION_SIZE ini, need disable it to avoid confusing. Change-Id: I9e49ad5218f913f116cf4472f768f572740f14df CRs-Fixed: 2918796 --- components/mlme/core/src/wlan_mlme_main.c | 22 ++++++++- components/mlme/dispatcher/inc/cfg_qos.h | 18 +++++-- configs/default_defconfig | 3 ++ core/hdd/src/wlan_hdd_cfg80211.c | 58 +++++++++++++++++++++++ core/wma/src/wma_features.c | 6 ++- 5 files changed, 99 insertions(+), 8 deletions(-) diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index 3c349e20175f..08a129b15b26 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -752,8 +752,9 @@ static void mlme_init_ht_cap_in_cfg(struct wlan_objmgr_psoc *psoc, cfg_get(psoc, CFG_SHORT_SLOT_TIME_ENABLED); } -static void mlme_init_qos_cfg(struct wlan_objmgr_psoc *psoc, - struct wlan_mlme_qos *qos_aggr_params) +#ifdef TX_AGGREGATION_SIZE_ENABLE +static void mlme_init_tx_aggregation_size(struct wlan_objmgr_psoc *psoc, + struct wlan_mlme_qos *qos_aggr_params) { qos_aggr_params->tx_aggregation_size = cfg_get(psoc, CFG_TX_AGGREGATION_SIZE); @@ -765,6 +766,23 @@ static void mlme_init_qos_cfg(struct wlan_objmgr_psoc *psoc, cfg_get(psoc, CFG_TX_AGGREGATION_SIZEVI); qos_aggr_params->tx_aggregation_size_vo = cfg_get(psoc, CFG_TX_AGGREGATION_SIZEVO); +} +#else +static void mlme_init_tx_aggregation_size(struct wlan_objmgr_psoc *psoc, + struct wlan_mlme_qos *qos_aggr_params) +{ + qos_aggr_params->tx_aggregation_size = 0; + qos_aggr_params->tx_aggregation_size_be = 0; + qos_aggr_params->tx_aggregation_size_bk = 0; + qos_aggr_params->tx_aggregation_size_vi = 0; + qos_aggr_params->tx_aggregation_size_vo = 0; +} +#endif + +static void mlme_init_qos_cfg(struct wlan_objmgr_psoc *psoc, + struct wlan_mlme_qos *qos_aggr_params) +{ + mlme_init_tx_aggregation_size(psoc, qos_aggr_params); qos_aggr_params->rx_aggregation_size = cfg_get(psoc, CFG_RX_AGGREGATION_SIZE); qos_aggr_params->tx_aggr_sw_retry_threshold_be = diff --git a/components/mlme/dispatcher/inc/cfg_qos.h b/components/mlme/dispatcher/inc/cfg_qos.h index 07f74acdf68c..9d94e33e7769 100644 --- a/components/mlme/dispatcher/inc/cfg_qos.h +++ b/components/mlme/dispatcher/inc/cfg_qos.h @@ -26,11 +26,13 @@ #if defined(QCA_WIFI_QCA6290) || defined(QCA_WIFI_QCA6390) || \ defined(QCA_WIFI_QCA6490) || defined(QCA_WIFI_QCA6750) + #define ADDBA_TXAGGR_SIZE 256 #else #define ADDBA_TXAGGR_SIZE 64 #endif +#ifdef TX_AGGREGATION_SIZE_ENABLE /* * * gTxAggregationSize - Gives an option to configure Tx aggregation size @@ -170,6 +172,16 @@ CFG_VALUE_OR_DEFAULT, \ "Tx Aggregation size value for VO") +#define CFG_QOS_TX_AGGREGATION \ + CFG(CFG_TX_AGGREGATION_SIZE) \ + CFG(CFG_TX_AGGREGATION_SIZEBE) \ + CFG(CFG_TX_AGGREGATION_SIZEBK) \ + CFG(CFG_TX_AGGREGATION_SIZEVI) \ + CFG(CFG_TX_AGGREGATION_SIZEVO) +#else +#define CFG_QOS_TX_AGGREGATION +#endif + /* * * gRxAggregationSize - Gives an option to configure Rx aggregation size @@ -525,12 +537,8 @@ "Enable UAPSD for SAP") #define CFG_QOS_ALL \ + CFG_QOS_TX_AGGREGATION \ CFG(CFG_SAP_MAX_INACTIVITY_OVERRIDE) \ - CFG(CFG_TX_AGGREGATION_SIZE) \ - CFG(CFG_TX_AGGREGATION_SIZEBE) \ - CFG(CFG_TX_AGGREGATION_SIZEBK) \ - CFG(CFG_TX_AGGREGATION_SIZEVI) \ - CFG(CFG_TX_AGGREGATION_SIZEVO) \ CFG(CFG_RX_AGGREGATION_SIZE) \ CFG(CFG_TX_AGGR_SW_RETRY_BE) \ CFG(CFG_TX_AGGR_SW_RETRY_BK) \ diff --git a/configs/default_defconfig b/configs/default_defconfig index b3221bc5bcba..228633772e63 100644 --- a/configs/default_defconfig +++ b/configs/default_defconfig @@ -1,3 +1,5 @@ +CONFIG_TX_AGGREGATION_SIZE_ENABLE := y + ifeq ($(CONFIG_CNSS_QCA6290), y) ifeq ($(CONFIG_CNSS_EMULATION), y) CONFIG_QCA_WIFI_NAPIER_EMULATION := y @@ -48,6 +50,7 @@ ifeq ($(CONFIG_CNSS_QCA6490), y) CONFIG_GENERIC_SHADOW_REGISTER_ACCESS_ENABLE :=y CONFIG_WLAN_TWT_SAP_STA_COUNT := y CONFIG_WLAN_TWT_SAP_PDEV_COUNT := y + CONFIG_TX_AGGREGATION_SIZE_ENABLE := n endif ifeq ($(CONFIG_CNSS_QCA6750), y) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index c61303fdcf6e..e406d0f8e08f 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -7530,6 +7530,7 @@ static int hdd_config_access_policy(struct hdd_adapter *adapter, return qdf_status_to_os_return(status); } +#ifdef TX_AGGREGATION_SIZE_ENABLE static int hdd_config_mpdu_aggregation(struct hdd_adapter *adapter, struct nlattr *tb[]) { @@ -7607,6 +7608,63 @@ static int hdd_config_msdu_aggregation(struct hdd_adapter *adapter, return qdf_status_to_os_return(status); } +#else +static int hdd_config_mpdu_aggregation(struct hdd_adapter *adapter, + struct nlattr *tb[]) +{ + struct nlattr *rx_attr = + tb[QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MPDU_AGGREGATION]; + uint8_t rx_size; + QDF_STATUS status; + + if (!rx_attr) { + hdd_err("Missing attribute for RX"); + return -EINVAL; + } + + rx_size = nla_get_u8(rx_attr); + if (!cfg_in_range(CFG_RX_AGGREGATION_SIZE, rx_size)) { + hdd_err("RX %d MPDU aggr size not in range", + rx_size); + return -EINVAL; + } + + status = wma_set_tx_rx_aggr_size(adapter->vdev_id, + 0, + rx_size, + WMI_VDEV_CUSTOM_AGGR_TYPE_AMPDU); + + return qdf_status_to_os_return(status); +} + +static int hdd_config_msdu_aggregation(struct hdd_adapter *adapter, + struct nlattr *tb[]) +{ + struct nlattr *rx_attr = + tb[QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MSDU_AGGREGATION]; + uint8_t rx_size; + QDF_STATUS status; + + if (!rx_attr) { + hdd_err("Missing attribute for RX"); + return -EINVAL; + } + + rx_size = nla_get_u8(rx_attr); + if (!cfg_in_range(CFG_RX_AGGREGATION_SIZE, rx_size)) { + hdd_err("RX %d MPDU aggr size not in range", + rx_size); + return -EINVAL; + } + + status = wma_set_tx_rx_aggr_size(adapter->vdev_id, + 0, + rx_size, + WMI_VDEV_CUSTOM_AGGR_TYPE_AMSDU); + + return qdf_status_to_os_return(status); +} +#endif static QDF_STATUS hdd_populate_vdev_chains(struct wlan_mlme_nss_chains *nss_chains_cfg, diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 6ae64f14d243..cc627b9c1524 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -4029,6 +4029,9 @@ QDF_STATUS wma_set_tx_rx_aggr_size(uint8_t vdev_id, /* bit 2 (aggr_type): TX Aggregation Type (0=A-MPDU, 1=A-MSDU) */ if (aggr_type == WMI_VDEV_CUSTOM_AGGR_TYPE_AMSDU) cmd->enable_bitmap |= 0x04; + /* bit 3 (tx_aggr_size_disable): If set tx_aggr_size is invalid */ + if (rx_size == 0) + cmd->enable_bitmap |= (0x1 << 3); cmd->enable_bitmap |= (0x1 << 6); @@ -4092,7 +4095,8 @@ QDF_STATUS wma_set_tx_rx_aggr_size_per_ac(WMA_HANDLE handle, cmd->rx_aggr_size = qos_aggr->rx_aggregation_size; cmd->tx_aggr_size = tx_aggr_size[queue_num]; /* bit 5: tx_ac_enable, if set, ac bitmap is valid. */ - cmd->enable_bitmap = 0x20 | queue_num; + if (cmd->rx_aggr_size != 0) + cmd->enable_bitmap = 0x20 | queue_num; /* bit 2 (aggr_type): TX Aggregation Type (0=A-MPDU, 1=A-MSDU) */ if (aggr_type == WMI_VDEV_CUSTOM_AGGR_TYPE_AMSDU) cmd->enable_bitmap |= 0x04;