Browse Source

qcacmn: Add code to remove void pointer usage

Add code to use cdp_vdev instead of void pointer for
API dp_tx_send_exception and dp_tx_send_mesh

Change-Id: I63ca5a62c2a8cd6feb906181702888814650dfce
CRs-Fixed: 2480836
Akshay Kosigi 5 years ago
parent
commit
c74162c269
6 changed files with 21 additions and 14 deletions
  1. 2 2
      dp/inc/cdp_txrx_cmn_struct.h
  2. 5 0
      dp/wifi3.0/dp_internal.h
  3. 2 2
      dp/wifi3.0/dp_ipa.c
  4. 3 2
      dp/wifi3.0/dp_rx.c
  5. 6 5
      dp/wifi3.0/dp_tx.c
  6. 3 3
      dp/wifi3.0/dp_tx.h

+ 2 - 2
dp/inc/cdp_txrx_cmn_struct.h

@@ -601,7 +601,7 @@ typedef void
  * @data_vdev - handle to the virtual device object
  * @msdu_list - list of network buffers
  */
-typedef qdf_nbuf_t (*ol_txrx_tx_fp)(void *data_vdev,
+typedef qdf_nbuf_t (*ol_txrx_tx_fp)(struct cdp_vdev *data_vdev,
 				    qdf_nbuf_t msdu_list);
 
 /**
@@ -610,7 +610,7 @@ typedef qdf_nbuf_t (*ol_txrx_tx_fp)(void *data_vdev,
  * @msdu_list - list of network buffers
  * @tx_exc_metadata - structure that holds parameters to exception path
  */
-typedef qdf_nbuf_t (*ol_txrx_tx_exc_fp)(void *data_vdev,
+typedef qdf_nbuf_t (*ol_txrx_tx_exc_fp)(struct cdp_vdev *data_vdev,
 					qdf_nbuf_t msdu_list,
 					struct cdp_tx_exception_metadata
 						*tx_exc_metadata);

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

@@ -1318,4 +1318,9 @@ QDF_STATUS dp_tx_add_to_comp_queue(struct dp_soc *soc,
 }
 #endif
 
+static inline
+struct cdp_vdev *dp_vdev_to_cdp_vdev(struct dp_vdev *vdev)
+{
+	return (struct cdp_vdev *)vdev;
+}
 #endif /* #ifndef _DP_INTERNAL_H_ */

+ 2 - 2
dp/wifi3.0/dp_ipa.c

@@ -711,7 +711,7 @@ qdf_nbuf_t dp_tx_send_ipa_data_frame(struct cdp_vdev *vdev, qdf_nbuf_t skb)
 
 	/* Terminate the (single-element) list of tx frames */
 	qdf_nbuf_set_next(skb, NULL);
-	ret = dp_tx_send((struct dp_vdev_t *)vdev, skb);
+	ret = dp_tx_send(vdev, skb);
 	if (ret) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
 			  "%s: Failed to tx", __func__);
@@ -1629,7 +1629,7 @@ static qdf_nbuf_t dp_ipa_intrabss_send(struct dp_pdev *pdev,
 	qdf_mem_zero(nbuf->cb, sizeof(nbuf->cb));
 	len = qdf_nbuf_len(nbuf);
 
-	if (dp_tx_send(vdev, nbuf)) {
+	if (dp_tx_send(dp_vdev_to_cdp_vdev(vdev), nbuf)) {
 		DP_STATS_INC_PKT(vdev_peer, rx.intra_bss.fail, 1, len);
 		return nbuf;
 	}

+ 3 - 2
dp/wifi3.0/dp_rx.c

@@ -444,7 +444,8 @@ dp_rx_intrabss_fwd(struct dp_soc *soc,
 				}
 			}
 
-			if (!dp_tx_send(ta_peer->vdev, nbuf)) {
+			if (!dp_tx_send(dp_vdev_to_cdp_vdev(ta_peer->vdev),
+					nbuf)) {
 				DP_STATS_INC_PKT(ta_peer, rx.intra_bss.pkts, 1,
 						 len);
 				return true;
@@ -473,7 +474,7 @@ dp_rx_intrabss_fwd(struct dp_soc *soc,
 		len = QDF_NBUF_CB_RX_PKT_LEN(nbuf);
 		memset(nbuf_copy->cb, 0x0, sizeof(nbuf_copy->cb));
 
-		if (dp_tx_send(ta_peer->vdev, nbuf_copy)) {
+		if (dp_tx_send(dp_vdev_to_cdp_vdev(ta_peer->vdev), nbuf_copy)) {
 			DP_STATS_INC_PKT(ta_peer, rx.intra_bss.fail, 1, len);
 			tid_stats->fail_cnt[INTRABSS_DROP]++;
 			qdf_nbuf_free(nbuf_copy);

+ 6 - 5
dp/wifi3.0/dp_tx.c

@@ -1910,8 +1910,9 @@ static bool dp_check_exc_metadata(struct cdp_tx_exception_metadata *tx_exc)
  * Return: NULL on success,
  *         nbuf when it fails to send
  */
-qdf_nbuf_t dp_tx_send_exception(void *vap_dev, qdf_nbuf_t nbuf,
-		struct cdp_tx_exception_metadata *tx_exc_metadata)
+qdf_nbuf_t
+dp_tx_send_exception(struct cdp_vdev *vap_dev, qdf_nbuf_t nbuf,
+		     struct cdp_tx_exception_metadata *tx_exc_metadata)
 {
 	qdf_ether_header_t *eh = NULL;
 	struct dp_vdev *vdev = (struct dp_vdev *) vap_dev;
@@ -2016,7 +2017,7 @@ fail:
  *         nbuf when it fails to send
  */
 #ifdef MESH_MODE_SUPPORT
-qdf_nbuf_t dp_tx_send_mesh(void *vap_dev, qdf_nbuf_t nbuf)
+qdf_nbuf_t dp_tx_send_mesh(struct cdp_vdev *vap_dev, qdf_nbuf_t nbuf)
 {
 	struct meta_hdr_s *mhdr;
 	qdf_nbuf_t nbuf_mesh = NULL;
@@ -2075,7 +2076,7 @@ qdf_nbuf_t dp_tx_send_mesh(void *vap_dev, qdf_nbuf_t nbuf)
 
 #else
 
-qdf_nbuf_t dp_tx_send_mesh(void *vap_dev, qdf_nbuf_t nbuf)
+qdf_nbuf_t dp_tx_send_mesh(struct cdp_vdev *vap_dev, qdf_nbuf_t nbuf)
 {
 	return dp_tx_send(vap_dev, nbuf);
 }
@@ -2094,7 +2095,7 @@ qdf_nbuf_t dp_tx_send_mesh(void *vap_dev, qdf_nbuf_t nbuf)
  * Return: NULL on success,
  *         nbuf when it fails to send
  */
-qdf_nbuf_t dp_tx_send(void *vap_dev, qdf_nbuf_t nbuf)
+qdf_nbuf_t dp_tx_send(struct cdp_vdev *vap_dev, qdf_nbuf_t nbuf)
 {
 	qdf_ether_header_t *eh = NULL;
 	struct dp_tx_msdu_info_s msdu_info;

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

@@ -185,10 +185,10 @@ QDF_STATUS dp_tso_soc_detach(void *txrx_soc);
 QDF_STATUS dp_tx_pdev_detach(struct dp_pdev *pdev);
 QDF_STATUS dp_tx_pdev_attach(struct dp_pdev *pdev);
 
-qdf_nbuf_t dp_tx_send(void *data_vdev, qdf_nbuf_t nbuf);
-qdf_nbuf_t dp_tx_send_exception(void *data_vdev, qdf_nbuf_t nbuf,
+qdf_nbuf_t dp_tx_send(struct cdp_vdev *data_vdev, qdf_nbuf_t nbuf);
+qdf_nbuf_t dp_tx_send_exception(struct cdp_vdev *data_vdev, qdf_nbuf_t nbuf,
 				struct cdp_tx_exception_metadata *tx_exc);
-qdf_nbuf_t dp_tx_send_mesh(void *data_vdev, qdf_nbuf_t nbuf);
+qdf_nbuf_t dp_tx_send_mesh(struct cdp_vdev *data_vdev, qdf_nbuf_t nbuf);
 
 #if QDF_LOCK_STATS
 noinline qdf_nbuf_t