qcacmn: Define psoc/pdev target_if structures
Define psoc/pdev target_if structure and implement alloc/free of these structures Change-Id: Ie741d0de77c48caa843d4f2b33220a987366ba9b CRs-Fixed: 2177109
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -62,6 +62,8 @@
|
|||||||
#ifdef WLAN_SUPPORT_GREEN_AP
|
#ifdef WLAN_SUPPORT_GREEN_AP
|
||||||
#include <target_if_green_ap.h>
|
#include <target_if_green_ap.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <init_deinit_ucfg.h>
|
||||||
|
#include <service_ready_util.h>
|
||||||
|
|
||||||
#ifdef DIRECT_BUF_RX_ENABLE
|
#ifdef DIRECT_BUF_RX_ENABLE
|
||||||
#include <target_if_direct_buf_rx_api.h>
|
#include <target_if_direct_buf_rx_api.h>
|
||||||
@@ -315,6 +317,15 @@ static void target_if_target_tx_ops_register(
|
|||||||
|
|
||||||
target_tx_ops->tgt_is_tgt_type_qca9888 =
|
target_tx_ops->tgt_is_tgt_type_qca9888 =
|
||||||
target_is_tgt_type_qca9888;
|
target_is_tgt_type_qca9888;
|
||||||
|
|
||||||
|
target_tx_ops->tgt_get_tgt_type =
|
||||||
|
ucfg_get_tgt_type;
|
||||||
|
|
||||||
|
target_tx_ops->tgt_get_tgt_version =
|
||||||
|
ucfg_get_tgt_version;
|
||||||
|
|
||||||
|
target_tx_ops->tgt_get_tgt_revision =
|
||||||
|
ucfg_get_tgt_revision;
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
@@ -412,26 +423,107 @@ QDF_STATUS target_if_register_legacy_service_ready_cb(
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(target_if_register_legacy_service_ready_cb);
|
EXPORT_SYMBOL(target_if_register_legacy_service_ready_cb);
|
||||||
|
|
||||||
|
QDF_STATUS target_if_alloc_pdev_tgt_info(struct wlan_objmgr_pdev *pdev)
|
||||||
|
{
|
||||||
|
struct target_pdev_info *tgt_pdev_info;
|
||||||
|
|
||||||
|
if (!pdev) {
|
||||||
|
target_if_err("pdev is null");
|
||||||
|
return QDF_STATUS_E_INVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
tgt_pdev_info = qdf_mem_malloc(sizeof(*tgt_pdev_info));
|
||||||
|
|
||||||
|
if (tgt_pdev_info == NULL) {
|
||||||
|
target_if_err("Failed to allocate pdev target info");
|
||||||
|
return QDF_STATUS_E_NOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
wlan_pdev_set_tgt_if_handle(pdev, tgt_pdev_info);
|
||||||
|
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDF_STATUS target_if_free_pdev_tgt_info(struct wlan_objmgr_pdev *pdev)
|
||||||
|
{
|
||||||
|
struct target_pdev_info *tgt_pdev_info;
|
||||||
|
|
||||||
|
if (!pdev) {
|
||||||
|
target_if_err("pdev is null");
|
||||||
|
return QDF_STATUS_E_INVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
tgt_pdev_info = wlan_pdev_get_tgt_if_handle(pdev);
|
||||||
|
|
||||||
|
wlan_pdev_set_tgt_if_handle(pdev, NULL);
|
||||||
|
|
||||||
|
qdf_mem_free(tgt_pdev_info);
|
||||||
|
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDF_STATUS target_if_alloc_psoc_tgt_info(struct wlan_objmgr_psoc *psoc)
|
||||||
|
{
|
||||||
|
struct target_psoc_info *tgt_psoc_info;
|
||||||
|
|
||||||
|
if (!psoc) {
|
||||||
|
target_if_err("psoc is null");
|
||||||
|
return QDF_STATUS_E_INVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
tgt_psoc_info = qdf_mem_malloc(sizeof(*tgt_psoc_info));
|
||||||
|
|
||||||
|
if (tgt_psoc_info == NULL) {
|
||||||
|
target_if_err("Failed to allocate psoc target info");
|
||||||
|
return QDF_STATUS_E_NOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
wlan_psoc_set_tgt_if_handle(psoc, tgt_psoc_info);
|
||||||
|
|
||||||
|
qdf_init_waitqueue_head(&tgt_psoc_info->info.event_queue);
|
||||||
|
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDF_STATUS target_if_free_psoc_tgt_info(struct wlan_objmgr_psoc *psoc)
|
||||||
|
{
|
||||||
|
struct target_psoc_info *tgt_psoc_info;
|
||||||
|
struct wlan_psoc_host_service_ext_param *ext_param;
|
||||||
|
|
||||||
|
if (!psoc) {
|
||||||
|
target_if_err("psoc is null");
|
||||||
|
return QDF_STATUS_E_INVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
tgt_psoc_info = wlan_psoc_get_tgt_if_handle(psoc);
|
||||||
|
|
||||||
|
ext_param = target_psoc_get_service_ext_param(tgt_psoc_info);
|
||||||
|
wlan_ext_service_ready_chainmask_table_free(ext_param);
|
||||||
|
|
||||||
|
wlan_psoc_set_tgt_if_handle(psoc, NULL);
|
||||||
|
|
||||||
|
qdf_mem_free(tgt_psoc_info);
|
||||||
|
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
void *target_if_get_wmi_handle(struct wlan_objmgr_psoc *psoc)
|
void *target_if_get_wmi_handle(struct wlan_objmgr_psoc *psoc)
|
||||||
{
|
{
|
||||||
struct target_psoc_info *tgt_psoc_info;
|
struct target_psoc_info *tgt_psoc_info;
|
||||||
void *wmi_handle;
|
|
||||||
|
|
||||||
if (psoc == NULL) {
|
if (psoc == NULL) {
|
||||||
target_if_err("%s: pSOC is NULL", __func__);
|
target_if_err("pSOC is NULL");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
tgt_psoc_info = wlan_psoc_get_tgt_if_handle(psoc);
|
tgt_psoc_info = wlan_psoc_get_tgt_if_handle(psoc);
|
||||||
|
|
||||||
if (tgt_psoc_info == NULL) {
|
if (tgt_psoc_info == NULL) {
|
||||||
target_if_err("%s: psoc tgt_if_handle is NULL", __func__);
|
target_if_err("psoc tgt_if_handle is NULL");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wmi_handle = tgt_psoc_info->wmi_handle;
|
return target_psoc_get_wmi_hdl(tgt_psoc_info);
|
||||||
|
|
||||||
return wmi_handle;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -22,14 +22,15 @@
|
|||||||
#include "target_if_direct_buf_rx_main.h"
|
#include "target_if_direct_buf_rx_main.h"
|
||||||
#include <target_if_direct_buf_rx_api.h>
|
#include <target_if_direct_buf_rx_api.h>
|
||||||
#include "hal_api.h"
|
#include "hal_api.h"
|
||||||
#include <wlan_objmgr_psoc_service_ready_api.h>
|
#include <service_ready_util.h>
|
||||||
|
|
||||||
static uint8_t get_num_dbr_modules_per_pdev(struct wlan_objmgr_pdev *pdev)
|
static uint8_t get_num_dbr_modules_per_pdev(struct wlan_objmgr_pdev *pdev)
|
||||||
{
|
{
|
||||||
struct wlan_objmgr_psoc *psoc;
|
struct wlan_objmgr_psoc *psoc;
|
||||||
struct wlan_objmgr_psoc_ext_service_ready_param *ext_svc_param;
|
|
||||||
struct wlan_psoc_host_dbr_ring_caps *dbr_ring_cap;
|
struct wlan_psoc_host_dbr_ring_caps *dbr_ring_cap;
|
||||||
uint8_t num_dbr_ring_caps, cap_idx, pdev_id, num_modules;
|
uint8_t num_dbr_ring_caps, cap_idx, pdev_id, num_modules;
|
||||||
|
struct target_psoc_info *tgt_psoc_info;
|
||||||
|
struct wlan_psoc_host_service_ext_param *ext_svc_param;
|
||||||
|
|
||||||
psoc = wlan_pdev_get_psoc(pdev);
|
psoc = wlan_pdev_get_psoc(pdev);
|
||||||
|
|
||||||
@@ -38,9 +39,14 @@ static uint8_t get_num_dbr_modules_per_pdev(struct wlan_objmgr_pdev *pdev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ext_svc_param = &psoc->ext_service_param;
|
tgt_psoc_info = wlan_psoc_get_tgt_if_handle(psoc);
|
||||||
num_dbr_ring_caps = ext_svc_param->service_ext_param.num_dbr_ring_caps;
|
if (tgt_psoc_info == NULL) {
|
||||||
dbr_ring_cap = ext_svc_param->dbr_ring_cap;
|
direct_buf_rx_err("target_psoc_info is null");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
ext_svc_param = target_psoc_get_service_ext_param(tgt_psoc_info);
|
||||||
|
num_dbr_ring_caps = ext_svc_param->num_dbr_ring_caps;
|
||||||
|
dbr_ring_cap = target_psoc_get_dbr_ring_caps(tgt_psoc_info);
|
||||||
pdev_id = wlan_objmgr_pdev_get_pdev_id(pdev);
|
pdev_id = wlan_objmgr_pdev_get_pdev_id(pdev);
|
||||||
num_modules = 0;
|
num_modules = 0;
|
||||||
|
|
||||||
@@ -56,12 +62,13 @@ static QDF_STATUS populate_dbr_cap_mod_param(struct wlan_objmgr_pdev *pdev,
|
|||||||
struct direct_buf_rx_module_param *mod_param)
|
struct direct_buf_rx_module_param *mod_param)
|
||||||
{
|
{
|
||||||
struct wlan_objmgr_psoc *psoc;
|
struct wlan_objmgr_psoc *psoc;
|
||||||
struct wlan_objmgr_psoc_ext_service_ready_param *ext_svc_param;
|
|
||||||
struct wlan_psoc_host_dbr_ring_caps *dbr_ring_cap;
|
struct wlan_psoc_host_dbr_ring_caps *dbr_ring_cap;
|
||||||
uint8_t cap_idx;
|
uint8_t cap_idx;
|
||||||
bool cap_found = false;
|
bool cap_found = false;
|
||||||
enum DBR_MODULE mod_id = mod_param->mod_id;
|
enum DBR_MODULE mod_id = mod_param->mod_id;
|
||||||
uint32_t num_dbr_ring_caps, pdev_id;
|
uint32_t num_dbr_ring_caps, pdev_id;
|
||||||
|
struct target_psoc_info *tgt_psoc_info;
|
||||||
|
struct wlan_psoc_host_service_ext_param *ext_svc_param;
|
||||||
|
|
||||||
psoc = wlan_pdev_get_psoc(pdev);
|
psoc = wlan_pdev_get_psoc(pdev);
|
||||||
|
|
||||||
@@ -70,9 +77,15 @@ static QDF_STATUS populate_dbr_cap_mod_param(struct wlan_objmgr_pdev *pdev,
|
|||||||
return QDF_STATUS_E_INVAL;
|
return QDF_STATUS_E_INVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ext_svc_param = &psoc->ext_service_param;
|
tgt_psoc_info = wlan_psoc_get_tgt_if_handle(psoc);
|
||||||
num_dbr_ring_caps = ext_svc_param->service_ext_param.num_dbr_ring_caps;
|
if (tgt_psoc_info == NULL) {
|
||||||
dbr_ring_cap = ext_svc_param->dbr_ring_cap;
|
direct_buf_rx_err("target_psoc_info is null");
|
||||||
|
return QDF_STATUS_E_INVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
ext_svc_param = target_psoc_get_service_ext_param(tgt_psoc_info);
|
||||||
|
num_dbr_ring_caps = ext_svc_param->num_dbr_ring_caps;
|
||||||
|
dbr_ring_cap = target_psoc_get_dbr_ring_caps(tgt_psoc_info);
|
||||||
pdev_id = wlan_objmgr_pdev_get_pdev_id(pdev);
|
pdev_id = wlan_objmgr_pdev_get_pdev_id(pdev);
|
||||||
|
|
||||||
for (cap_idx = 0; cap_idx < num_dbr_ring_caps; cap_idx++) {
|
for (cap_idx = 0; cap_idx < num_dbr_ring_caps; cap_idx++) {
|
||||||
@@ -966,9 +979,8 @@ QDF_STATUS target_if_direct_buf_rx_register_events(
|
|||||||
target_if_direct_buf_rx_rsp_event_handler,
|
target_if_direct_buf_rx_rsp_event_handler,
|
||||||
WMI_RX_UMAC_CTX);
|
WMI_RX_UMAC_CTX);
|
||||||
|
|
||||||
if (ret) {
|
if (ret)
|
||||||
direct_buf_rx_info("event handler not supported", ret);
|
direct_buf_rx_info("event handler not supported", ret);
|
||||||
}
|
|
||||||
|
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user