qca-wifi: Add stats mcs, nss and bw
Add encoding macros for mcs nss and bw stats Change-Id: Icc1b238380be8d8d5596e3c7117696c0b0b4cbeb
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
92d227899a
commit
6d13ce0f35
@@ -48,6 +48,34 @@
|
|||||||
QDF_DECLARE_EWMA(rx_rssi, 1024, 8)
|
QDF_DECLARE_EWMA(rx_rssi, 1024, 8)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define DP_PEER_STATS_RIX_MASK 0xffff
|
||||||
|
#define DP_PEER_STATS_NSS_MASK 0xf
|
||||||
|
#define DP_PEER_STATS_MCS_MASK 0xf
|
||||||
|
#define DP_PEER_STATS_BW_MASK 0xf
|
||||||
|
|
||||||
|
#define DP_PEER_STATS_RIX_OFFSET 0
|
||||||
|
#define DP_PEER_STATS_NSS_OFFSET 16
|
||||||
|
#define DP_PEER_STATS_MCS_OFFSET 20
|
||||||
|
#define DP_PEER_STATS_BW_OFFSET 24
|
||||||
|
|
||||||
|
#define ASSEMBLE_STATS_CODE(_rix, _nss, _mcs, _bw) \
|
||||||
|
(((_rix & DP_PEER_STATS_RIX_MASK) << DP_PEER_STATS_RIX_OFFSET) | \
|
||||||
|
((_nss & DP_PEER_STATS_NSS_MASK) << DP_PEER_STATS_NSS_OFFSET) | \
|
||||||
|
((_mcs & DP_PEER_STATS_MCS_MASK) << DP_PEER_STATS_MCS_OFFSET) | \
|
||||||
|
((_bw & DP_PEER_STATS_BW_MASK) << DP_PEER_STATS_BW_OFFSET))
|
||||||
|
|
||||||
|
#define GET_DP_PEER_STATS_RIX(_val) \
|
||||||
|
(((_val) >> DP_PEER_STATS_RIX_OFFSET) & DP_PEER_STATS_RIX_MASK)
|
||||||
|
|
||||||
|
#define GET_DP_PEER_STATS_NSS(_val) \
|
||||||
|
(((_val) >> DP_PEER_STATS_NSS_OFFSET) & DP_PEER_STATS_NSS_MASK)
|
||||||
|
|
||||||
|
#define GET_DP_PEER_STATS_MCS(_val) \
|
||||||
|
(((_val) >> DP_PEER_STATS_MCS_OFFSET) & DP_PEER_STATS_MCS_MASK)
|
||||||
|
|
||||||
|
#define GET_DP_PEER_STATS_BW(_val) \
|
||||||
|
(((_val) >> DP_PEER_STATS_BW_OFFSET) & DP_PEER_STATS_BW_MASK)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* enum cdp_peer_rate_stats_cmd -
|
* enum cdp_peer_rate_stats_cmd -
|
||||||
* used by app to get specific stats
|
* used by app to get specific stats
|
||||||
|
@@ -167,7 +167,15 @@ __wlan_peer_update_rx_rate_stats(struct wlan_rx_rate_stats *__rx_stats,
|
|||||||
{
|
{
|
||||||
uint8_t ant, ht;
|
uint8_t ant, ht;
|
||||||
|
|
||||||
__rx_stats->rix = cdp_rx_ppdu->rix;
|
if (cdp_rx_ppdu->rix == -1) {
|
||||||
|
__rx_stats->rix = cdp_rx_ppdu->rix;
|
||||||
|
} else {
|
||||||
|
__rx_stats->rix = ASSEMBLE_STATS_CODE(cdp_rx_ppdu->rix,
|
||||||
|
cdp_rx_ppdu->u.nss,
|
||||||
|
cdp_rx_ppdu->u.mcs,
|
||||||
|
cdp_rx_ppdu->u.bw);
|
||||||
|
}
|
||||||
|
|
||||||
__rx_stats->rate = cdp_rx_ppdu->rx_ratekbps;
|
__rx_stats->rate = cdp_rx_ppdu->rx_ratekbps;
|
||||||
__rx_stats->num_bytes += cdp_rx_ppdu->num_bytes;
|
__rx_stats->num_bytes += cdp_rx_ppdu->num_bytes;
|
||||||
__rx_stats->num_msdus += cdp_rx_ppdu->num_msdu;
|
__rx_stats->num_msdus += cdp_rx_ppdu->num_msdu;
|
||||||
@@ -267,8 +275,14 @@ __wlan_peer_update_tx_rate_stats(struct wlan_tx_rate_stats *__tx_stats,
|
|||||||
num_ppdus = ppdu_user->long_retries + 1;
|
num_ppdus = ppdu_user->long_retries + 1;
|
||||||
mpdu_attempts = num_ppdus * ppdu_user->mpdu_tried_ucast;
|
mpdu_attempts = num_ppdus * ppdu_user->mpdu_tried_ucast;
|
||||||
mpdu_success = ppdu_user->mpdu_tried_ucast - ppdu_user->mpdu_failed;
|
mpdu_success = ppdu_user->mpdu_tried_ucast - ppdu_user->mpdu_failed;
|
||||||
|
if (ppdu_user->rix == -1) {
|
||||||
__tx_stats->rix = ppdu_user->rix;
|
__tx_stats->rix = ppdu_user->rix;
|
||||||
|
} else {
|
||||||
|
__tx_stats->rix = ASSEMBLE_STATS_CODE(ppdu_user->rix,
|
||||||
|
ppdu_user->nss,
|
||||||
|
ppdu_user->mcs,
|
||||||
|
ppdu_user->bw);
|
||||||
|
}
|
||||||
__tx_stats->rate = ppdu_user->tx_ratekbps;
|
__tx_stats->rate = ppdu_user->tx_ratekbps;
|
||||||
__tx_stats->num_ppdus += num_ppdus;
|
__tx_stats->num_ppdus += num_ppdus;
|
||||||
__tx_stats->mpdu_attempts += mpdu_attempts;
|
__tx_stats->mpdu_attempts += mpdu_attempts;
|
||||||
|
Reference in New Issue
Block a user