Revert "qcacld-3.0: fix ipa mcc tx_desc pool size"
This reverts commit I3216a4c14ac624cc313d11226909efd4f63841d0
When alloccate free Tx desc list, Tx desc pool size is not initialized yet,
so tx_desc_size is set to 0.
This cause free Tx descriptor allocation failed.
Change-Id: I02ae2e59311e737dd9245228048d62f657d5b0d1
CRs-Fixed: 2085753
diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c
index ab68a04..79b3753 100644
--- a/core/hdd/src/wlan_hdd_ipa.c
+++ b/core/hdd/src/wlan_hdd_ipa.c
@@ -439,7 +439,6 @@
qdf_spinlock_t q_lock;
struct list_head pend_desc_head;
- uint16_t tx_desc_size;
struct hdd_ipa_tx_desc *tx_desc_list;
struct list_head free_tx_desc_head;
@@ -4527,33 +4526,24 @@
int i;
uint32_t max_desc_cnt;
struct hdd_ipa_tx_desc *tmp_desc;
- struct ol_txrx_pdev_t *pdev;
- pdev = cds_get_context(QDF_MODULE_ID_TXRX);
- if (!pdev) {
- HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "pdev is NULL");
- return -ENODEV;
- }
-
- hdd_ipa->tx_desc_size = QDF_MIN(
- hdd_ipa->hdd_ctx->config->IpaMccTxDescSize,
- pdev->tx_desc.pool_size);
+ max_desc_cnt = hdd_ipa->hdd_ctx->config->IpaUcTxBufCount;
INIT_LIST_HEAD(&hdd_ipa->free_tx_desc_head);
tmp_desc = qdf_mem_malloc(sizeof(struct hdd_ipa_tx_desc) *
- hdd_ipa->tx_desc_size);
+ max_desc_cnt);
if (!tmp_desc) {
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
- "Free Tx descriptor allocation failed");
+ "Free Tx descriptor allocation failed");
return -ENOMEM;
}
hdd_ipa->tx_desc_list = tmp_desc;
qdf_spin_lock_bh(&hdd_ipa->q_lock);
- for (i = 0; i < hdd_ipa->tx_desc_size; i++) {
+ for (i = 0; i < max_desc_cnt; i++) {
tmp_desc->id = i;
tmp_desc->ipa_tx_desc_ptr = NULL;
list_add_tail(&tmp_desc->link,
@@ -4659,7 +4649,7 @@
hdd_ipa->sys_pipe[HDD_IPA_RX_PIPE].conn_hdl_valid = 1;
}
- /* Allocate free Tx desc list */
+ /* Allocate free Tx desc list */
ret = hdd_ipa_alloc_tx_desc_list(hdd_ipa);
if (ret)
goto setup_sys_pipe_fail;
@@ -4686,6 +4676,7 @@
static void hdd_ipa_teardown_sys_pipe(struct hdd_ipa_priv *hdd_ipa)
{
int ret = 0, i;
+ uint32_t max_desc_cnt;
struct hdd_ipa_tx_desc *tmp_desc;
struct ipa_rx_data *ipa_tx_desc;
@@ -4702,8 +4693,10 @@
}
if (hdd_ipa->tx_desc_list) {
+ max_desc_cnt = hdd_ipa->hdd_ctx->config->IpaUcTxBufCount;
+
qdf_spin_lock_bh(&hdd_ipa->q_lock);
- for (i = 0; i < hdd_ipa->tx_desc_size; i++) {
+ for (i = 0; i < max_desc_cnt; i++) {
tmp_desc = hdd_ipa->tx_desc_list + i;
ipa_tx_desc = tmp_desc->ipa_tx_desc_ptr;
if (ipa_tx_desc)