|
@@ -4982,7 +4982,7 @@ EXPORT_SYMBOL(ipa3_wwan_platform_driver_register);
|
|
|
int rmnet_ipa3_query_per_client_stats_v2(
|
|
|
struct wan_ioctl_query_per_client_stats *data)
|
|
|
{
|
|
|
- int lan_clnt_idx, i, j;
|
|
|
+ int lan_clnt_idx, i, j, result = 1;
|
|
|
struct ipa_lan_client *lan_client = NULL;
|
|
|
struct ipa_lan_client_cntr_index
|
|
|
*lan_client_index = NULL;
|
|
@@ -5033,6 +5033,19 @@ int rmnet_ipa3_query_per_client_stats_v2(
|
|
|
mutex_unlock(&rmnet_ipa3_ctx->per_client_stats_guard);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
+
|
|
|
+ teth_ptr = &rmnet_ipa3_ctx->tether_device[data->device_type];
|
|
|
+ lan_client = &teth_ptr->lan_client[lan_clnt_idx];
|
|
|
+ /*
|
|
|
+ * Check if disconnect flag is set and
|
|
|
+ * and client is inited or not.
|
|
|
+ * if inited ignore resetting stats and return.
|
|
|
+ */
|
|
|
+ if (data->disconnect_clnt && lan_client->inited) {
|
|
|
+ IPAWANERR("Client not inited.\n");
|
|
|
+ mutex_unlock(&rmnet_ipa3_ctx->per_client_stats_guard);
|
|
|
+ return -EAGAIN;
|
|
|
+ }
|
|
|
} else {
|
|
|
/* Max number of clients. */
|
|
|
/* Check if disconnect flag is set and
|
|
@@ -5078,9 +5091,9 @@ int rmnet_ipa3_query_per_client_stats_v2(
|
|
|
lan_client_index[i].ul_cnt_idx,
|
|
|
lan_client_index[i].dl_cnt_idx);
|
|
|
memset(query, 0, sizeof(query_f));
|
|
|
- ret = rmnet_ipa_get_hw_fnr_stats_v2(&lan_client_index[i],
|
|
|
+ result = rmnet_ipa_get_hw_fnr_stats_v2(&lan_client_index[i],
|
|
|
data, query);
|
|
|
- if (ret) {
|
|
|
+ if (result) {
|
|
|
IPAWANERR("Failed: Client type %d, idx %d\n",
|
|
|
data->device_type, i);
|
|
|
kfree((void *)query->stats);
|
|
@@ -5103,6 +5116,7 @@ int rmnet_ipa3_query_per_client_stats_v2(
|
|
|
data->client_info[i].ipv4_rx_bytes);
|
|
|
|
|
|
kfree((void *)query->stats);
|
|
|
+ ret = result;
|
|
|
}
|
|
|
|
|
|
/* Legacy per-client stats */
|