diff --git a/spectral/dispatcher/src/wlan_spectral_tgt_api.c b/spectral/dispatcher/src/wlan_spectral_tgt_api.c index 8e08605e441e..48b0a2426f7f 100644 --- a/spectral/dispatcher/src/wlan_spectral_tgt_api.c +++ b/spectral/dispatcher/src/wlan_spectral_tgt_api.c @@ -21,6 +21,13 @@ #include #include +#ifdef DIRECT_BUF_RX_ENABLE +#include + +#define DBR_EVENT_TIMEOUT_IN_MS_SPECTRAL 1 +#define DBR_NUM_RESP_PER_EVENT_SPECTRAL 2 +#endif + void * tgt_get_target_handle(struct wlan_objmgr_pdev *pdev) { @@ -282,16 +289,19 @@ tgt_spectral_register_to_dbr(struct wlan_objmgr_pdev *pdev) { struct wlan_objmgr_psoc *psoc; struct wlan_lmac_if_direct_buf_rx_tx_ops *dbr_tx_ops = NULL; + struct dbr_module_config dbr_config = {0}; psoc = wlan_pdev_get_psoc(pdev); dbr_tx_ops = &psoc->soc_cb.tx_ops.dbr_tx_ops; + dbr_config.num_resp_per_event = DBR_NUM_RESP_PER_EVENT_SPECTRAL; + dbr_config.event_timeout_in_ms = DBR_EVENT_TIMEOUT_IN_MS_SPECTRAL; if ((tgt_spectral_get_target_type(psoc) == TARGET_TYPE_QCA8074) || (tgt_spectral_get_target_type(psoc) == TARGET_TYPE_QCA8074V2) || (tgt_spectral_get_target_type(psoc) == TARGET_TYPE_QCA6018)) if (dbr_tx_ops->direct_buf_rx_module_register) return dbr_tx_ops->direct_buf_rx_module_register - (pdev, 0, + (pdev, 0, &dbr_config, spectral_dbr_event_handler); return QDF_STATUS_SUCCESS; diff --git a/target_if/direct_buf_rx/inc/target_if_direct_buf_rx_api.h b/target_if/direct_buf_rx/inc/target_if_direct_buf_rx_api.h index 4298d54a7457..5f123d8aa27d 100644 --- a/target_if/direct_buf_rx/inc/target_if_direct_buf_rx_api.h +++ b/target_if/direct_buf_rx/inc/target_if_direct_buf_rx_api.h @@ -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 * diff --git a/target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.c b/target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.c index 7719fac2021f..6e8543a45c99 100644 --- a/target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.c +++ b/target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.c @@ -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); diff --git a/target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.h b/target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.h index 1d5c058f1e19..f556c8175aff 100644 --- a/target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.h +++ b/target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.h @@ -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)); diff --git a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h index 8c2dc63fc84b..7baa2d64c88a 100644 --- a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h +++ b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h @@ -68,6 +68,8 @@ struct oem_data_rsp; struct direct_buf_rx_data; /* Forward declaration for module_ring_params */ struct module_ring_params; +/*Forward declaration for dbr_module_config */ +struct dbr_module_config; #endif #ifdef FEATURE_WLAN_TDLS @@ -584,6 +586,7 @@ struct wlan_lmac_if_wifi_pos_tx_ops { struct wlan_lmac_if_direct_buf_rx_tx_ops { QDF_STATUS (*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));