浏览代码

qcacmn: FR65980: Add HYBRID TX support for pktlog

- A new pktlog mode called "hybrid", is added for QCN9224 only.
- Create WDI event for hybrid mode
- Add dummy APIs for monitor filter setting
- Send WMI_PKTLOG_EVENT_HYBRID_TX to FW for umac TLV subscription

Change-Id: I47f4e14bfc766f29a0ab4a8c07ab19e0d919e66b
CRs-Fixed: 3074184
Adwait Nayak 3 年之前
父节点
当前提交
3664b4c5c2

+ 3 - 0
dp/inc/cdp_txrx_stats_struct.h

@@ -567,6 +567,9 @@ enum WDI_EVENT {
 	WDI_EVENT_RX_CBF,
 	WDI_EVENT_PKT_CAPTURE_PPDU_STATS,
 	WDI_EVENT_HOST_SW_EVENT,
+#ifdef QCA_WIFI_QCN9224
+	WDI_EVENT_HYBRID_TX,
+#endif
 	/* End of new event items */
 	WDI_EVENT_LAST
 };

+ 6 - 0
dp/wifi3.0/monitor/1.0/dp_mon_1.0.c

@@ -3333,6 +3333,12 @@ struct dp_mon_ops monitor_ops_1_0 = {
 		dp_mon_filter_setup_rx_pkt_log_cbf_1_0,
 	.mon_filter_reset_rx_pkt_log_cbf =
 		dp_mon_filter_reset_rx_pktlog_cbf_1_0,
+#ifdef QCA_WIFI_QCN9224
+	.mon_filter_setup_pktlog_hybrid =
+		dp_mon_filter_setup_pktlog_hybrid_1_0,
+	.mon_filter_reset_pktlog_hybrid =
+		dp_mon_filter_reset_pktlog_hybrid_1_0,
+#endif
 #endif
 	.mon_filter_update = dp_mon_filter_update_1_0,
 	.rx_mon_desc_pool_init = dp_rx_pdev_mon_desc_pool_init,

+ 11 - 0
dp/wifi3.0/monitor/1.0/dp_mon_filter_1.0.c

@@ -941,6 +941,17 @@ void dp_mon_filter_reset_rx_pktlog_cbf_1_0(struct dp_pdev *pdev)
 	srng_type = DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS;
 	mon_pdev->filter[mode][srng_type] = filter;
 }
+
+#ifdef QCA_WIFI_QCN9224
+void dp_mon_filter_setup_pktlog_hybrid_1_0(struct dp_pdev *pdev)
+{
+	dp_mon_filter_err("This mode is only supported for QCN9224");
+}
+
+void dp_mon_filter_reset_pktlog_hybrid_1_0(struct dp_pdev *pdev)
+{
+}
+#endif
 #endif /* WDI_EVENT_ENABLE */
 
 #ifdef WLAN_DP_RESET_MON_BUF_RING_FILTER

+ 23 - 0
dp/wifi3.0/monitor/1.0/dp_mon_filter_1.0.h

@@ -198,6 +198,19 @@ void dp_mon_filter_setup_rx_pkt_log_cbf_1_0(struct dp_pdev *pdev);
  * @pdev: DP pdev handle
  */
 void dp_mon_filter_reset_rx_pktlog_cbf_1_0(struct dp_pdev *pdev);
