From eec6db94bd15644274ce8382086db853c8542a8f Mon Sep 17 00:00:00 2001 From: Akshay Kosigi Date: Tue, 2 Jul 2019 14:25:54 +0530 Subject: [PATCH] qcacmn: Remove void pointer usage for ctrl psoc Make change to remove usage of void pointers for ctrl psoc in DP and instead use a opaque pointer struct cdp_ctrl_objmgr_psoc. Change-Id: I9fac21db1156378fc10b95cf10517afa4364da00 CRs-Fixed: 2484411 --- cfg/inc/i_cfg.h | 3 ++- dp/inc/cdp_txrx_cmn_reg.h | 12 ++++++++---- dp/inc/cdp_txrx_cmn_struct.h | 2 +- dp/inc/cdp_txrx_handle.h | 7 ++++++- dp/inc/cdp_txrx_ops.h | 19 ++++++++++++------- dp/wifi3.0/dp_htt.c | 3 ++- dp/wifi3.0/dp_htt.h | 5 +++-- dp/wifi3.0/dp_main.c | 20 +++++++++++++------- dp/wifi3.0/dp_peer.c | 2 +- dp/wifi3.0/dp_peer.h | 2 +- dp/wifi3.0/dp_types.h | 2 +- wlan_cfg/wlan_cfg.c | 6 ++++-- wlan_cfg/wlan_cfg.h | 6 ++++-- 13 files changed, 58 insertions(+), 31 deletions(-) diff --git a/cfg/inc/i_cfg.h b/cfg/inc/i_cfg.h index afc240b808..986ba246be 100644 --- a/cfg/inc/i_cfg.h +++ b/cfg/inc/i_cfg.h @@ -70,7 +70,8 @@ struct cfg_values { struct cfg_values *cfg_psoc_get_values(struct wlan_objmgr_psoc *psoc); -#define __cfg_get(psoc, id) (cfg_psoc_get_values(psoc)->id##_internal) +#define __cfg_get(psoc, id) (cfg_psoc_get_values( \ + (struct wlan_objmgr_psoc *)psoc)->id##_internal) #endif /* __I_CFG_H */ diff --git a/dp/inc/cdp_txrx_cmn_reg.h b/dp/inc/cdp_txrx_cmn_reg.h index a6ee8b72b9..9bca5240b3 100644 --- a/dp/inc/cdp_txrx_cmn_reg.h +++ b/dp/inc/cdp_txrx_cmn_reg.h @@ -57,14 +57,17 @@ 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(void *ctrl_psoc, void *hif_handle, +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); -void *dp_soc_init_wifi3(void *soc, void *ctrl_psoc, void *hif_handle, +void *dp_soc_init_wifi3(void *soc, 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); #else -static inline void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle, +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, @@ -74,7 +77,8 @@ static inline void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle, } static inline -void *dp_soc_init_wifi3(void *soc, void *ctrl_psoc, void *hif_handle, +void *dp_soc_init_wifi3(void *soc, 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) { diff --git a/dp/inc/cdp_txrx_cmn_struct.h b/dp/inc/cdp_txrx_cmn_struct.h index 994c2607fc..bf2e97f066 100644 --- a/dp/inc/cdp_txrx_cmn_struct.h +++ b/dp/inc/cdp_txrx_cmn_struct.h @@ -358,7 +358,7 @@ enum cdp_ast_free_status { * @cookie: cookie * @cdp_ast_free_status: ast free status */ -typedef void (*txrx_ast_free_cb)(void *ctrl_soc, +typedef void (*txrx_ast_free_cb)(struct cdp_ctrl_objmgr_psoc *ctrl_soc, void *cdp_soc, void *cookie, enum cdp_ast_free_status); diff --git a/dp/inc/cdp_txrx_handle.h b/dp/inc/cdp_txrx_handle.h index 8b59efc18b..311e6d1e77 100644 --- a/dp/inc/cdp_txrx_handle.h +++ b/dp/inc/cdp_txrx_handle.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -33,6 +33,11 @@ struct cdp_peer; struct cdp_raw_ast; struct cdp_soc; +/** + * cdp_ctrl_objmgr_psoc - opaque handle for UMAC psoc object + */ +struct cdp_ctrl_objmgr_psoc; + /** * cdp_ctrl_objmgr_pdev - opaque handle for UMAC pdev object */ diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index 0cd0c6b296..a76dbe7e53 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -318,7 +318,9 @@ struct cdp_cmn_ops { * * Return: None */ - void *(*txrx_soc_init)(void *soc, void *ctrl_psoc, void *hif_handle, + void *(*txrx_soc_init)(void *soc, + 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); @@ -925,14 +927,17 @@ struct ol_if_ops { #else uint8_t (*rx_invalid_peer)(uint8_t vdev_id, void *wh); #endif - int (*peer_map_event)(void *ol_soc_handle, uint16_t peer_id, uint16_t hw_peer_id, - uint8_t vdev_id, uint8_t *peer_mac_addr, - enum cdp_txrx_ast_entry_type peer_type, - uint32_t tx_ast_hashidx); - int (*peer_unmap_event)(void *ol_soc_handle, uint16_t peer_id, + int (*peer_map_event)(struct cdp_ctrl_objmgr_psoc *ol_soc_handle, + uint16_t peer_id, uint16_t hw_peer_id, + uint8_t vdev_id, uint8_t *peer_mac_addr, + enum cdp_txrx_ast_entry_type peer_type, + uint32_t tx_ast_hashidx); + int (*peer_unmap_event)(struct cdp_ctrl_objmgr_psoc *ol_soc_handle, + uint16_t peer_id, uint8_t vdev_id); - int (*get_dp_cfg_param)(void *ol_soc_handle, enum cdp_cfg_param_type param_num); + int (*get_dp_cfg_param)(struct cdp_ctrl_objmgr_psoc *ol_soc_handle, + enum cdp_cfg_param_type param_num); void (*rx_mic_error)(void *ol_soc_handle, struct cdp_rx_mic_err_info *info); diff --git a/dp/wifi3.0/dp_htt.c b/dp/wifi3.0/dp_htt.c index 97f3895176..105b66d004 100644 --- a/dp/wifi3.0/dp_htt.c +++ b/dp/wifi3.0/dp_htt.c @@ -3581,7 +3581,8 @@ htt_htc_soc_attach(struct htt_soc *soc) * Return: HTT handle on success; NULL on failure */ void * -htt_soc_initialize(struct htt_soc *htt_soc, void *ctrl_psoc, +htt_soc_initialize(struct htt_soc *htt_soc, + struct cdp_ctrl_objmgr_psoc *ctrl_psoc, HTC_HANDLE htc_soc, void *hal_soc, qdf_device_t osdev) { diff --git a/dp/wifi3.0/dp_htt.h b/dp/wifi3.0/dp_htt.h index b38c4f554c..815e2a0fbc 100644 --- a/dp/wifi3.0/dp_htt.h +++ b/dp/wifi3.0/dp_htt.h @@ -114,7 +114,7 @@ struct dp_htt_htc_pkt_union { }; struct htt_soc { - void *ctrl_psoc; + struct cdp_ctrl_objmgr_psoc *ctrl_psoc; void *dp_soc; void *hal_soc; /* htt_logger handle */ @@ -218,7 +218,8 @@ struct htt_rx_ring_tlv_filter { * Return: HTT handle on success; NULL on failure */ void * -htt_soc_initialize(struct htt_soc *htt_soc, void *ctrl_psoc, +htt_soc_initialize(struct htt_soc *htt_soc, + struct cdp_ctrl_objmgr_psoc *ctrl_psoc, HTC_HANDLE htc_soc, void *hal_soc, qdf_device_t osdev); diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 29580ccb62..c2448133c8 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -134,7 +134,8 @@ dp_config_enh_tx_capture(struct cdp_pdev *pdev_handle, int val) void *dp_soc_init(void *dpsoc, HTC_HANDLE htc_handle, void *hif_handle); static void dp_pdev_detach(struct cdp_pdev *txrx_pdev, int force); static struct dp_soc * -dp_soc_attach(void *ctrl_psoc, HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, +dp_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, HTC_HANDLE htc_handle, + qdf_device_t qdf_osdev, struct ol_if_ops *ol_ops, uint16_t device_id); static void dp_pktlogmod_exit(struct dp_pdev *handle); static void *dp_peer_create_wifi3(struct cdp_vdev *vdev_handle, @@ -4341,7 +4342,8 @@ static QDF_STATUS dp_rxdma_ring_config(struct dp_soc *soc) if (soc->cdp_soc.ol_ops-> is_hw_dbs_2x2_capable) { dbs_enable = soc->cdp_soc.ol_ops-> - is_hw_dbs_2x2_capable(soc->ctrl_psoc); + is_hw_dbs_2x2_capable( + (void *)soc->ctrl_psoc); } if (dbs_enable) { @@ -9424,7 +9426,8 @@ void dp_soc_set_txrx_ring_map(struct dp_soc *soc) * * Return: DP SOC handle on success, NULL on failure */ -void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle, +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) { @@ -9453,7 +9456,8 @@ void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle, * * Return: DP SOC handle on success, NULL on failure */ -void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle, +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) { @@ -9477,7 +9481,8 @@ void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle, * Return: DP SOC handle on success, NULL on failure */ static struct dp_soc * -dp_soc_attach(void *ctrl_psoc, HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, +dp_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, HTC_HANDLE htc_handle, + qdf_device_t qdf_osdev, struct ol_if_ops *ol_ops, uint16_t device_id) { int int_ctx; @@ -9644,7 +9649,8 @@ void *dp_soc_init(void *dpsoc, HTC_HANDLE htc_handle, void *hif_handle) * * Return: DP SOC handle on success, NULL on failure */ -void *dp_soc_init_wifi3(void *dpsoc, void *ctrl_psoc, void *hif_handle, +void *dp_soc_init_wifi3(void *dpsoc, 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) { @@ -9684,7 +9690,7 @@ void dp_is_hw_dbs_enable(struct dp_soc *soc, bool dbs_enable = false; if (soc->cdp_soc.ol_ops->is_hw_dbs_2x2_capable) dbs_enable = soc->cdp_soc.ol_ops-> - is_hw_dbs_2x2_capable(soc->ctrl_psoc); + is_hw_dbs_2x2_capable((void *)soc->ctrl_psoc); *max_mac_rings = (dbs_enable)?(*max_mac_rings):1; } diff --git a/dp/wifi3.0/dp_peer.c b/dp/wifi3.0/dp_peer.c index 338799ca65..0dce9d2266 100644 --- a/dp/wifi3.0/dp_peer.c +++ b/dp/wifi3.0/dp_peer.c @@ -526,7 +526,7 @@ static inline void dp_peer_map_ast(struct dp_soc *soc, return; } -void dp_peer_free_hmwds_cb(void *ctrl_psoc, +void dp_peer_free_hmwds_cb(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, void *dp_soc, void *cookie, enum cdp_ast_free_status status) diff --git a/dp/wifi3.0/dp_peer.h b/dp/wifi3.0/dp_peer.h index 6eed9aab0d..066bf66045 100644 --- a/dp/wifi3.0/dp_peer.h +++ b/dp/wifi3.0/dp_peer.h @@ -140,7 +140,7 @@ void dp_peer_ast_set_type(struct dp_soc *soc, void dp_peer_ast_send_wds_del(struct dp_soc *soc, struct dp_ast_entry *ast_entry); -void dp_peer_free_hmwds_cb(void *ctrl_psoc, +void dp_peer_free_hmwds_cb(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, void *dp_soc, void *cookie, enum cdp_ast_free_status status); diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index f9878bf447..25124e2889 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -829,7 +829,7 @@ struct dp_soc { struct cdp_soc_t cdp_soc; /* SoC Obj */ - void *ctrl_psoc; + struct cdp_ctrl_objmgr_psoc *ctrl_psoc; /* OS device abstraction */ qdf_device_t osdev; diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index 0e416cf4d1..16ac932b6b 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -284,7 +284,8 @@ void wlan_set_srng_cfg(struct wlan_srng_cfg **wlan_cfg) * @psoc - Object manager psoc * Return: wlan_cfg_ctx - Handle to Configuration context */ -struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach(void *psoc) +struct wlan_cfg_dp_soc_ctxt * +wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc) { int i = 0; @@ -418,7 +419,8 @@ void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) qdf_mem_free(wlan_cfg_ctx); } -struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_attach(void *psoc) +struct wlan_cfg_dp_pdev_ctxt * +wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *psoc) { struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_ctx = qdf_mem_malloc(sizeof(struct wlan_cfg_dp_pdev_ctxt)); diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h index 8c36c55067..7dc72d691e 100644 --- a/wlan_cfg/wlan_cfg.h +++ b/wlan_cfg/wlan_cfg.h @@ -265,7 +265,8 @@ struct wlan_cfg_dp_pdev_ctxt { * * Return: Handle to configuration context */ -struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach(void *ctrl_obj); +struct wlan_cfg_dp_soc_ctxt * +wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj); /** * wlan_cfg_soc_detach() - Detach soc configuration handle @@ -287,7 +288,8 @@ void wlan_cfg_soc_detach(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx); * * Return: Handle to configuration context */ -struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_attach(void *ctrl_obj); +struct wlan_cfg_dp_pdev_ctxt * +wlan_cfg_pdev_attach(struct cdp_ctrl_objmgr_psoc *ctrl_obj); /** * wlan_cfg_pdev_detach() Detach and free pdev configuration handle