Explorar el Código

qcacmn: Add support for full pktlog

1. Enable CE5 and allow it to service
   pktlog messages from the firmware.
2. Register full pktlog callback handlers
   for handling sw_events and full tx pktlog.

Change-Id: Ifb70ac0993f2402201f88758845f730cf677b1a0
CRs-Fixed: 2388906
Venkata Sharath Chandra Manchala hace 6 años
padre
commit
cad74add80

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

@@ -415,7 +415,7 @@ void dp_pkt_log_init(struct cdp_pdev *ppdev, void *scn)
 	}
 
 	pktlog_sethandle(&handle->pl_dev, scn);
-	pktlog_set_callback_regtype(PKTLOG_LITE_CALLBACK_REGISTRATION);
+	pktlog_set_callback_regtype(PKTLOG_DEFAULT_CALLBACK_REGISTRATION);
 
 	if (pktlogmod_init(scn)) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,

+ 11 - 3
dp/wifi3.0/dp_rx_mon_status.c

@@ -518,6 +518,7 @@ dp_rx_mon_status_process_tlv(struct dp_soc *soc, uint32_t mac_id,
 	QDF_STATUS m_copy_status = QDF_STATUS_SUCCESS;
 	struct cdp_pdev_mon_stats *rx_mon_stats;
 	int smart_mesh_status;
+	enum WDI_EVENT pktlog_mode = WDI_NO_VAL;
 
 	ppdu_info = &pdev->ppdu_info;
 	rx_mon_stats = &pdev->rx_mon_stats;
@@ -553,9 +554,16 @@ dp_rx_mon_status_process_tlv(struct dp_soc *soc, uint32_t mac_id,
 			dp_rx_process_peer_based_pktlog(soc, ppdu_info,
 							status_nbuf, mac_id);
 		} else {
-			dp_wdi_event_handler(WDI_EVENT_RX_DESC, soc,
-					     status_nbuf, HTT_INVALID_PEER,
-					     WDI_NO_VAL, mac_id);
+			if (pdev->rx_pktlog_mode == DP_RX_PKTLOG_FULL)
+				pktlog_mode = WDI_EVENT_RX_DESC;
+			else if (pdev->rx_pktlog_mode == DP_RX_PKTLOG_LITE)
+				pktlog_mode = WDI_EVENT_LITE_RX;
+
+			if (pktlog_mode != WDI_NO_VAL)
+				dp_wdi_event_handler(pktlog_mode, soc,
+						     status_nbuf,
+						     HTT_INVALID_PEER,
+						     WDI_NO_VAL, mac_id);
 		}
 
 		/* smart monitor vap and m_copy cannot co-exist */

+ 1 - 5
dp/wifi3.0/dp_wdi_event.c

@@ -137,11 +137,7 @@ dp_wdi_event_handler(
 	 *  Subscribers must do the sanity based on the requirements
 	 */
 	event_index = event - WDI_EVENT_BASE;
-	if (!(txrx_pdev->wdi_event_list[event_index]) &&
-		(event == WDI_EVENT_RX_DESC)) {
-		/* WDI_EVEN_RX_DESC is indicated for RX_LITE also */
-		event_index = WDI_EVENT_LITE_RX - WDI_EVENT_BASE;
-	}
+
 	wdi_sub = txrx_pdev->wdi_event_list[event_index];
 
 	/* Find the subscriber */

+ 1 - 1
hif/src/ce/ce_assignment.h

@@ -905,7 +905,7 @@ static struct CE_attr host_ce_config_wlan_qca6390[] = {
 	{ /* CE4 */ (CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR), 0,
 		CE_HTT_H2T_MSG_SRC_NENTRIES, 256, 0, NULL,},
 	/* target -> host PKTLOG */
-	{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
+	{ /* CE5 */ CE_ATTR_FLAGS, 0, 0, 2048, 512, NULL,},
 	/* Target autonomous HIF_memcpy */
 	{ /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL,},
 	/* ce_diag, the Diagnostic Window */

+ 1 - 0
hif/src/ce/ce_main.c

@@ -578,6 +578,7 @@ static struct service_to_pipe target_service_to_ce_map_qca6390[] = {
 	{ HTC_CTRL_RSVD_SVC, PIPEDIR_IN, 2, },
 	{ HTT_DATA_MSG_SVC, PIPEDIR_OUT, 4, },
 	{ HTT_DATA_MSG_SVC, PIPEDIR_IN, 1, },
+	{ PACKET_LOG_SVC, PIPEDIR_IN, 5, },
 	/* (Additions here) */
 	{ 0, 0, 0, },
 };

+ 39 - 17
utils/pktlog/pktlog_ac.c

@@ -235,7 +235,7 @@ wdi_pktlog_subscribe(struct cdp_pdev *cdp_pdev, int32_t log_state)
 	if ((log_state & ATH_PKTLOG_TX) ||
 	    (log_state  & ATH_PKTLOG_RCFIND) ||
 	    (log_state & ATH_PKTLOG_RCUPDATE) ||
-	    (log_state & ATH_PKTLOG_RX)) {
+	    (log_state & ATH_PKTLOG_SW_EVENT)) {
 		if (cdp_wdi_event_sub(soc,
 				      cdp_pdev,
 				      &PKTLOG_OFFLOAD_SUBSCRIBER,
@@ -246,8 +246,8 @@ wdi_pktlog_subscribe(struct cdp_pdev *cdp_pdev, int32_t log_state)
 
 	if (log_state & ATH_PKTLOG_RX) {
 		if (cdp_wdi_event_sub(soc, cdp_pdev,
-				      &PKTLOG_RX_SUBSCRIBER,
-				      WDI_EVENT_RX_DESC)) {
+					&PKTLOG_RX_SUBSCRIBER,
+					WDI_EVENT_RX_DESC)) {
 			return A_ERROR;
 		}
 	}
@@ -465,7 +465,7 @@ wdi_pktlog_unsubscribe(struct cdp_pdev *pdev, uint32_t log_state)
 	if ((log_state & ATH_PKTLOG_TX) ||
 	    (log_state  & ATH_PKTLOG_RCFIND) ||
 	    (log_state & ATH_PKTLOG_RCUPDATE) ||
-	    (log_state & ATH_PKTLOG_RX)) {
+	    (log_state & ATH_PKTLOG_SW_EVENT)) {
 		if (cdp_wdi_event_unsub(soc,
 					pdev,
 					&PKTLOG_OFFLOAD_SUBSCRIBER,
@@ -557,6 +557,39 @@ int pktlog_disable(struct hif_opaque_softc *scn)
 	return 0;
 }
 
+#ifdef HELIUMPLUS
+/**
+ * pktlog_callback_registration() - Register pktlog handlers based on
+ *                                  on callback type
+ * @callback_type: pktlog full or lite registration
+ *
+ * Return: None
+ */
+static void pktlog_callback_registration(uint8_t callback_type)
+{
+	if (callback_type == PKTLOG_DEFAULT_CALLBACK_REGISTRATION) {
+		PKTLOG_TX_SUBSCRIBER.callback = pktlog_callback;
+		PKTLOG_RX_SUBSCRIBER.callback = pktlog_callback;
+		PKTLOG_RX_REMOTE_SUBSCRIBER.callback = pktlog_callback;
+		PKTLOG_RCFIND_SUBSCRIBER.callback = pktlog_callback;
+		PKTLOG_RCUPDATE_SUBSCRIBER.callback = pktlog_callback;
+		PKTLOG_SW_EVENT_SUBSCRIBER.callback = pktlog_callback;
+	}
+}
+#else
+static void pktlog_callback_registration(uint8_t callback_type)
+{
+	if (callback_type == PKTLOG_DEFAULT_CALLBACK_REGISTRATION) {
+		PKTLOG_RX_SUBSCRIBER.callback = lit_pktlog_callback;
+		PKTLOG_LITE_T2H_SUBSCRIBER.callback = lit_pktlog_callback;
+		PKTLOG_OFFLOAD_SUBSCRIBER.callback = pktlog_callback;
+	} else if (callback_type == PKTLOG_LITE_CALLBACK_REGISTRATION) {
+		PKTLOG_LITE_T2H_SUBSCRIBER.callback = lit_pktlog_callback;
+		PKTLOG_LITE_RX_SUBSCRIBER.callback = lit_pktlog_callback;
+	}
+}
+#endif
+
 void pktlog_init(struct hif_opaque_softc *scn)
 {
 	struct pktlog_dev_t *pl_dev = get_pktlog_handle();
@@ -589,18 +622,7 @@ void pktlog_init(struct hif_opaque_softc *scn)
 	pl_info->start_time_per = 0;
 	pl_dev->vendor_cmd_send = false;
 
-	if (pl_dev->callback_type == PKTLOG_DEFAULT_CALLBACK_REGISTRATION) {
-		PKTLOG_TX_SUBSCRIBER.callback = pktlog_callback;
-		PKTLOG_RX_SUBSCRIBER.callback = pktlog_callback;
-		PKTLOG_RX_REMOTE_SUBSCRIBER.callback = pktlog_callback;
-		PKTLOG_RCFIND_SUBSCRIBER.callback = pktlog_callback;
-		PKTLOG_RCUPDATE_SUBSCRIBER.callback = pktlog_callback;
-		PKTLOG_SW_EVENT_SUBSCRIBER.callback = pktlog_callback;
-	} else if (pl_dev->callback_type == PKTLOG_LITE_CALLBACK_REGISTRATION) {
-		PKTLOG_LITE_T2H_SUBSCRIBER.callback = lit_pktlog_callback;
-		PKTLOG_LITE_RX_SUBSCRIBER.callback = lit_pktlog_callback;
-		PKTLOG_OFFLOAD_SUBSCRIBER.callback = pktlog_callback;
-	}
+	pktlog_callback_registration(pl_dev->callback_type);
 }
 
 static int __pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state,
@@ -764,7 +786,7 @@ int pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state,
 }
 
 #define ONE_MEGABYTE (1024 * 1024)
-#define MAX_ALLOWED_PKTLOG_SIZE (16 * ONE_MEGABYTE)
+#define MAX_ALLOWED_PKTLOG_SIZE (64 * ONE_MEGABYTE)
 
 static int __pktlog_setsize(struct hif_opaque_softc *scn, int32_t size)
 {

+ 1 - 2
utils/pktlog/pktlog_internal.c

@@ -1455,8 +1455,7 @@ process_pktlog_lite(void *context, void *log_data, uint16_t log_type)
 	pl_hdr.timestamp = 0;
 	log_size = pl_hdr.size;
 	rxstat_log.rx_desc = (void *)pktlog_getbuf(pl_dev, pl_info,
-						  log_size, &pl_hdr);
-
+						   log_size, &pl_hdr);
 	if (rxstat_log.rx_desc == NULL) {
 		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_DEBUG,
 			"%s: Rx descriptor is NULL", __func__);