Browse Source

qcacmn: Handle void pointer declarations for pdev and vdev

Replace void pointer handles for pdev and vdev with
abstract structure handles in cdp.
New file cdp_txrx_handle.h has the abstract
structure declarations.

Change-Id: I333e6ea5e699e7cebbfc6281faf7f07c0aee4e2a
CRs-Fixed: 1109835
Venkata Sharath Chandra Manchala 8 years ago
parent
commit
f2a125a6f8

+ 16 - 15
dp/inc/cdp_txrx_cfg.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -30,7 +30,7 @@
  */
 #ifndef _CDP_TXRX_CFG_H_
 #define _CDP_TXRX_CFG_H_
-
+#include "cdp_txrx_handle.h"
 /**
  * cdp_cfg_set_rx_fwd_disabled() - enable/disable rx forwarding
  * @soc - data path soc handle
@@ -42,7 +42,7 @@
  * return NONE
  */
 static inline void
-cdp_cfg_set_rx_fwd_disabled(ol_txrx_soc_handle soc, void *pdev,
+cdp_cfg_set_rx_fwd_disabled(ol_txrx_soc_handle soc, struct cdp_cfg *cfg_pdev,
 		uint8_t disable_rx_fwd)
 {
 	if (!soc || !soc->ops || !soc->ops->cfg_ops) {
@@ -52,7 +52,7 @@ cdp_cfg_set_rx_fwd_disabled(ol_txrx_soc_handle soc, void *pdev,
 	}
 
 	if (soc->ops->cfg_ops->set_cfg_rx_fwd_disabled)
-		return soc->ops->cfg_ops->set_cfg_rx_fwd_disabled(pdev,
+		return soc->ops->cfg_ops->set_cfg_rx_fwd_disabled(cfg_pdev,
 			disable_rx_fwd);
 }
 
@@ -68,7 +68,7 @@ cdp_cfg_set_rx_fwd_disabled(ol_txrx_soc_handle soc, void *pdev,
  */
 static inline void
 cdp_cfg_set_packet_log_enabled(ol_txrx_soc_handle soc,
-		void *pdev, uint8_t val)
+		struct cdp_cfg *cfg_pdev, uint8_t val)
 {
 	if (!soc || !soc->ops || !soc->ops->cfg_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -77,7 +77,7 @@ cdp_cfg_set_packet_log_enabled(ol_txrx_soc_handle soc,
 	}
 
 	if (soc->ops->cfg_ops->set_cfg_packet_log_enabled)
-		return soc->ops->cfg_ops->set_cfg_packet_log_enabled(pdev,
+		return soc->ops->cfg_ops->set_cfg_packet_log_enabled(cfg_pdev,
 				val);
 }
 
@@ -91,7 +91,7 @@ cdp_cfg_set_packet_log_enabled(ol_txrx_soc_handle soc,
  *
  * return soc configuration module instance
  */
-static inline void
+static inline struct cdp_cfg
 *cdp_cfg_attach(ol_txrx_soc_handle soc,
 		qdf_device_t osdev, void *cfg_param)
 {
@@ -118,7 +118,8 @@ static inline void
  * return NONE
  */
 static inline void
-cdp_cfg_vdev_rx_set_intrabss_fwd(ol_txrx_soc_handle soc, void *vdev, bool val)
+cdp_cfg_vdev_rx_set_intrabss_fwd(ol_txrx_soc_handle soc,
+		struct cdp_vdev *vdev, bool val)
 {
 	if (!soc || !soc->ops || !soc->ops->cfg_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -141,7 +142,7 @@ cdp_cfg_vdev_rx_set_intrabss_fwd(ol_txrx_soc_handle soc, void *vdev, bool val)
  *        0 disabled
  */
 static inline uint8_t
-cdp_cfg_is_rx_fwd_disabled(ol_txrx_soc_handle soc, void *vdev)
+cdp_cfg_is_rx_fwd_disabled(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (!soc || !soc->ops || !soc->ops->cfg_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -189,7 +190,7 @@ cdp_cfg_tx_set_is_mgmt_over_wmi_enabled(ol_txrx_soc_handle soc,
  *        0 low latency data path
  */
 static inline int
-cdp_cfg_is_high_latency(ol_txrx_soc_handle soc, void *pdev)
+cdp_cfg_is_high_latency(ol_txrx_soc_handle soc, struct cdp_cfg *cfg_pdev)
 {
 	if (!soc || !soc->ops || !soc->ops->cfg_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -198,7 +199,7 @@ cdp_cfg_is_high_latency(ol_txrx_soc_handle soc, void *pdev)
 	}
 
 	if (soc->ops->cfg_ops->is_high_latency)
-		return soc->ops->cfg_ops->is_high_latency(pdev);
+		return soc->ops->cfg_ops->is_high_latency(cfg_pdev);
 
 	return 0;
 }
@@ -215,7 +216,7 @@ cdp_cfg_is_high_latency(ol_txrx_soc_handle soc, void *pdev)
  */
 static inline void
 cdp_cfg_set_flow_control_parameters(ol_txrx_soc_handle soc,
-		void *cfg, void *param)
+		struct cdp_cfg *cfg_pdev, void *param)
 {
 	if (!soc || !soc->ops || !soc->ops->cfg_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -224,7 +225,7 @@ cdp_cfg_set_flow_control_parameters(ol_txrx_soc_handle soc,
 	}
 
 	if (soc->ops->cfg_ops->set_flow_control_parameters)
-		return soc->ops->cfg_ops->set_flow_control_parameters(cfg,
+		return soc->ops->cfg_ops->set_flow_control_parameters(cfg_pdev,
 				param);
 
 	return;
@@ -240,7 +241,7 @@ cdp_cfg_set_flow_control_parameters(ol_txrx_soc_handle soc,
  * Return: None
  */
 static inline void cdp_cfg_set_flow_steering(ol_txrx_soc_handle soc,
-		void *pdev, uint8_t val)
+		struct cdp_cfg *cfg_pdev, uint8_t val)
 {
 	if (!soc || !soc->ops || !soc->ops->cfg_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -249,7 +250,7 @@ static inline void cdp_cfg_set_flow_steering(ol_txrx_soc_handle soc,
 	}
 
 	if (soc->ops->cfg_ops->set_flow_steering)
-		return soc->ops->cfg_ops->set_flow_steering(pdev, val);
+		return soc->ops->cfg_ops->set_flow_steering(cfg_pdev, val);
 
 	return;
 }

+ 35 - 33
dp/inc/cdp_txrx_cmn.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -35,6 +35,7 @@
 #include "qdf_types.h"
 #include "qdf_nbuf.h"
 #include "cdp_txrx_ops.h"
+#include "cdp_txrx_handle.h"
 /******************************************************************************
  *
  * Common Data Path Header File
@@ -49,8 +50,8 @@ cdp_soc_attach_target(ol_txrx_soc_handle soc)
 	return 0;
 }
 
-static inline void *
-cdp_vdev_attach(ol_txrx_soc_handle soc, void *pdev,
+static inline struct cdp_vdev *
+cdp_vdev_attach(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 	uint8_t *vdev_mac_addr, uint8_t vdev_id, enum wlan_op_mode op_mode)
 {
 	if (soc->ops->cmn_drv_ops->txrx_vdev_attach)
@@ -60,7 +61,7 @@ cdp_vdev_attach(ol_txrx_soc_handle soc, void *pdev,
 }
 
 static inline void
-cdp_vdev_detach(ol_txrx_soc_handle soc, void *vdev,
+cdp_vdev_detach(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
 	 ol_txrx_vdev_delete_cb callback, void *cb_context)
 {
 	if (soc->ops->cmn_drv_ops->txrx_vdev_detach)
@@ -70,15 +71,15 @@ cdp_vdev_detach(ol_txrx_soc_handle soc, void *vdev,
 }
 
 static inline int
-cdp_pdev_attach_target(ol_txrx_soc_handle soc, void *pdev)
+cdp_pdev_attach_target(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
 {
 	if (soc->ops->cmn_drv_ops->txrx_pdev_attach_target)
 		return soc->ops->cmn_drv_ops->txrx_pdev_attach_target(pdev);
 	return 0;
 }
 
-static inline void *cdp_pdev_attach
-	(ol_txrx_soc_handle soc, void *ctrl_pdev,
+static inline struct cdp_pdev *cdp_pdev_attach
+	(ol_txrx_soc_handle soc, struct cdp_cfg *ctrl_pdev,
 	HTC_HANDLE htc_pdev, qdf_device_t osdev, uint8_t pdev_id)
 {
 	if (soc->ops->cmn_drv_ops->txrx_pdev_attach)
@@ -87,7 +88,8 @@ static inline void *cdp_pdev_attach
 	return NULL;
 }
 
-static inline int cdp_pdev_post_attach(ol_txrx_soc_handle soc, void *pdev)
+static inline int cdp_pdev_post_attach(ol_txrx_soc_handle soc,
+	struct cdp_pdev *pdev)
 {
 	if (soc->ops->cmn_drv_ops->txrx_pdev_post_attach)
 		return soc->ops->cmn_drv_ops->txrx_pdev_post_attach(pdev);
@@ -95,7 +97,7 @@ static inline int cdp_pdev_post_attach(ol_txrx_soc_handle soc, void *pdev)
 }
 
 static inline void
-cdp_pdev_detach(ol_txrx_soc_handle soc, void *pdev, int force)
+cdp_pdev_detach(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, int force)
 {
 	if (soc->ops->cmn_drv_ops->txrx_pdev_detach)
 		return soc->ops->cmn_drv_ops->txrx_pdev_detach(pdev, force);
@@ -103,7 +105,7 @@ cdp_pdev_detach(ol_txrx_soc_handle soc, void *pdev, int force)
 }
 
 static inline void *cdp_peer_create
-	(ol_txrx_soc_handle soc, void *vdev,
+	(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
 	uint8_t *peer_mac_addr)
 {
 	if (soc->ops->cmn_drv_ops->txrx_peer_create)
@@ -113,7 +115,7 @@ static inline void *cdp_peer_create
 }
 
 static inline void cdp_peer_setup
-	(ol_txrx_soc_handle soc, void *vdev, void *peer)
+	(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, void *peer)
 {
 	if (soc->ops->cmn_drv_ops->txrx_peer_setup)
 		return soc->ops->cmn_drv_ops->txrx_peer_setup(vdev,
@@ -122,7 +124,7 @@ static inline void cdp_peer_setup
 }
 
 static inline void cdp_peer_teardown
-	(ol_txrx_soc_handle soc, void *vdev, void *peer)
+	(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, void *peer)
 {
 	if (soc->ops->cmn_drv_ops->txrx_peer_teardown)
 		return soc->ops->cmn_drv_ops->txrx_peer_teardown(vdev,
@@ -139,7 +141,7 @@ cdp_peer_delete(ol_txrx_soc_handle soc, void *peer)
 }
 
 static inline int
-cdp_set_monitor_mode(ol_txrx_soc_handle soc, void *vdev)
+cdp_set_monitor_mode(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (soc->ops->cmn_drv_ops->txrx_set_monitor_mode)
 		return soc->ops->cmn_drv_ops->txrx_set_monitor_mode(vdev);
@@ -148,7 +150,7 @@ cdp_set_monitor_mode(ol_txrx_soc_handle soc, void *vdev)
 
 static inline void
 cdp_set_curchan(ol_txrx_soc_handle soc,
-	void *pdev,
+	struct cdp_pdev *pdev,
 	uint32_t chan_mhz)
 {
 	if (soc->ops->cmn_drv_ops->txrx_set_curchan)
@@ -157,7 +159,7 @@ cdp_set_curchan(ol_txrx_soc_handle soc,
 }
 
 static inline void
-cdp_set_privacy_filters(ol_txrx_soc_handle soc, void *vdev,
+cdp_set_privacy_filters(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
 			 void *filter, uint32_t num)
 {
 	if (soc->ops->cmn_drv_ops->txrx_set_privacy_filters)
@@ -170,7 +172,7 @@ cdp_set_privacy_filters(ol_txrx_soc_handle soc, void *vdev,
  * Data Interface (B Interface)
  *****************************************************************************/
 static inline void
-cdp_vdev_register(ol_txrx_soc_handle soc, void *vdev,
+cdp_vdev_register(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
 	 void *osif_vdev, struct ol_txrx_ops *txrx_ops)
 {
 	if (soc->ops->cmn_drv_ops->txrx_vdev_register)
@@ -180,7 +182,7 @@ cdp_vdev_register(ol_txrx_soc_handle soc, void *vdev,
 }
 
 static inline int
-cdp_mgmt_send(ol_txrx_soc_handle soc, void *vdev,
+cdp_mgmt_send(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
 	qdf_nbuf_t tx_mgmt_frm,	uint8_t type)
 {
 	if (soc->ops->cmn_drv_ops->txrx_mgmt_send)
@@ -190,7 +192,7 @@ cdp_mgmt_send(ol_txrx_soc_handle soc, void *vdev,
 }
 
 static inline int
-cdp_mgmt_send_ext(ol_txrx_soc_handle soc, void *vdev,
+cdp_mgmt_send_ext(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
 	 qdf_nbuf_t tx_mgmt_frm, uint8_t type,
 	 uint8_t use_6mbps, uint16_t chanfreq)
 {
@@ -202,7 +204,7 @@ cdp_mgmt_send_ext(ol_txrx_soc_handle soc, void *vdev,
 
 
 static inline void
-cdp_mgmt_tx_cb_set(ol_txrx_soc_handle soc, void *pdev,
+cdp_mgmt_tx_cb_set(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 			 uint8_t type,
 			 ol_txrx_mgmt_tx_cb download_cb,
 			 ol_txrx_mgmt_tx_cb ota_ack_cb, void *ctxt)
@@ -214,7 +216,7 @@ cdp_mgmt_tx_cb_set(ol_txrx_soc_handle soc, void *pdev,
 }
 
 static inline int cdp_get_tx_pending(ol_txrx_soc_handle soc,
-void *pdev)
+struct cdp_pdev *pdev)
 {
 	if (soc->ops->cmn_drv_ops->txrx_get_tx_pending)
 		return soc->ops->cmn_drv_ops->txrx_get_tx_pending(pdev);
@@ -222,7 +224,7 @@ void *pdev)
 }
 
 static inline void
-cdp_data_tx_cb_set(ol_txrx_soc_handle soc, void *data_vdev,
+cdp_data_tx_cb_set(ol_txrx_soc_handle soc, struct cdp_vdev *data_vdev,
 		 ol_txrx_data_tx_cb callback, void *ctxt)
 {
 	if (soc->ops->cmn_drv_ops->txrx_data_tx_cb_set)
@@ -236,7 +238,7 @@ cdp_data_tx_cb_set(ol_txrx_soc_handle soc, void *data_vdev,
  *****************************************************************************/
 
 static inline int
-cdp_aggr_cfg(ol_txrx_soc_handle soc, void *vdev,
+cdp_aggr_cfg(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
 			 int max_subfrms_ampdu,
 			 int max_subfrms_amsdu)
 {
@@ -247,7 +249,7 @@ cdp_aggr_cfg(ol_txrx_soc_handle soc, void *vdev,
 }
 
 static inline int
-cdp_fw_stats_get(ol_txrx_soc_handle soc, void *vdev,
+cdp_fw_stats_get(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
 	struct ol_txrx_stats_req *req, bool per_vdev,
 	bool response_expected)
 {
@@ -258,7 +260,7 @@ cdp_fw_stats_get(ol_txrx_soc_handle soc, void *vdev,
 }
 
 static inline int
-cdp_debug(ol_txrx_soc_handle soc, void *vdev, int debug_specs)
+cdp_debug(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, int debug_specs)
 {
 	if (soc->ops->cmn_drv_ops->txrx_debug)
 		return soc->ops->cmn_drv_ops->txrx_debug(vdev, debug_specs);
@@ -266,7 +268,7 @@ cdp_debug(ol_txrx_soc_handle soc, void *vdev, int debug_specs)
 }
 
 static inline void cdp_fw_stats_cfg(ol_txrx_soc_handle soc,
-	 void *vdev, uint8_t cfg_stats_type, uint32_t cfg_val)
+	 struct cdp_vdev *vdev, uint8_t cfg_stats_type, uint32_t cfg_val)
 {
 	if (soc->ops->cmn_drv_ops->txrx_fw_stats_cfg)
 		return soc->ops->cmn_drv_ops->txrx_fw_stats_cfg(vdev,
@@ -282,7 +284,7 @@ static inline void cdp_print_level_set(ol_txrx_soc_handle soc, unsigned level)
 }
 
 static inline uint8_t *
-cdp_get_vdev_mac_addr(ol_txrx_soc_handle soc, void *vdev)
+cdp_get_vdev_mac_addr(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (soc->ops->cmn_drv_ops->txrx_get_vdev_mac_addr)
 		return soc->ops->cmn_drv_ops->txrx_get_vdev_mac_addr(vdev);
@@ -297,7 +299,7 @@ cdp_get_vdev_mac_addr(ol_txrx_soc_handle soc, void *vdev)
  * Return: Handle to struct qdf_mac_addr
  */
 static inline struct qdf_mac_addr *cdp_get_vdev_struct_mac_addr
-	(ol_txrx_soc_handle soc, void *vdev)
+	(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (soc->ops->cmn_drv_ops->txrx_get_vdev_struct_mac_addr)
 		return soc->ops->cmn_drv_ops->txrx_get_vdev_struct_mac_addr
@@ -311,8 +313,8 @@ static inline struct qdf_mac_addr *cdp_get_vdev_struct_mac_addr
  *
  * Return: Handle to pdev
  */
-static inline void *cdp_get_pdev_from_vdev
-	(ol_txrx_soc_handle soc, void *vdev)
+static inline struct cdp_pdev *cdp_get_pdev_from_vdev
+	(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (soc->ops->cmn_drv_ops->txrx_get_pdev_from_vdev)
 		return soc->ops->cmn_drv_ops->txrx_get_pdev_from_vdev(vdev);
@@ -325,8 +327,8 @@ static inline void *cdp_get_pdev_from_vdev
  *
  * Return: Handle to control pdev
  */
-static inline void *
-cdp_get_ctrl_pdev_from_vdev(ol_txrx_soc_handle soc, void *vdev)
+static inline struct cdp_cfg *
+cdp_get_ctrl_pdev_from_vdev(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (soc->ops->cmn_drv_ops->txrx_get_ctrl_pdev_from_vdev)
 		return soc->ops->cmn_drv_ops->txrx_get_ctrl_pdev_from_vdev
@@ -334,8 +336,8 @@ cdp_get_ctrl_pdev_from_vdev(ol_txrx_soc_handle soc, void *vdev)
 	return NULL;
 }
 
-static inline void *
-cdp_get_vdev_from_vdev_id(ol_txrx_soc_handle soc, void *pdev,
+static inline struct cdp_vdev *
+cdp_get_vdev_from_vdev_id(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 		uint8_t vdev_id)
 {
 	if (soc->ops->cmn_drv_ops->txrx_get_vdev_from_vdev_id)

+ 13 - 12
dp/inc/cdp_txrx_ctrl.h

@@ -32,9 +32,10 @@
 
 #ifndef _CDP_TXRX_CTRL_H_
 #define _CDP_TXRX_CTRL_H_
+#include "cdp_txrx_handle.h"
 
 static inline int cdp_is_target_ar900b
-	(ol_txrx_soc_handle soc, void *vdev)
+	(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (soc->ops->ctrl_ops->txrx_is_target_ar900b)
 		return soc->ops->ctrl_ops->txrx_is_target_ar900b(vdev);
@@ -53,7 +54,7 @@ cdp_mempools_attach(ol_txrx_soc_handle soc, void *ctrl_pdev)
 
 static inline int
 cdp_set_filter_neighbour_peers(ol_txrx_soc_handle soc,
-	void *pdev, u_int32_t val)
+	struct cdp_pdev *pdev, u_int32_t val)
 {
 	if (soc->ops->ctrl_ops->txrx_set_filter_neighbour_peers)
 		return soc->ops->ctrl_ops->txrx_set_filter_neighbour_peers
@@ -75,7 +76,7 @@ cdp_set_filter_neighbour_peers(ol_txrx_soc_handle soc,
 
 static inline void
 cdp_set_safemode(ol_txrx_soc_handle soc,
-	void *vdev, u_int32_t val)
+	struct cdp_vdev *vdev, u_int32_t val)
 {
 	if (soc->ops->ctrl_ops->txrx_set_safemode)
 		return soc->ops->ctrl_ops->txrx_set_safemode(vdev, val);
@@ -93,7 +94,7 @@ cdp_set_safemode(ol_txrx_soc_handle soc,
  */
 static inline void
 cdp_set_drop_unenc(ol_txrx_soc_handle soc,
-	void *vdev, u_int32_t val)
+	struct cdp_vdev *vdev, u_int32_t val)
 {
 	if (soc->ops->ctrl_ops->txrx_set_drop_unenc)
 		return soc->ops->ctrl_ops->txrx_set_drop_unenc(vdev, val);
@@ -112,7 +113,7 @@ cdp_set_drop_unenc(ol_txrx_soc_handle soc,
  */
 static inline void
 cdp_set_tx_encap_type(ol_txrx_soc_handle soc,
-	void *vdev, enum htt_cmn_pkt_type val)
+	struct cdp_vdev *vdev, enum htt_cmn_pkt_type val)
 {
 	if (soc->ops->ctrl_ops->txrx_set_tx_encap_type)
 		return soc->ops->ctrl_ops->txrx_set_tx_encap_type(vdev, val);
@@ -131,7 +132,7 @@ cdp_set_tx_encap_type(ol_txrx_soc_handle soc,
  */
 static inline void
 cdp_set_vdev_rx_decap_type(ol_txrx_soc_handle soc,
-	void *vdev, enum htt_cmn_pkt_type val)
+	struct cdp_vdev *vdev, enum htt_cmn_pkt_type val)
 {
 	if (soc->ops->ctrl_ops->txrx_set_vdev_rx_decap_type)
 		return soc->ops->ctrl_ops->txrx_set_vdev_rx_decap_type
@@ -146,7 +147,7 @@ cdp_set_vdev_rx_decap_type(ol_txrx_soc_handle soc,
  * @return - the Rx decap type (htt_cmn_pkt_type)
  */
 static inline enum htt_cmn_pkt_type
-cdp_get_vdev_rx_decap_type(ol_txrx_soc_handle soc, void *vdev)
+cdp_get_vdev_rx_decap_type(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (soc->ops->ctrl_ops->txrx_get_vdev_rx_decap_type)
 		return soc->ops->ctrl_ops->txrx_get_vdev_rx_decap_type(vdev);
@@ -177,7 +178,7 @@ cdp_peer_authorize(ol_txrx_soc_handle soc,
 }
 
 static inline bool
-cdp_set_inact_params(ol_txrx_soc_handle soc, void *pdev,
+cdp_set_inact_params(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 			u_int16_t inact_check_interval,
 			u_int16_t inact_normal,
 			u_int16_t inact_overload)
@@ -190,7 +191,7 @@ cdp_set_inact_params(ol_txrx_soc_handle soc, void *pdev,
 }
 static inline bool
 cdp_start_inact_timer(ol_txrx_soc_handle soc,
-	void *pdev,
+	struct cdp_pdev *pdev,
 	bool enable)
 {
 	if (soc->ops->ctrl_ops->txrx_start_inact_timer)
@@ -209,7 +210,7 @@ cdp_start_inact_timer(ol_txrx_soc_handle soc,
  * @param overload - whether the radio is overloaded or not
  */
 static inline void
-cdp_set_overload(ol_txrx_soc_handle soc, void *pdev,
+cdp_set_overload(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 	bool overload)
 {
 	if (soc->ops->ctrl_ops->txrx_set_overload)
@@ -254,7 +255,7 @@ cdp_mark_peer_inact(ol_txrx_soc_handle soc,
 
 /* Should be ol_txrx_ctrl_api.h */
 static inline void cdp_set_mesh_mode
-(ol_txrx_soc_handle soc, void *vdev, u_int32_t val)
+(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, u_int32_t val)
 {
 	if (soc->ops->ctrl_ops->txrx_set_mesh_mode)
 		return soc->ops->ctrl_ops->txrx_set_mesh_mode(vdev, val);
@@ -262,7 +263,7 @@ static inline void cdp_set_mesh_mode
 }
 
 static inline void cdp_tx_flush_buffers
-(ol_txrx_soc_handle soc, void *vdev)
+(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (soc->ops->ctrl_ops->tx_flush_buffers)
 		return soc->ops->ctrl_ops->tx_flush_buffers(vdev);

+ 5 - 4
dp/inc/cdp_txrx_flow_ctrl_legacy.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -32,6 +32,7 @@
 #ifndef _CDP_TXRX_FC_LEG_H_
 #define _CDP_TXRX_FC_LEG_H_
 #include <cdp_txrx_mob_def.h>
+#include "cdp_txrx_handle.h"
 
 /**
  * cdp_fc_register() - Register flow control callback function pointer
@@ -152,7 +153,7 @@ cdp_fc_ll_set_tx_pause_q_depth(ol_txrx_soc_handle soc,
  * return None
  */
 static inline void
-cdp_fc_vdev_flush(ol_txrx_soc_handle soc, void *vdev)
+cdp_fc_vdev_flush(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (!soc || !soc->ops || !soc->ops->l_flowctl_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -177,7 +178,7 @@ cdp_fc_vdev_flush(ol_txrx_soc_handle soc, void *vdev)
  * return None
  */
 static inline void
-cdp_fc_vdev_pause(ol_txrx_soc_handle soc, void *vdev,
+cdp_fc_vdev_pause(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
 		uint32_t reason)
 {
 	if (!soc || !soc->ops || !soc->ops->l_flowctl_ops) {
@@ -203,7 +204,7 @@ cdp_fc_vdev_pause(ol_txrx_soc_handle soc, void *vdev,
  * return None
  */
 static inline void
-cdp_fc_vdev_unpause(ol_txrx_soc_handle soc, void *vdev,
+cdp_fc_vdev_unpause(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
 		uint32_t reason)
 {
 	if (!soc || !soc->ops || !soc->ops->l_flowctl_ops) {

+ 20 - 19
dp/inc/cdp_txrx_host_stats.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -31,13 +31,14 @@
  */
 #ifndef _CDP_TXRX_HOST_STATS_H_
 #define _CDP_TXRX_HOST_STATS_H_
+#include "cdp_txrx_handle.h"
 /* WIN */
 /* Need to remove the "req" parameter */
 /* Need to rename the function to reflect the functionality "show" / "display"
  * WIN -- to figure out whether to change OSIF to converge (not an immediate AI)
  * */
 static inline int cdp_host_stats_get(ol_txrx_soc_handle soc,
-	void *vdev,
+	struct cdp_vdev *vdev,
 	struct ol_txrx_stats_req *req)
 {
 	if (soc->ops->host_stats_ops->txrx_host_stats_get)
@@ -47,7 +48,7 @@ static inline int cdp_host_stats_get(ol_txrx_soc_handle soc,
 
 
 static inline void
-cdp_host_stats_clr(ol_txrx_soc_handle soc, void *vdev)
+cdp_host_stats_clr(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (soc->ops->host_stats_ops->txrx_host_stats_clr)
 		return soc->ops->host_stats_ops->txrx_host_stats_clr(vdev);
@@ -55,7 +56,7 @@ cdp_host_stats_clr(ol_txrx_soc_handle soc, void *vdev)
 }
 
 static inline void
-cdp_host_ce_stats(ol_txrx_soc_handle soc, void *vdev)
+cdp_host_ce_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (soc->ops->host_stats_ops->txrx_host_ce_stats)
 		return soc->ops->host_stats_ops->txrx_host_ce_stats(vdev);
@@ -63,7 +64,7 @@ cdp_host_ce_stats(ol_txrx_soc_handle soc, void *vdev)
 }
 
 static inline int cdp_stats_publish
-	(ol_txrx_soc_handle soc, void *pdev,
+	(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 	struct ol_txrx_stats *buf)
 {
 	if (soc->ops->host_stats_ops->txrx_stats_publish)
@@ -77,7 +78,7 @@ static inline int cdp_stats_publish
  * @return - void
  */
 static inline void
-cdp_enable_enhanced_stats(ol_txrx_soc_handle soc, void *pdev)
+cdp_enable_enhanced_stats(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
 {
 	if (soc->ops->host_stats_ops->txrx_enable_enhanced_stats)
 		return soc->ops->host_stats_ops->txrx_enable_enhanced_stats
@@ -92,7 +93,7 @@ cdp_enable_enhanced_stats(ol_txrx_soc_handle soc, void *pdev)
  * @return - void
  */
 static inline void
-cdp_disable_enhanced_stats(ol_txrx_soc_handle soc, void *pdev)
+cdp_disable_enhanced_stats(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
 {
 	if (soc->ops->host_stats_ops->txrx_disable_enhanced_stats)
 		return soc->ops->host_stats_ops->txrx_disable_enhanced_stats
@@ -109,7 +110,7 @@ cdp_disable_enhanced_stats(ol_txrx_soc_handle soc, void *pdev)
  * @return - pointer to requested stat identified by type
  */
 static inline uint32_t *cdp_get_stats_base
-	(ol_txrx_soc_handle soc, void *pdev,
+	(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 	uint32_t *stats_base, uint32_t msg_len, uint8_t type)
 {
 	if (soc->ops->host_stats_ops->txrx_get_stats_base)
@@ -119,7 +120,7 @@ static inline uint32_t *cdp_get_stats_base
 }
 static inline void
 cdp_tx_print_tso_stats(ol_txrx_soc_handle soc,
-	void *vdev)
+	struct cdp_vdev *vdev)
 {
 	if (soc->ops->host_stats_ops->tx_print_tso_stats)
 		return soc->ops->host_stats_ops->tx_print_tso_stats(vdev);
@@ -127,7 +128,7 @@ cdp_tx_print_tso_stats(ol_txrx_soc_handle soc,
 }
 
 static inline void
-cdp_tx_rst_tso_stats(ol_txrx_soc_handle soc, void *vdev)
+cdp_tx_rst_tso_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (soc->ops->host_stats_ops->tx_rst_tso_stats)
 		return soc->ops->host_stats_ops->tx_rst_tso_stats(vdev);
@@ -136,7 +137,7 @@ cdp_tx_rst_tso_stats(ol_txrx_soc_handle soc, void *vdev)
 
 static inline void
 cdp_tx_print_sg_stats(ol_txrx_soc_handle soc,
-	void *vdev)
+	struct cdp_vdev *vdev)
 {
 	if (soc->ops->host_stats_ops->tx_print_sg_stats)
 		return soc->ops->host_stats_ops->tx_print_sg_stats(vdev);
@@ -144,7 +145,7 @@ cdp_tx_print_sg_stats(ol_txrx_soc_handle soc,
 }
 
 static inline void
-cdp_tx_rst_sg_stats(ol_txrx_soc_handle soc, void *vdev)
+cdp_tx_rst_sg_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (soc->ops->host_stats_ops->tx_rst_sg_stats)
 		return soc->ops->host_stats_ops->tx_rst_sg_stats(vdev);
@@ -153,7 +154,7 @@ cdp_tx_rst_sg_stats(ol_txrx_soc_handle soc, void *vdev)
 
 static inline void
 cdp_print_rx_cksum_stats(ol_txrx_soc_handle soc,
-	void *vdev)
+	struct cdp_vdev *vdev)
 {
 	if (soc->ops->host_stats_ops->print_rx_cksum_stats)
 		return soc->ops->host_stats_ops->print_rx_cksum_stats(vdev);
@@ -161,7 +162,7 @@ cdp_print_rx_cksum_stats(ol_txrx_soc_handle soc,
 }
 
 static inline void
-cdp_rst_rx_cksum_stats(ol_txrx_soc_handle soc, void *vdev)
+cdp_rst_rx_cksum_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (soc->ops->host_stats_ops->rst_rx_cksum_stats)
 		return soc->ops->host_stats_ops->rst_rx_cksum_stats(vdev);
@@ -169,14 +170,14 @@ cdp_rst_rx_cksum_stats(ol_txrx_soc_handle soc, void *vdev)
 }
 
 static inline A_STATUS
-cdp_host_me_stats(ol_txrx_soc_handle soc, void *vdev)
+cdp_host_me_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (soc->ops->host_stats_ops->txrx_host_me_stats)
 		return soc->ops->host_stats_ops->txrx_host_me_stats(vdev);
 	return 0;
 }
 static inline void cdp_per_peer_stats
-	(ol_txrx_soc_handle soc, void *pdev, char *addr)
+	(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, char *addr)
 {
 	if (soc->ops->host_stats_ops->txrx_per_peer_stats)
 		return soc->ops->host_stats_ops->txrx_per_peer_stats
@@ -185,7 +186,7 @@ static inline void cdp_per_peer_stats
 }
 
 static inline int cdp_host_msdu_ttl_stats(ol_txrx_soc_handle soc,
-	void *vdev,
+	struct cdp_vdev *vdev,
 	struct ol_txrx_stats_req *req)
 {
 	if (soc->ops->host_stats_ops->txrx_host_msdu_ttl_stats)
@@ -197,7 +198,7 @@ static inline int cdp_host_msdu_ttl_stats(ol_txrx_soc_handle soc,
 
 
 static inline void
-cdp_print_lro_stats(ol_txrx_soc_handle soc, void *vdev)
+cdp_print_lro_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (soc->ops->host_stats_ops->print_lro_stats)
 		return soc->ops->host_stats_ops->print_lro_stats(vdev);
@@ -205,7 +206,7 @@ cdp_print_lro_stats(ol_txrx_soc_handle soc, void *vdev)
 }
 
 static inline void
-cdp_reset_lro_stats(ol_txrx_soc_handle soc, void *vdev)
+cdp_reset_lro_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (soc->ops->host_stats_ops->reset_lro_stats)
 		return soc->ops->host_stats_ops->reset_lro_stats(vdev);

+ 11 - 11
dp/inc/cdp_txrx_ipa.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -31,7 +31,7 @@
 #ifndef _CDP_TXRX_IPA_H_
 #define _CDP_TXRX_IPA_H_
 #include <cdp_txrx_mob_def.h>
-
+#include "cdp_txrx_handle.h"
 /**
  * cdp_ipa_get_resource() - Get allocated wlan resources for ipa data path
  * @soc - data path soc handle
@@ -43,7 +43,7 @@
  * return none
  */
 static inline void
-cdp_ipa_get_resource(ol_txrx_soc_handle soc, void *pdev,
+cdp_ipa_get_resource(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 		 struct ol_txrx_ipa_resources *ipa_res)
 {
 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
@@ -70,7 +70,7 @@ cdp_ipa_get_resource(ol_txrx_soc_handle soc, void *pdev,
  * return none
  */
 static inline void
-cdp_ipa_set_doorbell_paddr(ol_txrx_soc_handle soc, void *pdev,
+cdp_ipa_set_doorbell_paddr(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 		 qdf_dma_addr_t ipa_tx_uc_doorbell_paddr,
 		 qdf_dma_addr_t ipa_rx_uc_doorbell_paddr)
 {
@@ -99,7 +99,7 @@ cdp_ipa_set_doorbell_paddr(ol_txrx_soc_handle soc, void *pdev,
  * return none
  */
 static inline void
-cdp_ipa_set_active(ol_txrx_soc_handle soc, void *pdev,
+cdp_ipa_set_active(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 		 bool uc_active, bool is_tx)
 {
 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
@@ -126,7 +126,7 @@ cdp_ipa_set_active(ol_txrx_soc_handle soc, void *pdev,
  * return none
  */
 static inline void
-cdp_ipa_op_response(ol_txrx_soc_handle soc, void *pdev,
+cdp_ipa_op_response(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 		uint8_t *op_msg)
 {
 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
@@ -153,7 +153,7 @@ cdp_ipa_op_response(ol_txrx_soc_handle soc, void *pdev,
  * return none
  */
 static inline void
-cdp_ipa_register_op_cb(ol_txrx_soc_handle soc, void *pdev,
+cdp_ipa_register_op_cb(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 		 ipa_op_cb_type op_cb, void *osif_dev)
 {
 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
@@ -179,7 +179,7 @@ cdp_ipa_register_op_cb(ol_txrx_soc_handle soc, void *pdev,
  * return none
  */
 static inline void
-cdp_ipa_get_stat(ol_txrx_soc_handle soc, void *pdev)
+cdp_ipa_get_stat(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
 {
 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -201,7 +201,7 @@ cdp_ipa_get_stat(ol_txrx_soc_handle soc, void *pdev)
  * Return: skb/ NULL is for success
  */
 static inline qdf_nbuf_t cdp_ipa_tx_send_data_frame(ol_txrx_soc_handle soc,
-						void *vdev, qdf_nbuf_t skb)
+				struct cdp_vdev *vdev, qdf_nbuf_t skb)
 {
 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -223,7 +223,7 @@ static inline qdf_nbuf_t cdp_ipa_tx_send_data_frame(ol_txrx_soc_handle soc,
  * Return: none
  */
 static inline void cdp_ipa_set_uc_tx_partition_base(ol_txrx_soc_handle soc,
-						void *pdev, uint32_t value)
+				struct cdp_cfg *cfg_pdev, uint32_t value)
 {
 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -232,7 +232,7 @@ static inline void cdp_ipa_set_uc_tx_partition_base(ol_txrx_soc_handle soc,
 	}
 
 	if (soc->ops->ipa_ops->ipa_set_uc_tx_partition_base)
-		return soc->ops->ipa_ops->ipa_set_uc_tx_partition_base(pdev,
+		return soc->ops->ipa_ops->ipa_set_uc_tx_partition_base(cfg_pdev,
 								       value);
 
 	return;

+ 10 - 9
dp/inc/cdp_txrx_me.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -34,10 +34,11 @@
 
 #include <cdp_txrx_ops.h>
 /* TODO: adf need to be replaced with qdf */
+#include "cdp_txrx_handle.h"
 
 static inline u_int16_t
 cdp_tx_desc_alloc_and_mark_for_mcast_clone(ol_txrx_soc_handle soc,
-	void *pdev, u_int16_t buf_count)
+	struct cdp_pdev *pdev, u_int16_t buf_count)
 {
 	if (soc->ops->me_ops->tx_desc_alloc_and_mark_for_mcast_clone)
 		return soc->ops->me_ops->
@@ -48,7 +49,7 @@ cdp_tx_desc_alloc_and_mark_for_mcast_clone(ol_txrx_soc_handle soc,
 
 static inline u_int16_t
 cdp_tx_desc_free_and_unmark_for_mcast_clone(ol_txrx_soc_handle soc,
-	void *pdev, u_int16_t buf_count)
+	struct cdp_pdev *pdev, u_int16_t buf_count)
 {
 	if (soc->ops->me_ops->tx_desc_free_and_unmark_for_mcast_clone)
 		return soc->ops->me_ops->
@@ -59,7 +60,7 @@ cdp_tx_desc_free_and_unmark_for_mcast_clone(ol_txrx_soc_handle soc,
 
 static inline u_int16_t
 cdp_tx_get_mcast_buf_allocated_marked(ol_txrx_soc_handle soc,
-	void *pdev)
+	struct cdp_pdev *pdev)
 {
 	if (soc->ops->me_ops->tx_get_mcast_buf_allocated_marked)
 		return soc->ops->me_ops->tx_get_mcast_buf_allocated_marked
@@ -68,7 +69,7 @@ cdp_tx_get_mcast_buf_allocated_marked(ol_txrx_soc_handle soc,
 }
 
 static inline void
-cdp_tx_me_alloc_descriptor(ol_txrx_soc_handle soc, void *pdev)
+cdp_tx_me_alloc_descriptor(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
 {
 	if (soc->ops->me_ops->tx_me_alloc_descriptor)
 		return soc->ops->me_ops->tx_me_alloc_descriptor(pdev);
@@ -76,7 +77,7 @@ cdp_tx_me_alloc_descriptor(ol_txrx_soc_handle soc, void *pdev)
 }
 
 static inline void
-cdp_tx_me_free_descriptor(ol_txrx_soc_handle soc, void *pdev)
+cdp_tx_me_free_descriptor(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
 {
 	if (soc->ops->me_ops->tx_me_free_descriptor)
 		return soc->ops->me_ops->tx_me_free_descriptor(pdev);
@@ -84,7 +85,7 @@ cdp_tx_me_free_descriptor(ol_txrx_soc_handle soc, void *pdev)
 }
 
 static inline uint16_t
-cdp_tx_me_convert_ucast(ol_txrx_soc_handle soc, void *vdev,
+cdp_tx_me_convert_ucast(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
 	qdf_nbuf_t wbuf, u_int8_t newmac[][6], uint8_t newmaccnt)
 {
 	if (soc->ops->me_ops->tx_me_convert_ucast)
@@ -104,8 +105,8 @@ cdp_tx_me_convert_ucast(ol_txrx_soc_handle soc, void *vdev,
  * @param msdu - the multicast msdu returned by FW for host inspect
  */
 
-static inline int cdp_mcast_notify(ol_txrx_soc_handle soc, void *pdev,
-	u_int8_t vdev_id, qdf_nbuf_t msdu)
+static inline int cdp_mcast_notify(ol_txrx_soc_handle soc,
+		struct cdp_pdev *pdev, u_int8_t vdev_id, qdf_nbuf_t msdu)
 {
 	if (soc->ops->me_ops->mcast_notify)
 		return soc->ops->me_ops->mcast_notify(pdev, vdev_id, msdu);

+ 18 - 16
dp/inc/cdp_txrx_misc.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -32,6 +32,7 @@
 #ifndef _CDP_TXRX_MISC_H_
 #define _CDP_TXRX_MISC_H_
 
+#include "cdp_txrx_handle.h"
 /**
  * cdp_tx_non_std() - Allow the control-path SW to send data frames
  *
@@ -56,7 +57,7 @@
  *  Return: null - success, skb - failure
  */
 static inline qdf_nbuf_t
-cdp_tx_non_std(ol_txrx_soc_handle soc, void *vdev,
+cdp_tx_non_std(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
 		enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
@@ -81,8 +82,8 @@ cdp_tx_non_std(ol_txrx_soc_handle soc, void *vdev,
  * Return: Old timer value set in vdev.
  */
 static inline uint16_t
-cdp_set_ibss_vdev_heart_beat_timer(ol_txrx_soc_handle soc, void *vdev,
-		uint16_t timer_value_sec)
+cdp_set_ibss_vdev_heart_beat_timer(ol_txrx_soc_handle soc,
+		struct cdp_vdev *vdev, uint16_t timer_value_sec)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -106,7 +107,7 @@ cdp_set_ibss_vdev_heart_beat_timer(ol_txrx_soc_handle soc, void *vdev,
  * Return: QDF_STATUS_SUCCESS mode enable success
  */
 static inline QDF_STATUS
-cdp_set_wisa_mode(ol_txrx_soc_handle soc, void *vdev, bool enable)
+cdp_set_wisa_mode(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, bool enable)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -128,7 +129,7 @@ cdp_set_wisa_mode(ol_txrx_soc_handle soc, void *vdev, bool enable)
  * Return: none
  */
 static inline void
-cdp_set_wmm_param(ol_txrx_soc_handle soc, void *pdev,
+cdp_set_wmm_param(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 		      struct ol_tx_wmm_param_t wmm_param)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
@@ -152,7 +153,7 @@ cdp_set_wmm_param(ol_txrx_soc_handle soc, void *pdev,
  * Return: QDF_STATUS_SUCCESS suspend success
  */
 static inline QDF_STATUS cdp_runtime_suspend(ol_txrx_soc_handle soc,
-		void *pdev)
+		struct cdp_pdev *pdev)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -174,7 +175,7 @@ static inline QDF_STATUS cdp_runtime_suspend(ol_txrx_soc_handle soc,
  * Return: QDF_STATUS_SUCCESS suspend success
  */
 static inline QDF_STATUS cdp_runtime_resume(ol_txrx_soc_handle soc,
-		void *pdev)
+		struct cdp_pdev *pdev)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -197,7 +198,7 @@ static inline QDF_STATUS cdp_runtime_resume(ol_txrx_soc_handle soc,
  * Return: none
  */
 static inline void
-cdp_hl_tdls_flag_reset(ol_txrx_soc_handle soc, void *vdev, bool flag)
+cdp_hl_tdls_flag_reset(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, bool flag)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -227,7 +228,7 @@ cdp_hl_tdls_flag_reset(ol_txrx_soc_handle soc, void *vdev, bool flag)
  *        0 unknown interface
  */
 static inline int
-cdp_get_opmode(ol_txrx_soc_handle soc, void *vdev)
+cdp_get_opmode(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -251,7 +252,7 @@ cdp_get_opmode(ol_txrx_soc_handle soc, void *vdev)
  *        0 unknown interface
  */
 static inline uint16_t
-cdp_get_vdev_id(ol_txrx_soc_handle soc, void *vdev)
+cdp_get_vdev_id(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -277,7 +278,7 @@ cdp_get_vdev_id(ol_txrx_soc_handle soc, void *vdev)
  * Return: none
  */
 static inline void
-cdp_bad_peer_txctl_set_setting(ol_txrx_soc_handle soc, void *pdev,
+cdp_bad_peer_txctl_set_setting(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 		int enable, int period, int txq_limit)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
@@ -305,7 +306,8 @@ cdp_bad_peer_txctl_set_setting(ol_txrx_soc_handle soc, void *pdev,
  * Return: none
  */
 static inline void
-cdp_bad_peer_txctl_update_threshold(ol_txrx_soc_handle soc, void *pdev,
+cdp_bad_peer_txctl_update_threshold(ol_txrx_soc_handle soc,
+		struct cdp_pdev *pdev,
 		int level, int tput_thresh, int tx_limit)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
@@ -422,8 +424,8 @@ static inline A_STATUS cdp_get_intra_bss_fwd_pkts_count(
  *
  * Return: void
  */
-static inline void cdp_pkt_log_init(ol_txrx_soc_handle soc, void *pdev,
-				void *scn)
+static inline void cdp_pkt_log_init(ol_txrx_soc_handle soc,
+		struct cdp_pdev *pdev, void *scn)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -445,7 +447,7 @@ static inline void cdp_pkt_log_init(ol_txrx_soc_handle soc, void *pdev,
  * Return: void
  */
 static inline void cdp_pkt_log_con_service(ol_txrx_soc_handle soc,
-		void *pdev, void *scn)
+		struct cdp_pdev *pdev, void *scn)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,

+ 9 - 9
dp/inc/cdp_txrx_mon.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -32,9 +32,9 @@
 
 #ifndef _CDP_TXRX_MON_H_
 #define _CDP_TXRX_MON_H_
-
+#include "cdp_txrx_handle.h"
 static inline void cdp_monitor_set_filter_ucast_data
-	(ol_txrx_soc_handle soc, void *pdev, u_int8_t val)
+	(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, u_int8_t val)
 {
 	if (soc->ops->mon_ops->txrx_monitor_set_filter_ucast_data)
 		return soc->ops->mon_ops->txrx_monitor_set_filter_ucast_data
@@ -42,7 +42,7 @@ static inline void cdp_monitor_set_filter_ucast_data
 	return;
 }
 static inline void cdp_monitor_set_filter_mcast_data
-	(ol_txrx_soc_handle soc, void *pdev, u_int8_t val)
+	(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, u_int8_t val)
 {
 	if (soc->ops->mon_ops->txrx_monitor_set_filter_mcast_data)
 		return soc->ops->mon_ops->txrx_monitor_set_filter_mcast_data
@@ -50,7 +50,7 @@ static inline void cdp_monitor_set_filter_mcast_data
 	return;
 }
 static inline void cdp_monitor_set_filter_non_data
-	(ol_txrx_soc_handle soc, void *pdev, u_int8_t val)
+	(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, u_int8_t val)
 {
 	if (soc->ops->mon_ops->txrx_monitor_set_filter_non_data)
 		return soc->ops->mon_ops->txrx_monitor_set_filter_non_data
@@ -59,7 +59,7 @@ static inline void cdp_monitor_set_filter_non_data
 }
 
 static inline u_int8_t cdp_monitor_get_filter_ucast_data(ol_txrx_soc_handle soc,
-				void *vdev_txrx_handle)
+			struct cdp_vdev *vdev_txrx_handle)
 {
 	if (soc->ops->mon_ops->txrx_monitor_get_filter_ucast_data)
 		return soc->ops->mon_ops->txrx_monitor_get_filter_ucast_data
@@ -67,7 +67,7 @@ static inline u_int8_t cdp_monitor_get_filter_ucast_data(ol_txrx_soc_handle soc,
 	return 0;
 }
 static inline u_int8_t cdp_monitor_get_filter_mcast_data(ol_txrx_soc_handle soc,
-				void *vdev_txrx_handle)
+				struct cdp_vdev *vdev_txrx_handle)
 {
 	if (soc->ops->mon_ops->txrx_monitor_get_filter_mcast_data)
 		return soc->ops->mon_ops->txrx_monitor_get_filter_mcast_data
@@ -75,7 +75,7 @@ static inline u_int8_t cdp_monitor_get_filter_mcast_data(ol_txrx_soc_handle soc,
 	return 0;
 }
 static inline u_int8_t cdp_monitor_get_filter_non_data(ol_txrx_soc_handle soc,
-				void *vdev_txrx_handle)
+				struct cdp_vdev *vdev_txrx_handle)
 {
 	if (soc->ops->mon_ops->txrx_monitor_get_filter_non_data)
 		return soc->ops->mon_ops->txrx_monitor_get_filter_non_data
@@ -83,7 +83,7 @@ static inline u_int8_t cdp_monitor_get_filter_non_data(ol_txrx_soc_handle soc,
 	return 0;
 }
 static inline int cdp_reset_monitor_mode
-(ol_txrx_soc_handle soc, void *pdev)
+(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
 {
 	if (soc->ops->mon_ops->txrx_reset_monitor_mode)
 		return soc->ops->mon_ops->txrx_reset_monitor_mode(pdev);

+ 4 - 4
dp/inc/cdp_txrx_ocb.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -28,7 +28,7 @@
 #ifndef _CDP_TXRX_OCB_H_
 #define _CDP_TXRX_OCB_H_
 #include <cdp_txrx_mob_def.h>
-
+#include "cdp_txrx_handle.h"
 /**
  * cdp_set_ocb_chan_info() - set OCB channel info to vdev.
  * @soc - data path soc handle
@@ -38,7 +38,7 @@
  * Return: NONE
  */
 static inline void
-cdp_set_ocb_chan_info(ol_txrx_soc_handle soc, void *vdev,
+cdp_set_ocb_chan_info(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
 		struct ol_txrx_ocb_set_chan ocb_set_chan)
 {
 	if (!soc || !soc->ops || !soc->ops->ocb_ops) {
@@ -61,7 +61,7 @@ cdp_set_ocb_chan_info(ol_txrx_soc_handle soc, void *vdev,
  * Return: handle to struct ol_txrx_ocb_chan_info
  */
 static inline struct ol_txrx_ocb_chan_info *
-cdp_get_ocb_chan_info(ol_txrx_soc_handle soc, void *vdev)
+cdp_get_ocb_chan_info(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 {
 	if (!soc || !soc->ops || !soc->ops->ocb_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,

+ 155 - 140
dp/inc/cdp_txrx_ops.h

@@ -30,6 +30,7 @@
 #ifdef CONFIG_WIN
 #include <cdp_txrx_stats_struct.h>
 #endif
+#include "cdp_txrx_handle.h"
 
 /******************************************************************************
  *
@@ -39,55 +40,55 @@
 
 struct cdp_cmn_ops {
 
-	int(*txrx_soc_attach_target)(ol_txrx_soc_handle soc);
+	int (*txrx_soc_attach_target)(ol_txrx_soc_handle soc);
 
-	int(*txrx_pdev_attach_target)(void *pdev);
+	int (*txrx_pdev_attach_target)(struct cdp_pdev *pdev);
 
-	void *(*txrx_vdev_attach)
-		(void *pdev, uint8_t *vdev_mac_addr,
+	struct cdp_vdev *(*txrx_vdev_attach)
+		(struct cdp_pdev *pdev, uint8_t *vdev_mac_addr,
 		 uint8_t vdev_id, enum wlan_op_mode op_mode);
 
-	void(*txrx_vdev_detach)
-		(void *vdev, ol_txrx_vdev_delete_cb callback,
+	void (*txrx_vdev_detach)
+		(struct cdp_vdev *vdev, ol_txrx_vdev_delete_cb callback,
 		 void *cb_context);
 
-	void *(*txrx_pdev_attach)
-		(ol_txrx_soc_handle soc, void *ctrl_pdev,
+	struct cdp_pdev *(*txrx_pdev_attach)
+		(ol_txrx_soc_handle soc, struct cdp_cfg *ctrl_pdev,
 		HTC_HANDLE htc_pdev, qdf_device_t osdev, uint8_t pdev_id);
 
-	int (*txrx_pdev_post_attach)(void *pdev);
+	int (*txrx_pdev_post_attach)(struct cdp_pdev *pdev);
 
-	void(*txrx_pdev_detach)(void *pdev, int force);
+	void (*txrx_pdev_detach)(struct cdp_pdev *pdev, int force);
 
 	void *(*txrx_peer_create)
-		(void *vdev, uint8_t *peer_mac_addr);
+		(struct cdp_vdev *vdev, uint8_t *peer_mac_addr);
 
 	void (*txrx_peer_setup)
-		(void *vdev_hdl, void *peer_hdl);
+		(struct cdp_vdev *vdev_hdl, void *peer_hdl);
 
 	void (*txrx_peer_teardown)
-		(void *vdev_hdl, void *peer_hdl);
+		(struct cdp_vdev *vdev_hdl, void *peer_hdl);
 
-	void(*txrx_peer_delete)(void *peer);
+	void (*txrx_peer_delete)(void *peer);
 
-	int(*txrx_set_monitor_mode)(void *vdev);
+	int (*txrx_set_monitor_mode)(struct cdp_vdev *vdev);
 
-	void(*txrx_set_curchan)(void *pdev, uint32_t chan_mhz);
+	void (*txrx_set_curchan)(struct cdp_pdev *pdev, uint32_t chan_mhz);
 
 	void (*txrx_set_privacy_filters)
-		(void *vdev, void *filter, uint32_t num);
+		(struct cdp_vdev *vdev, void *filter, uint32_t num);
 
 	/********************************************************************
 	 * Data Interface (B Interface)
 	 ********************************************************************/
 
-	void(*txrx_vdev_register)(void *vdev,
+	void (*txrx_vdev_register)(struct cdp_vdev *vdev,
 			void *osif_vdev, struct ol_txrx_ops *txrx_ops);
 
-	int(*txrx_mgmt_send)(void *vdev,
+	int (*txrx_mgmt_send)(struct cdp_vdev *vdev,
 			qdf_nbuf_t tx_mgmt_frm, uint8_t type);
 
-	int(*txrx_mgmt_send_ext)(void *vdev,
+	int (*txrx_mgmt_send_ext)(struct cdp_vdev *vdev,
 			qdf_nbuf_t tx_mgmt_frm,	uint8_t type, uint8_t use_6mbps,
 			uint16_t chanfreq);
 
@@ -96,12 +97,12 @@ struct cdp_cmn_ops {
 	 * callback function
 	 */
 
-	void(*txrx_mgmt_tx_cb_set)
-		(void *pdev, uint8_t type,
+	void (*txrx_mgmt_tx_cb_set)
+		(struct cdp_pdev *pdev, uint8_t type,
 		 ol_txrx_mgmt_tx_cb download_cb, ol_txrx_mgmt_tx_cb ota_ack_cb,
 		 void *ctxt);
 
-	int (*txrx_get_tx_pending)(void *pdev);
+	int (*txrx_get_tx_pending)(struct cdp_pdev *pdev);
 
 	/**
 	 * ol_txrx_data_tx_cb - Function registered with the data path
@@ -109,25 +110,26 @@ struct cdp_cmn_ops {
 	 * done being transmitted
 	 */
 
-	void(*txrx_data_tx_cb_set)(void *data_vdev,
+	void (*txrx_data_tx_cb_set)(struct cdp_vdev *data_vdev,
 			ol_txrx_data_tx_cb callback, void *ctxt);
 
 	/*******************************************************************
 	 * Statistics and Debugging Interface (C Inteface)
 	 ********************************************************************/
 
-	int(*txrx_aggr_cfg)(void *vdev, int max_subfrms_ampdu,
+	int (*txrx_aggr_cfg)(struct cdp_vdev *vdev, int max_subfrms_ampdu,
 			int max_subfrms_amsdu);
 
-	A_STATUS(*txrx_fw_stats_get)(void *vdev, struct ol_txrx_stats_req *req,
+	A_STATUS (*txrx_fw_stats_get)(struct cdp_vdev *vdev,
+			struct ol_txrx_stats_req *req,
 			bool per_vdev, bool response_expected);
 
-	int(*txrx_debug)(void *vdev, int debug_specs);
+	int (*txrx_debug)(struct cdp_vdev *vdev, int debug_specs);
 
-	void(*txrx_fw_stats_cfg)(void *vdev,
+	void (*txrx_fw_stats_cfg)(struct cdp_vdev *vdev,
 			uint8_t cfg_stats_type, uint32_t cfg_val);
 
-	void(*txrx_print_level_set)(unsigned level);
+	void (*txrx_print_level_set)(unsigned level);
 
 	/**
 	 * ol_txrx_get_vdev_mac_addr() - Return mac addr of vdev
@@ -135,7 +137,7 @@ struct cdp_cmn_ops {
 	 *
 	 * Return: vdev mac address
 	 */
-	uint8_t *(*txrx_get_vdev_mac_addr)(void *vdev);
+	uint8_t * (*txrx_get_vdev_mac_addr)(struct cdp_vdev *vdev);
 
 	/**
 	 * ol_txrx_get_vdev_struct_mac_addr() - Return handle to struct qdf_mac_addr of
@@ -145,7 +147,7 @@ struct cdp_cmn_ops {
 	 * Return: Handle to struct qdf_mac_addr
 	 */
 	struct qdf_mac_addr *
-		(*txrx_get_vdev_struct_mac_addr)(void *vdev);
+		(*txrx_get_vdev_struct_mac_addr)(struct cdp_vdev *vdev);
 
 	/**
 	 * ol_txrx_get_pdev_from_vdev() - Return handle to pdev of vdev
@@ -153,8 +155,8 @@ struct cdp_cmn_ops {
 	 *
 	 * Return: Handle to pdev
 	 */
-	void *(*txrx_get_pdev_from_vdev)
-		(void *vdev);
+	struct cdp_pdev *(*txrx_get_pdev_from_vdev)
+		(struct cdp_vdev *vdev);
 
 	/**
 	 * ol_txrx_get_ctrl_pdev_from_vdev() - Return control pdev of vdev
@@ -162,11 +164,12 @@ struct cdp_cmn_ops {
 	 *
 	 * Return: Handle to control pdev
 	 */
-	void *
-		(*txrx_get_ctrl_pdev_from_vdev)(void *vdev);
+	struct cdp_cfg *
+		(*txrx_get_ctrl_pdev_from_vdev)(struct cdp_vdev *vdev);
 
-	void *
-		(*txrx_get_vdev_from_vdev_id)(void *pdev, uint8_t vdev_id);
+	struct cdp_vdev *
+		(*txrx_get_vdev_from_vdev_id)(struct cdp_pdev *pdev,
+				uint8_t vdev_id);
 
 	void (*txrx_soc_detach)(void *soc);
 
@@ -188,7 +191,7 @@ struct cdp_ctrl_ops {
 		(*txrx_mempools_attach)(void *ctrl_pdev);
 	int
 		(*txrx_set_filter_neighbour_peers)(
-				void *pdev,
+				struct cdp_pdev *pdev,
 				u_int32_t val);
 	/**
 	 * @brief set the safemode of the device
@@ -205,7 +208,7 @@ struct cdp_ctrl_ops {
 
 	void
 		(*txrx_set_safemode)(
-				void *vdev,
+				struct cdp_vdev *vdev,
 				u_int32_t val);
 	/**
 	 * @brief configure the drop unencrypted frame flag
@@ -219,7 +222,7 @@ struct cdp_ctrl_ops {
 	 */
 	void
 		(*txrx_set_drop_unenc)(
-				void *vdev,
+				struct cdp_vdev *vdev,
 				u_int32_t val);
 
 
@@ -234,7 +237,7 @@ struct cdp_ctrl_ops {
 	 */
 	void
 		(*txrx_set_tx_encap_type)(
-				void *vdev,
+				struct cdp_vdev *vdev,
 				enum htt_cmn_pkt_type val);
 	/**
 	 * @brief set the Rx decapsulation type of the VDEV
@@ -248,7 +251,7 @@ struct cdp_ctrl_ops {
 	 */
 	void
 		(*txrx_set_vdev_rx_decap_type)(
-				void *vdev,
+				struct cdp_vdev *vdev,
 				enum htt_cmn_pkt_type val);
 
 	/**
@@ -258,7 +261,7 @@ struct cdp_ctrl_ops {
 	 * @return - the Rx decap type
 	 */
 	enum htt_cmn_pkt_type
-		(*txrx_get_vdev_rx_decap_type)(void *vdev);
+		(*txrx_get_vdev_rx_decap_type)(struct cdp_vdev *vdev);
 
 	/* Is this similar to ol_txrx_peer_state_update() in MCL */
 	/**
@@ -278,13 +281,13 @@ struct cdp_ctrl_ops {
 				u_int32_t authorize);
 
 	bool
-		(*txrx_set_inact_params)(void *pdev,
+		(*txrx_set_inact_params)(struct cdp_pdev *pdev,
 				u_int16_t inact_check_interval,
 				u_int16_t inact_normal,
 				u_int16_t inact_overload);
 	bool
 		(*txrx_start_inact_timer)(
-				void *pdev,
+				struct cdp_pdev *pdev,
 				bool enable);
 
 
@@ -298,7 +301,7 @@ struct cdp_ctrl_ops {
 	 * @param overload - whether the radio is overloaded or not
 	 */
 	void (*txrx_set_overload)(
-			void *pdev,
+			struct cdp_pdev *pdev,
 			bool overload);
 	/**
 	 * @brief Check the inactivity status of the peer/node
@@ -324,34 +327,34 @@ struct cdp_ctrl_ops {
 
 
 	/* Should be ol_txrx_ctrl_api.h */
-	void (*txrx_set_mesh_mode)(void *vdev, u_int32_t val);
+	void (*txrx_set_mesh_mode)(struct cdp_vdev *vdev, u_int32_t val);
 
-	void (*tx_flush_buffers)(void *vdev);
+	void (*tx_flush_buffers)(struct cdp_vdev *vdev);
 
-	int (*txrx_is_target_ar900b)(void *vdev);
+	int (*txrx_is_target_ar900b)(struct cdp_vdev *vdev);
 
 };
 
 struct cdp_me_ops {
 
 	u_int16_t (*tx_desc_alloc_and_mark_for_mcast_clone)
-		(void *pdev, u_int16_t buf_count);
+		(struct cdp_pdev *pdev, u_int16_t buf_count);
 
 		u_int16_t (*tx_desc_free_and_unmark_for_mcast_clone)(
-				void *pdev,
+				struct cdp_pdev *pdev,
 				u_int16_t buf_count);
 
 	u_int16_t
 		(*tx_get_mcast_buf_allocated_marked)
-			(void *pdev);
+			(struct cdp_pdev *pdev);
 	void
-		(*tx_me_alloc_descriptor)(void *pdev);
+		(*tx_me_alloc_descriptor)(struct cdp_pdev *pdev);
 
 	void
-		(*tx_me_free_descriptor)(void *pdev);
+		(*tx_me_free_descriptor)(struct cdp_pdev *pdev);
 
 	uint16_t
-		(*tx_me_convert_ucast)(void *vdev,
+		(*tx_me_convert_ucast)(struct cdp_vdev *vdev,
 			qdf_nbuf_t wbuf, u_int8_t newmac[][6],
 			uint8_t newmaccnt);
 	/* Should be a function pointer in ol_txrx_osif_ops{} */
@@ -366,38 +369,38 @@ struct cdp_me_ops {
 	 * @param msdu - the multicast msdu returned by FW for host inspect
 	 */
 
-	int (*mcast_notify)(void *pdev,
+	int (*mcast_notify)(struct cdp_pdev *pdev,
 			u_int8_t vdev_id, qdf_nbuf_t msdu);
 };
 
 struct cdp_mon_ops {
 
 	void (*txrx_monitor_set_filter_ucast_data)
-		(void *, u_int8_t val);
+		(struct cdp_pdev *, u_int8_t val);
 	void (*txrx_monitor_set_filter_mcast_data)
-		(void *, u_int8_t val);
+		(struct cdp_pdev *, u_int8_t val);
 	void (*txrx_monitor_set_filter_non_data)
-		(void *, u_int8_t val);
+		(struct cdp_pdev *, u_int8_t val);
 
 	u_int8_t (*txrx_monitor_get_filter_ucast_data)
-		(void *vdev_txrx_handle);
+		(struct cdp_vdev *vdev_txrx_handle);
 	u_int8_t (*txrx_monitor_get_filter_mcast_data)
-		(void *vdev_txrx_handle);
+		(struct cdp_vdev *vdev_txrx_handle);
 	u_int8_t (*txrx_monitor_get_filter_non_data)
-		(void *vdev_txrx_handle);
-	int (*txrx_reset_monitor_mode)(void *pdev);
+		(struct cdp_vdev *vdev_txrx_handle);
+	int (*txrx_reset_monitor_mode)(struct cdp_pdev *pdev);
 
 };
 
 struct cdp_host_stats_ops {
-	int (*txrx_host_stats_get)(void *vdev,
+	int (*txrx_host_stats_get)(struct cdp_vdev *vdev,
 			struct ol_txrx_stats_req *req);
 
-	void (*txrx_host_stats_clr)(void *vdev);
+	void (*txrx_host_stats_clr)(struct cdp_vdev *vdev);
 
-	void (*txrx_host_ce_stats)(void *vdev);
+	void (*txrx_host_ce_stats)(struct cdp_vdev *vdev);
 
-	int (*txrx_stats_publish)(void *pdev,
+	int (*txrx_stats_publish)(struct cdp_pdev *pdev,
 			void *buf);
 	/**
 	 * @brief Enable enhanced stats functionality.
@@ -405,7 +408,7 @@ struct cdp_host_stats_ops {
 	 * @param pdev - the physical device object
 	 * @return - void
 	 */
-	void (*txrx_enable_enhanced_stats)(void *pdev);
+	void (*txrx_enable_enhanced_stats)(struct cdp_pdev *pdev);
 
 	/**
 	 * @brief Disable enhanced stats functionality.
@@ -413,7 +416,7 @@ struct cdp_host_stats_ops {
 	 * @param pdev - the physical device object
 	 * @return - void
 	 */
-	void (*txrx_disable_enhanced_stats)(void *pdev);
+	void (*txrx_disable_enhanced_stats)(struct cdp_pdev *pdev);
 
 	/**
 	 * @brief Get the desired stats from the message.
@@ -423,53 +426,53 @@ struct cdp_host_stats_ops {
 	 * @param type - stats type.
 	 * @return - pointer to requested stat identified by type
 	 */
-	uint32_t*(*txrx_get_stats_base)(void *pdev,
+	uint32_t * (*txrx_get_stats_base)(struct cdp_pdev *pdev,
 			uint32_t *stats_base, uint32_t msg_len, uint8_t type);
 	void
-		(*tx_print_tso_stats)(void *vdev);
+		(*tx_print_tso_stats)(struct cdp_vdev *vdev);
 
 	void
-		(*tx_rst_tso_stats)(void *vdev);
+		(*tx_rst_tso_stats)(struct cdp_vdev *vdev);
 
 	void
-		(*tx_print_sg_stats)(void *vdev);
+		(*tx_print_sg_stats)(struct cdp_vdev *vdev);
 
 	void
-		(*tx_rst_sg_stats)(void *vdev);
+		(*tx_rst_sg_stats)(struct cdp_vdev *vdev);
 
 	void
-		(*print_rx_cksum_stats)(void *vdev);
+		(*print_rx_cksum_stats)(struct cdp_vdev *vdev);
 
 	void
-		(*rst_rx_cksum_stats)(void *vdev);
+		(*rst_rx_cksum_stats)(struct cdp_vdev *vdev);
 
 	A_STATUS
-		(*txrx_host_me_stats)(void *vdev);
+		(*txrx_host_me_stats)(struct cdp_vdev *vdev);
 	void
-		(*txrx_per_peer_stats)(void *pdev, char *addr);
-	int (*txrx_host_msdu_ttl_stats)(void *vdev,
+		(*txrx_per_peer_stats)(struct cdp_pdev *pdev, char *addr);
+	int (*txrx_host_msdu_ttl_stats)(struct cdp_vdev *vdev,
 			struct ol_txrx_stats_req *req);
 
 	void
-		(*print_lro_stats)(void *vdev);
+		(*print_lro_stats)(struct cdp_vdev *vdev);
 
 	void
-		(*reset_lro_stats)(void *vdev);
+		(*reset_lro_stats)(struct cdp_vdev *vdev);
 
 };
 
 struct cdp_wds_ops {
 	void
-		(*txrx_set_wds_rx_policy)(void *vdev,
+		(*txrx_set_wds_rx_policy)(struct cdp_vdev *vdev,
 				u_int32_t val);
 
 };
 
 struct cdp_raw_ops {
-	int (*txrx_get_nwifi_mode)(void *vdev);
+	int (*txrx_get_nwifi_mode)(struct cdp_vdev *vdev);
 
 	int
-		(*rsim_tx_encap)(void *vdev, qdf_nbuf_t *pnbuf);
+		(*rsim_tx_encap)(struct cdp_vdev *vdev, qdf_nbuf_t *pnbuf);
 };
 
 #ifdef CONFIG_WIN
@@ -511,29 +514,29 @@ struct ol_if_ops {
  * @runtime_resume:
  */
 struct cdp_misc_ops {
-	uint16_t (*set_ibss_vdev_heart_beat_timer)(void *vdev,
+	uint16_t (*set_ibss_vdev_heart_beat_timer)(struct cdp_vdev *vdev,
 			uint16_t timer_value_sec);
-	void (*set_wmm_param)(void *cfg_pdev,
+	void (*set_wmm_param)(struct cdp_pdev *cfg_pdev,
 			struct ol_tx_wmm_param_t wmm_param);
-	void (*bad_peer_txctl_set_setting)(void *pdev, int enable,
+	void (*bad_peer_txctl_set_setting)(struct cdp_pdev *pdev, int enable,
 			int period, int txq_limit);
-	void (*bad_peer_txctl_update_threshold)(void *pdev,
+	void (*bad_peer_txctl_update_threshold)(struct cdp_pdev *pdev,
 		int level, int tput_thresh, int tx_limit);
-	void (*hl_tdls_flag_reset)(void *vdev, bool flag);
-	qdf_nbuf_t (*tx_non_std)(void *vdev,
+	void (*hl_tdls_flag_reset)(struct cdp_vdev *vdev, bool flag);
+	qdf_nbuf_t (*tx_non_std)(struct cdp_vdev *vdev,
 		enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list);
-	uint16_t (*get_vdev_id)(void *vdev);
-	QDF_STATUS (*set_wisa_mode)(void *vdev, bool enable);
-	QDF_STATUS (*runtime_suspend)(void *pdev);
-	QDF_STATUS (*runtime_resume)(void *pdev);
-	int (*get_opmode)(void *vdev);
+	uint16_t (*get_vdev_id)(struct cdp_vdev *vdev);
+	QDF_STATUS (*set_wisa_mode)(struct cdp_vdev *vdev, bool enable);
+	QDF_STATUS (*runtime_suspend)(struct cdp_pdev *pdev);
+	QDF_STATUS (*runtime_resume)(struct cdp_pdev *pdev);
+	int (*get_opmode)(struct cdp_vdev *vdev);
 	void (*mark_first_wakeup_packet)(uint8_t value);
 	void (*update_mac_id)(uint8_t vdev_id, uint8_t mac_id);
 	void (*flush_rx_frames)(void *peer, bool drop);
 	A_STATUS (*get_intra_bss_fwd_pkts_count)(uint8_t vdev_id,
 		uint64_t *fwd_tx_packets, uint64_t *fwd_rx_packets);
-	void (*pkt_log_init)(void *handle, void *scn);
-	void (*pkt_log_con_service)(void *pdev, void *scn);
+	void (*pkt_log_init)(struct cdp_pdev *handle, void *scn);
+	void (*pkt_log_con_service)(struct cdp_pdev *pdev, void *scn);
 };
 
 /**
@@ -544,13 +547,15 @@ struct cdp_misc_ops {
  * @tx_set_compute_interval:
  */
 struct cdp_tx_delay_ops {
-	void (*tx_delay)(void *pdev, uint32_t *queue_delay_microsec,
+	void (*tx_delay)(struct cdp_pdev *pdev, uint32_t *queue_delay_microsec,
 		uint32_t *tx_delay_microsec, int category);
-	void (*tx_delay_hist)(void *pdev,
+	void (*tx_delay_hist)(struct cdp_pdev *pdev,
 		uint16_t *bin_values, int category);
-	void (*tx_packet_count)(void *pdev, uint16_t *out_packet_count,
+	void (*tx_packet_count)(struct cdp_pdev *pdev,
+		uint16_t *out_packet_count,
 		uint16_t *out_packet_loss_count, int category);
-	void (*tx_set_compute_interval)(void *pdev, uint32_t interval);
+	void (*tx_set_compute_interval)(struct cdp_pdev *pdev,
+		uint32_t interval);
 };
 
 /**
@@ -575,15 +580,18 @@ struct cdp_pmf_ops {
  * @set_flow_control_parameters:
  */
 struct cdp_cfg_ops {
-	void (*set_cfg_rx_fwd_disabled)(void *pdev, uint8_t disable_rx_fwd);
-	void (*set_cfg_packet_log_enabled)(void *pdev, uint8_t val);
-	void * (*cfg_attach)(qdf_device_t osdev, void *cfg_param);
-	void (*vdev_rx_set_intrabss_fwd)(void *vdev, bool val);
-	uint8_t (*is_rx_fwd_disabled)(void *vdev);
+	void (*set_cfg_rx_fwd_disabled)(struct cdp_cfg *cfg_pdev,
+		uint8_t disable_rx_fwd);
+	void (*set_cfg_packet_log_enabled)(struct cdp_cfg *cfg_pdev,
+		uint8_t val);
+	struct cdp_cfg * (*cfg_attach)(qdf_device_t osdev, void *cfg_param);
+	void (*vdev_rx_set_intrabss_fwd)(struct cdp_vdev *vdev, bool val);
+	uint8_t (*is_rx_fwd_disabled)(struct cdp_vdev *vdev);
 	void (*tx_set_is_mgmt_over_wmi_enabled)(uint8_t value);
-	int (*is_high_latency)(void *pdev);
-	void (*set_flow_control_parameters)(void *cfg, void *param);
-	void (*set_flow_steering)(void *pdev, uint8_t val);
+	int (*is_high_latency)(struct cdp_cfg *cfg_pdev);
+	void (*set_flow_control_parameters)(struct cdp_cfg *cfg_pdev,
+		void *param);
+	void (*set_flow_steering)(struct cdp_cfg *cfg_pdev, uint8_t val);
 };
 
 /**
@@ -614,14 +622,14 @@ struct cdp_lflowctl_ops {
 	int (*register_tx_flow_control)(uint8_t vdev_id,
 		ol_txrx_tx_flow_control_fp flowControl, void *osif_fc_ctx);
 	int (*deregister_tx_flow_control_cb)(uint8_t vdev_id);
-	void (*flow_control_cb)(void *vdev, bool tx_resume);
+	void (*flow_control_cb)(struct cdp_vdev *vdev, bool tx_resume);
 	bool (*get_tx_resource)(uint8_t sta_id,
 			 unsigned int low_watermark,
 			 unsigned int high_watermark_offset);
 	int (*ll_set_tx_pause_q_depth)(uint8_t vdev_id, int pause_q_depth);
-	void (*vdev_flush)(void *vdev);
-	void (*vdev_pause)(void *vdev, uint32_t reason);
-	void (*vdev_unpause)(void *vdev, uint32_t reason);
+	void (*vdev_flush)(struct cdp_vdev *vdev);
+	void (*vdev_pause)(struct cdp_vdev *vdev, uint32_t reason);
+	void (*vdev_unpause)(struct cdp_vdev *vdev, uint32_t reason);
 };
 
 /**
@@ -635,19 +643,21 @@ struct cdp_lflowctl_ops {
  * @ipa_tx_data_frame:
  */
 struct cdp_ipa_ops {
-	void (*ipa_get_resource)(void *pdev,
+	void (*ipa_get_resource)(struct cdp_pdev *pdev,
 			struct ol_txrx_ipa_resources *ipa_res);
-	void (*ipa_set_doorbell_paddr)(void *pdev,
+	void (*ipa_set_doorbell_paddr)(struct cdp_pdev *pdev,
 		 qdf_dma_addr_t ipa_tx_uc_doorbell_paddr,
 		 qdf_dma_addr_t ipa_rx_uc_doorbell_paddr);
-	void (*ipa_set_active)(void *pdev, bool uc_active, bool is_tx);
-	void (*ipa_op_response)(void *pdev, uint8_t *op_msg);
-	void (*ipa_register_op_cb)(void *pdev,
+	void (*ipa_set_active)(struct cdp_pdev *pdev,
+		bool uc_active, bool is_tx);
+	void (*ipa_op_response)(struct cdp_pdev *pdev, uint8_t *op_msg);
+	void (*ipa_register_op_cb)(struct cdp_pdev *pdev,
 		 void (*ipa_uc_op_cb_type)(uint8_t *op_msg, void *osif_ctxt),
 		 void *osif_dev);
-	void (*ipa_get_stat)(void *pdev);
-	qdf_nbuf_t (*ipa_tx_data_frame)(void *vdev, qdf_nbuf_t skb);
-	void (*ipa_set_uc_tx_partition_base)(void *pdev, uint32_t value);
+	void (*ipa_get_stat)(struct cdp_pdev *pdev);
+	qdf_nbuf_t (*ipa_tx_data_frame)(struct cdp_vdev *vdev, qdf_nbuf_t skb);
+	void (*ipa_set_uc_tx_partition_base)(struct cdp_cfg *cfg_pdev,
+		uint32_t value);
 };
 
 /**
@@ -677,9 +687,10 @@ struct cdp_bus_ops {
  * @get_ocb_chan_info:
  */
 struct cdp_ocb_ops {
-	void (*set_ocb_chan_info)(void *vdev,
-			  struct ol_txrx_ocb_set_chan ocb_set_chan);
-	struct ol_txrx_ocb_chan_info * (*get_ocb_chan_info)(void *vdev);
+	void (*set_ocb_chan_info)(struct cdp_vdev *vdev,
+			struct ol_txrx_ocb_set_chan ocb_set_chan);
+	struct ol_txrx_ocb_chan_info *
+		(*get_ocb_chan_info)(struct cdp_vdev *vdev);
 };
 
 /**
@@ -710,42 +721,46 @@ struct cdp_ocb_ops {
  * @update_last_real_peer:
  */
 struct cdp_peer_ops {
-	QDF_STATUS (*register_peer)(void *pdev,
+	QDF_STATUS (*register_peer)(struct cdp_pdev *pdev,
 			struct ol_txrx_desc_type *sta_desc);
-	QDF_STATUS (*clear_peer)(void *pdev, uint8_t sta_id);
+	QDF_STATUS (*clear_peer)(struct cdp_pdev *pdev, uint8_t sta_id);
 	QDF_STATUS (*change_peer_state)(uint8_t sta_id,
 			enum ol_txrx_peer_state sta_state,
 			bool roam_synch_in_progress);
-	void * (*find_peer_by_addr)(void *pdev,
+	void * (*find_peer_by_addr)(struct cdp_pdev *pdev,
 			uint8_t *peer_addr, uint8_t *peer_id);
-	void * (*find_peer_by_addr_and_vdev)(void *pdev, void *vdev,
+	void * (*find_peer_by_addr_and_vdev)(struct cdp_pdev *pdev,
+			struct cdp_vdev *vdev,
 			uint8_t *peer_addr, uint8_t *peer_id);
 	uint16_t (*local_peer_id)(void *peer);
-	void * (*peer_find_by_local_id)(void *pdev, uint8_t local_peer_id);
-	QDF_STATUS (*peer_state_update)(void *pdev, uint8_t *peer_addr,
+	void * (*peer_find_by_local_id)(struct cdp_pdev *pdev,
+			uint8_t local_peer_id);
+	QDF_STATUS (*peer_state_update)(struct cdp_pdev *pdev,
+			uint8_t *peer_addr,
 			enum ol_txrx_peer_state state);
 	QDF_STATUS (*get_vdevid)(void *peer, uint8_t *vdev_id);
-	void * (*get_vdev_by_sta_id)(uint8_t sta_id);
+	struct cdp_vdev * (*get_vdev_by_sta_id)(uint8_t sta_id);
 	QDF_STATUS (*register_ocb_peer)(void *cds_ctx, uint8_t *mac_addr,
 			uint8_t *peer_id);
 	uint8_t * (*peer_get_peer_mac_addr)(void *peer);
 	int (*get_peer_state)(void *peer);
-	void * (*get_vdev_for_peer)(void *peer);
-	int16_t (*update_ibss_add_peer_num_of_vdev)(void *vdev,
+	struct cdp_vdev * (*get_vdev_for_peer)(void *peer);
+	int16_t (*update_ibss_add_peer_num_of_vdev)(struct cdp_vdev *vdev,
 			int16_t peer_num_delta);
-	void (*remove_peers_for_vdev)(void *vdev,
+	void (*remove_peers_for_vdev)(struct cdp_vdev *vdev,
 			ol_txrx_vdev_peer_remove_cb callback,
 			void *callback_context, bool remove_last_peer);
-	void (*remove_peers_for_vdev_no_lock)(void *vdev,
+	void (*remove_peers_for_vdev_no_lock)(struct cdp_vdev *vdev,
 			ol_txrx_vdev_peer_remove_cb callback,
 			void *callback_context);
-	void (*copy_mac_addr_raw)(void *vdev, uint8_t *bss_addr);
-	void (*add_last_real_peer)(void *pdev, void *vdev, uint8_t *peer_id);
+	void (*copy_mac_addr_raw)(struct cdp_vdev *vdev, uint8_t *bss_addr);
+	void (*add_last_real_peer)(struct cdp_pdev *pdev,
+		struct cdp_vdev *vdev, uint8_t *peer_id);
 	qdf_time_t * (*last_assoc_received)(void *peer);
 	qdf_time_t * (*last_disassoc_received)(void *peer);
 	qdf_time_t * (*last_deauth_received)(void *peer);
 	bool (*is_vdev_restore_last_peer)(void *peer);
-	void (*update_last_real_peer)(void *pdev, void *peer,
+	void (*update_last_real_peer)(struct cdp_pdev *pdev, void *peer,
 			uint8_t *peer_id, bool restore_last_peer);
 	void (*peer_detach_force_delete)(void *peer);
 };
@@ -756,9 +771,9 @@ struct cdp_peer_ops {
  * @throttle_set_level:
  */
 struct cdp_throttle_ops {
-	void (*throttle_init_period)(void *pdev, int period,
+	void (*throttle_init_period)(struct cdp_pdev *pdev, int period,
 			uint8_t *dutycycle_level);
-	void (*throttle_set_level)(void *pdev, int level);
+	void (*throttle_set_level)(struct cdp_pdev *pdev, int level);
 };
 
 /**

+ 15 - 14
dp/inc/cdp_txrx_peer_ops.h

@@ -32,6 +32,7 @@
 #ifndef _CDP_TXRX_PEER_H_
 #define _CDP_TXRX_PEER_H_
 #include <cdp_txrx_ops.h>
+#include "cdp_txrx_handle.h"
 
 /**
  * cdp_peer_register() - Register peer into physical device
@@ -45,7 +46,7 @@
  *         QDF_STATUS_E_NOSUPPORT not support this feature
  */
 static inline QDF_STATUS
-cdp_peer_register(ol_txrx_soc_handle soc, void *pdev,
+cdp_peer_register(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 		struct ol_txrx_desc_type *sta_desc)
 {
 	if (!soc || !soc->ops || !soc->ops->peer_ops) {
@@ -72,7 +73,7 @@ cdp_peer_register(ol_txrx_soc_handle soc, void *pdev,
  *         QDF_STATUS_E_NOSUPPORT not support this feature
  */
 static inline QDF_STATUS
-cdp_clear_peer(ol_txrx_soc_handle soc, void *pdev, uint8_t sta_id)
+cdp_clear_peer(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, uint8_t sta_id)
 {
 	if (!soc || !soc->ops || !soc->ops->peer_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -129,7 +130,7 @@ cdp_peer_register_ocb_peer(ol_txrx_soc_handle soc, void *cds_ctx,
  */
 static inline void
 cdp_peer_remove_for_vdev(ol_txrx_soc_handle soc,
-		void *vdev, ol_txrx_vdev_peer_remove_cb callback,
+		struct cdp_vdev *vdev, ol_txrx_vdev_peer_remove_cb callback,
 		void *callback_context, bool remove_last_peer)
 {
 	if (!soc || !soc->ops || !soc->ops->peer_ops) {
@@ -158,7 +159,7 @@ cdp_peer_remove_for_vdev(ol_txrx_soc_handle soc,
  *         NULL cannot find target peer
  */
 static inline void
-*cdp_peer_find_by_addr(ol_txrx_soc_handle soc, void *pdev,
+*cdp_peer_find_by_addr(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 		uint8_t *peer_addr, uint8_t *peer_id)
 {
 	if (!soc || !soc->ops || !soc->ops->peer_ops) {
@@ -188,8 +189,8 @@ static inline void
  *         NULL cannot find target peer
  */
 static inline void
-*cdp_peer_find_by_addr_and_vdev(ol_txrx_soc_handle soc, void *pdev,
-		void *vdev, uint8_t *peer_addr, uint8_t *peer_id)
+*cdp_peer_find_by_addr_and_vdev(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
+		struct cdp_vdev *vdev, uint8_t *peer_addr, uint8_t *peer_id)
 {
 	if (!soc || !soc->ops || !soc->ops->peer_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -216,7 +217,7 @@ static inline void
  *         NULL cannot find target peer
  */
 static inline void
-*cdp_peer_find_by_local_id(ol_txrx_soc_handle soc, void *pdev,
+*cdp_peer_find_by_local_id(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 		uint8_t local_peer_id)
 {
 	if (!soc || !soc->ops || !soc->ops->peer_ops) {
@@ -245,7 +246,7 @@ static inline void
  *         QDF_STATUS_E_NOSUPPORT not support this feature
  */
 static inline QDF_STATUS
-cdp_peer_state_update(ol_txrx_soc_handle soc, void *pdev,
+cdp_peer_state_update(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 		uint8_t *peer_addr, enum ol_txrx_peer_state state)
 {
 	if (!soc || !soc->ops || !soc->ops->peer_ops) {
@@ -346,7 +347,7 @@ cdp_peer_get_vdevid(ol_txrx_soc_handle soc, void *peer, uint8_t *vdev_id)
  * Return: Virtual interface instance
  *         NULL in case cannot find
  */
-static inline void
+static inline struct cdp_vdev
 *cdp_peer_get_vdev_by_sta_id(ol_txrx_soc_handle soc, uint8_t sta_id)
 {
 	if (!soc || !soc->ops || !soc->ops->peer_ops) {
@@ -396,7 +397,7 @@ static inline uint8_t
  * Return: virtual interface instance pointer
  *         NULL in case cannot find
  */
-static inline void
+static inline struct cdp_vdev
 *cdp_peer_get_vdev(ol_txrx_soc_handle soc, void *peer)
 {
 	if (!soc || !soc->ops || !soc->ops->peer_ops) {
@@ -424,7 +425,7 @@ static inline void
  */
 static inline int16_t
 cdp_peer_update_ibss_add_peer_num_of_vdev(ol_txrx_soc_handle soc,
-		void *vdev, int16_t peer_num_delta)
+		struct cdp_vdev *vdev, int16_t peer_num_delta)
 {
 	if (!soc || !soc->ops || !soc->ops->peer_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -451,7 +452,7 @@ cdp_peer_update_ibss_add_peer_num_of_vdev(ol_txrx_soc_handle soc,
  */
 static inline void
 cdp_peer_copy_mac_addr_raw(ol_txrx_soc_handle soc,
-		void *vdev, uint8_t *bss_addr)
+		struct cdp_vdev *vdev, uint8_t *bss_addr)
 {
 	if (!soc || !soc->ops || !soc->ops->peer_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -478,7 +479,7 @@ cdp_peer_copy_mac_addr_raw(ol_txrx_soc_handle soc,
  */
 static inline void
 cdp_peer_add_last_real_peer(ol_txrx_soc_handle soc,
-		void *pdev, void *vdev, uint8_t *peer_id)
+		struct cdp_pdev *pdev, struct cdp_vdev *vdev, uint8_t *peer_id)
 {
 	if (!soc || !soc->ops || !soc->ops->peer_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -605,7 +606,7 @@ cdp_peer_is_vdev_restore_last_peer(ol_txrx_soc_handle soc, void *peer)
  * Return: none
  */
 static inline void
-cdp_peer_update_last_real_peer(ol_txrx_soc_handle soc, void *pdev,
+cdp_peer_update_last_real_peer(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 		void *peer, uint8_t *peer_id, bool restore_last_peer)
 {
 	if (!soc || !soc->ops || !soc->ops->peer_ops) {

+ 3 - 2
dp/inc/cdp_txrx_pflow.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -34,9 +34,10 @@
 
 #include <cdp_txrx_stats_struct.h>
 #include "cdp_txrx_ops.h"
+#include "cdp_txrx_handle.h"
 
 static inline uint32_t cdp_pflow_update_pdev_params
-	(ol_txrx_soc_handle soc, void *pdev,
+	(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 	ol_ath_param_t param, uint32_t val, void *ctx)
 {
 	if (soc->ops->pflow_ops->pflow_update_pdev_params)

+ 4 - 4
dp/inc/cdp_txrx_raw.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -32,11 +32,11 @@
 #ifndef _CDP_TXRX_RAW_H_
 #define _CDP_TXRX_RAW_H_
 
-
+#include "cdp_txrx_handle.h"
 #include "cdp_txrx_ops.h"
 /* TODO: adf need to be replaced with qdf */
 static inline int cdp_get_nwifi_mode(ol_txrx_soc_handle soc,
-	void *vdev)
+	struct cdp_vdev *vdev)
 {
 	if (soc->ops->raw_ops->txrx_get_nwifi_mode)
 		return soc->ops->raw_ops->txrx_get_nwifi_mode(vdev);
@@ -65,7 +65,7 @@ static inline int cdp_get_nwifi_mode(ol_txrx_soc_handle soc,
 
 static inline int
 cdp_rsim_tx_encap(ol_txrx_soc_handle soc,
-	void *vdev, qdf_nbuf_t *pnbuf)
+	struct cdp_vdev *vdev, qdf_nbuf_t *pnbuf)
 {
 	if (soc->ops->raw_ops->rsim_tx_encap)
 		return soc->ops->raw_ops->rsim_tx_encap(vdev, pnbuf);

+ 6 - 6
dp/inc/cdp_txrx_tx_delay.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -31,7 +31,7 @@
  */
 #ifndef _CDP_TXRX_COMPUTE_TX_DELAY_H_
 #define _CDP_TXRX_COMPUTE_TX_DELAY_H_
-
+#include "cdp_txrx_handle.h"
 /**
  * cdp_tx_delay() - get tx packet delay
  * @soc: data path soc handle
@@ -43,7 +43,7 @@
  * Return: NONE
  */
 static inline void
-cdp_tx_delay(ol_txrx_soc_handle soc, void *pdev,
+cdp_tx_delay(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 		uint32_t *queue_delay_microsec, uint32_t *tx_delay_microsec,
 		int category)
 {
@@ -69,7 +69,7 @@ cdp_tx_delay(ol_txrx_soc_handle soc, void *pdev,
  * Return: NONE
  */
 static inline void
-cdp_tx_delay_hist(ol_txrx_soc_handle soc, void *pdev,
+cdp_tx_delay_hist(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 		uint16_t *bin_values, int category)
 {
 	if (!soc || !soc->ops || !soc->ops->delay_ops) {
@@ -94,7 +94,7 @@ cdp_tx_delay_hist(ol_txrx_soc_handle soc, void *pdev,
  * Return: NONE
  */
 static inline void
-cdp_tx_packet_count(ol_txrx_soc_handle soc, void *pdev,
+cdp_tx_packet_count(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 		uint16_t *out_packet_count, uint16_t *out_packet_loss_count,
 		int category)
 {
@@ -119,7 +119,7 @@ cdp_tx_packet_count(ol_txrx_soc_handle soc, void *pdev,
  * Return: NONE
  */
 static inline void
-cdp_tx_set_compute_interval(ol_txrx_soc_handle soc, void *pdev,
+cdp_tx_set_compute_interval(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 		 uint32_t interval)
 {
 	if (!soc || !soc->ops || !soc->ops->delay_ops) {

+ 5 - 5
dp/inc/cdp_txrx_tx_throttle.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -33,7 +33,7 @@
 #ifndef _CDP_TXRX_TX_THROTTLE_H_
 #define _CDP_TXRX_TX_THROTTLE_H_
 #include <cdp_txrx_ops.h>
-
+#include "cdp_txrx_handle.h"
 /**
  * cdp_throttle_init_period() - init tx throttle period
  * @soc: data path soc handle
@@ -44,8 +44,8 @@
  * Return: NONE
  */
 static inline void
-cdp_throttle_init_period(ol_txrx_soc_handle soc, void *pdev, int period,
-		uint8_t *dutycycle_level)
+cdp_throttle_init_period(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
+		int period, uint8_t *dutycycle_level)
 {
 	if (!soc || !soc->ops || !soc->ops->throttle_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -68,7 +68,7 @@ cdp_throttle_init_period(ol_txrx_soc_handle soc, void *pdev, int period,
  * Return: NONE
  */
 static inline void
-cdp_throttle_set_level(ol_txrx_soc_handle soc, void *pdev, int level)
+cdp_throttle_set_level(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, int level)
 {
 	if (!soc || !soc->ops || !soc->ops->throttle_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,

+ 3 - 3
dp/inc/cdp_txrx_wds.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -31,7 +31,7 @@
  */
 #ifndef _CDP_TXRX_WDS_H_
 #define _CDP_TXRX_WDS_H_
-
+#include "cdp_txrx_handle.h"
 /**
  * @brief set the wds rx filter policy of the device
  * @details
@@ -44,7 +44,7 @@
  */
 static inline void
 cdp_set_wds_rx_policy(ol_txrx_soc_handle soc,
-	void *vdev,
+	struct cdp_vdev *vdev,
 	u_int32_t val)
 {
 	if (!soc || !soc->ops || !soc->ops->wds_ops) {

+ 9 - 7
dp/wifi3.0/dp_internal.h

@@ -22,6 +22,7 @@
 #if DP_PRINT_ENABLE
 #include <stdarg.h>       /* va_list */
 #include <qdf_types.h> /* qdf_vprint */
+#include <cdp_txrx_handle.h>
 
 enum {
 	/* FATAL_ERR - print only irrecoverable error messages */
@@ -63,20 +64,21 @@ extern void dp_peer_rx_cleanup(struct dp_vdev *vdev, struct dp_peer *peer);
 extern void dp_peer_unref_delete(void *peer_handle);
 extern void dp_rx_discard(struct dp_vdev *vdev, struct dp_peer *peer,
 	unsigned tid, qdf_nbuf_t msdu_list);
-extern void *dp_find_peer_by_addr(void *dev,
+extern void *dp_find_peer_by_addr(struct cdp_pdev *dev,
 	uint8_t *peer_mac_addr, uint8_t *peer_id);
 #ifndef CONFIG_WIN
-QDF_STATUS dp_register_peer(void *pdev_handle,
+QDF_STATUS dp_register_peer(struct cdp_pdev *pdev_handle,
 		struct ol_txrx_desc_type *sta_desc);
-QDF_STATUS dp_clear_peer(void *pdev_handle, uint8_t local_id);
-void *dp_find_peer_by_addr_and_vdev(void *pdev_handle, void *vdev,
+QDF_STATUS dp_clear_peer(struct cdp_pdev *pdev_handle, uint8_t local_id);
+void *dp_find_peer_by_addr_and_vdev(struct cdp_pdev *pdev_handle,
+		struct cdp_vdev *vdev,
 		uint8_t *peer_addr, uint8_t *local_id);
 uint16_t dp_local_peer_id(void *peer);
-void *dp_peer_find_by_local_id(void *pdev_handle, uint8_t local_id);
-QDF_STATUS dp_peer_state_update(void *pdev_handle, uint8_t *peer_mac,
+void *dp_peer_find_by_local_id(struct cdp_pdev *pdev_handle, uint8_t local_id);
+QDF_STATUS dp_peer_state_update(struct cdp_pdev *pdev_handle, uint8_t *peer_mac,
 		enum ol_txrx_peer_state state);
 QDF_STATUS dp_get_vdevid(void *peer_handle, uint8_t *vdev_id);
-void *dp_get_vdev_for_peer(void *peer);
+struct cdp_vdev *dp_get_vdev_for_peer(void *peer);
 uint8_t *dp_peer_get_peer_mac_addr(void *peer);
 int dp_get_peer_state(void *peer_handle);
 void dp_local_peer_id_pool_init(struct dp_pdev *pdev);

+ 27 - 23
dp/wifi3.0/dp_main.c

@@ -29,7 +29,7 @@
 #include "dp_tx.h"
 #include "dp_rx.h"
 #include "../../wlan_cfg/wlan_cfg.h"
-
+#include <cdp_txrx_handle.h>
 #define DP_INTR_POLL_TIMER_MS	100
 /**
  * dp_setup_srng - Internal function to setup SRNG rings used by data path
@@ -865,7 +865,7 @@ fail0:
 	return QDF_STATUS_E_FAILURE;
 }
 
-static void dp_pdev_detach_wifi3(void *txrx_pdev, int force);
+static void dp_pdev_detach_wifi3(struct cdp_pdev *txrx_pdev, int force);
 
 /*
 * dp_rxdma_ring_setup() - configure the RX DMA rings
@@ -914,7 +914,8 @@ static int dp_rxdma_ring_setup(struct dp_soc *soc,
 *
 * Return: DP PDEV handle on success, NULL on failure
 */
-static void *dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc, void *ctrl_pdev,
+static struct cdp_pdev *dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc,
+	struct cdp_cfg *ctrl_pdev,
 	HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, uint8_t pdev_id)
 {
 	struct dp_soc *soc = (struct dp_soc *)txrx_soc;
@@ -1034,10 +1035,10 @@ static void *dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc, void *ctrl_pdev,
 	dp_local_peer_id_pool_init(pdev);
 #endif
 
-	return (void *)pdev;
+	return (struct cdp_pdev *)pdev;
 
 fail1:
-	dp_pdev_detach_wifi3((void *)pdev, 0);
+	dp_pdev_detach_wifi3((struct cdp_pdev *)pdev, 0);
 
 fail0:
 	return NULL;
@@ -1076,7 +1077,7 @@ static void dp_rxdma_ring_cleanup(struct dp_soc *soc,
 * @force: Force detach
 *
 */
-static void dp_pdev_detach_wifi3(void *txrx_pdev, int force)
+static void dp_pdev_detach_wifi3(struct cdp_pdev *txrx_pdev, int force)
 {
 	struct dp_pdev *pdev = (struct dp_pdev *)txrx_pdev;
 	struct dp_soc *soc = pdev->soc;
@@ -1131,7 +1132,7 @@ static void dp_soc_detach_wifi3(void *txrx_soc)
 
 	for (i = 0; i < MAX_PDEV_CNT; i++) {
 		if (soc->pdev_list[i])
-			dp_pdev_detach_wifi3((void *)pdev, 1);
+			dp_pdev_detach_wifi3((struct cdp_pdev *)pdev, 1);
 	}
 
 	dp_peer_find_detach(soc);
@@ -1296,7 +1297,7 @@ static int dp_soc_attach_target_wifi3(struct cdp_soc_t *cdp_soc)
 *
 * Return: DP VDEV handle on success, NULL on failure
 */
-static void *dp_vdev_attach_wifi3(void *txrx_pdev,
+static struct cdp_vdev *dp_vdev_attach_wifi3(struct cdp_pdev *txrx_pdev,
 	uint8_t *vdev_mac_addr, uint8_t vdev_id, enum wlan_op_mode op_mode)
 {
 	struct dp_pdev *pdev = (struct dp_pdev *)txrx_pdev;
@@ -1352,7 +1353,7 @@ static void *dp_vdev_attach_wifi3(void *txrx_pdev,
 	QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
 		"Created vdev %p (%pM)", vdev, vdev->mac_addr.raw);
 
-	return (void *)vdev;
+	return (struct cdp_vdev *)vdev;
 
 fail0:
 	return NULL;
@@ -1366,7 +1367,8 @@ fail0:
  *
  * Return: DP VDEV handle on success, NULL on failure
  */
-static void dp_vdev_register_wifi3(void *vdev_handle, void *osif_vdev,
+static void dp_vdev_register_wifi3(struct cdp_vdev *vdev_handle,
+	void *osif_vdev,
 	struct ol_txrx_ops *txrx_ops)
 {
 	struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle;
@@ -1396,7 +1398,7 @@ static void dp_vdev_register_wifi3(void *vdev_handle, void *osif_vdev,
  * @cb_context:	Callback context
  *
  */
-static void dp_vdev_detach_wifi3(void *vdev_handle,
+static void dp_vdev_detach_wifi3(struct cdp_vdev *vdev_handle,
 	ol_txrx_vdev_delete_cb callback, void *cb_context)
 {
 	struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle;
@@ -1447,7 +1449,8 @@ static void dp_vdev_detach_wifi3(void *vdev_handle,
  *
  * Return: DP peeer handle on success, NULL on failure
  */
-static void *dp_peer_create_wifi3(void *vdev_handle, uint8_t *peer_mac_addr)
+static void *dp_peer_create_wifi3(struct cdp_vdev *vdev_handle,
+		uint8_t *peer_mac_addr)
 {
 	struct dp_peer *peer;
 	int i;
@@ -1527,7 +1530,7 @@ static void *dp_peer_create_wifi3(void *vdev_handle, uint8_t *peer_mac_addr)
  *
  * Return: void
  */
-static void dp_peer_setup_wifi3(void *vdev_hdl, void *peer_hdl)
+static void dp_peer_setup_wifi3(struct cdp_vdev *vdev_hdl, void *peer_hdl)
 {
 	struct dp_peer *peer = (struct dp_peer *)peer_hdl;
 	struct dp_vdev *vdev = (struct dp_vdev *)vdev_hdl;
@@ -1723,9 +1726,9 @@ static void dp_peer_delete_wifi3(void *peer_handle)
  * @peer_handle:		Datapath peer handle
  *
  */
-static uint8 *dp_get_vdev_mac_addr_wifi3(void *pvdev)
+static uint8 *dp_get_vdev_mac_addr_wifi3(struct cdp_vdev *pvdev)
 {
-	struct dp_vdev *vdev = pvdev;
+	struct dp_vdev *vdev = (struct dp_vdev *)pvdev;
 
 	return vdev->mac_addr.raw;
 }
@@ -1735,9 +1738,10 @@ static uint8 *dp_get_vdev_mac_addr_wifi3(void *pvdev)
  * @peer_handle:		Datapath peer handle
  *
  */
-static void *dp_get_vdev_from_vdev_id_wifi3(void *dev, uint8_t vdev_id)
+static struct cdp_vdev *dp_get_vdev_from_vdev_id_wifi3(struct cdp_pdev *dev,
+						uint8_t vdev_id)
 {
-	struct dp_pdev *pdev = dev;
+	struct dp_pdev *pdev = (struct dp_pdev *)dev;
 	struct dp_vdev *vdev = NULL;
 
 	if (qdf_unlikely(!pdev))
@@ -1748,22 +1752,22 @@ static void *dp_get_vdev_from_vdev_id_wifi3(void *dev, uint8_t vdev_id)
 			break;
 	}
 
-	return vdev;
+	return (struct cdp_vdev *)vdev;
 }
 
-static int dp_get_opmode(void *vdev_handle)
+static int dp_get_opmode(struct cdp_vdev *vdev_handle)
 {
-	struct dp_vdev *vdev = vdev_handle;
+	struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle;
 
 	return vdev->opmode;
 }
 
-static void *dp_get_ctrl_pdev_from_vdev_wifi3(void *pvdev)
+static struct cdp_cfg *dp_get_ctrl_pdev_from_vdev_wifi3(struct cdp_vdev *pvdev)
 {
-	struct dp_vdev *vdev = pvdev;
+	struct dp_vdev *vdev = (struct dp_vdev *)pvdev;
 	struct dp_pdev *pdev = vdev->pdev;
 
-	return (void *)pdev->wlan_cfg_ctx;
+	return (struct cdp_cfg *)pdev->wlan_cfg_ctx;
 }
 
 static struct cdp_cmn_ops dp_ops_cmn = {

+ 20 - 16
dp/wifi3.0/dp_peer.c

@@ -27,6 +27,7 @@
 #ifdef CONFIG_MCL
 #include <cds_ieee80211_common.h>
 #endif
+#include <cdp_txrx_handle.h>
 /* Temporary definitions to be moved to wlan_cfg */
 static inline uint32_t wlan_cfg_max_peer_id(void *wlan_cfg_ctx)
 {
@@ -430,10 +431,10 @@ static void dp_rx_tid_update_cb(struct dp_soc *soc, void *cb_ctxt,
  *
  * Return: peer instance pointer
  */
-void *dp_find_peer_by_addr(void *dev, uint8_t *peer_mac_addr,
+void *dp_find_peer_by_addr(struct cdp_pdev *dev, uint8_t *peer_mac_addr,
 		uint8_t *local_id)
 {
-	struct dp_pdev *pdev = dev;
+	struct dp_pdev *pdev = (struct dp_pdev *)dev;
 	struct dp_peer *peer;
 
 #if ATH_SUPPORT_WRAP
@@ -961,13 +962,14 @@ dp_rx_sec_ind_handler(void *soc_handle, uint16_t peer_id,
  * Return: QDF_STATUS_SUCCESS registration success
  *         QDF_STATUS_E_FAULT peer not found
  */
-QDF_STATUS dp_register_peer(void *pdev_handle,
+QDF_STATUS dp_register_peer(struct cdp_pdev *pdev_handle,
 		struct ol_txrx_desc_type *sta_desc)
 {
 	struct dp_peer *peer;
-	struct dp_pdev *pdev = pdev_handle;
+	struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
 
-	peer = dp_peer_find_by_local_id(pdev, sta_desc->sta_id);
+	peer = dp_peer_find_by_local_id((struct cdp_pdev *)pdev,
+			sta_desc->sta_id);
 	if (!peer)
 		return QDF_STATUS_E_FAULT;
 
@@ -988,12 +990,12 @@ QDF_STATUS dp_register_peer(void *pdev_handle,
  * Return: QDF_STATUS_SUCCESS registration success
  *         QDF_STATUS_E_FAULT peer not found
  */
-QDF_STATUS dp_clear_peer(void *pdev_handle, uint8_t local_id)
+QDF_STATUS dp_clear_peer(struct cdp_pdev *pdev_handle, uint8_t local_id)
 {
 	struct dp_peer *peer;
-	struct dp_pdev *pdev = pdev_handle;
+	struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
 
-	peer = dp_peer_find_by_local_id(pdev, local_id);
+	peer = dp_peer_find_by_local_id((struct cdp_pdev *)pdev, local_id);
 	if (!peer)
 		return QDF_STATUS_E_FAULT;
 
@@ -1016,10 +1018,12 @@ QDF_STATUS dp_clear_peer(void *pdev_handle, uint8_t local_id)
  * Return: peer instance void pointer
  *         NULL cannot find target peer
  */
-void *dp_find_peer_by_addr_and_vdev(void *pdev_handle, void *vdev,
+void *dp_find_peer_by_addr_and_vdev(struct cdp_pdev *pdev_handle,
+		struct cdp_vdev *vdev_handle,
 		uint8_t *peer_addr, uint8_t *local_id)
 {
-	struct dp_pdev *pdev = pdev_handle;
+	struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
+	struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle;
 	struct dp_peer *peer;
 
 	DP_TRACE(INFO, "vdev %p peer_addr %p", vdev, peer_addr);
@@ -1066,10 +1070,10 @@ uint16_t dp_local_peer_id(void *peer)
  * Return: peer instance void pointer
  *         NULL cannot find target peer
  */
-void *dp_peer_find_by_local_id(void *pdev_handle, uint8_t local_id)
+void *dp_peer_find_by_local_id(struct cdp_pdev *pdev_handle, uint8_t local_id)
 {
 	struct dp_peer *peer;
-	struct dp_pdev *pdev = pdev_handle;
+	struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
 
 	qdf_spin_lock_bh(&pdev->local_peer_ids.lock);
 	peer = pdev->local_peer_ids.map[local_id];
@@ -1089,11 +1093,11 @@ void *dp_peer_find_by_local_id(void *pdev_handle, uint8_t local_id)
  *
  * Return: QDF_STATUS_SUCCESS registration success
  */
-QDF_STATUS dp_peer_state_update(void *pdev_handle, uint8_t *peer_mac,
+QDF_STATUS dp_peer_state_update(struct cdp_pdev *pdev_handle, uint8_t *peer_mac,
 		enum ol_txrx_peer_state state)
 {
 	struct dp_peer *peer;
-	struct dp_pdev *pdev = pdev_handle;
+	struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
 
 	peer =  dp_peer_find_hash_find(pdev->soc, peer_mac, 0);
 	if (NULL == peer) {
@@ -1140,12 +1144,12 @@ QDF_STATUS dp_get_vdevid(void *peer_handle, uint8_t *vdev_id)
  * Return: virtual interface instance pointer
  *         NULL in case cannot find
  */
-void *dp_get_vdev_for_peer(void *peer_handle)
+struct cdp_vdev *dp_get_vdev_for_peer(void *peer_handle)
 {
 	struct dp_peer *peer = peer_handle;
 
 	DP_TRACE(INFO, "peer %p vdev %p", peer, peer->vdev);
-	return (void *)peer->vdev;
+	return (struct cdp_vdev *)peer->vdev;
 }
 
 /**