aboutsummaryrefslogtreecommitdiffstats
path: root/include
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 /include
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 'include')
-rw-r--r--include/net/cfg80211.h21
-rw-r--r--include/uapi/linux/nl80211.h31
2 files changed, 52 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 95420fb61600..197735788f18 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -939,6 +939,24 @@ struct sta_bss_parameters {
939 u16 beacon_interval; 939 u16 beacon_interval;
940}; 940};
941 941
942/**
943 * struct cfg80211_tid_stats - per-TID statistics
944 * @filled: bitmap of flags using the bits of &enum nl80211_tid_stats to
945 * indicate the relevant values in this struct are filled
946 * @rx_msdu: number of received MSDUs
947 * @tx_msdu: number of (attempted) transmitted MSDUs
948 * @tx_msdu_retries: number of retries (not counting the first) for
949 * transmitted MSDUs
950 * @tx_msdu_failed: number of failed transmitted MSDUs
951 */
952struct cfg80211_tid_stats {
953 u32 filled;
954 u64 rx_msdu;
955 u64 tx_msdu;
956 u64 tx_msdu_retries;
957 u64 tx_msdu_failed;
958};
959
942#define IEEE80211_MAX_CHAINS 4 960#define IEEE80211_MAX_CHAINS 4
943 961
944/** 962/**
@@ -990,6 +1008,8 @@ struct sta_bss_parameters {
990 * @rx_beacon: number of beacons received from this peer 1008 * @rx_beacon: number of beacons received from this peer
991 * @rx_beacon_signal_avg: signal strength average (in dBm) for beacons received 1009 * @rx_beacon_signal_avg: signal strength average (in dBm) for beacons received
992 * from this peer 1010 * from this peer
1011 * @pertid: per-TID statistics, see &struct cfg80211_tid_stats, using the last
1012 * (IEEE80211_NUM_TIDS) index for MSDUs not encapsulated in QoS-MPDUs.
993 */ 1013 */
994struct station_info { 1014struct station_info {
995 u32 filled; 1015 u32 filled;
@@ -1032,6 +1052,7 @@ struct station_info {
1032 1052
1033 u64 rx_beacon; 1053 u64 rx_beacon;
1034 u8 rx_beacon_signal_avg; 1054 u8 rx_beacon_signal_avg;
1055 struct cfg80211_tid_stats pertid[IEEE80211_NUM_TIDS + 1];
1035}; 1056};
1036 1057
1037/** 1058/**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index b0fb5d598250..a963d4824c51 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2384,6 +2384,11 @@ enum nl80211_sta_bss_param {
2384 * @NL80211_STA_INFO_BEACON_RX: number of beacons received from this peer (u64) 2384 * @NL80211_STA_INFO_BEACON_RX: number of beacons received from this peer (u64)
2385 * @NL80211_STA_INFO_BEACON_SIGNAL_AVG: signal strength average 2385 * @NL80211_STA_INFO_BEACON_SIGNAL_AVG: signal strength average
2386 * for beacons only (u8, dBm) 2386 * for beacons only (u8, dBm)
2387 * @NL80211_STA_INFO_TID_STATS: per-TID statistics (see &enum nl80211_tid_stats)
2388 * This is a nested attribute where each the inner attribute number is the
2389 * TID+1 and the special TID 16 (i.e. value 17) is used for non-QoS frames;
2390 * each one of those is again nested with &enum nl80211_tid_stats
2391 * attributes carrying the actual values.
2387 * @__NL80211_STA_INFO_AFTER_LAST: internal 2392 * @__NL80211_STA_INFO_AFTER_LAST: internal
2388 * @NL80211_STA_INFO_MAX: highest possible station info attribute 2393 * @NL80211_STA_INFO_MAX: highest possible station info attribute
2389 */ 2394 */
@@ -2419,6 +2424,7 @@ enum nl80211_sta_info {
2419 NL80211_STA_INFO_RX_DROP_MISC, 2424 NL80211_STA_INFO_RX_DROP_MISC,
2420 NL80211_STA_INFO_BEACON_RX, 2425 NL80211_STA_INFO_BEACON_RX,
2421 NL80211_STA_INFO_BEACON_SIGNAL_AVG, 2426 NL80211_STA_INFO_BEACON_SIGNAL_AVG,
2427 NL80211_STA_INFO_TID_STATS,
2422 2428
2423 /* keep last */ 2429 /* keep last */
2424 __NL80211_STA_INFO_AFTER_LAST, 2430 __NL80211_STA_INFO_AFTER_LAST,
@@ -2426,6 +2432,31 @@ enum nl80211_sta_info {
2426}; 2432};
2427 2433
2428/** 2434/**
2435 * enum nl80211_tid_stats - per TID statistics attributes
2436 * @__NL80211_TID_STATS_INVALID: attribute number 0 is reserved
2437 * @NL80211_TID_STATS_RX_MSDU: number of MSDUs received (u64)
2438 * @NL80211_TID_STATS_TX_MSDU: number of MSDUs transmitted (or
2439 * attempted to transmit; u64)
2440 * @NL80211_TID_STATS_TX_MSDU_RETRIES: number of retries for
2441 * transmitted MSDUs (not counting the first attempt; u64)
2442 * @NL80211_TID_STATS_TX_MSDU_FAILED: number of failed transmitted
2443 * MSDUs (u64)
2444 * @NUM_NL80211_TID_STATS: number of attributes here
2445 * @NL80211_TID_STATS_MAX: highest numbered attribute here
2446 */
2447enum nl80211_tid_stats {
2448 __NL80211_TID_STATS_INVALID,
2449 NL80211_TID_STATS_RX_MSDU,
2450 NL80211_TID_STATS_TX_MSDU,
2451 NL80211_TID_STATS_TX_MSDU_RETRIES,
2452 NL80211_TID_STATS_TX_MSDU_FAILED,
2453
2454 /* keep last */
2455 NUM_NL80211_TID_STATS,
2456 NL80211_TID_STATS_MAX = NUM_NL80211_TID_STATS - 1
2457};
2458
2459/**
2429 * enum nl80211_mpath_flags - nl80211 mesh path flags 2460 * enum nl80211_mpath_flags - nl80211 mesh path flags
2430 * 2461 *
2431 * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active 2462 * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active