Browse Source

qcacmn: Implement converged packetdump API

Packetdump invokes legacy data path API directly without
considering underlying HW:
1. ol_register_packetdump_callback
2. ol_deregister_packetdump_callback
Global pointer pdev_txrx_ctx will be casted to struct ol_txrx_pdev_t
always even Lithium (use struct dp_pdev) underlying, and overwrite
struct dp_pdev unexpected.

Wrap with cdp API to avoid.

Change-Id: I5c8847ddc51548e8854ba600bec99ce5200dd817
CRs-Fixed: 2366344
Lin Bai 6 years ago
parent
commit
00e8c948c8
1 changed files with 13 additions and 3 deletions
  1. 13 3
      utils/logging/src/wlan_logging_sock_svc.c

+ 13 - 3
utils/logging/src/wlan_logging_sock_svc.c

@@ -32,6 +32,7 @@
 #include "wma.h"
 #include "ol_txrx_api.h"
 #include "pktlog_ac.h"
+#include <cdp_txrx_misc.h>
 #endif
 #include <wlan_logging_sock_svc.h>
 #include <linux/kthread.h>
@@ -1425,8 +1426,13 @@ static void send_packetdump_monitor(uint8_t type)
  */
 void wlan_deregister_txrx_packetdump(void)
 {
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
+
+	if (!soc)
+		return;
+
 	if (gtx_count || grx_count) {
-		ol_deregister_packetdump_callback();
+		cdp_deregister_packetdump_cb(soc);
 		wma_deregister_packetdump_callback();
 		send_packetdump_monitor(STOP_MONITOR);
 		csr_packetdump_timer_stop();
@@ -1527,8 +1533,12 @@ static void rx_packetdump_cb(qdf_nbuf_t netbuf, uint8_t status,
  */
 void wlan_register_txrx_packetdump(void)
 {
-	ol_register_packetdump_callback(tx_packetdump_cb,
-			rx_packetdump_cb);
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
+
+	if (!soc)
+		return;
+
+	cdp_register_packetdump_cb(soc, tx_packetdump_cb, rx_packetdump_cb);
 	wma_register_packetdump_callback(tx_packetdump_cb,
 			rx_packetdump_cb);
 	send_packetdump_monitor(START_MONITOR);