qcacmn: Add direct rx buffer changes for CFR requirements
CFR requires to configure the number of DBRs that can be packed in a single DBR event. Currently, this is fixed value. Make this configurable at the time of registration. CRs-Fixed: 2415489 Change-Id: Ifcd606641f986a5345f8ccb361c3f45db07fdc37
This commit is contained in:
@@ -86,6 +86,16 @@ struct direct_buf_rx_data {
|
||||
struct direct_buf_rx_metadata meta_data;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct dbr_module_config - module configuration for dbr
|
||||
* @num_resp_per_event: Number of events to be packed together
|
||||
* @event_timeout_in_ms: Timeout until which multiple events can be packed
|
||||
*/
|
||||
struct dbr_module_config {
|
||||
uint32_t num_resp_per_event;
|
||||
uint32_t event_timeout_in_ms;
|
||||
};
|
||||
|
||||
/**
|
||||
* direct_buf_rx_init() - Function to initialize direct buf rx module
|
||||
*
|
||||
|
@@ -566,6 +566,7 @@ static QDF_STATUS target_if_dbr_cfg_tgt(struct wlan_objmgr_pdev *pdev,
|
||||
struct direct_buf_rx_cfg_req dbr_cfg_req = {0};
|
||||
struct direct_buf_rx_ring_cfg *dbr_ring_cfg;
|
||||
struct direct_buf_rx_ring_cap *dbr_ring_cap;
|
||||
struct dbr_module_config *dbr_config;
|
||||
|
||||
direct_buf_rx_enter();
|
||||
|
||||
@@ -577,6 +578,7 @@ static QDF_STATUS target_if_dbr_cfg_tgt(struct wlan_objmgr_pdev *pdev,
|
||||
|
||||
dbr_ring_cfg = mod_param->dbr_ring_cfg;
|
||||
dbr_ring_cap = mod_param->dbr_ring_cap;
|
||||
dbr_config = &mod_param->dbr_config;
|
||||
wmi_hdl = lmac_get_pdev_wmi_handle(pdev);
|
||||
if (!wmi_hdl) {
|
||||
direct_buf_rx_err("WMI handle null. Can't send WMI CMD");
|
||||
@@ -601,8 +603,8 @@ static QDF_STATUS target_if_dbr_cfg_tgt(struct wlan_objmgr_pdev *pdev,
|
||||
& 0xFFFFFFFF00000000;
|
||||
dbr_cfg_req.num_elems = dbr_ring_cap->ring_elems_min;
|
||||
dbr_cfg_req.buf_size = dbr_ring_cap->min_buf_size;
|
||||
dbr_cfg_req.num_resp_per_event = DBR_NUM_RESP_PER_EVENT;
|
||||
dbr_cfg_req.event_timeout_ms = DBR_EVENT_TIMEOUT_IN_MS;
|
||||
dbr_cfg_req.num_resp_per_event = dbr_config->num_resp_per_event;
|
||||
dbr_cfg_req.event_timeout_ms = dbr_config->event_timeout_in_ms;
|
||||
direct_buf_rx_info("pdev id %d mod id %d base addr lo %x\n"
|
||||
"base addr hi %x head idx addr lo %x\n"
|
||||
"head idx addr hi %x tail idx addr lo %x\n"
|
||||
@@ -670,12 +672,14 @@ dbr_srng_init_failed:
|
||||
|
||||
QDF_STATUS target_if_direct_buf_rx_module_register(
|
||||
struct wlan_objmgr_pdev *pdev, uint8_t mod_id,
|
||||
struct dbr_module_config *dbr_config,
|
||||
bool (*dbr_rsp_handler)
|
||||
(struct wlan_objmgr_pdev *pdev,
|
||||
struct direct_buf_rx_data *dbr_data))
|
||||
{
|
||||
QDF_STATUS status;
|
||||
struct direct_buf_rx_pdev_obj *dbr_pdev_obj;
|
||||
struct dbr_module_config *config = NULL;
|
||||
|
||||
if (!pdev) {
|
||||
direct_buf_rx_err("pdev context passed is null");
|
||||
@@ -712,8 +716,10 @@ QDF_STATUS target_if_direct_buf_rx_module_register(
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
config = &dbr_pdev_obj->dbr_mod_param[mod_id].dbr_config;
|
||||
dbr_pdev_obj->dbr_mod_param[mod_id].dbr_rsp_handler =
|
||||
dbr_rsp_handler;
|
||||
*config = *dbr_config;
|
||||
|
||||
status = target_if_init_dbr_ring(pdev, dbr_pdev_obj,
|
||||
(enum DBR_MODULE)mod_id);
|
||||
|
@@ -28,8 +28,6 @@ struct wlan_lmac_if_tx_ops;
|
||||
struct direct_buf_rx_data;
|
||||
|
||||
#define DBR_RING_BASE_ALIGN 8
|
||||
#define DBR_EVENT_TIMEOUT_IN_MS 1
|
||||
#define DBR_NUM_RESP_PER_EVENT 2
|
||||
|
||||
/**
|
||||
* struct direct_buf_rx_info - direct buffer rx operation info struct
|
||||
@@ -85,6 +83,7 @@ struct direct_buf_rx_ring_cap {
|
||||
/**
|
||||
* struct direct_buf_rx_module_param - DMA module param
|
||||
* @mod_id: Module ID
|
||||
* @dbr_config: Pointer to dirct buf rx module configuration struct
|
||||
* @dbr_ring_cap: Pointer to direct buf rx ring capabilities struct
|
||||
* @dbr_ring_cfg: Pointer to direct buf rx ring config struct
|
||||
* @dbr_buf_pool: Pointer to direct buf rx buffer pool struct
|
||||
@@ -92,6 +91,7 @@ struct direct_buf_rx_ring_cap {
|
||||
*/
|
||||
struct direct_buf_rx_module_param {
|
||||
enum DBR_MODULE mod_id;
|
||||
struct dbr_module_config dbr_config;
|
||||
struct direct_buf_rx_ring_cap *dbr_ring_cap;
|
||||
struct direct_buf_rx_ring_cfg *dbr_ring_cfg;
|
||||
struct direct_buf_rx_buf_info *dbr_buf_pool;
|
||||
@@ -222,6 +222,7 @@ QDF_STATUS target_if_deinit_dbr_ring(struct wlan_objmgr_pdev *pdev,
|
||||
* buffer rx module
|
||||
* @pdev: pointer to pdev object
|
||||
* @mod_id: module id indicating the module using direct buffer rx framework
|
||||
* @dbr_config: dbr module configuration params
|
||||
* @dbr_rsp_handler: function pointer pointing to the response handler to be
|
||||
* invoked for the module registering to direct buffer rx
|
||||
* module
|
||||
@@ -230,6 +231,7 @@ QDF_STATUS target_if_deinit_dbr_ring(struct wlan_objmgr_pdev *pdev,
|
||||
*/
|
||||
QDF_STATUS target_if_direct_buf_rx_module_register(
|
||||
struct wlan_objmgr_pdev *pdev, uint8_t mod_id,
|
||||
struct dbr_module_config *dbr_config,
|
||||
bool (*dbr_rsp_handler)
|
||||
(struct wlan_objmgr_pdev *pdev,
|
||||
struct direct_buf_rx_data *dbr_data));
|
||||
|
Reference in New Issue
Block a user