summaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-11-21 14:26:31 +0100
committerJohannes Berg <johannes.berg@intel.com>2015-01-08 15:28:20 +0100
commit79c892b85027d5074dfa670dd451c14ee649fb88 (patch)
treeb01b5e649d3d0256e5e84c886eda587b73ace6e1 /net/mac80211/rx.c
parent6de39808cf1dd7b02bf42e7d8695d80f5eaf645d (diff)
downloadlinux-79c892b85027d5074dfa670dd451c14ee649fb88.tar.gz
linux-79c892b85027d5074dfa670dd451c14ee649fb88.tar.bz2
linux-79c892b85027d5074dfa670dd451c14ee649fb88.zip
mac80211: provide per-TID RX/TX MSDU counters
Implement the new counters cfg80211 can now advertise to userspace. The TX code is in the sequence number handler, which is a bit odd, but that place already knows the TID and frame type, so it was easiest and least impact there. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r--net/mac80211/rx.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index fa5d870655a9..3a1a3ba40bd8 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2314,6 +2314,15 @@ ieee80211_rx_h_data(struct ieee80211_rx_data *rx)
if (unlikely(!ieee80211_is_data_present(hdr->frame_control)))
return RX_DROP_MONITOR;
+ if (rx->sta) {
+ /* The security index has the same property as needed
+ * for the rx_msdu field, i.e. it is IEEE80211_NUM_TIDS
+ * for non-QoS-data frames. Here we know it's a data
+ * frame, so count MSDUs.
+ */
+ rx->sta->rx_msdu[rx->security_idx]++;
+ }
+
/*
* Send unexpected-4addr-frame event to hostapd. For older versions,
* also drop the frame to cooked monitor interfaces.