|
@@ -827,6 +827,11 @@ int ipa_reset_quota_stats(enum ipa_client_type client)
|
|
|
}
|
|
|
|
|
|
ep_idx = ipa_get_ep_mapping(client);
|
|
|
+ if (ep_idx == IPA_EP_NOT_ALLOCATED) {
|
|
|
+ IPAERR("EP not allocated for client %d\n", client);
|
|
|
+ return EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
/* reset driver's cache */
|
|
|
stats = &ipa3_ctx->hw_stats->quota.stats.client[ep_idx];
|
|
|
memset(stats, 0, sizeof(*stats));
|
|
@@ -1276,6 +1281,11 @@ int ipa_query_teth_stats(enum ipa_client_type prod,
|
|
|
}
|
|
|
|
|
|
ipa_ep_idx = ipa_get_ep_mapping(prod);
|
|
|
+ if (ipa_ep_idx == IPA_EP_NOT_ALLOCATED) {
|
|
|
+ IPAERR("EP not allocated for prod %d\n", prod);
|
|
|
+ return EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
/* copy results to out parameter */
|
|
|
if (reset)
|
|
|
*out = ipa3_ctx->hw_stats->teth.prod_stats[ipa_ep_idx];
|
|
@@ -1300,7 +1310,17 @@ int ipa_reset_teth_stats(enum ipa_client_type prod, enum ipa_client_type cons)
|
|
|
}
|
|
|
|
|
|
prod_ep_idx = ipa_get_ep_mapping(prod);
|
|
|
+ if (prod_ep_idx == IPA_EP_NOT_ALLOCATED) {
|
|
|
+ IPAERR("EP not allocated for prod %d\n", prod);
|
|
|
+ return EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
cons_ep_idx = ipa_get_ep_mapping(cons);
|
|
|
+ if (cons_ep_idx == IPA_EP_NOT_ALLOCATED) {
|
|
|
+ IPAERR("EP not allocated for cons %d\n", cons);
|
|
|
+ return EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
/* reading stats will reset them in hardware */
|
|
|
ret = ipa_get_teth_stats();
|
|
|
if (ret) {
|
|
@@ -1331,6 +1351,11 @@ int ipa_reset_all_cons_teth_stats(enum ipa_client_type prod)
|
|
|
}
|
|
|
|
|
|
ipa_ep_idx = ipa_get_ep_mapping(prod);
|
|
|
+ if (ipa_ep_idx == IPA_EP_NOT_ALLOCATED) {
|
|
|
+ IPAERR("EP not allocated for prod %d\n", prod);
|
|
|
+ return EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
/* reading stats will reset them in hardware */
|
|
|
ret = ipa_get_teth_stats();
|
|
|
if (ret) {
|