qcacmn: Split dp_mon_link_desc_pool_setup to alloc and init APIs

Split dp_mon_link_desc_pool_setup to alloc and init APIs and
dp_mon_link_desc_pool_cleanup to deinit and free APIs

This split is made because dp_pdev_init is introduced
as part of this FR and these APIs will be called from
dp_pdev_init/dp_pdev_deinit or dp_pdev_attach/dp_pdev_
detach accordingly to maintain the symmetry to DP init
and deinit path

Change-Id: I36b2a98bd317010124916e0b2779938eba3883ea
CRs-Fixed: 2663595
This commit is contained in:
phadiman
2020-02-19 18:14:13 +05:30
committed by nshrivas
parent 8db0b893b4
commit 9798b16f3f
3 changed files with 34 additions and 245 deletions

View File

@@ -796,16 +796,18 @@ void *dp_rx_cookie_2_mon_link_desc_va(struct dp_pdev *pdev,
int mac_id)
{
void *link_desc_va;
struct qdf_mem_multi_page_t *pages;
uint16_t page_id = LINK_DESC_COOKIE_PAGE_ID(buf_info->sw_cookie);
/* TODO */
/* Add sanity for cookie */
pages = &pdev->soc->mon_link_desc_pages[mac_id];
if (!pages)
return NULL;
link_desc_va =
pdev->soc->mon_link_desc_banks[mac_id][buf_info->sw_cookie]
.base_vaddr +
(buf_info->paddr -
pdev->soc->mon_link_desc_banks[mac_id][buf_info->sw_cookie]
.base_paddr);
if (qdf_unlikely(page_id >= pages->num_pages))
return NULL;
link_desc_va = pages->dma_pages[page_id].page_v_addr_start +
(buf_info->paddr - pages->dma_pages[page_id].page_p_addr);
return link_desc_va;
}