+#ifdef QCA_WIFI_QCN9224
+/**
+ * dp_mon_filter_setup_pktlog_hybrid_1_0() - Setup the pktlog hybrid mode filter
+ * @pdev: DP pdev handle
+ */
+void dp_mon_filter_setup_pktlog_hybrid_1_0(struct dp_pdev *pdev);
+
+/**
+ * dp_mon_filter_reset_pktlog_hybrid_1_0() - Reset pktlog hybrid mode filter
+ * @pdev: DP pdev handle
+ */
+void dp_mon_filter_reset_pktlog_hybrid_1_0(struct dp_pdev *pdev);
+#endif
 #else
 static inline void dp_mon_filter_setup_rx_pkt_log_full_1_0(struct dp_pdev *pdev)
 {
@@ -222,6 +235,16 @@ static inline void dp_mon_filter_setup_rx_pkt_log_cbf_1_0(struct dp_pdev *pdev)
 static inline void dp_mon_filter_reset_rx_pktlog_cbf_1_0(struct dp_pdev *pdev)
 {
 }
+
+#ifdef QCA_WIFI_QCN9224
+static inline void dp_mon_filter_setup_pktlog_hybrid_1_0(struct dp_pdev *pdev)
+{
+}
+
+static inline void dp_mon_filter_reset_pktlog_hybrid_1_0(struct dp_pdev *pdev)
+{
+}
+#endif
 #endif
 
 QDF_STATUS dp_mon_filter_update_1_0(struct dp_pdev *pdev);

+ 4 - 0
dp/wifi3.0/monitor/2.0/dp_mon_2.0.c

@@ -883,6 +883,10 @@ struct dp_mon_ops monitor_ops_2_0 = {
 		dp_mon_filter_setup_rx_pkt_log_cbf_2_0,
 	.mon_filter_reset_rx_pkt_log_cbf =
 		dp_mon_filter_reset_rx_pktlog_cbf_2_0,
+	.mon_filter_setup_pktlog_hybrid =
+		dp_mon_filter_setup_pktlog_hybrid_2_0,
+	.mon_filter_reset_pktlog_hybrid =
+		dp_mon_filter_reset_pktlog_hybrid_2_0,
 #endif
 	.mon_filter_update = dp_mon_filter_update_2_0,
 	.mon_rings_alloc = dp_pdev_mon_rings_alloc_2_0,

+ 8 - 0
dp/wifi3.0/monitor/2.0/dp_mon_filter_2.0.c

@@ -997,6 +997,14 @@ void dp_mon_filter_setup_rx_pkt_log_cbf_2_0(struct dp_pdev *pdev)
 void dp_mon_filter_reset_rx_pktlog_cbf_2_0(struct dp_pdev *pdev)
 {
 }
+
+void dp_mon_filter_setup_pktlog_hybrid_2_0(struct dp_pdev *pdev)
+{
+}
+
+void dp_mon_filter_reset_pktlog_hybrid_2_0(struct dp_pdev *pdev)
+{
+}
 #endif /* WDI_EVENT_ENABLE */
 
 QDF_STATUS dp_mon_filter_update_2_0(struct dp_pdev *pdev)

+ 22 - 0
dp/wifi3.0/monitor/2.0/dp_mon_filter_2.0.h

@@ -204,6 +204,18 @@ void dp_mon_filter_setup_rx_pkt_log_cbf_2_0(struct dp_pdev *pdev);
  * @pdev: DP pdev handle
  */
 void dp_mon_filter_reset_rx_pktlog_cbf_2_0(struct dp_pdev *pdev);
+
+/**
+ * dp_mon_filter_setup_pktlog_hybrid_2_0() - Setup the pktlog hybrid mode filter
+ * @pdev: DP pdev handle
+ */
+void dp_mon_filter_setup_pktlog_hybrid_2_0(struct dp_pdev *pdev);
+
+/**
+ * dp_mon_filter_reset_pktlog_hybrid_2_0() - Reset pktlog hybrid mode filter
+ * @pdev: DP pdev handle
+ */
+void dp_mon_filter_reset_pktlog_hybrid_2_0(struct dp_pdev *pdev);
 #else
 static inline void
 dp_mon_filter_setup_rx_pkt_log_full_2_0(struct dp_pdev *pdev)
@@ -234,6 +246,16 @@ static inline void
 dp_mon_filter_reset_rx_pktlog_cbf_2_0(struct dp_pdev *pdev)
 {
 }
+
+static inline void
+dp_mon_filter_setup_pktlog_hybrid_2_0(struct dp_pdev *pdev)
+{
+}
+
+static inline void
+dp_mon_filter_reset_pktlog_hybrid_2_0(struct dp_pdev *pdev)
+{
+}
 #endif
 
 /**

+ 36 - 0
dp/wifi3.0/monitor/dp_mon.c

@@ -891,6 +891,36 @@ int dp_set_pktlog_wifi3(struct dp_pdev *pdev, uint32_t event,
 			}
 			break;
 
+#ifdef QCA_WIFI_QCN9224
+		case WDI_EVENT_HYBRID_TX:
+			if (mon_pdev->mvdev) {
+				/* Nothing needs to be done if monitor mode is
+				 * enabled
+				 */
+				mon_pdev->pktlog_hybrid_mode = true;
+				return 0;
+			}
+
+			if (!mon_pdev->pktlog_hybrid_mode) {
+				mon_pdev->pktlog_hybrid_mode = true;
+				dp_mon_filter_setup_pktlog_hybrid(pdev);
+				if (dp_mon_filter_update(pdev) !=
+				    QDF_STATUS_SUCCESS) {
+					dp_cdp_err("Set hybrid filters failed");
+					dp_mon_filter_reset_pktlog_hybrid(pdev);
+					mon_pdev->rx_pktlog_mode =
+						DP_RX_PKTLOG_DISABLED;
+					return 0;
+				}
+
+				if (mon_soc->reap_timer_init &&
+				    !dp_mon_is_enable_reap_timer_non_pkt(pdev))
+					qdf_timer_mod(&mon_soc->mon_reap_timer,
+						      DP_INTR_POLL_TIMER_MS);
+			}
+			break;
+#endif
+
 		default:
 			/* Nothing needs to be done for other pktlog types */
 			break;
@@ -963,6 +993,12 @@ int dp_set_pktlog_wifi3(struct dp_pdev *pdev, uint32_t event,
 			mon_pdev->rx_pktlog_cbf = false;
 			break;
 
+#ifdef QCA_WIFI_QCN9224
+		case WDI_EVENT_HYBRID_TX:
+			mon_pdev->pktlog_hybrid_mode = false;
+			break;
+#endif
+
 		default:
 			/* Nothing needs to be done for other pktlog types */
 			break;

+ 8 - 0
dp/wifi3.0/monitor/dp_mon.h

@@ -506,6 +506,10 @@ struct dp_mon_ops {
 	void (*mon_filter_reset_rx_pkt_log_lite)(struct dp_pdev *pdev);
 	void (*mon_filter_setup_rx_pkt_log_cbf)(struct dp_pdev *pdev);
 	void (*mon_filter_reset_rx_pkt_log_cbf)(struct dp_pdev *pdev);
+#ifdef QCA_WIFI_QCN9224
+	void (*mon_filter_setup_pktlog_hybrid)(struct dp_pdev *pdev);
+	void (*mon_filter_reset_pktlog_hybrid)(struct dp_pdev *pdev);
+#endif
 #endif
 	QDF_STATUS (*mon_filter_update)(struct dp_pdev *pdev);
 
@@ -677,6 +681,10 @@ struct  dp_mon_pdev {
 	/* Enable pktlog logging cbf */
 	bool rx_pktlog_cbf;
 
+	/* Enable pktlog logging hybrid */
+#ifdef QCA_WIFI_QCN9224
+	bool pktlog_hybrid_mode;
+#endif
 	bool tx_sniffer_enable;
 	/* mirror copy mode */
 	enum m_copy_mode mcopy_mode;

+ 20 - 0
dp/wifi3.0/monitor/dp_mon_filter.c

@@ -254,6 +254,26 @@ void dp_mon_filter_reset_rx_pktlog_cbf(struct dp_pdev *pdev)
 	if (mon_ops && mon_ops->mon_filter_reset_rx_pkt_log_cbf)
 		mon_ops->mon_filter_reset_rx_pkt_log_cbf(pdev);
 }
+
+#ifdef QCA_WIFI_QCN9224
+void dp_mon_filter_setup_pktlog_hybrid(struct dp_pdev *pdev)
+{
+	struct dp_mon_ops *mon_ops = NULL;
+
+	mon_ops = dp_mon_ops_get(pdev->soc);
+	if (mon_ops && mon_ops->mon_filter_setup_pktlog_hybrid)
+		mon_ops->mon_filter_setup_pktlog_hybrid(pdev);
+}
+
+void dp_mon_filter_reset_pktlog_hybrid(struct dp_pdev *pdev)
+{
+	struct dp_mon_ops *mon_ops = NULL;
+
+	mon_ops = dp_mon_ops_get(pdev->soc);
+	if (mon_ops && mon_ops->mon_filter_reset_pktlog_hybrid)
+		mon_ops->mon_filter_reset_pktlog_hybrid(pdev);
+}
+#endif
 #endif /* WDI_EVENT_ENABLE */
 
 QDF_STATUS dp_mon_filter_update(struct dp_pdev *pdev)

+ 18 - 0
dp/wifi3.0/monitor/dp_mon_filter.h

@@ -80,6 +80,9 @@ enum dp_mon_filter_mode {
 	DP_MON_FILTER_PKT_LOG_FULL_MODE,
 	DP_MON_FILTER_PKT_LOG_LITE_MODE,
 	DP_MON_FILTER_PKT_LOG_CBF_MODE,
+#ifdef QCA_WIFI_QCN9224
+	DP_MON_FILTER_PKT_LOG_HYBRID_MODE,
+#endif
 #endif /* WDI_EVENT_ENABLE */
 	DP_MON_FILTER_MAX_MODE
 };
@@ -220,6 +223,21 @@ void dp_mon_filter_setup_rx_pkt_log_cbf(struct dp_pdev *pdev);
  * @pdev: DP pdev handle
  */
 void dp_mon_filter_reset_rx_pktlog_cbf(struct dp_pdev *pdev);
+
+#ifdef QCA_WIFI_QCN9224
+/**
+ * dp_mon_filter_setup_pktlog_hybrid() - Setup the pktlog hybrid mode filter
+ * in the radio object.
+ * @pdev: DP pdev handle
+ */
+void dp_mon_filter_setup_pktlog_hybrid(struct dp_pdev *pdev);
+
+/**
+ * dp_mon_filter_reset_pktlog_hybrid() - Reset the pktlog hybrid mode filter
+ * @pdev: DP pdev handle
+ */
+void dp_mon_filter_reset_pktlog_hybrid(struct dp_pdev *pdev);
+#endif
 #endif /* WDI_EVENT_ENABLE */
 
 /**

+ 5 - 1
utils/pktlog/pktlog_ac.c

@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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
@@ -56,6 +57,9 @@ wdi_event_subscribe PKTLOG_SW_EVENT_SUBSCRIBER;
 wdi_event_subscribe PKTLOG_LITE_T2H_SUBSCRIBER;
 wdi_event_subscribe PKTLOG_LITE_RX_SUBSCRIBER;
 wdi_event_subscribe PKTLOG_OFFLOAD_SUBSCRIBER;
+#ifdef QCA_WIFI_QCN9224
+wdi_event_subscribe PKTLOG_HYBRID_SUBSCRIBER;
+#endif
 
 struct ol_pl_arch_dep_funcs ol_pl_funcs = {
 	.pktlog_init = pktlog_init,

+ 7 - 0
wmi/inc/wmi_unified_param.h

@@ -6337,6 +6337,9 @@ enum {
 	WMI_HOST_PKTLOG_EVENT_TX_DATA_CAPTURE_BIT,
 	WMI_HOST_PKTLOG_EVENT_PHY_LOGGING_BIT,
 	WMI_HOST_PKTLOG_EVENT_CBF_BIT,
+#ifdef QCA_WIFI_QCN9224
+	WMI_HOST_PKTLOG_EVENT_HYBRID_TX_BIT,
+#endif
 };
 
 typedef enum {
@@ -6363,6 +6366,10 @@ typedef enum {
 		BIT(WMI_HOST_PKTLOG_EVENT_PHY_LOGGING_BIT),
 	WMI_HOST_PKTLOG_EVENT_CBF =
 		BIT(WMI_HOST_PKTLOG_EVENT_CBF_BIT),
+#ifdef QCA_WIFI_QCN9224
+	WMI_HOST_PKTLOG_EVENT_HYBRID_TX =
+		BIT(WMI_HOST_PKTLOG_EVENT_HYBRID_TX_BIT),
+#endif
 } WMI_HOST_PKTLOG_EVENT;
 
 /**

+ 3 - 0
wmi/src/wmi_unified_tlv.c

@@ -563,6 +563,9 @@ static const uint32_t pktlog_event_tlv[] =  {
 	[WMI_HOST_PKTLOG_EVENT_TX_DATA_CAPTURE_BIT] = 0,
 	[WMI_HOST_PKTLOG_EVENT_PHY_LOGGING_BIT] = WMI_PKTLOG_EVENT_PHY,
 	[WMI_HOST_PKTLOG_EVENT_CBF_BIT] = WMI_PKTLOG_EVENT_CBF,
+#ifdef QCA_WIFI_QCN9224
+	[WMI_HOST_PKTLOG_EVENT_HYBRID_TX_BIT] = WMI_PKTLOG_EVENT_HYBRID_TX,
+#endif
 };
 
 /**