From 032d352263f605297111666dbe2732e6e657a67f Mon Sep 17 00:00:00 2001 From: Himanshu Batra Date: Wed, 10 Jul 2019 12:36:06 +0530 Subject: [PATCH] qcacmn: Replace void * Host Target Communications handle with abstract type Replace void * Host Target Communications handle with abstract type handles provided by Host Target Communications component Change-Id: I16ca87e4f9716791d340da2fda0a8a640fa2ec34 CRs-Fixed: 2487151 --- dp/inc/cdp_txrx_cmn.h | 2 +- dp/inc/cdp_txrx_cmn_reg.h | 7 ++++--- htc/htc_api.h | 10 ++++++++-- htc/htc_send.c | 4 ++-- target_if/core/inc/target_if.h | 11 +++++------ target_if/init_deinit/inc/init_deinit_lmac.h | 4 ++-- target_if/init_deinit/src/init_deinit_lmac.c | 4 ++-- wmi/inc/wmi_unified_api.h | 11 ++++++----- wmi/inc/wmi_unified_priv.h | 4 ++-- wmi/src/wmi_unified.c | 9 +-------- 10 files changed, 33 insertions(+), 33 deletions(-) diff --git a/dp/inc/cdp_txrx_cmn.h b/dp/inc/cdp_txrx_cmn.h index 791f8466e8..574216a1be 100644 --- a/dp/inc/cdp_txrx_cmn.h +++ b/dp/inc/cdp_txrx_cmn.h @@ -1243,7 +1243,7 @@ cdp_soc_detach(ol_txrx_soc_handle soc) */ static inline ol_txrx_soc_handle cdp_soc_init(ol_txrx_soc_handle soc, u_int16_t devid, void *hif_handle, - void *psoc, void *htc_handle, qdf_device_t qdf_dev, + void *psoc, HTC_HANDLE htc_handle, qdf_device_t qdf_dev, struct ol_if_ops *dp_ol_if_ops) { if (!soc || !soc->ops) { diff --git a/dp/inc/cdp_txrx_cmn_reg.h b/dp/inc/cdp_txrx_cmn_reg.h index 0200794d3f..a6ee8b72b9 100644 --- a/dp/inc/cdp_txrx_cmn_reg.h +++ b/dp/inc/cdp_txrx_cmn_reg.h @@ -82,9 +82,10 @@ void *dp_soc_init_wifi3(void *soc, void *ctrl_psoc, void *hif_handle, } #endif /* QCA_WIFI_QCA8074 */ -static inline ol_txrx_soc_handle cdp_soc_attach(u_int16_t devid, - void *hif_handle, void *psoc, void *htc_handle, - qdf_device_t qdf_dev, struct ol_if_ops *dp_ol_if_ops) +static inline ol_txrx_soc_handle cdp_soc_attach( + u_int16_t devid, void *hif_handle, void *psoc, + HTC_HANDLE htc_handle, qdf_device_t qdf_dev, + struct ol_if_ops *dp_ol_if_ops) { switch (devid) { case LITHIUM_DP: /*FIXME Add lithium devide IDs */ diff --git a/htc/htc_api.h b/htc/htc_api.h index f871c33ed2..554f4abc5d 100644 --- a/htc/htc_api.h +++ b/htc/htc_api.h @@ -38,7 +38,13 @@ extern "C" { #define HTC_HTT_TRANSFER_HDRSIZE 24 -typedef void *HTC_HANDLE; +/* + * NOTE WELL: struct opaque_htc_handle is not defined anywhere. This + * reference is used to help ensure that a HTC_HANDLE is never used + * where a different handle type is expected + */ +struct opaque_htc_handle; +typedef struct opaque_htc_handle *HTC_HANDLE; typedef uint16_t HTC_SERVICE_ID; @@ -691,7 +697,7 @@ struct ol_ath_htc_stats *ieee80211_ioctl_get_htc_stats(HTC_HANDLE * * Return: htc_handle tx queue depth */ -int htc_get_tx_queue_depth(HTC_HANDLE *htc_handle, HTC_ENDPOINT_ID endpoint_id); +int htc_get_tx_queue_depth(HTC_HANDLE htc_handle, HTC_ENDPOINT_ID endpoint_id); #ifdef WLAN_FEATURE_FASTPATH void htc_ctrl_msg_cmpl(HTC_HANDLE htc_pdev, HTC_ENDPOINT_ID htc_ep_id); diff --git a/htc/htc_send.c b/htc/htc_send.c index 8973b69cc9..380ffecab0 100644 --- a/htc/htc_send.c +++ b/htc/htc_send.c @@ -71,7 +71,7 @@ void htc_dump_counter_info(HTC_HANDLE HTCHandle) __func__, target->ce_send_cnt, target->TX_comp_cnt)); } -int htc_get_tx_queue_depth(HTC_HANDLE *htc_handle, HTC_ENDPOINT_ID endpoint_id) +int htc_get_tx_queue_depth(HTC_HANDLE htc_handle, HTC_ENDPOINT_ID endpoint_id) { HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(htc_handle); HTC_ENDPOINT *endpoint = &target->endpoint[endpoint_id]; @@ -2263,7 +2263,7 @@ void htc_process_credit_rpt(HTC_TARGET *target, HTC_CREDIT_REPORT *pRpt, htc_try_send(target, pEndpoint, NULL); #else if (pEndpoint->service_id == HTT_DATA_MSG_SVC) - htc_send_data_pkt(target, NULL, 0); + htc_send_data_pkt((HTC_HANDLE)target, NULL, 0); else htc_try_send(target, pEndpoint, NULL); #endif diff --git a/target_if/core/inc/target_if.h b/target_if/core/inc/target_if.h index eb552a4fbf..561874c82d 100644 --- a/target_if/core/inc/target_if.h +++ b/target_if/core/inc/target_if.h @@ -111,7 +111,6 @@ struct host_fw_ver { struct common_dbglog_handle; struct common_hif_handle; -struct common_htc_handle; struct common_accelerator_handle; /** @@ -125,7 +124,7 @@ struct common_accelerator_handle; */ struct comp_hdls { struct common_hif_handle *hif_hdl; - struct common_htc_handle *htc_hdl; + HTC_HANDLE htc_hdl; struct wmi_unified *wmi_hdl; struct common_accelerator_handle *accelerator_hdl; struct common_dbglog_handle *dbglog_hdl; @@ -910,9 +909,9 @@ static inline struct common_hif_handle *target_psoc_get_hif_hdl * * Return: void */ -static inline void target_psoc_set_htc_hdl - (struct target_psoc_info *psoc_info, - struct common_htc_handle *htc_hdl) +static inline void target_psoc_set_htc_hdl( + struct target_psoc_info *psoc_info, + HTC_HANDLE htc_hdl) { if (!psoc_info) return; @@ -928,7 +927,7 @@ static inline void target_psoc_set_htc_hdl * * Return: htc_hdl */ -static inline struct common_htc_handle *target_psoc_get_htc_hdl +static inline HTC_HANDLE target_psoc_get_htc_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 89ea0069f9..325792a8ed 100644 --- a/target_if/init_deinit/inc/init_deinit_lmac.h +++ b/target_if/init_deinit/inc/init_deinit_lmac.h @@ -137,7 +137,7 @@ wmi_unified_t lmac_get_wmi_unified_hdl(struct wlan_objmgr_psoc *psoc); * * Return: htc handler */ -struct common_htc_handle *lmac_get_htc_hdl(struct wlan_objmgr_psoc *psoc); +HTC_HANDLE lmac_get_htc_hdl(struct wlan_objmgr_psoc *psoc); /** * lmac_set_htc_hdl() - set htc handle @@ -149,7 +149,7 @@ struct common_htc_handle *lmac_get_htc_hdl(struct wlan_objmgr_psoc *psoc); * Return: void */ void lmac_set_htc_hdl(struct wlan_objmgr_psoc *psoc, - struct common_htc_handle *htc_hdl); + HTC_HANDLE htc_hdl); /** * lmac_get_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 e2f8fc4f52..84496b06e0 100644 --- a/target_if/init_deinit/src/init_deinit_lmac.c +++ b/target_if/init_deinit/src/init_deinit_lmac.c @@ -212,7 +212,7 @@ wmi_unified_t lmac_get_wmi_unified_hdl(struct wlan_objmgr_psoc *psoc) } qdf_export_symbol(lmac_get_wmi_unified_hdl); -struct common_htc_handle *lmac_get_htc_hdl(struct wlan_objmgr_psoc *psoc) +HTC_HANDLE lmac_get_htc_hdl(struct wlan_objmgr_psoc *psoc) { struct target_psoc_info *tgt_hdl; @@ -232,7 +232,7 @@ struct common_htc_handle *lmac_get_htc_hdl(struct wlan_objmgr_psoc *psoc) qdf_export_symbol(lmac_get_htc_hdl); void lmac_set_htc_hdl(struct wlan_objmgr_psoc *psoc, - struct common_htc_handle *htc_hdl) + HTC_HANDLE htc_hdl) { struct target_psoc_info *tgt_hdl; diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index 2068305220..ea86aa629c 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -337,14 +337,15 @@ wmi_unified_unregister_event_handler(wmi_unified_t wmi_handle, wmi_conv_event_id event_id); /** - * request wmi to connet its htc service. - * @param wmi_handle : handle to WMI. - * @param htc_handle : handle to HTC. - * @return void + * wmi_unified_connect_htc_service() - WMI API to get connect to HTC service + * @wmi_handle: handle to WMI. + * @htc_handle: handle to HTC. + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAULT for failure */ QDF_STATUS wmi_unified_connect_htc_service(struct wmi_unified *wmi_handle, - void *htc_handle); + HTC_HANDLE htc_handle); /* * WMI API to verify the host has enough credits to suspend diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index d60e852793..e2cab3a39f 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -2029,7 +2029,7 @@ struct wmi_unified { uint32_t *event_id; wmi_unified_event_handler *event_handler; enum wmi_rx_exec_ctx *ctx; - void *htc_handle; + HTC_HANDLE htc_handle; qdf_spinlock_t eventq_lock; qdf_nbuf_queue_t event_queue; qdf_work_t rx_event_work; @@ -2081,7 +2081,7 @@ struct wmi_soc { qdf_atomic_t num_pdevs; enum wmi_target_type target_type; bool is_async_ep; - void *htc_handle; + HTC_HANDLE htc_handle; uint32_t event_id[WMI_UNIFIED_MAX_EVENT]; wmi_unified_event_handler event_handler[WMI_UNIFIED_MAX_EVENT]; uint32_t max_event_idx; diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index 584e8c1bbd..cb106d0c6a 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -2814,16 +2814,9 @@ static QDF_STATUS wmi_connect_pdev_htc_service(struct wmi_soc *soc, return QDF_STATUS_SUCCESS; } -/** - * wmi_unified_connect_htc_service() - WMI API to get connect to HTC service - * - * @wmi_handle: handle to WMI. - * - * @Return: status. - */ QDF_STATUS wmi_unified_connect_htc_service(struct wmi_unified *wmi_handle, - void *htc_handle) + HTC_HANDLE htc_handle) { uint32_t i; uint8_t wmi_ep_count;