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>
This commit is contained in:
@@ -3772,6 +3772,47 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
|
||||
PUT_SINFO(BEACON_SIGNAL_AVG, rx_beacon_signal_avg, u8);
|
||||
|
||||
#undef PUT_SINFO
|
||||
|
||||
if (sinfo->filled & BIT(NL80211_STA_INFO_TID_STATS)) {
|
||||
struct nlattr *tidsattr;
|
||||
int tid;
|
||||
|
||||
tidsattr = nla_nest_start(msg, NL80211_STA_INFO_TID_STATS);
|
||||
if (!tidsattr)
|
||||
goto nla_put_failure;
|
||||
|
||||
for (tid = 0; tid < IEEE80211_NUM_TIDS + 1; tid++) {
|
||||
struct cfg80211_tid_stats *tidstats;
|
||||
struct nlattr *tidattr;
|
||||
|
||||
tidstats = &sinfo->pertid[tid];
|
||||
|
||||
if (!tidstats->filled)
|
||||
continue;
|
||||
|
||||
tidattr = nla_nest_start(msg, tid + 1);
|
||||
if (!tidattr)
|
||||
goto nla_put_failure;
|
||||
|
||||
#define PUT_TIDVAL(attr, memb, type) do { \
|
||||
if (tidstats->filled & BIT(NL80211_TID_STATS_ ## attr) && \
|
||||
nla_put_ ## type(msg, NL80211_TID_STATS_ ## attr, \
|
||||
tidstats->memb)) \
|
||||
goto nla_put_failure; \
|
||||
} while (0)
|
||||
|
||||
PUT_TIDVAL(RX_MSDU, rx_msdu, u64);
|
||||
PUT_TIDVAL(TX_MSDU, tx_msdu, u64);
|
||||
PUT_TIDVAL(TX_MSDU_RETRIES, tx_msdu_retries, u64);
|
||||
PUT_TIDVAL(TX_MSDU_FAILED, tx_msdu_failed, u64);
|
||||
|
||||
#undef PUT_TIDVAL
|
||||
nla_nest_end(msg, tidattr);
|
||||
}
|
||||
|
||||
nla_nest_end(msg, tidsattr);
|
||||
}
|
||||
|
||||
nla_nest_end(msg, sinfoattr);
|
||||
|
||||
if (sinfo->assoc_req_ies_len &&
|
||||
|
Referens i nytt ärende
Block a user