qcacmn: Pre allocate pdev during attach

Pre-allocate pdev context as size exceeds dynamic allocation
threshold (4KB).

Change-Id: Ida866275ed1ddea5a9b6aa1cf114ccd226ed0f22
CRs-Fixed: 2825110
此提交包含在:
Ananya Gupta
2020-11-26 23:31:19 +05:30
提交者 snandini
父節點 27378433c5
當前提交 a660173209
共有 4 個檔案被更改,包括 93 行新增2 行删除

查看文件

@@ -2517,6 +2517,29 @@ QDF_STATUS dp_wds_ext_set_peer_rx(ol_txrx_soc_handle soc,
#endif /* QCA_SUPPORT_WDS_EXTENDED */
#ifdef DP_MEM_PRE_ALLOC
/**
* dp_context_alloc_mem() - allocate memory for DP context
* @soc: datapath soc handle
* @ctxt_type: DP context type
* @ctxt_size: DP context size
*
* Return: DP context address
*/
void *dp_context_alloc_mem(struct dp_soc *soc, enum dp_ctxt_type ctxt_type,
size_t ctxt_size);
/**
* dp_context_free_mem() - Free memory of DP context
* @soc: datapath soc handle
* @ctxt_type: DP context type
* @vaddr: Address of context memory
*
* Return: None
*/
void dp_context_free_mem(struct dp_soc *soc, enum dp_ctxt_type ctxt_type,
void *vaddr);
/**
* dp_desc_multi_pages_mem_alloc() - alloc memory over multiple pages
* @soc: datapath soc handle
@@ -2563,6 +2586,20 @@ void dp_desc_multi_pages_mem_free(struct dp_soc *soc,
bool cacheable);
#else
static inline
void *dp_context_alloc_mem(struct dp_soc *soc, enum dp_ctxt_type ctxt_type,
size_t ctxt_size)
{
return qdf_mem_malloc(ctxt_size);
}
static inline
void dp_context_free_mem(struct dp_soc *soc, enum dp_ctxt_type ctxt_type,
void *vaddr)
{
qdf_mem_free(vaddr);
}
static inline
void dp_desc_multi_pages_mem_alloc(struct dp_soc *soc,
enum dp_desc_type desc_type,