aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-12-19 06:34:00 -0500
committerJohannes Berg <johannes.berg@intel.com>2015-01-08 09:28:18 -0500
commit6de39808cf1dd7b02bf42e7d8695d80f5eaf645d (patch)
tree257f8e2c3bb35c1049c1b860454973ce4108b159 /net/wireless
parent8d791361a4698ca6f01c361a47b39b30d26bf66c (diff)
nl80211: support per-TID station statistics
The base for the current statistics is pretty mixed up, support exporting RX/TX statistics for MSDUs per TID. This (currently) covers received MSDUs, transmitted MSDUs and retries/failures thereof. Doing it per TID for MSDUs makes more sense than say only per AC because it's symmetric - we could export per-AC statistics for all frames (which AC we used for transmission can be determined also for management frames) but per TID is better and usually data frames are really the ones we care about. Also, on RX we can't determine the AC - but we do know the TID for any QoS MPDU we received. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/nl80211.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 42b968a1f994..7c2ce26e22de 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -3772,6 +3772,47 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
3772 PUT_SINFO(BEACON_SIGNAL_AVG, rx_beacon_signal_avg, u8); 3772 PUT_SINFO(BEACON_SIGNAL_AVG, rx_beacon_signal_avg, u8);
3773 3773
3774#undef PUT_SINFO 3774#undef PUT_SINFO
3775
3776 if (sinfo->filled & BIT(NL80211_STA_INFO_TID_STATS)) {
3777 struct nlattr *tidsattr;
3778 int tid;
3779
3780 tidsattr = nla_nest_start(msg, NL80211_STA_INFO_TID_STATS);
3781 if (!tidsattr)
3782 goto nla_put_failure;
3783
3784 for (tid = 0; tid < IEEE80211_NUM_TIDS + 1; tid++) {
3785 struct cfg80211_tid_stats *tidstats;
3786 struct nlattr *tidattr;
3787
3788 tidstats = &sinfo->pertid[tid];
3789
3790 if (!tidstats->filled)
3791 continue;
3792
3793 tidattr = nla_nest_start(msg, tid + 1);
3794 if (!tidattr)
3795 goto nla_put_failure;
3796
3797#define PUT_TIDVAL(attr, memb, type) do { \
3798 if (tidstats->filled & BIT(NL80211_TID_STATS_ ## attr) && \
3799 nla_put_ ## type(msg, NL80211_TID_STATS_ ## attr, \
3800 tidstats->memb)) \
3801 goto nla_put_failure; \
3802 } while (0)
3803
3804 PUT_TIDVAL(RX_MSDU, rx_msdu, u64);
3805 PUT_TIDVAL(TX_MSDU, tx_msdu, u64);
3806 PUT_TIDVAL(TX_MSDU_RETRIES, tx_msdu_retries, u64);
3807 PUT_TIDVAL(TX_MSDU_FAILED, tx_msdu_failed, u64);
3808
3809#undef PUT_TIDVAL
3810 nla_nest_end(msg, tidattr);
3811 }
3812
3813 nla_nest_end(msg, tidsattr);
3814 }
3815
3775 nla_nest_end(msg, sinfoattr); 3816 nla_nest_end(msg, sinfoattr);
3776 3817
3777 if (sinfo->assoc_req_ies_len && 3818 if (sinfo->assoc_req_ies_len &&