diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_stats.c b/drivers/platform/msm/ipa/ipa_v3/ipa_stats.c index 44274c29a1..155cbdc1e9 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_stats.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_stats.c @@ -120,112 +120,50 @@ static int ipa_stats_ioctl_open(struct inode *inode, struct file *filp) return 0; } -static bool ipa_stats_struct_mismatch(enum ipa_lnx_stats_ioc_cmd_type type) +static bool ipa_stats_struct_mismatch() { - switch (type) { - case IPA_LNX_CMD_GET_ALLOC_INFO: - 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 size mismatch"); - return true; - } else return false; - case IPA_LNX_CMD_GENERIC_STATS: - 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 size mismatch"); - return true; - } else return false; - case IPA_LNX_CMD_CLOCK_STATS: - 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 size mismatch"); - return true; - } else return false; - case IPA_LNX_CMD_WLAN_INST_STATS: - 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 size mismatch"); - return true; - } else return false; - case IPA_LNX_CMD_ETH_INST_STATS: - 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_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 size mismatch"); - return true; - } else return false; - case IPA_LNX_CMD_USB_INST_STATS: - 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_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 ize mismatch"); - return true; - } else return false; - case IPA_LNX_CMD_MHIP_INST_STATS: - 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_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 size mismatch"); - return true; - } else return false; - default: - return true; - } + 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) @@ -1711,6 +1649,10 @@ 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 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; + goto success; + } if (ipa_usb_is_teth_prot_connected(IPA_USB_RNDIS)) ipa_lnx_agent_ctx.usb_teth_prot[0] = IPA_USB_RNDIS; else if(ipa_usb_is_teth_prot_connected(IPA_USB_RMNET)) @@ -1742,6 +1684,7 @@ static int ipa_stats_get_alloc_info(unsigned long arg) #endif } +success: if(copy_to_user((u8 *)arg, &ipa_lnx_agent_ctx, sizeof(struct ipa_lnx_stats_spearhead_ctx))) { @@ -1755,8 +1698,8 @@ static long ipa_lnx_stats_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) { - int retval = 0; - u8 *param = NULL; + int retval = IPA_LNX_STATS_SUCCESS; + struct ipa_lnx_consolidated_stats *consolidated_stats; if (_IOC_TYPE(cmd) != IPA_LNX_STATS_IOC_MAGIC) { IPA_STATS_ERR("IOC type mismatch %d\n", cmd); @@ -1770,79 +1713,100 @@ static long ipa_lnx_stats_ioctl(struct file *filp, switch (cmd) { case IPA_LNX_IOC_GET_ALLOC_INFO: - if (!ipa_stats_struct_mismatch(IPA_LNX_CMD_GET_ALLOC_INFO)) { - retval = ipa_stats_get_alloc_info(arg); - if (retval) { - IPA_STATS_ERR("ipa get alloc info fail"); - break; - } - } - else retval = -EPERM; + retval = ipa_stats_get_alloc_info(arg); + if (retval) + IPA_STATS_ERR("ipa get alloc info fail"); break; case IPA_LNX_IOC_GET_GENERIC_STATS: - if (!ipa_stats_struct_mismatch(IPA_LNX_CMD_GENERIC_STATS)) { - retval = ipa_get_generic_stats(arg); + retval = ipa_get_generic_stats(arg); + if (retval) + IPA_STATS_ERR("ipa get generic stats fail"); + break; + case IPA_LNX_IOC_GET_CLOCK_STATS: + retval = ipa_get_clock_stats(arg); + if (retval) + IPA_STATS_ERR("ipa get clock stats fail"); + break; + case IPA_LNX_IOC_GET_WLAN_INST_STATS: + retval = ipa_get_wlan_inst_stats(arg); + if (retval) + IPA_STATS_ERR("ipa get wlan inst stats fail"); + break; + case IPA_LNX_IOC_GET_ETH_INST_STATS: + retval = ipa_get_eth_inst_stats(arg); + if (retval) + IPA_STATS_ERR("ipa get eth inst stats fail"); + break; + case IPA_LNX_IOC_GET_USB_INST_STATS: + retval = ipa_get_usb_inst_stats(arg); + if (retval) + IPA_STATS_ERR("ipa get usb inst stats fail"); + break; + case IPA_LNX_IOC_GET_MHIP_INST_STATS: +#if IS_ENABLED(CONFIG_IPA3_MHI_PRIME_MANAGER) + retval = ipa_get_mhip_inst_stats(arg); + if (retval) + IPA_STATS_ERR("ipa get mhip inst stats fail"); +#else + retval = IPA_LNX_STATS_SUCCESS; +#endif + break; + case IPA_LNX_IOC_GET_CONSOLIDATED_STATS: + consolidated_stats = (struct ipa_lnx_consolidated_stats *) memdup_user(( + const void __user *)arg, sizeof(struct ipa_lnx_consolidated_stats)); + if (IS_ERR(consolidated_stats)) { + IPA_STATS_ERR("copy from user failed"); + return -ENOMEM; + } + + if (consolidated_stats->log_type_mask & SPRHD_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; } } - else retval = -EPERM; - break; - case IPA_LNX_IOC_GET_CLOCK_STATS: - if (!ipa_stats_struct_mismatch(IPA_LNX_CMD_CLOCK_STATS)) { - retval = ipa_get_clock_stats(arg); + if (consolidated_stats->log_type_mask & SPRHD_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; } - } else retval = -EPERM; - break; - case IPA_LNX_IOC_GET_WLAN_INST_STATS: - if (!ipa_stats_struct_mismatch(IPA_LNX_CMD_WLAN_INST_STATS)) { - retval = ipa_get_wlan_inst_stats(arg); + } + if (consolidated_stats->log_type_mask & SPRHD_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; } - } else retval = -EPERM; - break; - case IPA_LNX_IOC_GET_ETH_INST_STATS: - if (!ipa_stats_struct_mismatch(IPA_LNX_CMD_ETH_INST_STATS)) { - retval = ipa_get_eth_inst_stats(arg); + } + if (consolidated_stats->log_type_mask & SPRHD_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; } - } else retval = -EPERM; - break; - case IPA_LNX_IOC_GET_USB_INST_STATS: - if (!ipa_stats_struct_mismatch(IPA_LNX_CMD_USB_INST_STATS)) { - retval = ipa_get_usb_inst_stats(arg); + } + if (consolidated_stats->log_type_mask & SPRHD_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; } - } else retval = -EPERM; - break; - case IPA_LNX_IOC_GET_MHIP_INST_STATS: + } + if (consolidated_stats->log_type_mask & SPRHD_IPA_LOG_TYPE_MHIP_STATS) { #if IS_ENABLED(CONFIG_IPA3_MHI_PRIME_MANAGER) - if (!ipa_stats_struct_mismatch(IPA_LNX_CMD_MHIP_INST_STATS)) { - retval = ipa_get_mhip_inst_stats(arg); + retval = ipa_get_mhip_inst_stats((unsigned long) consolidated_stats->mhip_stats); if (retval) { IPA_STATS_ERR("ipa get mhip inst stats fail"); break; } - } else retval = -EPERM; -#else - retval = IPA_LNX_STATS_SUCCESS; #endif + } break; default: retval = -ENOTTY; } - if (param) - vfree(param); return retval; } @@ -1906,6 +1870,11 @@ int ipa_spearhead_stats_init() { int ret; + if (ipa_stats_struct_mismatch()) { + IPA_STATS_ERR("ipa stats structure mismatch\n"); + return -1; + } + ret = ipa_spearhead_stats_ioctl_init(); if(ret) { IPA_STATS_ERR("IPA_LNX_STATS_IOCTL init failure = %d\n", ret); diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_stats.h b/drivers/platform/msm/ipa/ipa_v3/ipa_stats.h index d3130d251a..1eefc32a35 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_stats.h +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_stats.h @@ -41,6 +41,10 @@ IPA_LNX_CMD_MHIP_INST_STATS, \ struct ipa_lnx_mhip_inst_stats) +#define IPA_LNX_IOC_GET_CONSOLIDATED_STATS _IOWR(IPA_LNX_STATS_IOC_MAGIC, \ + IPA_LNX_CMD_CONSOLIDATED_STATS, \ + struct ipa_lnx_consolidated_stats) + #define IPA_LNX_STATS_SUCCESS 0 #define IPA_LNX_STATS_FAILURE -1 @@ -334,6 +338,18 @@ struct ipa_lnx_mhip_inst_stats { }; #define IPA_LNX_MHIP_INST_STATS_STRUCT_LEN_INT (8 + 248) + +struct ipa_lnx_consolidated_stats { + uint64_t log_type_mask; + struct ipa_lnx_generic_stats *generic_stats; + struct ipa_lnx_clock_stats *clock_stats; + struct ipa_lnx_wlan_inst_stats *wlan_stats; + struct ipa_lnx_eth_inst_stats *eth_stats; + struct ipa_lnx_usb_inst_stats *usb_stats; + struct ipa_lnx_mhip_inst_stats *mhip_stats; +}; +#define IPA_LNX_CONSOLIDATED_STATS_STRUCT_LEN_INT (8 + 48) + /* Explain below structures */ struct ipa_lnx_each_inst_alloc_info { uint32_t pipes_client_type[SPEARHEAD_NUM_MAX_PIPES]; @@ -374,356 +390,13 @@ struct ipa_lnx_stats_spearhead_ctx { */ enum ipa_lnx_stats_ioc_cmd_type { IPA_LNX_CMD_GET_ALLOC_INFO, - /** - * IPA_LNX_CMD_GENERIC_STATS - Includes following fields (in bytes) - * (min - 296 bytes, max - 300 bytes) - * - * tx_dma_pkts(4) - Packets sent to IPA with IP_PACKET_INIT command - * tx_hw_pkts(4) - Packets sent to IPA without PACKET_INIT. - * These packets go through IPA HW processing - * tx_non_linear(4) - Non linear TX packets - * tx_pkts_compl(4) - No of TX packets processed by IPA - * stats_compl(4) - No of TX commands and LAN packets processed by IPA - * active_eps(4) - No of active end points - * wan_rx_empty(4) - No of times WAN_CONS/COAL pipes have buffers less than threshold of 32 - * wan_repl_rx_empty(4) - No of times there are no pages in temp cache for WAN pipe - * lan_rx_empty(4) - No of times LAN_CONS pipe has buffers less than threshold of 32 - * lan_repl_rx_empty(4) - No of times LAN_CONS pipe has replinished buffers - * pg_recycle_stats(32) - Page recycling stats - * |______ coal_total_repl_buff(8) - Total no of buffers replenished for coal pipe - * coal_temp_repl_buff(8) - Total no of buffers replenished from temp cache - * def_total_repl_buff(8) - Total no of buffers replenished for default pipe - * def_temp_repl_buff(8) - Total no of buffers replenished from temp cache - * exception_stats(40) - Exception path stats - * |______ excptn_type_none(4) - No of packets with exception type as None - * excptn_type_deaggr(4)- No of packets with exception type as deaggr - * excptn_type_iptype(4)- No of packets with exception type as IP type - * excptn_type_pkt_len(4)- No of packets with exception type as packet length - * excptn_type_pkt_thrshld(4)- No of packets with exception type as packet threshold - * excptn_type_frag_rule_miss(4)- No of packets with exception type as frag rule - * excptn_type_sw_flt(4)- No of packets with exception type as sw filter - * excptn_type_nat(4)- No of packets with exception type as NAT - * excptn_type_ipv6_ct(4)- No of packets with exception type as IPv6 CT - * excptn_type_csum(4)- No of packets with exception type as checksum - * odl_stats(16) - ODL stats - * |______ rx_pkt(4) - Total no of packets received - * processed_pkt(4)- Total no of processed packets - * dropped_pkt(4) - Total no of dropped packets - * num_queue_pkt(4)- Total no of packets in queue - * holb_stats(168+) - HOLB stats - * |______ num_pipes(4) - Total num of pipes for which HOLB is enabled(currently 5) - * |______ num_holb_mon_clients(4) - Total num of pipes for which HOLB is enabled(currently 5) - * |______ holb_discard_stats(80) - HOLB Discard Stats - * | |______ client_type(4) - IPA Client type - * | num_drp_cnt(4) - Total number of dropped pkts - * | num_drp_bytes(4)- Total number of dropped bytes - * | reserved(4) - Reserved. - * |______ holb_monitor_stats(80) - No of clients for which HOLB monitrng is enabled(currently 5) - * |______ client_type(4) - IPA Client type - * curr_index(4) - Current HOLB monitoring index - * num_en_cnt(4) - Number of times peripheral went to bad state - * num_dis_cnt(4) - Number of times peripheral was recovered - */ IPA_LNX_CMD_GENERIC_STATS, - /** - * IPA_LNX_CMD_CLOCK_STATS - Includes following fields (in bytes) - * (min - 888 bytes, max - 900 bytes) - * - * active_clients(4) - No of active clock votes - * scale_thresh_svs(4) - BW threshold value to be met for voting for SVS - * scale_thresh_nom(4) - BW threshold value to be met for voting for nominal - * scale_thresh_tur(4) - BW threshold value to be met for voting for turbo - * aggr_bw(4) - Total BW required from the clients for caculating the vote. - * curr_clk_vote(4) - Current active clock vote - * pm_client_stats(864+) - Power Management stats (36 clients) - * |______ pm_client_state(4) - State of the PM client - * pm_client_group(4) - Group of the PM client - * pm_client_bw(4) - BW requested by PM client - * pm_client_hdl(4) - PM Client hdl - * pm_client_type(4) - Client type of the PM client - * reserved(4) - Reserved. - */ IPA_LNX_CMD_CLOCK_STATS, - /** - * IPA_LNX_CMD_WLAN_INST_STATS - Includes following fields (in bytes) - * (min - 558 bytes, max - 600 bytes) - * - * num_wlan_instance(4) - No of WLAN attaches - * reserved(4) - Reserved. - * wlan_instance_info(550) - Each WLAN Instance Info - * |______ instance_id(4) - Instance id of the WLAN - * | wdi_ver(4) - WDI version in use - * | wlan_mode(4) - Indicates the WLAN mode - * | wdi_over_gsi(4) - Indicates whether communication is over GSI or uC - * | dbs_mode(4) - Indicates whether DBS mode is enabled - * | pm_bandwidth(4) - Bandwidth voted by the client - * | num_pipes(4) - Number of pipes associated with WLAN - * | reserved(4) - Reserved. - * |______ pipe_info(360) - Pipe Information (120 x 3 pipes) - * | |______ gsi_chan_ring_bp(8) - Gsi channel ring base pointer address - * | gsi_chan_ring_rp(8) - Transfer Ring Current read pointer address - * | gsi_chan_ring_wp(8) - Transfer Ring Current write pointer address - * | gsi_evt_ring_bp(8) - Event ring base pointer address - * | gsi_evt_ring_rp(8) - Event Ring Current read pointer address - * | gsi_evt_ring_wp(8) - Event Ring Current write pointer address - * | gsi_evt_ring_len(4) - Transfer Ring length - * | gsi_chan_ring_len(4)- Transfer Ring length - * | buff_size(4) - Size of buffer - * | num_free_buff(4)- Number of free credits with HW - * | gsi_ipa_if_tlv(4) - Number of IPA_IF TLV - * | gsi_ipa_if_aos(4) - Number of IPA_IF AOS - * | gsi_desc_size(4) - Descriptor Size - * | pipe_num(4) - Pipe number of the client - * | direction(4) - Pipe direction(0 – IPA Consumer, 1 – IPA Producer) - * | client_type(4) - Client type - * | gsi_chan_num(4) - GSI channel number associated with Pipe - * | gsi_evt_num(4) - GSI event number associated with Pipe - * | is_common_evt_ring(4)- Indicates whether common evt ring is used - * | gsi_prot_type(4)- GSI Protocol type - * | gsi_chan_state(4)-GSI Channel state - * | gsi_chan_stop_stm(4)- GSI channel stop state machine - * | gsi_poll_mode(4)- GSI Current Mode:- Polling/Interrupt - * | gsi_db_in_bytes(4) - Indicates whether DB in bytes - * |______ gsi_debug_stats(158)- GSI debug information - * |______ num_tx_instances(4) - Number of tx instances - * |______ num_rx_instances(4) - Number of rx instances - * |______ gsi_tx_debug_stats(102)- GSI TX Debug Stats Info (2 X 56) - * | |______ tx_client(4) - TX client type - * | num_tx_ring_100_perc_with_cred(4) - Total number of times the ring is full of free credits - * | num_tx_ring_0_perc_with_cred(4) - Total number of times the ring has empty credits - * | num_tx_ring_above_75_perc_cred(4) - Total number of times ring has > 75% free credits - * | num_tx_ring_above_25_perc_cred(4) - Total number of times ring has < 25% of free credits - * | num_tx_ring_stats_polled(4) - Total number of times TX ring stats are counted - * | num_tx_oob(4) - Number of times GSI encountered OOB - * | num_tx_oob_time(4) - Total time GSI was in OOB state i.e no credits available - * | gsi_debug1(4) - Additional GSI Debug information - * | gsi_debug2(4) - Additional GSI Debug information - * | gsi_debug3(4) - Additional GSI Debug information - * | gsi_debug4(4) - Additional GSI Debug information - * | tx_summary(4) - 1 – Peripheral is bad in replenishing credits, 2 – IPA is not giving packets fast enough - * | reserved(4) - Reserved. - * |______ gsi_rx_debug_stats(48)- GSI RX Debug Stats Info (1 X 48) - * |______ rx_client(4) - RX client type - * num_rx_ring_100_perc_with_pack(4) - Total number of times the ring is full of packets - * num_rx_ring_0_perc_with_pack(4) - Total number of times the ring has 0 packets - * num_rx_ring_above_75_perc_pack(4) - Total number of times ring has > 75% packets - * num_rx_ring_above_25_perc_pack(4) - Total number of times ring has < 25% packets - * num_rx_ring_stats_polled(4) - Total number of times RX ring stats are counted - * num_rx_drop_stats(4) - Total number of times GSI dropped packets - * gsi_debug1(4) - Additional GSI Debug information - * gsi_debug2(4) - Additional GSI Debug information - * gsi_debug3(4) - Additional GSI Debug information - * gsi_debug4(4) - Additional GSI Debug information - * rx_summary(4) - 1 – Peripheral is bad in providing packets, 2 – IPA is not processing packets fast enough - */ IPA_LNX_CMD_WLAN_INST_STATS, - /** - * IPA_LNX_CMD_ETH_INST_STATS - Includes following fields (in bytes) - * (min - 724 bytes, max - 800 bytes) - * - * num_eth_instance(4) - No of ETH attaches - * reserved(4) - Reserved. - * eth_instance_info(716) - Each ETH Instance Info (358 x 2) - * |______ instance_id(4) - Instance id of the ETH - * | eth_mode(4) - Ethernet mode - * | pm_bandwidth(4) - Bandwidth voted by the client - * | num_pipes(4) - Number of pipes associated with ETH - * |______ pipe_info(240) - Pipe Information (120 x 2 pipes) - * | |______ gsi_chan_ring_bp(8) - Gsi channel ring base pointer address - * | gsi_chan_ring_rp(8) - Transfer Ring Current read pointer address - * | gsi_chan_ring_wp(8) - Transfer Ring Current write pointer address - * | gsi_evt_ring_bp(8) - Event ring base pointer address - * | gsi_evt_ring_rp(8) - Event Ring Current read pointer address - * | gsi_evt_ring_wp(8) - Event Ring Current write pointer address - * | gsi_evt_ring_len(4) - Transfer Ring length - * | gsi_chan_ring_len(4)- Transfer Ring length - * | buff_size(4) - Size of buffer - * | num_free_buff(4)- Number of free credits with HW - * | gsi_ipa_if_tlv(4) - Number of IPA_IF TLV - * | gsi_ipa_if_aos(4) - Number of IPA_IF AOS - * | gsi_desc_size(4) - Descriptor Size - * | pipe_num(4) - Pipe number of the client - * | direction(4) - Pipe direction(0 – IPA Consumer, 1 – IPA Producer) - * | client_type(4) - Client type - * | gsi_chan_num(4) - GSI channel number associated with Pipe - * | gsi_evt_num(4) - GSI event number associated with Pipe - * | is_common_evt_ring(4)- Indicates whether common evt ring is used - * | gsi_prot_type(4)- GSI Protocol type - * | gsi_chan_state(4)-GSI Channel state - * | gsi_chan_stop_stm(4)- GSI channel stop state machine - * | gsi_poll_mode(4)- GSI Current Mode:- Polling/Interrupt - * | gsi_db_in_bytes(4) - Indicates whether DB in bytes - * |______ gsi_debug_stats(102)- GSI debug information - * |______ num_tx_instances(4) - Number of tx instances - * |______ num_rx_instances(4) - Number of rx instances - * |______ gsi_tx_debug_stats(56)- GSI TX Debug Stats Info (1 X 56) - * | |______ tx_client(4) - TX client type - * | num_tx_ring_100_perc_with_cred(4) - Total number of times the ring is full of free credits - * | num_tx_ring_0_perc_with_cred(4) - Total number of times the ring has empty credits - * | num_tx_ring_above_75_perc_cred(4) - Total number of times ring has > 75% free credits - * | num_tx_ring_above_25_perc_cred(4) - Total number of times ring has < 25% of free credits - * | num_tx_ring_stats_polled(4) - Total number of times TX ring stats are counted - * | num_tx_oob(4) - Number of times GSI encountered OOB - * | num_tx_oob_time(4) - Total time GSI was in OOB state i.e no credits available - * | gsi_debug1(4) - Additional GSI Debug information - * | gsi_debug2(4) - Additional GSI Debug information - * | gsi_debug3(4) - Additional GSI Debug information - * | gsi_debug4(4) - Additional GSI Debug information - * | tx_summary(4) - 1 – Peripheral is bad in replenishing credits, 2 – IPA is not giving packets fast enough - * | reserved(4) - Reserved. - * |______ gsi_rx_debug_stats(48)- GSI RX Debug Stats Info (1 X 48) - * |______ rx_client(4) - RX client type - * num_rx_ring_100_perc_with_pack(4) - Total number of times the ring is full of packets - * num_rx_ring_0_perc_with_pack(4) - Total number of times the ring has 0 packets - * num_rx_ring_above_75_perc_pack(4) - Total number of times ring has > 75% packets - * num_rx_ring_above_25_perc_pack(4) - Total number of times ring has < 25% packets - * num_rx_ring_stats_polled(4) - Total number of times RX ring stats are counted - * num_rx_drop_stats(4) - Total number of times GSI dropped packets - * gsi_debug1(4) - Additional GSI Debug information - * gsi_debug2(4) - Additional GSI Debug information - * gsi_debug3(4) - Additional GSI Debug information - * gsi_debug4(4) - Additional GSI Debug information - * rx_summary(4) - 1 – Peripheral is bad in providing packets, 2 – IPA is not processing packets fast enough - */ IPA_LNX_CMD_ETH_INST_STATS, - /** - * IPA_LNX_CMD_USB_INST_STATS - Includes following fields (in bytes) - * (min - 366 bytes, max - 400 bytes) - * - * num_usb_instance(4) - No of USB attaches - * reserved(4) - Reserved. - * usb_instance_info(358) - Each USB Instance Info - * |______ instance_id(4) - Instance id of the USB - * | usb_mode(4) - USB mode - * | pm_bandwidth(4) - Bandwidth voted by the client - * | num_pipes(4) - Number of pipes associated with USB - * |______ pipe_info(240) - Pipe Information (120 x 2 pipes) - * | |______ gsi_chan_ring_bp(8) - Gsi channel ring base pointer address - * | gsi_chan_ring_rp(8) - Transfer Ring Current read pointer address - * | gsi_chan_ring_wp(8) - Transfer Ring Current write pointer address - * | gsi_evt_ring_bp(8) - Event ring base pointer address - * | gsi_evt_ring_rp(8) - Event Ring Current read pointer address - * | gsi_evt_ring_wp(8) - Event Ring Current write pointer address - * | gsi_evt_ring_len(4) - Transfer Ring length - * | gsi_chan_ring_len(4)- Transfer Ring length - * | buff_size(4) - Size of buffer - * | num_free_buff(4)- Number of free credits with HW - * | gsi_ipa_if_tlv(4) - Number of IPA_IF TLV - * | gsi_ipa_if_aos(4) - Number of IPA_IF AOS - * | gsi_desc_size(4) - Descriptor Size - * | pipe_num(4) - Pipe number of the client - * | direction(4) - Pipe direction(0 – IPA Consumer, 1 – IPA Producer) - * | client_type(4) - Client type - * | gsi_chan_num(4) - GSI channel number associated with Pipe - * | gsi_evt_num(4) - GSI event number associated with Pipe - * | is_common_evt_ring(4)- Indicates whether common evt ring is used - * | gsi_prot_type(4)- GSI Protocol type - * | gsi_chan_state(4)-GSI Channel state - * | gsi_chan_stop_stm(4)- GSI channel stop state machine - * | gsi_poll_mode(4)- GSI Current Mode:- Polling/Interrupt - * | gsi_db_in_bytes(4) - Indicates whether DB in bytes - * |______ gsi_debug_stats(102)- GSI debug information - * |______ num_tx_instances(4) - Number of tx instances - * |______ num_rx_instances(4) - Number of rx instances - * |______ gsi_tx_debug_stats(56)- GSI TX Debug Stats Info (1 X 56) - * | |______ tx_client(4) - TX client type - * | num_tx_ring_100_perc_with_cred(4) - Total number of times the ring is full of free credits - * | num_tx_ring_0_perc_with_cred(4) - Total number of times the ring has empty credits - * | num_tx_ring_above_75_perc_cred(4) - Total number of times ring has > 75% free credits - * | num_tx_ring_above_25_perc_cred(4) - Total number of times ring has < 25% of free credits - * | num_tx_ring_stats_polled(4) - Total number of times TX ring stats are counted - * | num_tx_oob(4) - Number of times GSI encountered OOB - * | num_tx_oob_time(4) - Total time GSI was in OOB state i.e no credits available - * | gsi_debug1(4) - Additional GSI Debug information - * | gsi_debug2(4) - Additional GSI Debug information - * | gsi_debug3(4) - Additional GSI Debug information - * | gsi_debug4(4) - Additional GSI Debug information - * | tx_summary(4) - 1 – Peripheral is bad in replenishing credits, 2 – IPA is not giving packets fast enough - * | reserved(4) - Reserved. - * |______ gsi_rx_debug_stats(48)- GSI RX Debug Stats Info (1 X 48) - * |______ rx_client(4) - RX client type - * num_rx_ring_100_perc_with_pack(4) - Total number of times the ring is full of packets - * num_rx_ring_0_perc_with_pack(4) - Total number of times the ring has 0 packets - * num_rx_ring_above_75_perc_pack(4) - Total number of times ring has > 75% packets - * num_rx_ring_above_25_perc_pack(4) - Total number of times ring has < 25% packets - * num_rx_ring_stats_polled(4) - Total number of times RX ring stats are counted - * num_rx_drop_stats(4) - Total number of times GSI dropped packets - * gsi_debug1(4) - Additional GSI Debug information - * gsi_debug2(4) - Additional GSI Debug information - * gsi_debug3(4) - Additional GSI Debug information - * gsi_debug4(4) - Additional GSI Debug information - * rx_summary(4) - 1 – Peripheral is bad in providing packets, 2 – IPA is not processing packets fast enough - */ IPA_LNX_CMD_USB_INST_STATS, - /** - * IPA_LNX_CMD_MHIP_INST_STATS - Includes following fields (in bytes) - * (min - 710 bytes, max - 800 bytes) - * - * num_mhip_instance(4) - No of MHIP attaches - * reserved(4) - Reserved. - * mhip_instance_info(702) - Each MHIP Instance Info - * |______ instance_id(4) - Instance id of the MHIP - * | mhip_mode(4) - MHIP mode - * | pm_bandwidth(4) - Bandwidth voted by the client - * | num_pipes(4) - Number of pipes associated with USB - * |______ pipe_info(480) - Pipe Information (120 x 4 pipes) - * | |______ gsi_chan_ring_bp(8) - Gsi channel ring base pointer address - * | gsi_chan_ring_rp(8) - Transfer Ring Current read pointer address - * | gsi_chan_ring_wp(8) - Transfer Ring Current write pointer address - * | gsi_evt_ring_bp(8) - Event ring base pointer address - * | gsi_evt_ring_rp(8) - Event Ring Current read pointer address - * | gsi_evt_ring_wp(8) - Event Ring Current write pointer address - * | gsi_evt_ring_len(4) - Transfer Ring length - * | gsi_chan_ring_len(4)- Transfer Ring length - * | buff_size(4) - Size of buffer - * | num_free_buff(4)- Number of free credits with HW - * | gsi_ipa_if_tlv(4) - Number of IPA_IF TLV - * | gsi_ipa_if_aos(4) - Number of IPA_IF AOS - * | gsi_desc_size(4) - Descriptor Size - * | pipe_num(4) - Pipe number of the client - * | direction(4) - Pipe direction(0 – IPA Consumer, 1 – IPA Producer) - * | client_type(4) - Client type - * | gsi_chan_num(4) - GSI channel number associated with Pipe - * | gsi_evt_num(4) - GSI event number associated with Pipe - * | is_common_evt_ring(4)- Indicates whether common evt ring is used - * | gsi_prot_type(4)- GSI Protocol type - * | gsi_chan_state(4)-GSI Channel state - * | gsi_chan_stop_stm(4)- GSI channel stop state machine - * | gsi_poll_mode(4)- GSI Current Mode:- Polling/Interrupt - * | gsi_db_in_bytes(4) - Indicates whether DB in bytes - * |______ gsi_debug_stats(206)- GSI debug information - * |______ num_tx_instances(4) - Number of tx instances - * |______ num_rx_instances(4) - Number of rx instances - * |______ gsi_tx_debug_stats(102)- GSI TX Debug Stats Info (2 X 56) - * | |______ tx_client(4) - TX client type - * | num_tx_ring_100_perc_with_cred(4) - Total number of times the ring is full of free credits - * | num_tx_ring_0_perc_with_cred(4) - Total number of times the ring has empty credits - * | num_tx_ring_above_75_perc_cred(4) - Total number of times ring has > 75% free credits - * | num_tx_ring_above_25_perc_cred(4) - Total number of times ring has < 25% of free credits - * | num_tx_ring_stats_polled(4) - Total number of times TX ring stats are counted - * | num_tx_oob(4) - Number of times GSI encountered OOB - * | num_tx_oob_time(4) - Total time GSI was in OOB state i.e no credits available - * | gsi_debug1(4) - Additional GSI Debug information - * | gsi_debug2(4) - Additional GSI Debug information - * | gsi_debug3(4) - Additional GSI Debug information - * | gsi_debug4(4) - Additional GSI Debug information - * | tx_summary(4) - 1 – Peripheral is bad in replenishing credits, 2 – IPA is not giving packets fast enough - * | reserved(4) - Reserved. - * |______ gsi_rx_debug_stats(96)- GSI RX Debug Stats Info (2 X 48) - * |______ rx_client(4) - RX client type - * num_rx_ring_100_perc_with_pack(4) - Total number of times the ring is full of packets - * num_rx_ring_0_perc_with_pack(4) - Total number of times the ring has 0 packets - * num_rx_ring_above_75_perc_pack(4) - Total number of times ring has > 75% packets - * num_rx_ring_above_25_perc_pack(4) - Total number of times ring has < 25% packets - * num_rx_ring_stats_polled(4) - Total number of times RX ring stats are counted - * num_rx_drop_stats(4) - Total number of times GSI dropped packets - * gsi_debug1(4) - Additional GSI Debug information - * gsi_debug2(4) - Additional GSI Debug information - * gsi_debug3(4) - Additional GSI Debug information - * gsi_debug4(4) - Additional GSI Debug information - * rx_summary(4) - 1 – Peripheral is bad in providing packets, 2 – IPA is not processing packets fast enough - */ IPA_LNX_CMD_MHIP_INST_STATS, + IPA_LNX_CMD_CONSOLIDATED_STATS, IPA_LNX_CMD_STATS_MAX, };