ソースを参照

dataipa: renaming spearhead to TLPD

Changing the naming convention from spearhead to tlpd.

Change-Id: I13568df4a01848c212dd22f00298ca4a7b781bff
Signed-off-by: Michael Adisumarta <[email protected]>
Michael Adisumarta 2 年 前
コミット
a1450dfda1

+ 3 - 3
drivers/platform/msm/ipa/ipa_v3/ipa.c

@@ -2,7 +2,7 @@
 /*
  * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
  *
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #include <linux/clk.h>
@@ -8259,8 +8259,8 @@ static int ipa3_post_init(const struct ipa3_plat_drv_res *resource_p,
 	if (ipa3_ctx->gsi_msi_addr)
 		ipa_gsi_map_unmap_gsi_msi_addr(true);
 
-	if(!ipa_spearhead_stats_init())
-		IPADBG("Fail to init spearhead ipa lnx module");
+	if(!ipa_tlpd_stats_init())
+		IPADBG("Fail to init tlpd ipa lnx module");
 
 	pr_info("IPA driver initialization was successful.\n");
 #if IS_ENABLED(CONFIG_QCOM_VA_MINIDUMP)

+ 24 - 75
drivers/platform/msm/ipa/ipa_v3/ipa_stats.c

@@ -2,7 +2,7 @@
 /*
  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
  *
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #include <linux/init.h>
@@ -51,7 +51,7 @@ static struct cdev ipa_lnx_stats_ioctl_cdev;
 static struct class *class;
 static dev_t device;
 
-struct ipa_lnx_stats_spearhead_ctx ipa_lnx_agent_ctx;
+struct ipa_lnx_stats_tlpd_ctx ipa_lnx_agent_ctx;
 static DEFINE_MUTEX(ipa_lnx_ctx_mutex);
 
 struct wlan_intf_mode_cnt {
@@ -126,52 +126,6 @@ static int ipa_stats_ioctl_open(struct inode *inode, struct file *filp)
 	return 0;
 }
 
-static bool ipa_stats_struct_mismatch(void)
-{
-	if (IPA_LNX_EACH_INST_ALLOC_INFO_STRUCT_LEN_INT != IPA_LNX_EACH_INST_ALLOC_INFO_STRUCT_LEN ||
-		IPA_LNX_STATS_ALL_INFO_STRUCT_LEN_INT != IPA_LNX_STATS_ALL_INFO_STRUCT_LEN ||
-		IPA_LNX_STATS_SPEARHEAD_CTX_STRUCT_LEN_INT != IPA_LNX_STATS_SPEARHEAD_CTX_STRUCT_LEN) {
-			IPA_STATS_ERR("IPA_LNX_CMD_GET_ALLOC_INFO structure size mismatch\n");
-			return true;
-	} else if (IPA_LNX_CONSOLIDATED_STATS_STRUCT_LEN_INT != IPA_LNX_CONSOLIDATED_STATS_STRUCT_LEN) {
-			IPA_STATS_ERR("IPA_LNX_CMD_GET_CONSOLIDATED_STATS structure size mismatch\n");
-			return true;
-	} else if (IPA_LNX_PG_RECYCLE_STATS_STRUCT_LEN_INT != IPA_LNX_PG_RECYCLE_STATS_STRUCT_LEN ||
-		IPA_LNX_EXCEPTION_STATS_STRUCT_LEN_INT != IPA_LNX_EXCEPTION_STATS_STRUCT_LEN ||
-		IPA_LNX_ODL_EP_STATS_STRUCT_LEN_INT != IPA_LNX_ODL_EP_STATS_STRUCT_LEN ||
-		IPA_LNX_HOLB_DISCARD_STATS_STRUCT_LEN_INT != IPA_LNX_HOLB_DISCARD_STATS_STRUCT_LEN ||
-		IPA_LNX_HOLB_MONITOR_STATS_STRUCT_LEN_INT != IPA_LNX_HOLB_MONITOR_STATS_STRUCT_LEN ||
-		IPA_LNX_HOLB_DROP_AND_MON_STATS_STRUCT_LEN_INT != IPA_LNX_HOLB_DROP_AND_MON_STATS_STRUCT_LEN ||
-		IPA_LNX_GENERIC_STATS_STRUCT_LEN_INT != IPA_LNX_GENERIC_STATS_STRUCT_LEN) {
-			IPA_STATS_ERR("IPA_LNX_CMD_GENERIC_STATS structure size mismatch\n");
-			return true;
-	} else if (IPA_LNX_PM_CLIENT_STATS_STRUCT_LEN_INT != IPA_LNX_PM_CLIENT_STATS_STRUCT_LEN ||
-		IPA_LNX_CLOCK_STATS_STRUCT_LEN_INT != IPA_LNX_CLOCK_STATS_STRUCT_LEN) {
-			IPA_STATS_ERR("IPA_LNX_CMD_CLOCK_STATS structure size mismatch\n");
-			return true;
-	} else if (IPA_LNX_GSI_RX_DEBUG_STATS_STRUCT_LEN_INT != IPA_LNX_GSI_RX_DEBUG_STATS_STRUCT_LEN ||
-		IPA_LNX_GSI_TX_DEBUG_STATS_STRUCT_LEN_INT != IPA_LNX_GSI_TX_DEBUG_STATS_STRUCT_LEN ||
-		IPA_LNX_GSI_DEBUG_STATS_STRUCT_LEN_INT != IPA_LNX_GSI_DEBUG_STATS_STRUCT_LEN ||
-		IPA_LNX_PIPE_INFO_STATS_STRUCT_LEN_INT != IPA_LNX_PIPE_INFO_STATS_STRUCT_LEN ||
-		IPA_LNX_WLAN_INSTANCE_INFO_STRUCT_LEN_INT != IPA_LNX_WLAN_INSTANCE_INFO_STRUCT_LEN ||
-		IPA_LNX_WLAN_INST_STATS_STRUCT_LEN_INT != IPA_LNX_WLAN_INST_STATS_STRUCT_LEN) {
-			IPA_STATS_ERR("IPA_LNX_CMD_WLAN_INST_STATS structure size mismatch\n");
-			return true;
-	} else if (IPA_LNX_ETH_INSTANCE_INFO_STRUCT_LEN_INT != IPA_LNX_ETH_INSTANCE_INFO_STRUCT_LEN ||
-		IPA_LNX_ETH_INST_STATS_STRUCT_LEN_INT != IPA_LNX_ETH_INST_STATS_STRUCT_LEN) {
-			IPA_STATS_ERR("IPA_LNX_CMD_ETH_INST_STATS structure size mismatch\n");
-			return true;
-	} else if (IPA_LNX_USB_INSTANCE_INFO_STRUCT_LEN_INT != IPA_LNX_USB_INSTANCE_INFO_STRUCT_LEN ||
-		IPA_LNX_USB_INST_STATS_STRUCT_LEN_INT != IPA_LNX_USB_INST_STATS_STRUCT_LEN) {
-			IPA_STATS_ERR("IPA_LNX_CMD_USB_INST_STATS structure size mismatch\n");
-			return true;
-	} else if (IPA_LNX_MHIP_INSTANCE_INFO_STRUCT_LEN_INT != IPA_LNX_MHIP_INSTANCE_INFO_STRUCT_LEN ||
-		IPA_LNX_MHIP_INST_STATS_STRUCT_LEN_INT != IPA_LNX_MHIP_INST_STATS_STRUCT_LEN) {
-			IPA_STATS_ERR("IPA_LNX_CMD_MHIP_INST_STATS structure size mismatch\n");
-			return true;
-	} else return false;
-}
-
 static int ipa_get_generic_stats(unsigned long arg)
 {
 	int res;
@@ -1521,14 +1475,14 @@ static int ipa_stats_get_alloc_info(unsigned long arg)
 	int eth_instance_id;
 
 	if (copy_from_user(&ipa_lnx_agent_ctx, u64_to_user_ptr((u64) arg),
-		sizeof(struct ipa_lnx_stats_spearhead_ctx))) {
+		sizeof(struct ipa_lnx_stats_tlpd_ctx))) {
 		IPA_STATS_ERR("copy from user failed");
 		return -EFAULT;
 	}
 
 	/* For generic stats */
 	if (ipa_lnx_agent_ctx.log_type_mask &
-		SPRHD_IPA_LOG_TYPE_GENERIC_STATS) {
+		TLPD_IPA_LOG_TYPE_GENERIC_STATS) {
 		for (i = 0; i < IPA_CLIENT_MAX; i++) {
 			int ep_idx = ipa_get_ep_mapping(i);
 
@@ -1551,12 +1505,12 @@ static int ipa_stats_get_alloc_info(unsigned long arg)
 	}
 
 	/* For clock stats */
-	if (ipa_lnx_agent_ctx.log_type_mask & SPRHD_IPA_LOG_TYPE_CLOCK_STATS)
+	if (ipa_lnx_agent_ctx.log_type_mask & TLPD_IPA_LOG_TYPE_CLOCK_STATS)
 		ipa_lnx_agent_ctx.alloc_info.num_pm_clients =
 			ipa3_get_max_num_pipes();
 
 	/* For WLAN instance */
-	if (ipa_lnx_agent_ctx.log_type_mask & SPRHD_IPA_LOG_TYPE_WLAN_STATS) {
+	if (ipa_lnx_agent_ctx.log_type_mask & TLPD_IPA_LOG_TYPE_WLAN_STATS) {
 		ipa_ep_idx_tx = ipa_get_ep_mapping(IPA_CLIENT_WLAN2_CONS);
 		ipa_ep_idx_rx = ipa_get_ep_mapping(IPA_CLIENT_WLAN2_PROD);
 		if ((ipa_ep_idx_tx == -1) || (ipa_ep_idx_rx == -1) ||
@@ -1588,7 +1542,7 @@ static int ipa_stats_get_alloc_info(unsigned long arg)
 	}
 
 	/* For ETH instance */
-	if (ipa_lnx_agent_ctx.log_type_mask & SPRHD_IPA_LOG_TYPE_ETH_STATS) {
+	if (ipa_lnx_agent_ctx.log_type_mask & TLPD_IPA_LOG_TYPE_ETH_STATS) {
 		ipa_lnx_agent_ctx.alloc_info.num_eth_instances = 0;
 		for (i = 0; i < IPA_ETH_INST_ID_MAX; i++) {
 			ipa_lnx_agent_ctx.alloc_info.eth_inst_info[i].num_pipes = 0;
@@ -1599,7 +1553,7 @@ static int ipa_stats_get_alloc_info(unsigned long arg)
 				= 0;
 			k = 0;
 			for (j = 0; (j < IPA_ETH_CLIENT_MAX) &&
-				(k < SPEARHEAD_NUM_MAX_TX_INSTANCES); j++) {
+				(k < TLPD_NUM_MAX_TX_INSTANCES); j++) {
 				if (ipa_eth_client_exist(j, i) &&
 					(ipa_lnx_agent_ctx.alloc_info.num_eth_instances < 2)) {
 					eth_instance_id = ipa_lnx_agent_ctx.alloc_info.num_eth_instances;
@@ -1644,13 +1598,13 @@ static int ipa_stats_get_alloc_info(unsigned long arg)
 	}
 
 	/* For USB instance */
-	if (ipa_lnx_agent_ctx.log_type_mask & SPRHD_IPA_LOG_TYPE_USB_STATS) {
+	if (ipa_lnx_agent_ctx.log_type_mask & TLPD_IPA_LOG_TYPE_USB_STATS) {
 		ipa_lnx_agent_ctx.alloc_info.num_usb_instances = 0;
 		index = 0;
 		for (i = 0; (i < IPA_USB_MAX_TETH_PROT_SIZE) &&
-			(index < SPEARHEAD_NUM_MAX_INSTANCES); i++) {
+			(index < TLPD_NUM_MAX_INSTANCES); i++) {
 			if(ipa_usb_is_teth_prot_connected(i)) {
-				if (index == SPEARHEAD_NUM_MAX_INSTANCES) {
+				if (index == TLPD_NUM_MAX_INSTANCES) {
 					IPA_STATS_ERR("USB alloc info max size reached\n");
 					break;
 				}
@@ -1698,7 +1652,7 @@ static int ipa_stats_get_alloc_info(unsigned long arg)
 	}
 
 	/* For MHIP instance */
-	if (ipa_lnx_agent_ctx.log_type_mask & SPRHD_IPA_LOG_TYPE_MHIP_STATS) {
+	if (ipa_lnx_agent_ctx.log_type_mask & TLPD_IPA_LOG_TYPE_MHIP_STATS) {
 #if IS_ENABLED(CONFIG_IPA3_MHI_PRIME_MANAGER)
 		if (!ipa3_ctx->mhip_ctx.dbg_stats.uc_dbg_stats_mmio) {
 			ipa_lnx_agent_ctx.alloc_info.num_mhip_instances = 0;
@@ -1736,13 +1690,13 @@ static int ipa_stats_get_alloc_info(unsigned long arg)
 	}
 
 	/* For Page recycling stats for default, coal and Low lat pipes */
-	if (ipa_lnx_agent_ctx.log_type_mask & SPRHD_IPA_LOG_TYPE_RECYCLE_STATS)
+	if (ipa_lnx_agent_ctx.log_type_mask & TLPD_IPA_LOG_TYPE_RECYCLE_STATS)
 		ipa_lnx_agent_ctx.alloc_info.num_page_rec_interval =
 			IPA_LNX_PIPE_PAGE_RECYCLING_INTERVAL_COUNT;
 
 	if(copy_to_user((u8 *)arg,
 		&ipa_lnx_agent_ctx,
-		sizeof(struct ipa_lnx_stats_spearhead_ctx))) {
+		sizeof(struct ipa_lnx_stats_tlpd_ctx))) {
 		IPA_STATS_ERR("copy to user failed");
 		return -EFAULT;
 	}
@@ -1816,42 +1770,42 @@ static long ipa_lnx_stats_ioctl(struct file *filp,
 			return -ENOMEM;
 		}
 
-		if (consolidated_stats->log_type_mask & SPRHD_IPA_LOG_TYPE_GENERIC_STATS) {
+		if (consolidated_stats->log_type_mask & TLPD_IPA_LOG_TYPE_GENERIC_STATS) {
 			retval = ipa_get_generic_stats((unsigned long) consolidated_stats->generic_stats);
 			if (retval) {
 				IPA_STATS_ERR("ipa get generic stats fail");
 				break;
 			}
 		}
-		if (consolidated_stats->log_type_mask & SPRHD_IPA_LOG_TYPE_CLOCK_STATS) {
+		if (consolidated_stats->log_type_mask & TLPD_IPA_LOG_TYPE_CLOCK_STATS) {
 			retval = ipa_get_clock_stats((unsigned long) consolidated_stats->clock_stats);
 			if (retval) {
 				IPA_STATS_ERR("ipa get clock stats fail");
 				break;
 			}
 		}
-		if (consolidated_stats->log_type_mask & SPRHD_IPA_LOG_TYPE_WLAN_STATS) {
+		if (consolidated_stats->log_type_mask & TLPD_IPA_LOG_TYPE_WLAN_STATS) {
 			retval = ipa_get_wlan_inst_stats((unsigned long) consolidated_stats->wlan_stats);
 			if (retval) {
 				IPA_STATS_ERR("ipa get wlan inst stats fail");
 				break;
 			}
 		}
-		if (consolidated_stats->log_type_mask & SPRHD_IPA_LOG_TYPE_ETH_STATS) {
+		if (consolidated_stats->log_type_mask & TLPD_IPA_LOG_TYPE_ETH_STATS) {
 			retval = ipa_get_eth_inst_stats((unsigned long) consolidated_stats->eth_stats);
 			if (retval) {
 				IPA_STATS_ERR("ipa get eth inst stats fail");
 				break;
 			}
 		}
-		if (consolidated_stats->log_type_mask & SPRHD_IPA_LOG_TYPE_USB_STATS) {
+		if (consolidated_stats->log_type_mask & TLPD_IPA_LOG_TYPE_USB_STATS) {
 			retval = ipa_get_usb_inst_stats((unsigned long) consolidated_stats->usb_stats);
 			if (retval) {
 				IPA_STATS_ERR("ipa get usb inst stats fail");
 				break;
 			}
 		}
-		if (consolidated_stats->log_type_mask & SPRHD_IPA_LOG_TYPE_MHIP_STATS) {
+		if (consolidated_stats->log_type_mask & TLPD_IPA_LOG_TYPE_MHIP_STATS) {
 #if IS_ENABLED(CONFIG_IPA3_MHI_PRIME_MANAGER)
 			retval = ipa_get_mhip_inst_stats((unsigned long) consolidated_stats->mhip_stats);
 			if (retval) {
@@ -1860,7 +1814,7 @@ static long ipa_lnx_stats_ioctl(struct file *filp,
 			}
 #endif
 		}
-		if (consolidated_stats->log_type_mask & SPRHD_IPA_LOG_TYPE_RECYCLE_STATS) {
+		if (consolidated_stats->log_type_mask & TLPD_IPA_LOG_TYPE_RECYCLE_STATS) {
 			retval = ipa_get_page_recycle_stats((unsigned long) consolidated_stats->recycle_stats);
 			if (retval) {
 				IPA_STATS_ERR("ipa get page recycle stats fail\n");
@@ -1882,7 +1836,7 @@ const struct file_operations ipa_stats_fops = {
 	.unlocked_ioctl = ipa_lnx_stats_ioctl,
 };
 
-static int ipa_spearhead_stats_ioctl_init(void)
+static int ipa_tlpd_stats_ioctl_init(void)
 {
 	unsigned int ipa_lnx_stats_ioctl_major = 0;
 	int ret;
@@ -1931,16 +1885,11 @@ dev_alloc_err:
 	return -ENODEV;
 }
 
-int ipa_spearhead_stats_init(void)
+int ipa_tlpd_stats_init(void)
 {
 	int ret;
 
-	if (ipa_stats_struct_mismatch()) {
-		IPA_STATS_ERR("ipa stats structure mismatch\n");
-		return -1;
-	}
-
-	ret = ipa_spearhead_stats_ioctl_init();
+	ret = ipa_tlpd_stats_ioctl_init();
 	if(ret) {
 		IPA_STATS_ERR("IPA_LNX_STATS_IOCTL init failure = %d\n", ret);
 		return -1;

+ 26 - 52
drivers/platform/msm/ipa/ipa_v3/ipa_stats.h

@@ -2,7 +2,7 @@
 /*
  * Copyright (c) 2021, The Linux Foundation. All rights reserved.
  *
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #ifndef _IPA_LNX_STATS_I_H_
@@ -17,7 +17,7 @@
 
 #define IPA_LNX_IOC_GET_ALLOC_INFO _IOWR(IPA_LNX_STATS_IOC_MAGIC, \
 	IPA_LNX_CMD_GET_ALLOC_INFO, \
-	struct ipa_lnx_stats_spearhead_ctx)
+	struct ipa_lnx_stats_tlpd_ctx)
 
 #define IPA_LNX_IOC_GET_GENERIC_STATS _IOWR(IPA_LNX_STATS_IOC_MAGIC, \
 	IPA_LNX_CMD_GENERIC_STATS, \
@@ -45,32 +45,31 @@
 
 #define IPA_LNX_IOC_GET_CONSOLIDATED_STATS _IOWR(IPA_LNX_STATS_IOC_MAGIC, \
 	IPA_LNX_CMD_CONSOLIDATED_STATS, \
-	struct ipa_lnx_consolidated_stats)
+	int)
 
 #define IPA_LNX_STATS_SUCCESS 0
 #define IPA_LNX_STATS_FAILURE -1
 
-#define SPEARHEAD_NUM_MAX_PIPES 6
-#define SPEARHEAD_NUM_MAX_TX_INSTANCES 3
-#define SPEARHEAD_NUM_MAX_RX_INSTANCES 3
+#define TLPD_NUM_MAX_PIPES 6
+#define TLPD_NUM_MAX_TX_INSTANCES 3
+#define TLPD_NUM_MAX_RX_INSTANCES 3
 
-#define SPEARHEAD_NUM_MAX_INSTANCES 2
+#define TLPD_NUM_MAX_INSTANCES 2
 
 #define IPA_LNX_PIPE_PAGE_RECYCLING_INTERVAL_COUNT 5
 #define IPA_LNX_PIPE_PAGE_RECYCLING_INTERVAL_TIME 10 /* In milli second */
 
 /**
  * This is used to indicate which set of logs is enabled from IPA
- * These bitmapped macros are copied from
- * spearhead/inc/spearhead_client.h
+ * These bitmapped macros.
  */
-#define SPRHD_IPA_LOG_TYPE_GENERIC_STATS   0x00001
-#define SPRHD_IPA_LOG_TYPE_CLOCK_STATS     0x00002
-#define SPRHD_IPA_LOG_TYPE_WLAN_STATS      0x00004
-#define SPRHD_IPA_LOG_TYPE_ETH_STATS       0x00008
-#define SPRHD_IPA_LOG_TYPE_USB_STATS       0x00010
-#define SPRHD_IPA_LOG_TYPE_MHIP_STATS      0x00020
-#define SPRHD_IPA_LOG_TYPE_RECYCLE_STATS   0x00040
+#define TLPD_IPA_LOG_TYPE_GENERIC_STATS   0x00001
+#define TLPD_IPA_LOG_TYPE_CLOCK_STATS     0x00002
+#define TLPD_IPA_LOG_TYPE_WLAN_STATS      0x00004
+#define TLPD_IPA_LOG_TYPE_ETH_STATS       0x00008
+#define TLPD_IPA_LOG_TYPE_USB_STATS       0x00010
+#define TLPD_IPA_LOG_TYPE_MHIP_STATS      0x00020
+#define TLPD_IPA_LOG_TYPE_RECYCLE_STATS   0x00040
 
 
 /**
@@ -99,7 +98,7 @@ static struct pm_client_name_lookup client_lookup_table[] = {
  * is structure modification.This is NOT the sizeof(struct) but
  * it is addition of the specified type of variable included
  * inside the structre. Also update the internal structure lengths
- * in ipa_lnx_spearhead_stats.c to overcome backward and forward
+ * in ipa_lnx_tlpd_stats.c to overcome backward and forward
  * compatibility between userspace and driver structures.
  */
 /* IPA Linux generic stats structures */
@@ -109,7 +108,6 @@ struct pg_recycle_stats {
 	uint64_t def_total_repl_buff;
 	uint64_t def_temp_repl_buff;
 };
-#define IPA_LNX_PG_RECYCLE_STATS_STRUCT_LEN_INT 32
 
 struct exception_stats {
 	uint32_t excptn_type_none;
@@ -123,7 +121,6 @@ struct exception_stats {
 	uint32_t excptn_type_ipv6_ct;
 	uint32_t excptn_type_csum;
 };
-#define IPA_LNX_EXCEPTION_STATS_STRUCT_LEN_INT 40
 
 struct odl_ep_stats {
 	uint32_t rx_pkt;
@@ -131,7 +128,6 @@ struct odl_ep_stats {
 	uint32_t dropped_pkt;
 	uint32_t num_queue_pkt;
 };
-#define IPA_LNX_ODL_EP_STATS_STRUCT_LEN_INT 16
 
 struct holb_discard_stats {
 	uint32_t client_type;
@@ -139,7 +135,6 @@ struct holb_discard_stats {
 	uint32_t num_drp_bytes;
 	uint32_t reserved;
 };
-#define IPA_LNX_HOLB_DISCARD_STATS_STRUCT_LEN_INT 16
 
 struct holb_monitor_stats {
 	uint32_t client_type;
@@ -147,7 +142,6 @@ struct holb_monitor_stats {
 	uint32_t num_en_cnt;
 	uint32_t num_dis_cnt;
 };
-#define IPA_LNX_HOLB_MONITOR_STATS_STRUCT_LEN_INT 16
 
 struct holb_drop_and_mon_stats {
 	uint32_t num_holb_disc_pipes;
@@ -155,7 +149,6 @@ struct holb_drop_and_mon_stats {
 	struct holb_discard_stats holb_disc_stats[0];
 	struct holb_monitor_stats holb_mon_stats[0];
 };
-#define IPA_LNX_HOLB_DROP_AND_MON_STATS_STRUCT_LEN_INT (8 + 16 +16)
 
 struct ipa_lnx_generic_stats {
 	uint32_t tx_dma_pkts;
@@ -173,7 +166,6 @@ struct ipa_lnx_generic_stats {
 	struct odl_ep_stats odl_stats;
 	struct holb_drop_and_mon_stats holb_stats;
 };
-#define IPA_LNX_GENERIC_STATS_STRUCT_LEN_INT (40 + 32 + 40 + 16 + 40)
 
 /* IPA Linux clock stats structures */
 struct pm_client_stats {
@@ -184,7 +176,6 @@ struct pm_client_stats {
 	uint32_t pm_client_type;
 	uint32_t reserved;
 };
-#define IPA_LNX_PM_CLIENT_STATS_STRUCT_LEN_INT 24
 
 struct ipa_lnx_clock_stats {
 	uint32_t active_clients;
@@ -195,7 +186,6 @@ struct ipa_lnx_clock_stats {
 	uint32_t curr_clk_vote;
 	struct pm_client_stats pm_clnt_stats[0];
 };
-#define IPA_LNX_CLOCK_STATS_STRUCT_LEN_INT (24 + 24)
 
 /* Generic instance structures */
 struct ipa_lnx_gsi_rx_debug_stats {
@@ -212,7 +202,6 @@ struct ipa_lnx_gsi_rx_debug_stats {
 	uint32_t gsi_debug4;
 	uint32_t rx_summary;
 };
-#define IPA_LNX_GSI_RX_DEBUG_STATS_STRUCT_LEN_INT 48
 
 struct ipa_lnx_gsi_tx_debug_stats {
 	uint32_t tx_client;
@@ -230,7 +219,6 @@ struct ipa_lnx_gsi_tx_debug_stats {
 	uint32_t tx_summary;
 	uint32_t reserved;
 };
-#define IPA_LNX_GSI_TX_DEBUG_STATS_STRUCT_LEN_INT 56
 
 struct ipa_lnx_gsi_debug_stats {
 	uint32_t num_tx_instances;
@@ -238,7 +226,6 @@ struct ipa_lnx_gsi_debug_stats {
 	struct ipa_lnx_gsi_tx_debug_stats gsi_tx_dbg_stats[0];
 	struct ipa_lnx_gsi_rx_debug_stats gsi_rx_dbg_stats[0];
 };
-#define IPA_LNX_GSI_DEBUG_STATS_STRUCT_LEN_INT (8 + 48 + 56)
 
 struct ipa_lnx_pipe_info {
 	uint64_t gsi_chan_ring_bp;
@@ -266,7 +253,6 @@ struct ipa_lnx_pipe_info {
 	uint32_t gsi_poll_mode;
 	uint32_t gsi_db_in_bytes;
 };
-#define IPA_LNX_PIPE_INFO_STATS_STRUCT_LEN_INT 120
 
 /* IPA Linux wlan instance stats structures */
 struct wlan_instance_info {
@@ -281,14 +267,12 @@ struct wlan_instance_info {
 	struct ipa_lnx_gsi_debug_stats gsi_debug_stats;
 	struct ipa_lnx_pipe_info pipe_info[0];
 };
-#define IPA_LNX_WLAN_INSTANCE_INFO_STRUCT_LEN_INT (32 + 112 + 120)
 
 struct ipa_lnx_wlan_inst_stats {
 	uint32_t num_wlan_instance;
 	uint32_t reserved;
 	struct wlan_instance_info instance_info[0];
 };
-#define IPA_LNX_WLAN_INST_STATS_STRUCT_LEN_INT (8 + 264)
 
 /* IPA Linux eth instance stats structures */
 struct eth_instance_info {
@@ -299,14 +283,12 @@ struct eth_instance_info {
 	struct ipa_lnx_gsi_debug_stats gsi_debug_stats;
 	struct ipa_lnx_pipe_info pipe_info[0];
 };
-#define IPA_LNX_ETH_INSTANCE_INFO_STRUCT_LEN_INT (16 + 112 + 120)
 
 struct ipa_lnx_eth_inst_stats {
 	uint32_t num_eth_instance;
 	uint32_t reserved;
 	struct eth_instance_info instance_info[0];
 };
-#define IPA_LNX_ETH_INST_STATS_STRUCT_LEN_INT (8 + 248)
 
 /* IPA Linux usb instance stats structures */
 struct usb_instance_info {
@@ -317,14 +299,12 @@ struct usb_instance_info {
 	struct ipa_lnx_gsi_debug_stats gsi_debug_stats;
 	struct ipa_lnx_pipe_info pipe_info[0];
 };
-#define IPA_LNX_USB_INSTANCE_INFO_STRUCT_LEN_INT (16 + 112 + 120)
 
 struct ipa_lnx_usb_inst_stats {
 	uint32_t num_usb_instance;
 	uint32_t reserved;
 	struct usb_instance_info instance_info[0];
 };
-#define IPA_LNX_USB_INST_STATS_STRUCT_LEN_INT (8 + 248)
 
 /* IPA Linux mhip instance stats structures */
 struct mhip_instance_info {
@@ -335,14 +315,12 @@ struct mhip_instance_info {
 	struct ipa_lnx_gsi_debug_stats gsi_debug_stats;
 	struct ipa_lnx_pipe_info pipe_info[0];
 };
-#define IPA_LNX_MHIP_INSTANCE_INFO_STRUCT_LEN_INT (16 + 112 + 120)
 
 struct ipa_lnx_mhip_inst_stats {
 	uint32_t num_mhip_instance;
 	uint32_t reserved;
 	struct mhip_instance_info instance_info[0];
 };
-#define IPA_LNX_MHIP_INST_STATS_STRUCT_LEN_INT (8 + 248)
 
 struct ipa_lnx_consolidated_stats {
 	uint64_t log_type_mask;
@@ -354,7 +332,6 @@ struct ipa_lnx_consolidated_stats {
 	struct ipa_lnx_mhip_inst_stats *mhip_stats;
 	struct ipa_lnx_pipe_page_recycling_stats *recycle_stats;
 };
-#define IPA_LNX_CONSOLIDATED_STATS_STRUCT_LEN_INT (8 + 48)
 
 enum rx_channel_type {
 	RX_WAN_COALESCING,
@@ -391,15 +368,14 @@ struct ipa_lnx_pipe_page_recycling_stats {
 
 /* Explain below structures */
 struct ipa_lnx_each_inst_alloc_info {
-	uint32_t pipes_client_type[SPEARHEAD_NUM_MAX_PIPES];
-	uint32_t tx_inst_client_type[SPEARHEAD_NUM_MAX_TX_INSTANCES];
-	uint32_t rx_inst_client_type[SPEARHEAD_NUM_MAX_RX_INSTANCES];
+	uint32_t pipes_client_type[TLPD_NUM_MAX_PIPES];
+	uint32_t tx_inst_client_type[TLPD_NUM_MAX_TX_INSTANCES];
+	uint32_t rx_inst_client_type[TLPD_NUM_MAX_RX_INSTANCES];
 	uint32_t num_pipes;
 	uint32_t num_tx_instances;
 	uint32_t num_rx_instances;
 	uint32_t reserved;
 };
-#define IPA_LNX_EACH_INST_ALLOC_INFO_STRUCT_LEN_INT (24 + 12 + 12 + 16)
 
 struct ipa_lnx_stats_alloc_info {
 	uint32_t num_holb_drop_stats_clients;
@@ -410,19 +386,17 @@ struct ipa_lnx_stats_alloc_info {
 	uint32_t num_usb_instances;
 	uint32_t num_mhip_instances;
 	uint32_t num_page_rec_interval;
-	struct ipa_lnx_each_inst_alloc_info wlan_inst_info[SPEARHEAD_NUM_MAX_INSTANCES];
-	struct ipa_lnx_each_inst_alloc_info eth_inst_info[SPEARHEAD_NUM_MAX_INSTANCES];
-	struct ipa_lnx_each_inst_alloc_info usb_inst_info[SPEARHEAD_NUM_MAX_INSTANCES];
-	struct ipa_lnx_each_inst_alloc_info mhip_inst_info[SPEARHEAD_NUM_MAX_INSTANCES];
+	struct ipa_lnx_each_inst_alloc_info wlan_inst_info[TLPD_NUM_MAX_INSTANCES];
+	struct ipa_lnx_each_inst_alloc_info eth_inst_info[TLPD_NUM_MAX_INSTANCES];
+	struct ipa_lnx_each_inst_alloc_info usb_inst_info[TLPD_NUM_MAX_INSTANCES];
+	struct ipa_lnx_each_inst_alloc_info mhip_inst_info[TLPD_NUM_MAX_INSTANCES];
 };
-#define IPA_LNX_STATS_ALL_INFO_STRUCT_LEN_INT (32 + 128 + 128 + 128)
 
-struct ipa_lnx_stats_spearhead_ctx {
-	uint32_t usb_teth_prot[SPEARHEAD_NUM_MAX_INSTANCES];
+struct ipa_lnx_stats_tlpd_ctx {
+	uint32_t usb_teth_prot[TLPD_NUM_MAX_INSTANCES];
 	uint32_t log_type_mask;
 	struct ipa_lnx_stats_alloc_info alloc_info;
 };
-#define IPA_LNX_STATS_SPEARHEAD_CTX_STRUCT_LEN_INT (8 + 4 + 416)
 
 /* enum ipa_lnx_stats_ioc_cmd_type - IOCTL Command types for IPA lnx stats
  *
@@ -439,7 +413,7 @@ enum ipa_lnx_stats_ioc_cmd_type {
 	IPA_LNX_CMD_STATS_MAX,
 };
 
-int ipa_spearhead_stats_init(void);
+int ipa_tlpd_stats_init(void);
 
 /* Peripheral stats for Q6, should be in the same order, defined by Q6 */
 struct ipa_peripheral_mdm_stats {