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
此提交包含在:
@@ -28,25 +28,22 @@
|
||||
#include <qdf_status.h>
|
||||
#include <qdf_nbuf.h>
|
||||
|
||||
/* wbuff available pools */
|
||||
/* Pool of nbuf size 256 bytes */
|
||||
#define WBUFF_POOL_0 0
|
||||
/* Pool of nbuf size 512 bytes */
|
||||
#define WBUFF_POOL_1 1
|
||||
/* Pool of nbuf size 1024 bytes */
|
||||
#define WBUFF_POOL_2 2
|
||||
/* Pool of nbuf 2048 bytes */
|
||||
#define WBUFF_POOL_3 3
|
||||
enum wbuff_module_id {
|
||||
WBUFF_MODULE_WMI_TX,
|
||||
WBUFF_MAX_MODULES,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct wbuff_alloc_request - allocation structure for registering each
|
||||
* pool for wbuff module.
|
||||
* @slot: pool_slot identifier
|
||||
* @size: number of buffers for @pool_slot
|
||||
* @pool_id: pool identifier
|
||||
* @pool_size: number of buffers for @pool_id
|
||||
* @buffer_size: size of each buffer in this @pool_id
|
||||
*/
|
||||
struct wbuff_alloc_request {
|
||||
uint8_t slot;
|
||||
uint16_t size;
|
||||
uint8_t pool_id;
|
||||
uint16_t pool_size;
|
||||
uint16_t buffer_size;
|
||||
};
|
||||
|
||||
/* Opaque handle for wbuff */
|
||||
@@ -72,16 +69,17 @@ QDF_STATUS wbuff_module_deinit(void);
|
||||
/**
|
||||
* wbuff_module_register() - Registers a module with wbuff
|
||||
* @req: allocation request from registered module
|
||||
* @num: number of pools required
|
||||
* @num_pools: number of pools required
|
||||
* @reserve: nbuf headroom to start with
|
||||
* @align: alignment for the nbuf
|
||||
* @module_id: module identifier
|
||||
*
|
||||
* Return: Handle if registration success
|
||||
* NULL if registration failure
|
||||
*/
|
||||
struct wbuff_mod_handle *
|
||||
wbuff_module_register(struct wbuff_alloc_request *req, uint8_t num,
|
||||
int reserve, int align);
|
||||
wbuff_module_register(struct wbuff_alloc_request *req, uint8_t num_pools,
|
||||
int reserve, int align, enum wbuff_module_id module_id);
|
||||
|
||||
/**
|
||||
* wbuff_module_deregister() - De-registers a module with wbuff
|
||||
@@ -127,8 +125,8 @@ static inline QDF_STATUS wbuff_module_deinit(void)
|
||||
}
|
||||
|
||||
static inline struct wbuff_mod_handle *
|
||||
wbuff_module_register(struct wbuff_alloc_request *req, uint8_t num,
|
||||
int reserve, int align)
|
||||
wbuff_module_register(struct wbuff_alloc_request *req, uint8_t num_pools,
|
||||
int reserve, int align, enum wbuff_module_id module_id)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
新增問題並參考
封鎖使用者