Explorar o código

qcacmn: Add API to return the msdu link descriptor for NSS offload

Add API to return the msdu link descriptor from obtained from NSS back to
host link descriptor pool.

CRs-Fixed: 2178692

Change-Id: Ib4f967ea887e013d6461ba760a45dbda6fd92baa
Aniruddha Paul %!s(int64=7) %!d(string=hai) anos
pai
achega
80f52e70ca
Modificáronse 2 ficheiros con 36 adicións e 7 borrados
  1. 13 1
      dp/wifi3.0/dp_rx.h
  2. 23 6
      dp/wifi3.0/dp_rx_err.c

+ 13 - 1
dp/wifi3.0/dp_rx.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2018 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
@@ -700,6 +700,18 @@ dp_rx_link_desc_return(struct dp_soc *soc, void *ring_desc, uint8_t bm_action);
 QDF_STATUS
 dp_rx_link_desc_buf_return(struct dp_soc *soc, struct dp_srng *dp_rxdma_srng,
 				void *buf_addr_info, uint8_t bm_action);
+/**
+ * dp_rx_link_desc_return_by_addr - Return a MPDU link descriptor to
+ *					(WBM) by address
+ *
+ * @soc: core DP main context
+ * @link_desc_addr: link descriptor addr
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+dp_rx_link_desc_return_by_addr(struct dp_soc *soc, void *link_desc_addr,
+					uint8_t bm_action);
 
 uint32_t
 dp_rxdma_err_process(struct dp_soc *soc, uint32_t mac_id,

+ 23 - 6
dp/wifi3.0/dp_rx_err.c

@@ -127,18 +127,18 @@ static inline bool dp_rx_mcast_echo_check(struct dp_soc *soc,
 }
 
 /**
- * dp_rx_link_desc_return() - Return a MPDU link descriptor to HW
- *			      (WBM), following error handling
+ * dp_rx_link_desc_return_by_addr - Return a MPDU link descriptor to
+ *					(WBM) by address
  *
  * @soc: core DP main context
- * @ring_desc: opaque pointer to the REO error ring descriptor
+ * @link_desc_addr: link descriptor addr
  *
  * Return: QDF_STATUS
  */
 QDF_STATUS
-dp_rx_link_desc_return(struct dp_soc *soc, void *ring_desc, uint8_t bm_action)
+dp_rx_link_desc_return_by_addr(struct dp_soc *soc, void *link_desc_addr,
+					uint8_t bm_action)
 {
-	void *buf_addr_info = HAL_RX_REO_BUF_ADDR_INFO_GET(ring_desc);
 	struct dp_srng *wbm_desc_rel_ring = &soc->wbm_desc_rel_ring;
 	void *wbm_rel_srng = wbm_desc_rel_ring->hal_srng;
 	void *hal_soc = soc->hal_soc;
@@ -168,7 +168,7 @@ dp_rx_link_desc_return(struct dp_soc *soc, void *ring_desc, uint8_t bm_action)
 	if (qdf_likely(src_srng_desc)) {
 		/* Return link descriptor through WBM ring (SW2WBM)*/
 		hal_rx_msdu_link_desc_set(hal_soc,
-				src_srng_desc, buf_addr_info, bm_action);
+				src_srng_desc, link_desc_addr, bm_action);
 		status = QDF_STATUS_SUCCESS;
 	} else {
 		struct hal_srng *srng = (struct hal_srng *)wbm_rel_srng;
@@ -182,6 +182,23 @@ dp_rx_link_desc_return(struct dp_soc *soc, void *ring_desc, uint8_t bm_action)
 done:
 	hal_srng_access_end(hal_soc, wbm_rel_srng);
 	return status;
+
+}
+
+/**
+ * dp_rx_link_desc_return() - Return a MPDU link descriptor to HW
+ *				(WBM), following error handling
+ *
+ * @soc: core DP main context
+ * @ring_desc: opaque pointer to the REO error ring descriptor
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+dp_rx_link_desc_return(struct dp_soc *soc, void *ring_desc, uint8_t bm_action)
+{
+	void *buf_addr_info = HAL_RX_REO_BUF_ADDR_INFO_GET(ring_desc);
+	return dp_rx_link_desc_return_by_addr(soc, buf_addr_info, bm_action);
 }
 
 /**