From c6366e4b700d38b5ccc1eb309adf3397c178e8b6 Mon Sep 17 00:00:00 2001 From: Yun Park Date: Thu, 20 Mar 2014 13:44:40 -0700 Subject: qcacld: ipa: Add one additional descriptor in IPA TX pipe descriptor FIFO The maximum number of descriptors that can be provided to a BAM at once is one less than the total number of descriptors that the buffer can contain. Because of that reason, one extra descriptor will be added to make sure hardware always has one descriptor. Change-Id: Ib7869c16677a2c515a66a2a3d7c19820258b2aa4 CRs-fixed: 635223 --- CORE/HDD/src/wlan_hdd_ipa.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/CORE/HDD/src/wlan_hdd_ipa.c b/CORE/HDD/src/wlan_hdd_ipa.c index 6d0aa84458e3..a198040111e3 100644 --- a/CORE/HDD/src/wlan_hdd_ipa.c +++ b/CORE/HDD/src/wlan_hdd_ipa.c @@ -912,13 +912,26 @@ static int hdd_ipa_setup_sys_pipe(struct hdd_ipa_priv *hdd_ipa) { int i, ret = 0; struct ipa_sys_connect_params *ipa; + uint32_t desc_fifo_sz; + + /* The maximum number of descriptors that can be provided to a BAM at + * once is one less than the total number of descriptors that the buffer + * can contain. + * If max_num_of_descriptors = (BAM_PIPE_DESCRIPTOR_FIFO_SIZE / sizeof + * (SPS_DESCRIPTOR)), then (max_num_of_descriptors - 1) descriptors can + * be provided at once. + * Because of above requirement, one extra descriptor will be added to + * make sure hardware always has one descriptor. + */ + desc_fifo_sz = hdd_ipa->hdd_ctx->cfg_ini->IpaDescSize + + sizeof(struct sps_iovec); /*setup TX pipes */ for (i = 0; i < HDD_IPA_MAX_IFACE; i++) { ipa = &hdd_ipa->sys_pipe[i].ipa_sys_params; ipa->client = hdd_ipa_adapter_2_client[i].cons_client; - ipa->desc_fifo_sz = hdd_ipa->hdd_ctx->cfg_ini->IpaDescSize; + ipa->desc_fifo_sz = desc_fifo_sz; ipa->priv = &hdd_ipa->iface_context[i]; ipa->notify = hdd_ipa_i2w_cb; @@ -944,17 +957,7 @@ static int hdd_ipa_setup_sys_pipe(struct hdd_ipa_priv *hdd_ipa) ipa->client = hdd_ipa->prod_client; - /* The maximum number of descriptors that can be provided to a BAM at - * once is one less than the total number of descriptors that the buffer - * can contain. - * If max_num_of_descriptors = (BAM_PIPE_DESCRIPTOR_FIFO_SIZE / sizeof - * (SPS_DESCRIPTOR)), then (max_num_of_descriptors - 1) descriptors can - * be provided at once. - * Because of above requirement, one extra descriptor will be added to - * make sure hardware always has one descriptor. - */ - ipa->desc_fifo_sz = hdd_ipa->hdd_ctx->cfg_ini->IpaDescSize - + sizeof(struct sps_iovec); + ipa->desc_fifo_sz = desc_fifo_sz; ipa->priv = hdd_ipa; ipa->notify = hdd_ipa_w2i_cb; -- cgit v1.2.3