From 15a9ac983c9c56843d38c4759abd4f47044e7ae8 Mon Sep 17 00:00:00 2001 From: Jinwei Chen Date: Mon, 25 Apr 2022 01:35:37 -0700 Subject: [PATCH] qcacmn: Support 1K BA window size for KIWI Support 1K BA window size for KIWI Change-Id: I9912524ebc3afc0a2a7e53f5849f5c2c881a10f4 CRs-Fixed: 3181140 --- hal/wifi3.0/be/hal_be_rx.h | 2 ++ hal/wifi3.0/kiwi/hal_kiwi.c | 46 ++++++++++++++++++++++++++++++++++ hal/wifi3.0/qcn9224/hal_9224.c | 1 - 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/hal/wifi3.0/be/hal_be_rx.h b/hal/wifi3.0/be/hal_be_rx.h index 44d62b56de..2df65264f1 100644 --- a/hal/wifi3.0/be/hal_be_rx.h +++ b/hal/wifi3.0/be/hal_be_rx.h @@ -30,6 +30,8 @@ #define HAL_RX_DA_IDX_PEER_ID_MASK 0x3fff #define HAL_RX_DA_IDX_ML_PEER_MASK 0x2000 +#define HAL_RX_MAX_BA_WINDOW_BE 1024 + /* * macro to set the cookie into the rxdma ring entry */ diff --git a/hal/wifi3.0/kiwi/hal_kiwi.c b/hal/wifi3.0/kiwi/hal_kiwi.c index 434ed8917c..525b566f51 100644 --- a/hal/wifi3.0/kiwi/hal_kiwi.c +++ b/hal/wifi3.0/kiwi/hal_kiwi.c @@ -34,6 +34,7 @@ #include "hal_rx_flow_info.h" #include "hal_be_api.h" #include "reo_destination_ring_with_pn.h" +#include "rx_reo_queue_1k.h" #include @@ -1640,6 +1641,49 @@ static inline uint8_t hal_get_first_wow_wakeup_packet_kiwi(uint8_t *buf) } #endif +/** + * hal_get_reo_qdesc_size_kiwi()- Get the reo queue descriptor size + * from the give Block-Ack window size + * Return: reo queue descriptor size + */ +static uint32_t hal_get_reo_qdesc_size_kiwi(uint32_t ba_window_size, int tid) +{ + /* Hardcode the ba_window_size to HAL_RX_MAX_BA_WINDOW for + * NON_QOS_TID until HW issues are resolved. + */ + if (tid != HAL_NON_QOS_TID) + ba_window_size = HAL_RX_MAX_BA_WINDOW_BE; + + /* Return descriptor size corresponding to window size of 2 since + * we set ba_window_size to 2 while setting up REO descriptors as + * a WAR to get 2k jump exception aggregates are received without + * a BA session. + */ + if (ba_window_size <= 1) { + if (tid != HAL_NON_QOS_TID) + return sizeof(struct rx_reo_queue) + + sizeof(struct rx_reo_queue_ext); + else + return sizeof(struct rx_reo_queue); + } + + if (ba_window_size <= 105) + return sizeof(struct rx_reo_queue) + + sizeof(struct rx_reo_queue_ext); + + if (ba_window_size <= 210) + return sizeof(struct rx_reo_queue) + + (2 * sizeof(struct rx_reo_queue_ext)); + + if (ba_window_size <= 256) + return sizeof(struct rx_reo_queue) + + (3 * sizeof(struct rx_reo_queue_ext)); + + return sizeof(struct rx_reo_queue) + + (10 * sizeof(struct rx_reo_queue_ext)) + + sizeof(struct rx_reo_queue_1k); +} + static void hal_hw_txrx_ops_attach_kiwi(struct hal_soc *hal_soc) { /* init and setup */ @@ -1651,6 +1695,8 @@ static void hal_hw_txrx_ops_attach_kiwi(struct hal_soc *hal_soc) hal_reo_set_err_dst_remap_kiwi; hal_soc->ops->hal_reo_enable_pn_in_dest = hal_reo_enable_pn_in_dest_kiwi; + /* Overwrite the default BE ops */ + hal_soc->ops->hal_get_reo_qdesc_size = hal_get_reo_qdesc_size_kiwi; /* tx */ hal_soc->ops->hal_tx_set_dscp_tid_map = hal_tx_set_dscp_tid_map_kiwi; diff --git a/hal/wifi3.0/qcn9224/hal_9224.c b/hal/wifi3.0/qcn9224/hal_9224.c index eef091fb6b..1a12ba5f5e 100644 --- a/hal/wifi3.0/qcn9224/hal_9224.c +++ b/hal/wifi3.0/qcn9224/hal_9224.c @@ -1652,7 +1652,6 @@ static uint32_t hal_qcn9224_get_reo_qdesc_size(uint32_t ba_window_size, int tid) /* Hardcode the ba_window_size to HAL_RX_MAX_BA_WINDOW for * NON_QOS_TID until HW issues are resolved. */ -#define HAL_RX_MAX_BA_WINDOW_BE 1024 if (tid != HAL_NON_QOS_TID) ba_window_size = HAL_RX_MAX_BA_WINDOW_BE;