Răsfoiți Sursa

qcacmn: Add API to get TX pending in WoW state

This change is used to provide an API for PMO module to
check whether there are pending TX frames before HOST sends
wake up indication to FW. PMO module uses this to indicate
FW whehter to discard HWDTIM.

Change-Id: Icc3271e87e376e3313fddc5f4f99e39daeaf6af7
CRs-Fixed: 3046947
Yu Tian 3 ani în urmă
părinte
comite
112813c1b7
5 a modificat fișierele cu 22 adăugiri și 0 ștergeri
  1. 15 0
      dp/inc/cdp_txrx_cmn.h
  2. 1 0
      dp/inc/cdp_txrx_ops.h
  3. 1 0
      dp/wifi3.0/dp_main.c
  4. 2 0
      dp/wifi3.0/dp_tx.c
  5. 3 0
      dp/wifi3.0/dp_types.h

+ 15 - 0
dp/inc/cdp_txrx_cmn.h

@@ -2700,4 +2700,19 @@ cdp_set_pkt_capture_mode(ol_txrx_soc_handle soc, bool val)
 {
 }
 #endif
+
+/**
+ * cdp_rx_get_pending() - Get number of pending frames of RX threads
+ * @soc: opaque soc handle
+ * Return: number of pending frames
+ */
+static inline uint32_t
+cdp_get_tx_inqueue(ol_txrx_soc_handle soc)
+{
+	if (!soc || !soc->ol_ops ||
+	    !soc->ol_ops->dp_get_tx_inqueue)
+		return 0;
+
+	return soc->ol_ops->dp_get_tx_inqueue(soc);
+}
 #endif /* _CDP_TXRX_CMN_H_ */

+ 1 - 0
dp/inc/cdp_txrx_ops.h

@@ -1232,6 +1232,7 @@ struct ol_if_ops {
 				   uint32_t service_interval_ul, uint32_t burst_size_ul,
 				   uint8_t add_or_sub, uint8_t ac);
 #endif
+	uint32_t (*dp_get_tx_inqueue)(ol_txrx_soc_handle soc);
 };
 
 #ifdef DP_PEER_EXTENDED_API

+ 1 - 0
dp/wifi3.0/dp_main.c

@@ -11218,6 +11218,7 @@ void dp_flush_ring_hptp(struct dp_soc *soc, hal_ring_handle_t hal_srng)
 		hal_srng_access_end(soc->hal_soc, hal_srng);
 
 		hal_srng_set_flush_last_ts(hal_srng);
+		qdf_atomic_set(&soc->tx_pending_rtpm, 0);
 		dp_debug("flushed");
 	}
 }

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

@@ -1458,6 +1458,7 @@ dp_tx_ring_access_end_wrapper(struct dp_soc *soc,
 		} else {
 			dp_tx_hal_ring_access_end_reap(soc, hal_ring_hdl);
 			hal_srng_set_event(hal_ring_hdl, HAL_SRNG_FLUSH_EVENT);
+			qdf_atomic_inc(&soc->tx_pending_rtpm);
 			hal_srng_inc_flush_cnt(hal_ring_hdl);
 		}
 		dp_runtime_put(soc);
@@ -1466,6 +1467,7 @@ dp_tx_ring_access_end_wrapper(struct dp_soc *soc,
 		dp_runtime_get(soc);
 		dp_tx_hal_ring_access_end_reap(soc, hal_ring_hdl);
 		hal_srng_set_event(hal_ring_hdl, HAL_SRNG_FLUSH_EVENT);
+		qdf_atomic_inc(&soc->tx_pending_rtpm);
 		hal_srng_inc_flush_cnt(hal_ring_hdl);
 		dp_runtime_put(soc);
 	}

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

@@ -2126,6 +2126,9 @@ struct dp_soc {
 #ifdef FEATURE_RUNTIME_PM
 	/* Dp runtime refcount */
 	qdf_atomic_t dp_runtime_refcount;
+
+	/* Dp tx pending count in RTPM */
+	qdf_atomic_t tx_pending_rtpm;
 #endif
 	/* Invalid buffer that allocated for RX buffer */
 	qdf_nbuf_queue_t invalid_buf_queue;