Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad5f103c authored by Skylar Chang's avatar Skylar Chang Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa: return the wifi stats when reset is set



After Andorid-O, every time after framework queries
the WIFI-stats, it will reset the stats because
framework would like to know only the difference of
data usage, not accumulated stats.

Change-Id: I66bbf779f872c54311dcc8e3ba635949126e94ac
Acked-by: default avatarPooja Kumari <kumarip@qti.qualcomm.com>
Signed-off-by: default avatarMohammed Javid <mjavid@codeaurora.org>
Signed-off-by: default avatarSkylar Chang <chiaweic@codeaurora.org>
parent a5cabe93
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -2807,7 +2807,8 @@ static int rmnet_ipa_query_tethering_stats_wifi(
	if (rc) {
		kfree(sap_stats);
		return rc;
	} else if (reset) {
	} else if (data == NULL) {
		IPAWANDBG("only reset wlan stats\n");
		kfree(sap_stats);
		return 0;
	}
@@ -2880,6 +2881,7 @@ int rmnet_ipa_query_tethering_stats_modem(
		kfree(resp);
		return rc;
	} else if (data == NULL) {
		IPAWANDBG("only reset modem stats\n");
		kfree(req);
		kfree(resp);
		return 0;
@@ -3074,11 +3076,8 @@ int rmnet_ipa_query_tethering_stats_all(
int rmnet_ipa_reset_tethering_stats(struct wan_ioctl_reset_tether_stats *data)
{
	enum ipa_upstream_type upstream_type;
	struct wan_ioctl_query_tether_stats tether_stats;
	int rc = 0;

	memset(&tether_stats, 0, sizeof(struct wan_ioctl_query_tether_stats));

	/* prevent string buffer overflows */
	data->upstreamIface[IFNAMSIZ-1] = '\0';

@@ -3099,7 +3098,7 @@ int rmnet_ipa_reset_tethering_stats(struct wan_ioctl_reset_tether_stats *data)
	} else {
		IPAWANDBG(" reset modem-backhaul stats\n");
		rc = rmnet_ipa_query_tethering_stats_modem(
			&tether_stats, true);
			NULL, true);
		if (rc) {
			IPAWANERR("reset MODEM stats failed\n");
			return rc;
+5 −6
Original line number Diff line number Diff line
/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -2953,7 +2953,8 @@ static int rmnet_ipa3_query_tethering_stats_wifi(
		IPAWANERR("can't get ipa3_get_wlan_stats\n");
		kfree(sap_stats);
		return rc;
	} else if (reset) {
	} else if (data == NULL) {
		IPAWANDBG("only reset wlan stats\n");
		kfree(sap_stats);
		return 0;
	}
@@ -3024,6 +3025,7 @@ static int rmnet_ipa3_query_tethering_stats_modem(
		kfree(resp);
		return rc;
	} else if (data == NULL) {
		IPAWANDBG("only reset modem stats\n");
		kfree(req);
		kfree(resp);
		return 0;
@@ -3218,11 +3220,8 @@ int rmnet_ipa3_query_tethering_stats_all(
int rmnet_ipa3_reset_tethering_stats(struct wan_ioctl_reset_tether_stats *data)
{
	enum ipa_upstream_type upstream_type;
	struct wan_ioctl_query_tether_stats tether_stats;
	int rc = 0;

	memset(&tether_stats, 0, sizeof(struct wan_ioctl_query_tether_stats));

	/* prevent string buffer overflows */
	data->upstreamIface[IFNAMSIZ-1] = '\0';

@@ -3243,7 +3242,7 @@ int rmnet_ipa3_reset_tethering_stats(struct wan_ioctl_reset_tether_stats *data)
	} else {
		IPAWANERR(" reset modem-backhaul stats\n");
		rc = rmnet_ipa3_query_tethering_stats_modem(
			&tether_stats, true);
			NULL, true);
		if (rc) {
			IPAWANERR("reset MODEM stats failed\n");
			return rc;