qcacmn: Cleanup WBUFF code to support additional modules
Currently, WBUFF logic is being used only for WMI TX buffers and the logic is closely tied to the WMI TX buffers alone. It is cumbersome to extend the support of WBUFF for additional modules in the current state. Cleanup the WBUFF code and make it generic to add future module additions. Change-Id: Ib20ddd487b4e88c3225da1883ad9ade722c2a606 CRs-Fixed: 3520811
This commit is contained in:

committato da
Rahul Choudhary

parent
fd1d804527
commit
9b27c6e104
@@ -112,6 +112,12 @@ typedef PREPACK struct {
|
||||
/* Allocation of size 2048 bytes */
|
||||
#define WMI_WBUFF_POOL_3_SIZE 8
|
||||
|
||||
/* wbuff pool buffer lengths in bytes for WMI*/
|
||||
#define WMI_WBUFF_LEN_POOL0 256
|
||||
#define WMI_WBUFF_LEN_POOL1 512
|
||||
#define WMI_WBUFF_LEN_POOL2 1024
|
||||
#define WMI_WBUFF_LEN_POOL3 2048
|
||||
|
||||
#define RX_DIAG_EVENT_WORK_PROCESS_MAX_COUNT 500
|
||||
|
||||
#ifdef WMI_INTERFACE_EVENT_LOGGING
|
||||
@@ -3269,18 +3275,27 @@ qdf_export_symbol(wmi_unified_register_module);
|
||||
static void wmi_wbuff_register(struct wmi_unified *wmi_handle)
|
||||
{
|
||||
struct wbuff_alloc_request wbuff_alloc[4];
|
||||
uint8_t reserve = WMI_MIN_HEAD_ROOM;
|
||||
|
||||
wbuff_alloc[0].slot = WBUFF_POOL_0;
|
||||
wbuff_alloc[0].size = WMI_WBUFF_POOL_0_SIZE;
|
||||
wbuff_alloc[1].slot = WBUFF_POOL_1;
|
||||
wbuff_alloc[1].size = WMI_WBUFF_POOL_1_SIZE;
|
||||
wbuff_alloc[2].slot = WBUFF_POOL_2;
|
||||
wbuff_alloc[2].size = WMI_WBUFF_POOL_2_SIZE;
|
||||
wbuff_alloc[3].slot = WBUFF_POOL_3;
|
||||
wbuff_alloc[3].size = WMI_WBUFF_POOL_3_SIZE;
|
||||
wbuff_alloc[0].pool_id = 0;
|
||||
wbuff_alloc[0].pool_size = WMI_WBUFF_POOL_0_SIZE;
|
||||
wbuff_alloc[0].buffer_size = roundup(WMI_WBUFF_LEN_POOL0 + reserve, 4);
|
||||
|
||||
wmi_handle->wbuff_handle = wbuff_module_register(wbuff_alloc, 4,
|
||||
WMI_MIN_HEAD_ROOM, 4);
|
||||
wbuff_alloc[1].pool_id = 1;
|
||||
wbuff_alloc[1].pool_size = WMI_WBUFF_POOL_1_SIZE;
|
||||
wbuff_alloc[1].buffer_size = roundup(WMI_WBUFF_LEN_POOL1 + reserve, 4);
|
||||
|
||||
wbuff_alloc[2].pool_id = 2;
|
||||
wbuff_alloc[2].pool_size = WMI_WBUFF_POOL_2_SIZE;
|
||||
wbuff_alloc[2].buffer_size = roundup(WMI_WBUFF_LEN_POOL2 + reserve, 4);
|
||||
|
||||
wbuff_alloc[3].pool_id = 3;
|
||||
wbuff_alloc[3].pool_size = WMI_WBUFF_POOL_3_SIZE;
|
||||
wbuff_alloc[3].buffer_size = roundup(WMI_WBUFF_LEN_POOL3 + reserve, 4);
|
||||
|
||||
wmi_handle->wbuff_handle =
|
||||
wbuff_module_register(wbuff_alloc, QDF_ARRAY_SIZE(wbuff_alloc),
|
||||
reserve, 4, WBUFF_MODULE_WMI_TX);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Fai riferimento in un nuovo problema
Block a user