|
@@ -6383,7 +6383,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, result = 1;
|
|
|
+ int lan_clnt_idx, i, j, result = 1, stats_idx = 0;
|
|
|
struct ipa_lan_client *lan_client = NULL;
|
|
|
struct ipa_lan_client_cntr_index
|
|
|
*lan_client_index = NULL;
|
|
@@ -6490,19 +6490,23 @@ int rmnet_ipa3_query_per_client_stats_v2(
|
|
|
}
|
|
|
fnr_stats = &((struct ipa_flt_rt_stats *)
|
|
|
query->stats)[0];
|
|
|
- data->client_info[i].ipv4_tx_bytes =
|
|
|
+ if (data->num_clients == 1)
|
|
|
+ stats_idx = 0;
|
|
|
+ else
|
|
|
+ stats_idx = i;
|
|
|
+ data->client_info[stats_idx].ipv4_tx_bytes =
|
|
|
fnr_stats->num_bytes;
|
|
|
fnr_stats = &((struct ipa_flt_rt_stats *)
|
|
|
query->stats)[1];
|
|
|
- data->client_info[i].ipv4_rx_bytes =
|
|
|
+ data->client_info[stats_idx].ipv4_rx_bytes =
|
|
|
fnr_stats->num_bytes;
|
|
|
- memcpy(data->client_info[i].mac,
|
|
|
+ memcpy(data->client_info[stats_idx].mac,
|
|
|
lan_client[i].mac,
|
|
|
IPA_MAC_ADDR_SIZE);
|
|
|
|
|
|
- IPAWANDBG("Client ipv4_tx_bytes = %lu, ipv4_rx_bytes = %lu\n",
|
|
|
- data->client_info[i].ipv4_tx_bytes,
|
|
|
- data->client_info[i].ipv4_rx_bytes);
|
|
|
+ IPAWANDBG("Client ipv4_tx_bytes = %llu, ipv4_rx_bytes = %llu\n",
|
|
|
+ data->client_info[stats_idx].ipv4_tx_bytes,
|
|
|
+ data->client_info[stats_idx].ipv4_rx_bytes);
|
|
|
|
|
|
kfree((void *)query->stats);
|
|
|
ret = result;
|