qcacmn: Pass psoc/pdev object as ctrl objects to DP

pass psoc/pdev object as ctrl pointers to instead of legacy objects.
It introduces new APIs to get feature pointers of psoc/pdev.

DP attach API param modified to pass ctrl psoc (psoc object)

Change-Id: I3d83f28c3e72e5ee984a4220b9d5cf3c4522b501
CRs-Fixed: 2177109
这个提交包含在:
Sathyanarayanan Esakkiappan
2017-12-05 12:00:31 +05:30
提交者 snandini
父节点 0b9d3b241a
当前提交 38c6f988d5
修改 8 个文件,包含 120 行新增38 行删除

查看文件

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -33,31 +33,30 @@
ol_txrx_soc_handle ol_txrx_soc_attach(void *scn_handle, struct ol_if_ops *dp_ol_if_ops); ol_txrx_soc_handle ol_txrx_soc_attach(void *scn_handle, struct ol_if_ops *dp_ol_if_ops);
#ifdef QCA_WIFI_QCA8074 #ifdef QCA_WIFI_QCA8074
void *dp_soc_attach_wifi3(void *osif_soc, void *hif_handle, void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle,
HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
struct ol_if_ops *ol_ops, struct wlan_objmgr_psoc *psoc); struct ol_if_ops *ol_ops);
#else #else
/* /*
* dp_soc_attach_wifi3() - Attach txrx SOC * dp_soc_attach_wifi3() - Attach txrx SOC
* @osif_soc: Opaque SOC handle from OSIF/HDD * @ctrl_psoc: Opaque SOC handle from Ctrl plane
* @htc_handle: Opaque HTC handle * @htc_handle: Opaque HTC handle
* @hif_handle: Opaque HIF handle * @hif_handle: Opaque HIF handle
* @qdf_osdev: QDF device * @qdf_osdev: QDF device
* *
* Return: DP SOC handle on success, NULL on failure * Return: DP SOC handle on success, NULL on failure
*/ */
static inline void *dp_soc_attach_wifi3(void *osif_soc, void *hif_handle, static inline void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle,
HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
struct ol_if_ops *ol_ops, struct wlan_objmgr_psoc *psoc) struct ol_if_ops *ol_ops)
{ {
return NULL; return NULL;
} }
#endif /* QCA_WIFI_QCA8074 */ #endif /* QCA_WIFI_QCA8074 */
static inline ol_txrx_soc_handle cdp_soc_attach(u_int16_t devid, static inline ol_txrx_soc_handle cdp_soc_attach(u_int16_t devid,
void *hif_handle, void *scn, void *htc_handle, void *hif_handle, void *psoc, void *htc_handle,
qdf_device_t qdf_dev, struct ol_if_ops *dp_ol_if_ops, qdf_device_t qdf_dev, struct ol_if_ops *dp_ol_if_ops)
struct wlan_objmgr_psoc *psoc)
{ {
switch (devid) { switch (devid) {
case LITHIUM_DP: /*FIXME Add lithium devide IDs */ case LITHIUM_DP: /*FIXME Add lithium devide IDs */
@@ -66,11 +65,11 @@ static inline ol_txrx_soc_handle cdp_soc_attach(u_int16_t devid,
case RUMIM2M_DEVICE_ID_NODE1: /*lithium emulation */ case RUMIM2M_DEVICE_ID_NODE1: /*lithium emulation */
case RUMIM2M_DEVICE_ID_NODE2: /*lithium emulation */ case RUMIM2M_DEVICE_ID_NODE2: /*lithium emulation */
case RUMIM2M_DEVICE_ID_NODE3: /*lithium emulation */ case RUMIM2M_DEVICE_ID_NODE3: /*lithium emulation */
return dp_soc_attach_wifi3(scn, hif_handle, htc_handle, return dp_soc_attach_wifi3(psoc, hif_handle, htc_handle,
qdf_dev, dp_ol_if_ops, psoc); qdf_dev, dp_ol_if_ops);
break; break;
default: default:
return ol_txrx_soc_attach(scn, dp_ol_if_ops); return ol_txrx_soc_attach(psoc, dp_ol_if_ops);
} }
return NULL; return NULL;
} }

查看文件

@@ -2764,7 +2764,7 @@ htt_htc_soc_attach(struct htt_soc *soc)
/* /*
* htt_soc_attach() - SOC level HTT initialization * htt_soc_attach() - SOC level HTT initialization
* @dp_soc: Opaque Data path SOC handle * @dp_soc: Opaque Data path SOC handle
* @osif_soc: Opaque OSIF SOC handle * @ctrl_psoc: Opaque ctrl SOC handle
* @htc_soc: SOC level HTC handle * @htc_soc: SOC level HTC handle
* @hal_soc: Opaque HAL SOC handle * @hal_soc: Opaque HAL SOC handle
* @osdev: QDF device * @osdev: QDF device
@@ -2772,7 +2772,7 @@ htt_htc_soc_attach(struct htt_soc *soc)
* Return: HTT handle on success; NULL on failure * Return: HTT handle on success; NULL on failure
*/ */
void * void *
htt_soc_attach(void *dp_soc, void *osif_soc, HTC_HANDLE htc_soc, htt_soc_attach(void *dp_soc, void *ctrl_psoc, HTC_HANDLE htc_soc,
void *hal_soc, qdf_device_t osdev) void *hal_soc, qdf_device_t osdev)
{ {
struct htt_soc *soc; struct htt_soc *soc;
@@ -2784,7 +2784,7 @@ htt_soc_attach(void *dp_soc, void *osif_soc, HTC_HANDLE htc_soc,
goto fail1; goto fail1;
soc->osdev = osdev; soc->osdev = osdev;
soc->osif_soc = osif_soc; soc->ctrl_psoc = ctrl_psoc;
soc->dp_soc = dp_soc; soc->dp_soc = dp_soc;
soc->htc_soc = htc_soc; soc->htc_soc = htc_soc;
soc->hal_soc = hal_soc; soc->hal_soc = hal_soc;

查看文件

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -62,7 +62,7 @@ struct dp_htt_htc_pkt_union {
}; };
struct htt_soc { struct htt_soc {
void *osif_soc; void *ctrl_psoc;
void *dp_soc; void *dp_soc;
void *hal_soc; void *hal_soc;
HTC_HANDLE htc_soc; HTC_HANDLE htc_soc;
@@ -135,7 +135,7 @@ struct htt_rx_ring_tlv_filter {
}; };
void * void *
htt_soc_attach(void *txrx_soc, void *osif_soc, HTC_HANDLE htc_soc, htt_soc_attach(void *txrx_soc, void *ctrl_psoc, HTC_HANDLE htc_soc,
void *hal_soc, qdf_device_t osdev); void *hal_soc, qdf_device_t osdev);
void htt_soc_detach(void *soc); void htt_soc_detach(void *soc);

查看文件

@@ -2080,7 +2080,7 @@ static void dp_lro_hash_setup(struct dp_soc *soc)
if (soc->cdp_soc.ol_ops->lro_hash_config) if (soc->cdp_soc.ol_ops->lro_hash_config)
(void)soc->cdp_soc.ol_ops->lro_hash_config (void)soc->cdp_soc.ol_ops->lro_hash_config
(soc->osif_soc, &lro_hash); (soc->ctrl_psoc, &lro_hash);
} }
/* /*
@@ -2248,7 +2248,7 @@ void dp_mark_peer_inact(void *peer, bool inactive)
/* /*
* dp_pdev_attach_wifi3() - attach txrx pdev * dp_pdev_attach_wifi3() - attach txrx pdev
* @osif_pdev: Opaque PDEV handle from OSIF/HDD * @ctrl_pdev: Opaque PDEV object
* @txrx_soc: Datapath SOC handle * @txrx_soc: Datapath SOC handle
* @htc_handle: HTC handle for host-target interface * @htc_handle: HTC handle for host-target interface
* @qdf_osdev: QDF OS device * @qdf_osdev: QDF OS device
@@ -2760,7 +2760,7 @@ static void dp_rxdma_ring_config(struct dp_soc *soc)
if (soc->cdp_soc.ol_ops-> if (soc->cdp_soc.ol_ops->
is_hw_dbs_2x2_capable) { is_hw_dbs_2x2_capable) {
dbs_enable = soc->cdp_soc.ol_ops-> dbs_enable = soc->cdp_soc.ol_ops->
is_hw_dbs_2x2_capable(soc->psoc); is_hw_dbs_2x2_capable(soc->ctrl_psoc);
} }
if (dbs_enable) { if (dbs_enable) {
@@ -6411,7 +6411,7 @@ static void dp_soc_set_txrx_ring_map(struct dp_soc *soc)
/* /*
* dp_soc_attach_wifi3() - Attach txrx SOC * dp_soc_attach_wifi3() - Attach txrx SOC
* @osif_soc: Opaque SOC handle from OSIF/HDD * @ctrl_psoc: Opaque SOC handle from control plane
* @htc_handle: Opaque HTC handle * @htc_handle: Opaque HTC handle
* @hif_handle: Opaque HIF handle * @hif_handle: Opaque HIF handle
* @qdf_osdev: QDF device * @qdf_osdev: QDF device
@@ -6423,12 +6423,12 @@ static void dp_soc_set_txrx_ring_map(struct dp_soc *soc)
* -Wmissing-prototypes. A more correct solution, namely to expose * -Wmissing-prototypes. A more correct solution, namely to expose
* a prototype in an appropriate header file, will come later. * a prototype in an appropriate header file, will come later.
*/ */
void *dp_soc_attach_wifi3(void *osif_soc, void *hif_handle, void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle,
HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
struct ol_if_ops *ol_ops, struct wlan_objmgr_psoc *psoc); struct ol_if_ops *ol_ops);
void *dp_soc_attach_wifi3(void *osif_soc, void *hif_handle, void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle,
HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
struct ol_if_ops *ol_ops, struct wlan_objmgr_psoc *psoc) struct ol_if_ops *ol_ops)
{ {
struct dp_soc *soc = qdf_mem_malloc(sizeof(*soc)); struct dp_soc *soc = qdf_mem_malloc(sizeof(*soc));
@@ -6440,13 +6440,12 @@ void *dp_soc_attach_wifi3(void *osif_soc, void *hif_handle,
soc->cdp_soc.ops = &dp_txrx_ops; soc->cdp_soc.ops = &dp_txrx_ops;
soc->cdp_soc.ol_ops = ol_ops; soc->cdp_soc.ol_ops = ol_ops;
soc->osif_soc = osif_soc; soc->ctrl_psoc = ctrl_psoc;
soc->osdev = qdf_osdev; soc->osdev = qdf_osdev;
soc->hif_handle = hif_handle; soc->hif_handle = hif_handle;
soc->psoc = psoc;
soc->hal_soc = hif_get_hal_handle(hif_handle); soc->hal_soc = hif_get_hal_handle(hif_handle);
soc->htt_handle = htt_soc_attach(soc, osif_soc, htc_handle, soc->htt_handle = htt_soc_attach(soc, ctrl_psoc, htc_handle,
soc->hal_soc, qdf_osdev); soc->hal_soc, qdf_osdev);
if (!soc->htt_handle) { if (!soc->htt_handle) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
@@ -6465,14 +6464,14 @@ void *dp_soc_attach_wifi3(void *osif_soc, void *hif_handle,
soc->cce_disable = false; soc->cce_disable = false;
if (soc->cdp_soc.ol_ops->get_dp_cfg_param) { if (soc->cdp_soc.ol_ops->get_dp_cfg_param) {
int ret = soc->cdp_soc.ol_ops->get_dp_cfg_param(soc->osif_soc, int ret = soc->cdp_soc.ol_ops->get_dp_cfg_param(soc->ctrl_psoc,
CDP_CFG_MAX_PEER_ID); CDP_CFG_MAX_PEER_ID);
if (ret != -EINVAL) { if (ret != -EINVAL) {
wlan_cfg_set_max_peer_id(soc->wlan_cfg_ctx, ret); wlan_cfg_set_max_peer_id(soc->wlan_cfg_ctx, ret);
} }
ret = soc->cdp_soc.ol_ops->get_dp_cfg_param(soc->osif_soc, ret = soc->cdp_soc.ol_ops->get_dp_cfg_param(soc->ctrl_psoc,
CDP_CFG_CCE_DISABLE); CDP_CFG_CCE_DISABLE);
if (ret) if (ret)
soc->cce_disable = true; soc->cce_disable = true;
@@ -6552,7 +6551,7 @@ void dp_is_hw_dbs_enable(struct dp_soc *soc,
bool dbs_enable = false; bool dbs_enable = false;
if (soc->cdp_soc.ol_ops->is_hw_dbs_2x2_capable) if (soc->cdp_soc.ol_ops->is_hw_dbs_2x2_capable)
dbs_enable = soc->cdp_soc.ol_ops-> dbs_enable = soc->cdp_soc.ol_ops->
is_hw_dbs_2x2_capable(soc->psoc); is_hw_dbs_2x2_capable(soc->ctrl_psoc);
*max_mac_rings = (dbs_enable)?(*max_mac_rings):1; *max_mac_rings = (dbs_enable)?(*max_mac_rings):1;
} }

查看文件

@@ -382,7 +382,7 @@ static inline void dp_peer_map_ast(struct dp_soc *soc,
if (ast_entry_found || (peer->vdev && peer->vdev->proxysta_vdev)) { if (ast_entry_found || (peer->vdev && peer->vdev->proxysta_vdev)) {
if (soc->cdp_soc.ol_ops->peer_map_event) { if (soc->cdp_soc.ol_ops->peer_map_event) {
soc->cdp_soc.ol_ops->peer_map_event( soc->cdp_soc.ol_ops->peer_map_event(
soc->osif_soc, peer->peer_ids[0], soc->ctrl_psoc, peer->peer_ids[0],
hw_peer_id, vdev_id, hw_peer_id, vdev_id,
mac_addr, peer_type); mac_addr, peer_type);
} }
@@ -856,7 +856,7 @@ dp_rx_peer_unmap_handler(void *soc_handle, uint16_t peer_id)
} }
if (soc->cdp_soc.ol_ops->peer_unmap_event) { if (soc->cdp_soc.ol_ops->peer_unmap_event) {
soc->cdp_soc.ol_ops->peer_unmap_event(soc->osif_soc, soc->cdp_soc.ol_ops->peer_unmap_event(soc->ctrl_psoc,
peer_id); peer_id);
} }

查看文件

@@ -591,8 +591,8 @@ struct dp_soc {
/* Common base structure - Should be the first member */ /* Common base structure - Should be the first member */
struct cdp_soc_t cdp_soc; struct cdp_soc_t cdp_soc;
/* SoC/softc handle from OSIF layer */ /* SoC Obj */
void *osif_soc; void *ctrl_psoc;
/* OS device abstraction */ /* OS device abstraction */
qdf_device_t osdev; qdf_device_t osdev;
@@ -795,8 +795,6 @@ struct dp_soc {
qdf_list_t reo_desc_freelist; qdf_list_t reo_desc_freelist;
qdf_spinlock_t reo_desc_freelist_lock; qdf_spinlock_t reo_desc_freelist_lock;
/* Obj Mgr SoC */
struct wlan_objmgr_psoc *psoc;
#ifdef QCA_SUPPORT_SON #ifdef QCA_SUPPORT_SON
/* The timer to check station's inactivity status */ /* The timer to check station's inactivity status */
os_timer_t pdev_bs_inact_timer; os_timer_t pdev_bs_inact_timer;

查看文件

@@ -164,6 +164,17 @@ void *ucfg_get_wmi_hdl(struct wlan_objmgr_psoc *psoc);
*/ */
void *ucfg_get_htc_hdl(struct wlan_objmgr_psoc *psoc); void *ucfg_get_htc_hdl(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_set_htc_hdl() - set htc handle
* @psoc: pointer to psoc
* @htc_hdl: HTC handle
*
* API to set htc handle
*
* Return: void
*/
void ucfg_set_htc_hdl(struct wlan_objmgr_psoc *psoc, void *htc_hdl);
/** /**
* ucfg_get_hif_hdl() - get hif handle * ucfg_get_hif_hdl() - get hif handle
* @psoc: pointer to psoc * @psoc: pointer to psoc
@@ -183,4 +194,24 @@ void *ucfg_get_hif_hdl(struct wlan_objmgr_psoc *psoc);
* Return: wmi handle * Return: wmi handle
*/ */
void *ucfg_get_pdev_wmi_handle(struct wlan_objmgr_pdev *pdev); void *ucfg_get_pdev_wmi_handle(struct wlan_objmgr_pdev *pdev);
/**
* ucfg_get_psoc_feature_ptr() - get feature pointer
* @psoc: pointer to psoc
*
* API to get legacy pointer
*
* Return: feature pointer
*/
void *ucfg_get_psoc_feature_ptr(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_get_pdev_feature_ptr() - get feature pointer
* @pdev: pointer to pdev
*
* API to get legacy pointer
*
* Return: pdev feature pointer
*/
void *ucfg_get_pdev_feature_ptr(struct wlan_objmgr_pdev *pdev);
#endif /* _INIT_DEINIT_UCFG_H_ */ #endif /* _INIT_DEINIT_UCFG_H_ */

查看文件

@@ -249,6 +249,7 @@ void *ucfg_get_wmi_hdl(struct wlan_objmgr_psoc *psoc)
target_if_err("psoc is null"); target_if_err("psoc is null");
return NULL; return NULL;
} }
tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc); tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc);
if (!tgt_hdl) { if (!tgt_hdl) {
target_if_err("target_psoc_info is null"); target_if_err("target_psoc_info is null");
@@ -266,6 +267,7 @@ void *ucfg_get_htc_hdl(struct wlan_objmgr_psoc *psoc)
target_if_err("psoc is null"); target_if_err("psoc is null");
return NULL; return NULL;
} }
tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc); tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc);
if (!tgt_hdl) { if (!tgt_hdl) {
target_if_err("target_psoc_info is null"); target_if_err("target_psoc_info is null");
@@ -275,6 +277,23 @@ void *ucfg_get_htc_hdl(struct wlan_objmgr_psoc *psoc)
return target_psoc_get_htc_hdl(tgt_hdl); return target_psoc_get_htc_hdl(tgt_hdl);
} }
void ucfg_set_htc_hdl(struct wlan_objmgr_psoc *psoc, void *htc_hdl)
{
struct target_psoc_info *tgt_hdl;
if (!psoc) {
target_if_err("psoc is null");
return;
}
tgt_hdl = (struct target_psoc_info *)wlan_psoc_get_tgt_if_handle(psoc);
if (!tgt_hdl) {
target_if_err("target_psoc_info is null");
return;
}
target_psoc_set_htc_hdl(tgt_hdl, htc_hdl);
}
void *ucfg_get_hif_hdl(struct wlan_objmgr_psoc *psoc) void *ucfg_get_hif_hdl(struct wlan_objmgr_psoc *psoc)
{ {
struct target_psoc_info *tgt_hdl; struct target_psoc_info *tgt_hdl;
@@ -283,6 +302,7 @@ void *ucfg_get_hif_hdl(struct wlan_objmgr_psoc *psoc)
target_if_err("psoc is null"); target_if_err("psoc is null");
return NULL; return NULL;
} }
tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc); tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc);
if (!tgt_hdl) { if (!tgt_hdl) {
target_if_err("target_psoc_info is null"); target_if_err("target_psoc_info is null");
@@ -300,6 +320,7 @@ void *ucfg_get_pdev_wmi_handle(struct wlan_objmgr_pdev *pdev)
target_if_err("pdev is null"); target_if_err("pdev is null");
return NULL; return NULL;
} }
tgt_hdl = wlan_pdev_get_tgt_if_handle(pdev); tgt_hdl = wlan_pdev_get_tgt_if_handle(pdev);
if (!tgt_hdl) { if (!tgt_hdl) {
target_if_err("target_pdev_info is null"); target_if_err("target_pdev_info is null");
@@ -308,3 +329,37 @@ void *ucfg_get_pdev_wmi_handle(struct wlan_objmgr_pdev *pdev)
return target_pdev_get_wmi_handle(tgt_hdl); return target_pdev_get_wmi_handle(tgt_hdl);
} }
void *ucfg_get_psoc_feature_ptr(struct wlan_objmgr_psoc *psoc)
{
struct target_psoc_info *tgt_hdl;
if (!psoc) {
target_if_err("psoc is null");
return NULL;
}
tgt_hdl = (struct target_psoc_info *)wlan_psoc_get_tgt_if_handle(psoc);
if (!tgt_hdl) {
target_if_err("target_psoc_info is null");
return NULL;
}
return target_psoc_get_feature_ptr(tgt_hdl);
}
void *ucfg_get_pdev_feature_ptr(struct wlan_objmgr_pdev *pdev)
{
struct target_pdev_info *tgt_hdl;
if (!pdev) {
target_if_err("pdev is null");
return NULL;
}
tgt_hdl = (struct target_pdev_info *)wlan_pdev_get_tgt_if_handle(pdev);
if (!tgt_hdl) {
target_if_err("target_pdev_info is null");
return NULL;
}
return target_pdev_get_feature_ptr(tgt_hdl);
}