diff --git a/drivers/platform/msm/ipa/ipa_clients/ipa_usb.c b/drivers/platform/msm/ipa/ipa_clients/ipa_usb.c index 8a1d1a7201d8..394c5a854c5c 100644 --- a/drivers/platform/msm/ipa/ipa_clients/ipa_usb.c +++ b/drivers/platform/msm/ipa/ipa_clients/ipa_usb.c @@ -3213,6 +3213,53 @@ static void ipa3_usb_exit(void) kfree(ipa3_usb_ctx); } +/** + * ipa3_get_usb_gsi_stats() - Query USB gsi stats from uc + * @stats: [inout] stats blob from client populated by driver + * + * Returns: 0 on success, negative on failure + * + * @note Cannot be called from atomic context + * + */ +int ipa3_get_usb_gsi_stats(struct ipa3_uc_dbg_ring_stats *stats) +{ + int i; + + if (!ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_mmio) { + IPAERR("bad parms NULL usb_gsi_stats_mmio\n"); + return -EINVAL; + } + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); + for (i = 0; i < MAX_CH_STATS_SUPPORTED; i++) { + stats->ring[i].ringFull = ioread32( + ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_mmio + + i * IPA3_UC_DEBUG_STATS_OFF + + IPA3_UC_DEBUG_STATS_RINGFULL_OFF); + stats->ring[i].ringEmpty = ioread32( + ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_mmio + + i * IPA3_UC_DEBUG_STATS_OFF + + IPA3_UC_DEBUG_STATS_RINGEMPTY_OFF); + stats->ring[i].ringUsageHigh = ioread32( + ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_mmio + + i * IPA3_UC_DEBUG_STATS_OFF + + IPA3_UC_DEBUG_STATS_RINGUSAGEHIGH_OFF); + stats->ring[i].ringUsageLow = ioread32( + ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_mmio + + i * IPA3_UC_DEBUG_STATS_OFF + + IPA3_UC_DEBUG_STATS_RINGUSAGELOW_OFF); + stats->ring[i].RingUtilCount = ioread32( + ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_mmio + + i * IPA3_UC_DEBUG_STATS_OFF + + IPA3_UC_DEBUG_STATS_RINGUTILCOUNT_OFF); + } + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); + + + return 0; +} + + arch_initcall(ipa3_usb_init); module_exit(ipa3_usb_exit); diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_client.c b/drivers/platform/msm/ipa/ipa_v3/ipa_client.c index 35c2742eca54..89f228e259c1 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_client.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_client.c @@ -1534,6 +1534,8 @@ int ipa3_start_gsi_channel(u32 clnt_hdl) struct ipa3_ep_context *ep; int result = -EFAULT; enum gsi_status gsi_res; + enum ipa_client_type client_type; + struct IpaHwOffloadStatsAllocCmdData_t *gsi_info; IPADBG("entry\n"); if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || @@ -1543,9 +1545,9 @@ int ipa3_start_gsi_channel(u32 clnt_hdl) } ep = &ipa3_ctx->ep[clnt_hdl]; - + client_type = ipa3_get_client_mapping(clnt_hdl); if (!ep->keep_ipa_awake) - IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_INC_EP(client_type); gsi_res = gsi_start_channel(ep->gsi_chan_hdl); if (gsi_res != GSI_STATUS_SUCCESS) { @@ -1553,8 +1555,53 @@ int ipa3_start_gsi_channel(u32 clnt_hdl) goto start_chan_fail; } + /* start uC gsi dbg stats monitor */ + if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_5) { + switch (client_type) { + case IPA_CLIENT_MHI_PRIME_TETH_PROD: + gsi_info = &ipa3_ctx->gsi_info[IPA_HW_PROTOCOL_MHIP]; + gsi_info->ch_id_info[0].ch_id = ep->gsi_chan_hdl; + gsi_info->ch_id_info[0].dir = DIR_PRODUCER; + ipa3_uc_debug_stats_alloc(*gsi_info); + break; + case IPA_CLIENT_MHI_PRIME_TETH_CONS: + gsi_info = &ipa3_ctx->gsi_info[IPA_HW_PROTOCOL_MHIP]; + gsi_info->ch_id_info[1].ch_id = ep->gsi_chan_hdl; + gsi_info->ch_id_info[1].dir = DIR_CONSUMER; + ipa3_uc_debug_stats_alloc(*gsi_info); + break; + case IPA_CLIENT_MHI_PRIME_RMNET_PROD: + gsi_info = &ipa3_ctx->gsi_info[IPA_HW_PROTOCOL_MHIP]; + gsi_info->ch_id_info[2].ch_id = ep->gsi_chan_hdl; + gsi_info->ch_id_info[2].dir = DIR_PRODUCER; + ipa3_uc_debug_stats_alloc(*gsi_info); + break; + case IPA_CLIENT_MHI_PRIME_RMNET_CONS: + gsi_info = &ipa3_ctx->gsi_info[IPA_HW_PROTOCOL_MHIP]; + gsi_info->ch_id_info[3].ch_id = ep->gsi_chan_hdl; + gsi_info->ch_id_info[3].dir = DIR_CONSUMER; + ipa3_uc_debug_stats_alloc(*gsi_info); + break; + case IPA_CLIENT_USB_PROD: + gsi_info = &ipa3_ctx->gsi_info[IPA_HW_PROTOCOL_USB]; + gsi_info->ch_id_info[0].ch_id = ep->gsi_chan_hdl; + gsi_info->ch_id_info[0].dir = DIR_PRODUCER; + ipa3_uc_debug_stats_alloc(*gsi_info); + break; + case IPA_CLIENT_USB_CONS: + gsi_info = &ipa3_ctx->gsi_info[IPA_HW_PROTOCOL_USB]; + gsi_info->ch_id_info[0].ch_id = ep->gsi_chan_hdl; + gsi_info->ch_id_info[0].dir = DIR_CONSUMER; + ipa3_uc_debug_stats_alloc(*gsi_info); + break; + default: + IPADBG("client_type %d not supported\n", + client_type); + } + } + if (!ep->keep_ipa_awake) - IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); + IPA_ACTIVE_CLIENTS_DEC_EP(client_type); IPADBG("exit\n"); return 0; diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c b/drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c index 878549531629..ded52a01e5ff 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c @@ -2111,6 +2111,126 @@ done: return simple_read_from_buffer(ubuf, count, ppos, dbg_buff, cnt); } +static ssize_t ipa3_read_mhip_gsi_stats(struct file *file, + char __user *ubuf, size_t count, loff_t *ppos) +{ + struct ipa3_uc_dbg_ring_stats stats; + int nbytes; + int cnt = 0; + + if (ipa3_ctx->ipa_hw_type < IPA_HW_v4_5) { + nbytes = scnprintf(dbg_buff, IPA_MAX_MSG_LEN, + "This feature only support on IPA4.5+\n"); + cnt += nbytes; + goto done; + } + if (!ipa3_get_mhip_gsi_stats(&stats)) { + nbytes = scnprintf(dbg_buff, IPA_MAX_MSG_LEN, + "IPA_CLIENT_MHI_PRIME_TETH_CONS ringFull=%u\n" + "IPA_CLIENT_MHI_PRIME_TETH_CONS ringEmpty=%u\n" + "IPA_CLIENT_MHI_PRIME_TETH_CONS ringUsageHigh=%u\n" + "IPA_CLIENT_MHI_PRIME_TETH_CONS ringUsageLow=%u\n" + "IPA_CLIENT_MHI_PRIME_TETH_CONS RingUtilCount=%u\n", + stats.ring[1].ringFull, + stats.ring[1].ringEmpty, + stats.ring[1].ringUsageHigh, + stats.ring[1].ringUsageLow, + stats.ring[1].RingUtilCount); + cnt += nbytes; + nbytes = scnprintf(dbg_buff + cnt, IPA_MAX_MSG_LEN - cnt, + "IPA_CLIENT_MHI_PRIME_TETH_PROD ringFull=%u\n" + "IPA_CLIENT_MHI_PRIME_TETH_PROD ringEmpty=%u\n" + "IPA_CLIENT_MHI_PRIME_TETH_PROD ringUsageHigh=%u\n" + "IPA_CLIENT_MHI_PRIME_TETH_PROD ringUsageLow=%u\n" + "IPA_CLIENT_MHI_PRIME_TETH_PROD RingUtilCount=%u\n", + stats.ring[0].ringFull, + stats.ring[0].ringEmpty, + stats.ring[0].ringUsageHigh, + stats.ring[0].ringUsageLow, + stats.ring[0].RingUtilCount); + cnt += nbytes; + nbytes = scnprintf(dbg_buff + cnt, IPA_MAX_MSG_LEN - cnt, + "IPA_CLIENT_MHI_PRIME_RMNET_CONS ringFull=%u\n" + "IPA_CLIENT_MHI_PRIME_RMNET_CONS ringEmpty=%u\n" + "IPA_CLIENT_MHI_PRIME_RMNET_CONS ringUsageHigh=%u\n" + "IPA_CLIENT_MHI_PRIME_RMNET_CONS ringUsageLow=%u\n" + "IPA_CLIENT_MHI_PRIME_RMNET_CONS RingUtilCount=%u\n", + stats.ring[3].ringFull, + stats.ring[3].ringEmpty, + stats.ring[3].ringUsageHigh, + stats.ring[3].ringUsageLow, + stats.ring[3].RingUtilCount); + cnt += nbytes; + nbytes = scnprintf(dbg_buff + cnt, IPA_MAX_MSG_LEN - cnt, + "IPA_CLIENT_MHI_PRIME_RMNET_PROD ringFull=%u\n" + "IPA_CLIENT_MHI_PRIME_RMNET_PROD ringEmpty=%u\n" + "IPA_CLIENT_MHI_PRIME_RMNET_PROD ringUsageHigh=%u\n" + "IPA_CLIENT_MHI_PRIME_RMNET_PROD ringUsageLow=%u\n" + "IPA_CLIENT_MHI_PRIME_RMNET_PROD RingUtilCount=%u\n", + stats.ring[2].ringFull, + stats.ring[2].ringEmpty, + stats.ring[2].ringUsageHigh, + stats.ring[2].ringUsageLow, + stats.ring[2].RingUtilCount); + cnt += nbytes; + } else { + nbytes = scnprintf(dbg_buff, IPA_MAX_MSG_LEN, + "Fail to read WDI GSI stats\n"); + cnt += nbytes; + } + +done: + return simple_read_from_buffer(ubuf, count, ppos, dbg_buff, cnt); +} + +static ssize_t ipa3_read_usb_gsi_stats(struct file *file, + char __user *ubuf, size_t count, loff_t *ppos) +{ + struct ipa3_uc_dbg_ring_stats stats; + int nbytes; + int cnt = 0; + + if (ipa3_ctx->ipa_hw_type < IPA_HW_v4_5) { + nbytes = scnprintf(dbg_buff, IPA_MAX_MSG_LEN, + "This feature only support on IPA4.5+\n"); + cnt += nbytes; + goto done; + } + if (!ipa3_get_usb_gsi_stats(&stats)) { + nbytes = scnprintf(dbg_buff, IPA_MAX_MSG_LEN, + "TX ringFull=%u\n" + "TX ringEmpty=%u\n" + "TX ringUsageHigh=%u\n" + "TX ringUsageLow=%u\n" + "TX RingUtilCount=%u\n", + stats.ring[1].ringFull, + stats.ring[1].ringEmpty, + stats.ring[1].ringUsageHigh, + stats.ring[1].ringUsageLow, + stats.ring[1].RingUtilCount); + cnt += nbytes; + nbytes = scnprintf(dbg_buff + cnt, IPA_MAX_MSG_LEN - cnt, + "RX ringFull=%u\n" + "RX ringEmpty=%u\n" + "RX ringUsageHigh=%u\n" + "RX ringUsageLow=%u\n" + "RX RingUtilCount=%u\n", + stats.ring[0].ringFull, + stats.ring[0].ringEmpty, + stats.ring[0].ringUsageHigh, + stats.ring[0].ringUsageLow, + stats.ring[0].RingUtilCount); + cnt += nbytes; + } else { + nbytes = scnprintf(dbg_buff, IPA_MAX_MSG_LEN, + "Fail to read WDI GSI stats\n"); + cnt += nbytes; + } + +done: + return simple_read_from_buffer(ubuf, count, ppos, dbg_buff, cnt); +} + static void ipa_dump_status(struct ipahal_pkt_status *status) { IPA_DUMP_STATUS_FIELD(status_opcode); @@ -2401,6 +2521,14 @@ static const struct ipa3_debugfs_file debugfs_files[] = { "aqc_gsi_stats", IPA_READ_ONLY_MODE, NULL, { .read = ipa3_read_aqc_gsi_stats, } + }, { + "mhip_gsi_stats", IPA_READ_ONLY_MODE, NULL, { + .read = ipa3_read_mhip_gsi_stats, + } + }, { + "usb_gsi_stats", IPA_READ_ONLY_MODE, NULL, { + .read = ipa3_read_usb_gsi_stats, + } } }; diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_i.h b/drivers/platform/msm/ipa/ipa_v3/ipa_i.h index e745e3a8a140..d8caa5fa835c 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_i.h +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_i.h @@ -1484,6 +1484,20 @@ struct ipa3_wdi3_ctx { struct ipa3_uc_dbg_stats dbg_stats; }; +/** + * struct ipa3_usb_ctx - IPA usb context + */ +struct ipa3_usb_ctx { + struct ipa3_uc_dbg_stats dbg_stats; +}; + +/** + * struct ipa3_mhip_ctx - IPA mhip context + */ +struct ipa3_mhip_ctx { + struct ipa3_uc_dbg_stats dbg_stats; +}; + /** * struct ipa3_transport_pm - transport power management related members * @transport_pm_mutex: Mutex to protect the transport_pm functionality. @@ -1882,6 +1896,8 @@ struct ipa3_context { struct ipa3_wdi2_ctx wdi2_ctx; struct ipa3_pc_mbox_data pc_mbox; struct ipa3_wdi3_ctx wdi3_ctx; + struct ipa3_usb_ctx usb_ctx; + struct ipa3_mhip_ctx mhip_ctx; atomic_t ipa_clk_vote; int gsi_chk_intset_value; int uc_mailbox17_chk; @@ -2474,6 +2490,8 @@ int ipa3_resume_wdi_pipe(u32 clnt_hdl); int ipa3_resume_gsi_wdi_pipe(u32 clnt_hdl); int ipa3_suspend_wdi_pipe(u32 clnt_hdl); int ipa3_get_wdi_gsi_stats(struct ipa3_uc_dbg_ring_stats *stats); +int ipa3_get_wdi3_gsi_stats(struct ipa3_uc_dbg_ring_stats *stats); +int ipa3_get_usb_gsi_stats(struct ipa3_uc_dbg_ring_stats *stats); int ipa3_get_wdi_stats(struct IpaHwStatsWDIInfoData_t *stats); u16 ipa3_get_smem_restr_bytes(void); int ipa3_broadcast_wdi_quota_reach_ind(uint32_t fid, uint64_t num_bytes); @@ -2784,7 +2802,6 @@ int ipa3_write_qmapid_wdi_pipe(u32 clnt_hdl, u8 qmap_id); int ipa3_write_qmapid_wdi3_gsi_pipe(u32 clnt_hdl, u8 qmap_id); int ipa3_tag_process(struct ipa3_desc *desc, int num_descs, unsigned long timeout); -int ipa3_get_wdi3_gsi_stats(struct ipa3_uc_dbg_ring_stats *stats); void ipa3_q6_pre_shutdown_cleanup(void); void ipa3_q6_post_shutdown_cleanup(void); @@ -2995,6 +3012,7 @@ int ipa3_is_mhip_offload_enabled(void); int ipa_mpm_reset_dma_mode(enum ipa_client_type src_pipe, enum ipa_client_type dst_pipe); int ipa_mpm_panic_handler(char *buf, int size); +int ipa3_get_mhip_gsi_stats(struct ipa3_uc_dbg_ring_stats *stats); #else static inline int ipa_mpm_mhip_xdci_pipe_enable( enum ipa_usb_teth_prot prot) @@ -3030,6 +3048,16 @@ static inline int ipa_mpm_panic_handler(char *buf, int size) return 0; } +static inline int ipa3_get_mhip_gsi_stats(struct ipa3_uc_dbg_ring_stats *stats) +{ + return 0; +} + +static inline void *alloc_and_init(u32 size, u32 init_val) +{ + return 0; +} + #endif /* CONFIG_IPA3_MHI_PRIME_MANAGER */ /* query ipa APQ mode*/ diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c b/drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c index 1093daf8723a..3462442f53ce 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_mpm.c @@ -990,7 +990,6 @@ static int ipa_mpm_connect_mhip_gsi_pipe(enum ipa_client_type mhip_client, ipa_mpm_change_gsi_state(mhi_idx, IPA_MPM_MHIP_CHAN_UL, GSI_ALLOCATED); - result = ipa3_start_gsi_channel(ipa_ep_idx); if (result) { IPA_MPM_ERR("start MHIP channel %d failed\n", mhip_client); @@ -2784,6 +2783,54 @@ int ipa_mpm_panic_handler(char *buf, int size) } return cnt; } + +/** + * ipa3_get_mhip_gsi_stats() - Query MHIP gsi stats from uc + * @stats: [inout] stats blob from client populated by driver + * + * Returns: 0 on success, negative on failure + * + * @note Cannot be called from atomic context + * + */ +int ipa3_get_mhip_gsi_stats(struct ipa3_uc_dbg_ring_stats *stats) +{ + int i; + + if (!ipa3_ctx->mhip_ctx.dbg_stats.uc_dbg_stats_mmio) { + IPAERR("bad parms NULL mhip_gsi_stats_mmio\n"); + return -EINVAL; + } + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); + for (i = 0; i < MAX_CH_STATS_SUPPORTED; i++) { + stats->ring[i].ringFull = ioread32( + ipa3_ctx->mhip_ctx.dbg_stats.uc_dbg_stats_mmio + + i * IPA3_UC_DEBUG_STATS_OFF + + IPA3_UC_DEBUG_STATS_RINGFULL_OFF); + stats->ring[i].ringEmpty = ioread32( + ipa3_ctx->mhip_ctx.dbg_stats.uc_dbg_stats_mmio + + i * IPA3_UC_DEBUG_STATS_OFF + + IPA3_UC_DEBUG_STATS_RINGEMPTY_OFF); + stats->ring[i].ringUsageHigh = ioread32( + ipa3_ctx->mhip_ctx.dbg_stats.uc_dbg_stats_mmio + + i * IPA3_UC_DEBUG_STATS_OFF + + IPA3_UC_DEBUG_STATS_RINGUSAGEHIGH_OFF); + stats->ring[i].ringUsageLow = ioread32( + ipa3_ctx->mhip_ctx.dbg_stats.uc_dbg_stats_mmio + + i * IPA3_UC_DEBUG_STATS_OFF + + IPA3_UC_DEBUG_STATS_RINGUSAGELOW_OFF); + stats->ring[i].RingUtilCount = ioread32( + ipa3_ctx->mhip_ctx.dbg_stats.uc_dbg_stats_mmio + + i * IPA3_UC_DEBUG_STATS_OFF + + IPA3_UC_DEBUG_STATS_RINGUTILCOUNT_OFF); + } + IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); + + + return 0; +} + + late_initcall(ipa_mpm_init); MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("MHI Proxy Manager Driver"); diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_uc.c b/drivers/platform/msm/ipa/ipa_v3/ipa_uc.c index 2bb9d9b3456d..85f7e0bef7e0 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_uc.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_uc.c @@ -257,6 +257,16 @@ static void ipa3_uc_save_dbg_stats(u32 size) break; case IPA_HW_PROTOCOL_ETH: break; + case IPA_HW_PROTOCOL_MHIP: + ipa3_ctx->mhip_ctx.dbg_stats.uc_dbg_stats_size = size; + ipa3_ctx->mhip_ctx.dbg_stats.uc_dbg_stats_ofst = addr_offset; + ipa3_ctx->mhip_ctx.dbg_stats.uc_dbg_stats_mmio = mmio; + break; + case IPA_HW_PROTOCOL_USB: + ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_size = size; + ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_ofst = addr_offset; + ipa3_ctx->usb_ctx.dbg_stats.uc_dbg_stats_mmio = mmio; + break; default: IPAERR("unknown protocols %d\n", protocol_id); } diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_uc_offload_i.h b/drivers/platform/msm/ipa/ipa_v3/ipa_uc_offload_i.h index cd908921f1fb..d20d412fe8bb 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_uc_offload_i.h +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_uc_offload_i.h @@ -86,6 +86,8 @@ enum ipa4_hw_protocol { IPA_HW_PROTOCOL_WDI = 0x3, IPA_HW_PROTOCOL_WDI3 = 0x4, IPA_HW_PROTOCOL_ETH = 0x5, + IPA_HW_PROTOCOL_MHIP = 0x6, + IPA_HW_PROTOCOL_USB = 0x7, IPA_HW_PROTOCOL_MAX }; diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c b/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c index 9788d13ce9e2..bd12c7fa6137 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c @@ -7139,6 +7139,8 @@ static int __ipa3_stop_gsi_channel(u32 clnt_hdl) int res = 0; int i; struct ipa3_ep_context *ep; + enum ipa_client_type client_type; + struct IpaHwOffloadStatsAllocCmdData_t *gsi_info; if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || ipa3_ctx->ep[clnt_hdl].valid == 0) { @@ -7147,8 +7149,53 @@ static int __ipa3_stop_gsi_channel(u32 clnt_hdl) } ep = &ipa3_ctx->ep[clnt_hdl]; + client_type = ipa3_get_client_mapping(clnt_hdl); memset(&mem, 0, sizeof(mem)); + /* start uC gsi dbg stats monitor */ + if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_5) { + switch (client_type) { + case IPA_CLIENT_MHI_PRIME_TETH_PROD: + gsi_info = &ipa3_ctx->gsi_info[IPA_HW_PROTOCOL_MHIP]; + gsi_info->ch_id_info[0].ch_id = ep->gsi_chan_hdl; + gsi_info->ch_id_info[0].dir = DIR_PRODUCER; + ipa3_uc_debug_stats_alloc(*gsi_info); + break; + case IPA_CLIENT_MHI_PRIME_TETH_CONS: + gsi_info = &ipa3_ctx->gsi_info[IPA_HW_PROTOCOL_MHIP]; + gsi_info->ch_id_info[1].ch_id = ep->gsi_chan_hdl; + gsi_info->ch_id_info[1].dir = DIR_CONSUMER; + ipa3_uc_debug_stats_alloc(*gsi_info); + break; + case IPA_CLIENT_MHI_PRIME_RMNET_PROD: + gsi_info = &ipa3_ctx->gsi_info[IPA_HW_PROTOCOL_MHIP]; + gsi_info->ch_id_info[2].ch_id = ep->gsi_chan_hdl; + gsi_info->ch_id_info[2].dir = DIR_PRODUCER; + ipa3_uc_debug_stats_alloc(*gsi_info); + break; + case IPA_CLIENT_MHI_PRIME_RMNET_CONS: + gsi_info = &ipa3_ctx->gsi_info[IPA_HW_PROTOCOL_MHIP]; + gsi_info->ch_id_info[3].ch_id = ep->gsi_chan_hdl; + gsi_info->ch_id_info[3].dir = DIR_CONSUMER; + ipa3_uc_debug_stats_alloc(*gsi_info); + break; + case IPA_CLIENT_USB_PROD: + gsi_info = &ipa3_ctx->gsi_info[IPA_HW_PROTOCOL_USB]; + gsi_info->ch_id_info[0].ch_id = ep->gsi_chan_hdl; + gsi_info->ch_id_info[0].dir = DIR_PRODUCER; + ipa3_uc_debug_stats_alloc(*gsi_info); + break; + case IPA_CLIENT_USB_CONS: + gsi_info = &ipa3_ctx->gsi_info[IPA_HW_PROTOCOL_USB]; + gsi_info->ch_id_info[0].ch_id = ep->gsi_chan_hdl; + gsi_info->ch_id_info[0].dir = DIR_CONSUMER; + ipa3_uc_debug_stats_alloc(*gsi_info); + break; + default: + IPADBG("client_type %d not supported\n", + client_type); + } + } if (IPA_CLIENT_IS_PROD(ep->client)) { IPADBG("Calling gsi_stop_channel ch:%lu\n", ep->gsi_chan_hdl);