qcacmn: Change to remove void pointer usage for HIF handle

Add code to remove void pointer usage for hif_handle
and use opaque pointer hif_opaque_softc and also use
cdp_soc for opaque DP soc handle

Change-Id: I2896f7704ffb809214c5b08756c4b8673307fd9e
CRs-Fixed: 2487247
This commit is contained in:
Akshay Kosigi
2019-07-08 23:04:36 +05:30
committed by nshrivas
parent 67c8bb9e06
commit 4002f765f1
10 changed files with 56 additions and 26 deletions

View File

@@ -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 * Return: DP SOC handle on success, NULL on failure
*/ */
#if defined(QCA_WIFI_QCA8074) || defined(QCA_WIFI_QCA6018) #if defined(QCA_WIFI_QCA8074) || defined(QCA_WIFI_QCA6018)
void *dp_soc_attach_wifi3(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, struct cdp_soc_t *
void *hif_handle, dp_soc_attach_wifi3(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, struct hif_opaque_softc *hif_handle,
struct ol_if_ops *ol_ops, uint16_t device_id); 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 *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, HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
struct ol_if_ops *ol_ops, uint16_t device_id); struct ol_if_ops *ol_ops, uint16_t device_id);
#else #else
static inline void *dp_soc_attach_wifi3(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, static inline
void *hif_handle, struct cdp_soc_t *dp_soc_attach_wifi3(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
HTC_HANDLE htc_handle, struct hif_opaque_softc *hif_handle,
qdf_device_t qdf_osdev, HTC_HANDLE htc_handle,
struct ol_if_ops *ol_ops, qdf_device_t qdf_osdev,
uint16_t device_id) struct ol_if_ops *ol_ops,
uint16_t device_id)
{ {
return NULL; return NULL;
} }
static inline static inline
void *dp_soc_init_wifi3(void *soc, struct cdp_ctrl_objmgr_psoc *ctrl_psoc, 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, HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
struct ol_if_ops *ol_ops, uint16_t device_id) struct ol_if_ops *ol_ops, uint16_t device_id)
{ {

View File

@@ -359,7 +359,7 @@ enum cdp_ast_free_status {
* @cdp_ast_free_status: ast free status * @cdp_ast_free_status: ast free status
*/ */
typedef void (*txrx_ast_free_cb)(struct cdp_ctrl_objmgr_psoc *ctrl_soc, typedef void (*txrx_ast_free_cb)(struct cdp_ctrl_objmgr_psoc *ctrl_soc,
void *cdp_soc, struct cdp_soc *cdp_soc,
void *cookie, void *cookie,
enum cdp_ast_free_status); enum cdp_ast_free_status);

View File

@@ -44,6 +44,8 @@
#define CDP_PEER_DELETE_NO_SPECIAL 0 #define CDP_PEER_DELETE_NO_SPECIAL 0
#define CDP_PEER_DO_NOT_START_UNMAP_TIMER 1 #define CDP_PEER_DO_NOT_START_UNMAP_TIMER 1
struct hif_opaque_softc;
/* same as ieee80211_nac_param */ /* same as ieee80211_nac_param */
enum cdp_nac_param_cmd { enum cdp_nac_param_cmd {
/* IEEE80211_NAC_PARAM_ADD */ /* IEEE80211_NAC_PARAM_ADD */
@@ -320,7 +322,7 @@ struct cdp_cmn_ops {
*/ */
void *(*txrx_soc_init)(void *soc, void *(*txrx_soc_init)(void *soc,
struct cdp_ctrl_objmgr_psoc *ctrl_psoc, 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, HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
struct ol_if_ops *ol_ops, uint16_t device_id); struct ol_if_ops *ol_ops, uint16_t device_id);

View File

@@ -1323,15 +1323,39 @@ QDF_STATUS dp_tx_add_to_comp_queue(struct dp_soc *soc,
} }
#endif #endif
/**
* dp_vdev_to_cdp_vdev() - typecast dp vdev to cdp vdev
* @vdev: DP vdev handle
*
* Return: struct cdp_vdev pointer
*/
static inline static inline
struct cdp_vdev *dp_vdev_to_cdp_vdev(struct dp_vdev *vdev) struct cdp_vdev *dp_vdev_to_cdp_vdev(struct dp_vdev *vdev)
{ {
return (struct cdp_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 static inline
struct cdp_pdev *dp_pdev_to_cdp_pdev(struct dp_pdev *pdev) struct cdp_pdev *dp_pdev_to_cdp_pdev(struct dp_pdev *pdev)
{ {
return (struct cdp_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_ */ #endif /* #ifndef _DP_INTERNAL_H_ */

View File

@@ -269,7 +269,7 @@ static inline void dp_peer_ast_cleanup(struct dp_soc *soc,
ast->callback = NULL; ast->callback = NULL;
ast->cookie = NULL; ast->cookie = NULL;
cb(soc->ctrl_psoc, cb(soc->ctrl_psoc,
soc, dp_psoc_to_cdp_psoc(soc),
cookie, cookie,
CDP_TXRX_AST_DELETE_IN_PROGRESS); 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_peer_free_hmwds_cb(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
void *dp_soc, struct cdp_soc *dp_soc,
void *cookie, void *cookie,
enum cdp_ast_free_status status) enum cdp_ast_free_status status)
{ {
@@ -715,7 +715,9 @@ int dp_peer_add_ast(struct dp_soc *soc,
/* Call the saved callback*/ /* Call the saved callback*/
if (cb) { 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); CDP_TXRX_AST_DELETE_IN_PROGRESS);
} }
return 0; return 0;
@@ -1140,7 +1142,7 @@ static int dp_peer_ast_free_entry_by_mac(struct dp_soc *soc,
if (cb) { if (cb) {
cb(soc->ctrl_psoc, cb(soc->ctrl_psoc,
soc, dp_psoc_to_cdp_psoc(soc),
cookie, cookie,
CDP_TXRX_AST_DELETED); CDP_TXRX_AST_DELETED);
} }

View File

@@ -141,7 +141,7 @@ void dp_peer_ast_send_wds_del(struct dp_soc *soc,
struct dp_ast_entry *ast_entry); struct dp_ast_entry *ast_entry);
void dp_peer_free_hmwds_cb(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, void dp_peer_free_hmwds_cb(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
void *dp_soc, struct cdp_soc *dp_soc,
void *cookie, void *cookie,
enum cdp_ast_free_status status); enum cdp_ast_free_status status);

View File

@@ -213,7 +213,8 @@ struct hif_softc {
#endif #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; struct hif_softc *sc = (struct hif_softc *)hif_hdl;

View File

@@ -110,7 +110,6 @@ struct host_fw_ver {
}; };
struct common_dbglog_handle; struct common_dbglog_handle;
struct common_hif_handle;
struct common_accelerator_handle; struct common_accelerator_handle;
/** /**
@@ -123,7 +122,7 @@ struct common_accelerator_handle;
* @dbglog_hdl: Debug log handle * @dbglog_hdl: Debug log handle
*/ */
struct comp_hdls { struct comp_hdls {
struct common_hif_handle *hif_hdl; struct hif_opaque_softc *hif_hdl;
HTC_HANDLE htc_hdl; HTC_HANDLE htc_hdl;
struct wmi_unified *wmi_hdl; struct wmi_unified *wmi_hdl;
struct common_accelerator_handle *accelerator_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 static inline void target_psoc_set_hif_hdl
(struct target_psoc_info *psoc_info, (struct target_psoc_info *psoc_info,
struct common_hif_handle *hif_hdl) struct hif_opaque_softc *hif_hdl)
{ {
if (!psoc_info) if (!psoc_info)
return; return;
@@ -891,7 +890,7 @@ static inline void target_psoc_set_hif_hdl
* *
* Return: 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) (struct target_psoc_info *psoc_info)
{ {
if (!psoc_info) if (!psoc_info)

View File

@@ -159,7 +159,7 @@ void lmac_set_htc_hdl(struct wlan_objmgr_psoc *psoc,
* *
* Return: hif handler * 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 * lmac_get_ol_hif_hdl() - get hif handle

View File

@@ -249,7 +249,7 @@ void lmac_set_htc_hdl(struct wlan_objmgr_psoc *psoc,
target_psoc_set_htc_hdl(tgt_hdl, htc_hdl); 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; struct target_psoc_info *tgt_hdl;