From a3f8db2b0962cb0d888c03108f622c62f96da81d Mon Sep 17 00:00:00 2001 From: Ashok Vuyyuru Date: Thu, 29 Aug 2019 16:33:52 +0530 Subject: [PATCH] msm: ipa4: Don't query wigig client tethering stats for all targets Add changes to query wigig pipe tethering stats only if IPA_CLIENT_WIGIG_PROD client supported, otherwise ignore query wigig pipe stats. Change-Id: I656ec832336672399752090d885873256bfae232 Signed-off-by: Ashok Vuyyuru --- drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c | 62 +++++++++++---------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c index 69cc52a0ccd0..53feea865d2a 100644 --- a/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c +++ b/drivers/platform/msm/ipa/ipa_v3/rmnet_ipa.c @@ -3583,36 +3583,42 @@ static int rmnet_ipa3_query_tethering_stats_hw( data->ipv6_tx_bytes += con_stats->client[index].num_ipv6_bytes; - /* query WIGIG UL stats */ - memset(con_stats, 0, sizeof(struct ipa_quota_stats_all)); - rc = ipa_query_teth_stats(IPA_CLIENT_WIGIG_PROD, con_stats, reset); - if (rc) { - IPAERR("IPA_CLIENT_WIGIG_PROD query failed %d\n", rc); - kfree(con_stats); - return rc; + if (ipa3_get_ep_mapping(IPA_CLIENT_WIGIG_PROD) != + IPA_EP_NOT_ALLOCATED) { + /* query WIGIG UL stats */ + memset(con_stats, 0, sizeof(struct ipa_quota_stats_all)); + rc = ipa_query_teth_stats(IPA_CLIENT_WIGIG_PROD, con_stats, + reset); + if (rc) { + IPAERR("IPA_CLIENT_WIGIG_PROD query failed %d\n", rc); + kfree(con_stats); + return rc; + } + + if (rmnet_ipa3_ctx->ipa_config_is_apq) + index = IPA_CLIENT_MHI_PRIME_TETH_CONS; + else + index = IPA_CLIENT_Q6_WAN_CONS; + + IPAWANDBG("wigig: v4_tx_p(%d) b(%lld) v6_tx_p(%d) b(%lld)\n", + con_stats->client[index].num_ipv4_pkts, + con_stats->client[index].num_ipv4_bytes, + con_stats->client[index].num_ipv6_pkts, + con_stats->client[index].num_ipv6_bytes); + + /* update the WIGIG UL stats */ + data->ipv4_tx_packets += + con_stats->client[index].num_ipv4_pkts; + data->ipv6_tx_packets += + con_stats->client[index].num_ipv6_pkts; + data->ipv4_tx_bytes += + con_stats->client[index].num_ipv4_bytes; + data->ipv6_tx_bytes += + con_stats->client[index].num_ipv6_bytes; + } else { + IPAWANDBG("IPA_CLIENT_WIGIG_PROD client not supported\n"); } - if (rmnet_ipa3_ctx->ipa_config_is_apq) - index = IPA_CLIENT_MHI_PRIME_TETH_CONS; - else - index = IPA_CLIENT_Q6_WAN_CONS; - - IPAWANDBG("wigig: v4_tx_p(%d) b(%lld) v6_tx_p(%d) b(%lld)\n", - con_stats->client[index].num_ipv4_pkts, - con_stats->client[index].num_ipv4_bytes, - con_stats->client[index].num_ipv6_pkts, - con_stats->client[index].num_ipv6_bytes); - - /* update the WIGIG UL stats */ - data->ipv4_tx_packets += - con_stats->client[index].num_ipv4_pkts; - data->ipv6_tx_packets += - con_stats->client[index].num_ipv6_pkts; - data->ipv4_tx_bytes += - con_stats->client[index].num_ipv4_bytes; - data->ipv6_tx_bytes += - con_stats->client[index].num_ipv6_bytes; - IPAWANDBG("v4_tx_p(%lu) v6_tx_p(%lu) v4_tx_b(%lu) v6_tx_b(%lu)\n", (unsigned long) data->ipv4_tx_packets, (unsigned long) data->ipv6_tx_packets,