diff --git a/dp/wifi3.0/dp_peer.c b/dp/wifi3.0/dp_peer.c index c951f8d1e0..3cfde73a19 100644 --- a/dp/wifi3.0/dp_peer.c +++ b/dp/wifi3.0/dp_peer.c @@ -3268,12 +3268,8 @@ QDF_STATUS dp_rx_tid_setup_wifi3(struct dp_peer *peer, int tid, * send WMI message to FW to change the REO queue descriptor in Rx * peer entry as part of dp_rx_tid_update. */ - if (tid != DP_NON_QOS_TID) - hw_qdesc_size = hal_get_reo_qdesc_size(soc->hal_soc, - HAL_RX_MAX_BA_WINDOW, tid); - else - hw_qdesc_size = hal_get_reo_qdesc_size(soc->hal_soc, - ba_window_size, tid); + hw_qdesc_size = hal_get_reo_qdesc_size(soc->hal_soc, + ba_window_size, tid); hw_qdesc_align = hal_get_reo_qdesc_align(soc->hal_soc); /* To avoid unnecessary extra allocation for alignment, try allocating @@ -4047,6 +4043,9 @@ int dp_addba_resp_tx_completion_wifi3(struct cdp_soc_t *cdp_soc, if (peer->active_ba_session_cnt == 0) { if (rx_tid->ba_win_size > 64 && rx_tid->ba_win_size <= 256) peer->hw_buffer_size = 256; + else if (rx_tid->ba_win_size <= 1024 && + rx_tid->ba_win_size > 256) + peer->hw_buffer_size = 1024; else peer->hw_buffer_size = 64; } @@ -4472,12 +4471,12 @@ dp_set_pn_check_wifi3(struct cdp_soc_t *soc, uint8_t vdev_id, case cdp_sec_type_aes_gcmp: case cdp_sec_type_aes_gcmp_256: params.u.upd_queue_params.pn_check_needed = 1; - params.u.upd_queue_params.pn_size = 48; + params.u.upd_queue_params.pn_size = PN_SIZE_48; pn_size = 48; break; case cdp_sec_type_wapi: params.u.upd_queue_params.pn_check_needed = 1; - params.u.upd_queue_params.pn_size = 128; + params.u.upd_queue_params.pn_size = PN_SIZE_128; pn_size = 128; if (vdev->opmode == wlan_op_mode_ap) { params.u.upd_queue_params.pn_even = 1; diff --git a/hal/wifi3.0/be/hal_be_generic_api.c b/hal/wifi3.0/be/hal_be_generic_api.c index 6d9a1d1e6a..d56520842c 100644 --- a/hal/wifi3.0/be/hal_be_generic_api.c +++ b/hal/wifi3.0/be/hal_be_generic_api.c @@ -165,6 +165,12 @@ void hal_set_link_desc_addr_be(void *desc, uint32_t cookie, static uint32_t hal_get_reo_qdesc_size_be(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; + /* 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 diff --git a/hal/wifi3.0/be/hal_be_reo.c b/hal/wifi3.0/be/hal_be_reo.c index 36d3f8268f..1fed0d7c60 100644 --- a/hal/wifi3.0/be/hal_be_reo.c +++ b/hal/wifi3.0/be/hal_be_reo.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -804,13 +805,6 @@ hal_reo_cmd_update_rx_queue_be(hal_ring_handle_t hal_ring_hdl, HAL_DESC_64_SET_FIELD(reo_desc, REO_UPDATE_RX_REO_QUEUE, BA_WINDOW_SIZE, p->ba_window_size - 1); - if (p->pn_size == 24) - p->pn_size = PN_SIZE_24; - else if (p->pn_size == 48) - p->pn_size = PN_SIZE_48; - else if (p->pn_size == 128) - p->pn_size = PN_SIZE_128; - HAL_DESC_64_SET_FIELD(reo_desc, REO_UPDATE_RX_REO_QUEUE, PN_SIZE, p->pn_size); diff --git a/hal/wifi3.0/hal_hw_headers.h b/hal/wifi3.0/hal_hw_headers.h index a7a82c34e4..7abeb74595 100644 --- a/hal/wifi3.0/hal_hw_headers.h +++ b/hal/wifi3.0/hal_hw_headers.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -371,29 +371,13 @@ static inline uint32_t hal_get_reo_qdesc_size(hal_soc_handle_t hal_soc_hdl, uint32_t ba_window_size, int tid) { - /* 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); - } + struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl; - if (ba_window_size <= 105) - return sizeof(struct rx_reo_queue) + - sizeof(struct rx_reo_queue_ext); + if (hal_soc->ops->hal_get_reo_qdesc_size) + return hal_soc->ops->hal_get_reo_qdesc_size(ba_window_size, + tid); - if (ba_window_size <= 210) - return sizeof(struct rx_reo_queue) + - (2 * sizeof(struct rx_reo_queue_ext)); - - return sizeof(struct rx_reo_queue) + - (3 * sizeof(struct rx_reo_queue_ext)); + return sizeof(struct rx_reo_queue); } /** diff --git a/hal/wifi3.0/hal_reo.h b/hal/wifi3.0/hal_reo.h index 003244b5b0..90ff8fce5f 100644 --- a/hal/wifi3.0/hal_reo.h +++ b/hal/wifi3.0/hal_reo.h @@ -321,8 +321,8 @@ struct hal_reo_cmd_update_queue_params { pn_uneven:1, pn_hand_enab:1, ignore_ampdu:1; - uint32_t ba_window_size:9, - pn_size:8, + uint32_t ba_window_size:15, + pn_size:2, svld:1, ssn:12, seq_2k_err_detect:1, diff --git a/hal/wifi3.0/li/hal_li_generic_api.c b/hal/wifi3.0/li/hal_li_generic_api.c index 45c068cae3..8ec62d8354 100644 --- a/hal/wifi3.0/li/hal_li_generic_api.c +++ b/hal/wifi3.0/li/hal_li_generic_api.c @@ -28,6 +28,12 @@ static uint32_t hal_get_reo_qdesc_size_li(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; + /* 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 diff --git a/hal/wifi3.0/li/hal_li_reo.c b/hal/wifi3.0/li/hal_li_reo.c index 8fbf438270..b536c67920 100644 --- a/hal/wifi3.0/li/hal_li_reo.c +++ b/hal/wifi3.0/li/hal_li_reo.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -795,13 +795,6 @@ hal_reo_cmd_update_rx_queue_li(hal_ring_handle_t hal_ring_hdl, HAL_DESC_SET_FIELD(reo_desc, REO_UPDATE_RX_REO_QUEUE_4, BA_WINDOW_SIZE, p->ba_window_size - 1); - if (p->pn_size == 24) - p->pn_size = PN_SIZE_24; - else if (p->pn_size == 48) - p->pn_size = PN_SIZE_48; - else if (p->pn_size == 128) - p->pn_size = PN_SIZE_128; - HAL_DESC_SET_FIELD(reo_desc, REO_UPDATE_RX_REO_QUEUE_4, PN_SIZE, p->pn_size); diff --git a/hal/wifi3.0/qcn9224/hal_9224.c b/hal/wifi3.0/qcn9224/hal_9224.c index 803cf31fb4..e333f44e21 100644 --- a/hal/wifi3.0/qcn9224/hal_9224.c +++ b/hal/wifi3.0/qcn9224/hal_9224.c @@ -44,6 +44,7 @@ #include #include #endif +#include "rx_reo_queue_1k.h" #include @@ -1631,6 +1632,50 @@ static void hal_reo_setup_9224(struct hal_soc *soc, void *reoparams) hal_reo_shared_qaddr_init((hal_soc_handle_t)soc); } +/** + * hal_qcn9224_get_reo_qdesc_size()- Get the reo queue descriptor size + * from the give Block-Ack window size + * Return: reo queue descriptor size + */ +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; + + /* 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_qcn9224(struct hal_soc *hal_soc) { /* init and setup */ @@ -1840,6 +1885,8 @@ static void hal_hw_txrx_ops_attach_qcn9224(struct hal_soc *hal_soc) hal_soc->ops->hal_reo_shared_qaddr_detach = hal_reo_shared_qaddr_detach_be; hal_soc->ops->hal_reo_shared_qaddr_write = hal_reo_shared_qaddr_write_be; #endif + /* Overwrite the default BE ops */ + hal_soc->ops->hal_get_reo_qdesc_size = hal_qcn9224_get_reo_qdesc_size; /* TX MONITOR */ #ifdef QCA_MONITOR_2_0_SUPPORT hal_soc->ops->hal_txmon_status_parse_tlv =