qcacld-3.0: Populate peer stats in HDD

Extract and populate peer stats in HDD and then send the stats to the
userspace via station_info in get_station command

Change-Id: Ia0077aadd33095210b1022a8e5a4ba77e9a9b739
CRs-Fixed: 2397649
This commit is contained in:
Sourav Mohapatra 2018-09-03 11:10:37 +05:30 committed by nshrivas
parent 52ac654259
commit 9c398f06e5
2 changed files with 21 additions and 2 deletions

View File

@ -577,6 +577,18 @@ struct hdd_icmpv4_stats_s {
uint16_t tx_ack_cnt;
};
/**
* struct hdd_peer_stats - Peer stats at HDD level
* @rx_count: RX count
* @rx_bytes: RX bytes
* @fcs_count: FCS err count
*/
struct hdd_peer_stats {
uint32_t rx_count;
uint64_t rx_bytes;
uint32_t fcs_count;
};
struct hdd_stats {
tCsrSummaryStatsInfo summary_stat;
tCsrGlobalClassAStatsInfo class_a_stat;
@ -587,6 +599,7 @@ struct hdd_stats {
struct hdd_dns_stats_s hdd_dns_stats;
struct hdd_tcp_stats_s hdd_tcp_stats;
struct hdd_icmpv4_stats_s hdd_icmpv4_stats;
struct hdd_peer_stats peer_stats;
#ifdef WLAN_FEATURE_11W
struct hdd_pmf_stats hdd_pmf_stats;
#endif

View File

@ -4568,8 +4568,8 @@ static int wlan_hdd_get_sta_stats(struct wiphy *wiphy,
wlan_hdd_fill_summary_stats(&adapter->hdd_stats.summary_stat, sinfo);
sinfo->tx_bytes = adapter->stats.tx_bytes;
sinfo->rx_bytes = adapter->stats.rx_bytes;
sinfo->rx_packets = adapter->stats.rx_packets;
sinfo->rx_bytes = adapter->hdd_stats.peer_stats.rx_bytes;
sinfo->rx_packets = adapter->hdd_stats.peer_stats.rx_count;
qdf_mem_copy(&sta_ctx->conn_info.txrate,
&sinfo->txrate, sizeof(sinfo->txrate));
@ -5956,6 +5956,12 @@ int wlan_hdd_get_station_stats(struct hdd_adapter *adapter)
stats->vdev_summary_stats[0].stats.rx_discard_cnt;
adapter->hdd_stats.summary_stat.rx_error_cnt =
stats->vdev_summary_stats[0].stats.rx_error_cnt;
adapter->hdd_stats.peer_stats.rx_count =
stats->peer_adv_stats->rx_count;
adapter->hdd_stats.peer_stats.rx_bytes =
stats->peer_adv_stats->rx_bytes;
adapter->hdd_stats.peer_stats.fcs_count =
stats->peer_adv_stats->fcs_count;
/* save class a stats to legacy location */
adapter->hdd_stats.class_a_stat.tx_nss =