]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: Add support for NL80211_STA_INFO_RX_DURATION netlink attribute
authorMohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
Thu, 7 Apr 2016 14:30:20 +0000 (20:00 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 31 May 2016 09:39:42 +0000 (11:39 +0200)
Add support for new netlink attribute 'NL80211_STA_INFO_RX_DURATION'.
'NL80211_STA_INFO_RX_DURATION' accounts for aggregate PPDU duration
in microseconds for all the frames from a peer. Drivers can fill
'rx_duration' field and set the flag 'NL80211_STA_INFO_RX_DURATION'.
'rx_duration' will give an idea about the total time spent by our peer
with each of its connected peers.

This will get dumped as part of 'iw dev wlan#N station dump'

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
station.c

index 8fdb83aad906d591906c68e2fd742265d087a3f2..6c408f97efcd1937b2ba5f5fa7ed4967112e3e09 100644 (file)
--- a/station.c
+++ b/station.c
@@ -236,6 +236,7 @@ static int print_sta_handler(struct nl_msg *msg, void *arg)
                [NL80211_STA_INFO_CHAIN_SIGNAL_AVG] = { .type = NLA_NESTED },
                [NL80211_STA_INFO_TID_STATS] = { .type = NLA_NESTED },
                [NL80211_STA_INFO_BSS_PARAM] = { .type = NLA_NESTED },
+               [NL80211_STA_INFO_RX_DURATION] = { .type = NLA_U64 },
        };
        char *chain;
 
@@ -333,6 +334,10 @@ static int print_sta_handler(struct nl_msg *msg, void *arg)
                printf("\n\trx bitrate:\t%s", buf);
        }
 
+       if (sinfo[NL80211_STA_INFO_RX_DURATION])
+               printf("\n\trx duration:\t%lld us",
+                      (unsigned long long)nla_get_u64(sinfo[NL80211_STA_INFO_RX_DURATION]));
+
        if (sinfo[NL80211_STA_INFO_EXPECTED_THROUGHPUT]) {
                uint32_t thr;