浏览代码

qcacmn: Remove void ptr usage in DP cal client

Make change to remove void pointer usage in DP cal client
instead use cdp opaque pointers.

Change-Id: Ie966ebb7b6bb937d4ee1d6dce3b040804e61ac37
Crs-Fixed: 2484412
Akshay Kosigi 5 年之前
父节点
当前提交
67c8bb9e06

+ 4 - 3
dp/cmn_dp_api/dp_cal_client_api.c

@@ -27,9 +27,10 @@
  *
  * return: void
  */
-void dp_cal_client_attach(void **cal_client_ctx, void *pdev,
+void dp_cal_client_attach(struct cdp_cal_client **cal_client_ctx,
+			  struct cdp_pdev *pdev,
 			  qdf_device_t osdev,
-			  void (*dp_iterate_peer_list)(void *))
+			  void (*dp_iterate_peer_list)(struct cdp_pdev *))
 {
 	struct cal_client *cal_cl;
 
@@ -54,7 +55,7 @@ qdf_export_symbol(dp_cal_client_attach);
  *
  * return: void
  */
-void dp_cal_client_detach(void **cal_client_ctx)
+void dp_cal_client_detach(struct cdp_cal_client **cal_client_ctx)
 {
 	struct cal_client *cal_cl;
 

+ 4 - 0
dp/inc/cdp_txrx_handle.h

@@ -53,4 +53,8 @@ struct cdp_ctrl_objmgr_vdev;
  */
 struct cdp_ctrl_objmgr_peer;
 
+/**
+ * cdp_cal_client - opaque handle for cal client object
+ */
+struct cdp_cal_client;
 #endif

+ 12 - 9
dp/wifi3.0/dp_cal_client_api.h

@@ -1,5 +1,5 @@
 /*
- * 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
@@ -26,31 +26,34 @@
 #include<cdp_txrx_stats_struct.h>
 #include <qdf_timer.h>
 #include <qdf_mem.h>
+#include <cdp_txrx_handle.h>
 
 /*timer will run every 1 sec*/
 #define DP_CAL_CLIENT_TIME 1000
 
 struct cal_client {
 	qdf_timer_t cal_client_timer;
-	void (*iterate_update_peer_list)(void *ctx);
-	void *pdev_hdl;
+	void (*iterate_update_peer_list)(struct cdp_pdev *ctx);
+	struct cdp_pdev *pdev_hdl;
 };
 
-void dp_cal_client_attach(void **cal_client_ctx, void *pdev, qdf_device_t osdev,
-			  void (*iterate_peer_list)(void *));
-void dp_cal_client_detach(void **cal_client_ctx);
+void dp_cal_client_attach(struct cdp_cal_client **cal_client_ctx,
+			  struct cdp_pdev *pdev, qdf_device_t osdev,
+			  void (*iterate_peer_list)(struct cdp_pdev *));
+void dp_cal_client_detach(struct cdp_cal_client **cal_client_ctx);
 void dp_cal_client_timer_start(void *ctx);
 void dp_cal_client_timer_stop(void *ctx);
 void dp_cal_client_stats_timer_fn(void *pdev_hdl);
 void dp_cal_client_update_peer_stats(struct cdp_peer_stats *peer_stats);
 
 #ifndef ATH_SUPPORT_EXT_STAT
-void dp_cal_client_attach(void **cal_client_ctx, void *pdev, qdf_device_t osdev,
-			  void (*iterate_peer_list)(void *))
+void dp_cal_client_attach(struct cdp_cal_client **cal_client_ctx,
+			  struct cdp_pdev *pdev, qdf_device_t osdev,
+			  void (*iterate_peer_list)(struct cdp_pdev *))
 {
 }
 
-void dp_cal_client_detach(void **cal_client_ctx)
+void dp_cal_client_detach(struct cdp_cal_client **cal_client_ctx)
 {
 }
 

+ 6 - 0
dp/wifi3.0/dp_internal.h

@@ -1328,4 +1328,10 @@ struct cdp_vdev *dp_vdev_to_cdp_vdev(struct dp_vdev *vdev)
 {
 	return (struct cdp_vdev *)vdev;
 }
+
+static inline
+struct cdp_pdev *dp_pdev_to_cdp_pdev(struct dp_pdev *pdev)
+{
+	return (struct cdp_pdev *)pdev;
+}
 #endif /* #ifndef _DP_INTERNAL_H_ */

+ 5 - 3
dp/wifi3.0/dp_main.c

@@ -3321,7 +3321,7 @@ QDF_STATUS dp_mon_rings_setup(struct dp_soc *soc, struct dp_pdev *pdev)
  * @pdev_hdl: pdev handle
  */
 #ifdef ATH_SUPPORT_EXT_STAT
-void  dp_iterate_update_peer_list(void *pdev_hdl)
+void  dp_iterate_update_peer_list(struct cdp_pdev *pdev_hdl)
 {
 	struct dp_pdev *pdev = (struct dp_pdev *)pdev_hdl;
 	struct dp_soc *soc = pdev->soc;
@@ -3339,7 +3339,7 @@ void  dp_iterate_update_peer_list(void *pdev_hdl)
 	qdf_spin_unlock_bh(&soc->peer_ref_mutex);
 }
 #else
-void  dp_iterate_update_peer_list(void *pdev_hdl)
+void  dp_iterate_update_peer_list(struct cdp_pdev *pdev_hdl)
 {
 }
 #endif
@@ -3602,7 +3602,9 @@ static struct cdp_pdev *dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc,
 		qdf_mem_zero(sojourn_buf, sizeof(struct cdp_tx_sojourn_stats));
 	}
 	/* initlialize cal client timer */
-	dp_cal_client_attach(&pdev->cal_client_ctx, pdev, pdev->soc->osdev,
+	dp_cal_client_attach(&pdev->cal_client_ctx,
+			     dp_pdev_to_cdp_pdev(pdev),
+			     pdev->soc->osdev,
 			     &dp_iterate_update_peer_list);
 	qdf_event_create(&pdev->fw_peer_stats_event);
 

+ 1 - 1
dp/wifi3.0/dp_tx.h

@@ -294,7 +294,7 @@ void  dp_send_completion_to_stack(struct dp_soc *soc,  struct dp_pdev *pdev,
 		qdf_nbuf_t netbuf);
 #endif
 
-void  dp_iterate_update_peer_list(void *pdev_hdl);
+void  dp_iterate_update_peer_list(struct cdp_pdev *pdev_hdl);
 
 #ifdef ATH_TX_PRI_OVERRIDE
 #define DP_TX_TID_OVERRIDE(_msdu_info, _nbuf) \

+ 1 - 1
dp/wifi3.0/dp_types.h

@@ -1575,7 +1575,7 @@ struct dp_pdev {
 	 */
 	uint8_t is_primary;
 	/* Context of cal client timer */
-	void *cal_client_ctx;
+	struct cdp_cal_client *cal_client_ctx;
 	struct cdp_tx_sojourn_stats sojourn_stats;
 	qdf_nbuf_t sojourn_buf;