|
@@ -439,6 +439,7 @@ struct hdd_ipa_priv {
|
|
|
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;
|
|
|
|
|
@@ -4442,12 +4443,22 @@ static int hdd_ipa_alloc_tx_desc_list(struct hdd_ipa_priv *hdd_ipa)
|
|
|
int i;
|
|
|
uint32_t max_desc_cnt;
|
|
|
struct hdd_ipa_tx_desc *tmp_desc;
|
|
|
+ struct ol_txrx_pdev_t *pdev;
|
|
|
|
|
|
- max_desc_cnt = hdd_ipa->hdd_ctx->config->IpaUcTxBufCount;
|
|
|
+ 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);
|
|
|
|
|
|
INIT_LIST_HEAD(&hdd_ipa->free_tx_desc_head);
|
|
|
|
|
|
- tmp_desc = qdf_mem_malloc(sizeof(struct hdd_ipa_tx_desc)*max_desc_cnt);
|
|
|
+ tmp_desc = qdf_mem_malloc(sizeof(struct hdd_ipa_tx_desc) *
|
|
|
+ hdd_ipa->tx_desc_size);
|
|
|
|
|
|
if (!tmp_desc) {
|
|
|
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
|
|
@@ -4458,7 +4469,7 @@ static int hdd_ipa_alloc_tx_desc_list(struct hdd_ipa_priv *hdd_ipa)
|
|
|
hdd_ipa->tx_desc_list = tmp_desc;
|
|
|
|
|
|
qdf_spin_lock_bh(&hdd_ipa->q_lock);
|
|
|
- for (i = 0; i < max_desc_cnt; i++) {
|
|
|
+ for (i = 0; i < hdd_ipa->tx_desc_size; i++) {
|
|
|
tmp_desc->id = i;
|
|
|
tmp_desc->ipa_tx_desc_ptr = NULL;
|
|
|
list_add_tail(&tmp_desc->link,
|
|
@@ -4564,7 +4575,7 @@ static int hdd_ipa_setup_sys_pipe(struct hdd_ipa_priv *hdd_ipa)
|
|
|
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;
|
|
@@ -4591,7 +4602,6 @@ setup_sys_pipe_fail:
|
|
|
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;
|
|
|
|
|
@@ -4608,10 +4618,8 @@ static void hdd_ipa_teardown_sys_pipe(struct hdd_ipa_priv *hdd_ipa)
|
|
|
}
|
|
|
|
|
|
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 < max_desc_cnt; i++) {
|
|
|
+ for (i = 0; i < hdd_ipa->tx_desc_size; i++) {
|
|
|
tmp_desc = hdd_ipa->tx_desc_list + i;
|
|
|
ipa_tx_desc = tmp_desc->ipa_tx_desc_ptr;
|
|
|
if (ipa_tx_desc)
|