diff --git a/dp/inc/cdp_txrx_cmn_reg.h b/dp/inc/cdp_txrx_cmn_reg.h index 9bca5240b3..2957c64acd 100644 --- a/dp/inc/cdp_txrx_cmn_reg.h +++ b/dp/inc/cdp_txrx_cmn_reg.h @@ -57,28 +57,30 @@ ol_txrx_soc_handle ol_txrx_soc_attach(void *scn_handle, struct ol_if_ops *dp_ol_ * Return: DP SOC handle on success, NULL on failure */ #if defined(QCA_WIFI_QCA8074) || defined(QCA_WIFI_QCA6018) -void *dp_soc_attach_wifi3(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, - void *hif_handle, - HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, - struct ol_if_ops *ol_ops, uint16_t device_id); +struct cdp_soc_t * +dp_soc_attach_wifi3(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, + struct hif_opaque_softc *hif_handle, + HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, + struct ol_if_ops *ol_ops, uint16_t device_id); void *dp_soc_init_wifi3(void *soc, struct cdp_ctrl_objmgr_psoc *ctrl_psoc, - void *hif_handle, + struct hif_opaque_softc *hif_handle, HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, struct ol_if_ops *ol_ops, uint16_t device_id); #else -static inline void *dp_soc_attach_wifi3(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, - void *hif_handle, - HTC_HANDLE htc_handle, - qdf_device_t qdf_osdev, - struct ol_if_ops *ol_ops, - uint16_t device_id) +static inline +struct cdp_soc_t *dp_soc_attach_wifi3(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, + struct hif_opaque_softc *hif_handle, + HTC_HANDLE htc_handle, + qdf_device_t qdf_osdev, + struct ol_if_ops *ol_ops, + uint16_t device_id) { return NULL; } static inline void *dp_soc_init_wifi3(void *soc, struct cdp_ctrl_objmgr_psoc *ctrl_psoc, - void *hif_handle, + struct hif_opaque_softc *hif_handle, HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, struct ol_if_ops *ol_ops, uint16_t device_id) { diff --git a/dp/inc/cdp_txrx_cmn_struct.h b/dp/inc/cdp_txrx_cmn_struct.h index bf2e97f066..4ad3a82416 100644 --- a/dp/inc/cdp_txrx_cmn_struct.h +++ b/dp/inc/cdp_txrx_cmn_struct.h @@ -359,7 +359,7 @@ enum cdp_ast_free_status { * @cdp_ast_free_status: ast free status */ typedef void (*txrx_ast_free_cb)(struct cdp_ctrl_objmgr_psoc *ctrl_soc, - void *cdp_soc, + struct cdp_soc *cdp_soc, void *cookie, enum cdp_ast_free_status); diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index a76dbe7e53..710a3a316c 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -44,6 +44,8 @@ #define CDP_PEER_DELETE_NO_SPECIAL 0 #define CDP_PEER_DO_NOT_START_UNMAP_TIMER 1 +struct hif_opaque_softc; + /* same as ieee80211_nac_param */ enum cdp_nac_param_cmd { /* IEEE80211_NAC_PARAM_ADD */ @@ -320,7 +322,7 @@ struct cdp_cmn_ops { */ void *(*txrx_soc_init)(void *soc, struct cdp_ctrl_objmgr_psoc *ctrl_psoc, - void *hif_handle, + struct hif_opaque_softc *hif_handle, HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, struct ol_if_ops *ol_ops, uint16_t device_id); diff --git a/dp/wifi3.0/dp_internal.h b/dp/wifi3.0/dp_internal.h index cb23b04571..7d9288df31 100644 --- a/dp/wifi3.0/dp_internal.h +++ b/dp/wifi3.0/dp_internal.h @@ -1323,15 +1323,39 @@ QDF_STATUS dp_tx_add_to_comp_queue(struct dp_soc *soc, } #endif +/** + * dp_vdev_to_cdp_vdev() - typecast dp vdev to cdp vdev + * @vdev: DP vdev handle + * + * Return: struct cdp_vdev pointer + */ static inline struct cdp_vdev *dp_vdev_to_cdp_vdev(struct dp_vdev *vdev) { return (struct cdp_vdev *)vdev; } +/** + * dp_pdev_to_cdp_pdev() - typecast dp pdev to cdp pdev + * @pdev: DP pdev handle + * + * Return: struct cdp_pdev pointer + */ static inline struct cdp_pdev *dp_pdev_to_cdp_pdev(struct dp_pdev *pdev) { return (struct cdp_pdev *)pdev; } + +/** + * dp_soc_to_cdp_soc() - typecast dp psoc to cdp psoc + * @psoc: DP psoc handle + * + * Return: struct cdp_soc pointer + */ +static inline +struct cdp_soc *dp_soc_to_cdp_soc(struct dp_soc *psoc) +{ + return (struct cdp_soc *)psoc; +} #endif /* #ifndef _DP_INTERNAL_H_ */ diff --git a/dp/wifi3.0/dp_peer.c b/dp/wifi3.0/dp_peer.c index 3dd539e4bd..f38623f655 100644 --- a/dp/wifi3.0/dp_peer.c +++ b/dp/wifi3.0/dp_peer.c @@ -269,7 +269,7 @@ static inline void dp_peer_ast_cleanup(struct dp_soc *soc, ast->callback = NULL; ast->cookie = NULL; cb(soc->ctrl_psoc, - soc, + dp_psoc_to_cdp_psoc(soc), cookie, CDP_TXRX_AST_DELETE_IN_PROGRESS); } @@ -527,7 +527,7 @@ static inline void dp_peer_map_ast(struct dp_soc *soc, } void dp_peer_free_hmwds_cb(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, - void *dp_soc, + struct cdp_soc *dp_soc, void *cookie, enum cdp_ast_free_status status) { @@ -715,7 +715,9 @@ int dp_peer_add_ast(struct dp_soc *soc, /* Call the saved callback*/ if (cb) { - cb(soc->ctrl_psoc, soc, cookie, + cb(soc->ctrl_psoc, + dp_psoc_to_cdp_psoc(soc), + cookie, CDP_TXRX_AST_DELETE_IN_PROGRESS); } return 0; @@ -1140,7 +1142,7 @@ static int dp_peer_ast_free_entry_by_mac(struct dp_soc *soc, if (cb) { cb(soc->ctrl_psoc, - soc, + dp_psoc_to_cdp_psoc(soc), cookie, CDP_TXRX_AST_DELETED); } diff --git a/dp/wifi3.0/dp_peer.h b/dp/wifi3.0/dp_peer.h index ef5cdd8697..fca020c685 100644 --- a/dp/wifi3.0/dp_peer.h +++ b/dp/wifi3.0/dp_peer.h @@ -141,7 +141,7 @@ void dp_peer_ast_send_wds_del(struct dp_soc *soc, struct dp_ast_entry *ast_entry); void dp_peer_free_hmwds_cb(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, - void *dp_soc, + struct cdp_soc *dp_soc, void *cookie, enum cdp_ast_free_status status); diff --git a/hif/src/hif_main.h b/hif/src/hif_main.h index 02fab8e043..911363c0fb 100644 --- a/hif/src/hif_main.h +++ b/hif/src/hif_main.h @@ -213,7 +213,8 @@ struct hif_softc { #endif }; -static inline void *hif_get_hal_handle(void *hif_hdl) +static inline +void *hif_get_hal_handle(struct hif_opaque_softc *hif_hdl) { struct hif_softc *sc = (struct hif_softc *)hif_hdl; diff --git a/target_if/core/inc/target_if.h b/target_if/core/inc/target_if.h index 561874c82d..0587f0283d 100644 --- a/target_if/core/inc/target_if.h +++ b/target_if/core/inc/target_if.h @@ -110,7 +110,6 @@ struct host_fw_ver { }; struct common_dbglog_handle; -struct common_hif_handle; struct common_accelerator_handle; /** @@ -123,7 +122,7 @@ struct common_accelerator_handle; * @dbglog_hdl: Debug log handle */ struct comp_hdls { - struct common_hif_handle *hif_hdl; + struct hif_opaque_softc *hif_hdl; HTC_HANDLE htc_hdl; struct wmi_unified *wmi_hdl; struct common_accelerator_handle *accelerator_hdl; @@ -875,7 +874,7 @@ static inline uint32_t target_psoc_get_num_mem_chunks */ static inline void target_psoc_set_hif_hdl (struct target_psoc_info *psoc_info, - struct common_hif_handle *hif_hdl) + struct hif_opaque_softc *hif_hdl) { if (!psoc_info) return; @@ -891,7 +890,7 @@ static inline void target_psoc_set_hif_hdl * * Return: hif_hdl */ -static inline struct common_hif_handle *target_psoc_get_hif_hdl +static inline struct hif_opaque_softc *target_psoc_get_hif_hdl (struct target_psoc_info *psoc_info) { if (!psoc_info) diff --git a/target_if/init_deinit/inc/init_deinit_lmac.h b/target_if/init_deinit/inc/init_deinit_lmac.h index 325792a8ed..7d3b710418 100644 --- a/target_if/init_deinit/inc/init_deinit_lmac.h +++ b/target_if/init_deinit/inc/init_deinit_lmac.h @@ -159,7 +159,7 @@ void lmac_set_htc_hdl(struct wlan_objmgr_psoc *psoc, * * Return: hif handler */ -struct common_hif_handle *lmac_get_hif_hdl(struct wlan_objmgr_psoc *psoc); +struct hif_opaque_softc *lmac_get_hif_hdl(struct wlan_objmgr_psoc *psoc); /** * lmac_get_ol_hif_hdl() - get hif handle diff --git a/target_if/init_deinit/src/init_deinit_lmac.c b/target_if/init_deinit/src/init_deinit_lmac.c index 84496b06e0..680a0a0313 100644 --- a/target_if/init_deinit/src/init_deinit_lmac.c +++ b/target_if/init_deinit/src/init_deinit_lmac.c @@ -249,7 +249,7 @@ void lmac_set_htc_hdl(struct wlan_objmgr_psoc *psoc, target_psoc_set_htc_hdl(tgt_hdl, htc_hdl); } -struct common_hif_handle *lmac_get_hif_hdl(struct wlan_objmgr_psoc *psoc) +struct hif_opaque_softc *lmac_get_hif_hdl(struct wlan_objmgr_psoc *psoc) { struct target_psoc_info *tgt_hdl;