]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: Support associated-at station statistic.
authorBen Greear <greearb@candelatech.com>
Mon, 9 Sep 2019 20:13:56 +0000 (13:13 -0700)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 11 Sep 2019 07:35:22 +0000 (09:35 +0200)
This can be helpful for calculating roaming time and other
higher precision stats.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Link: https://lore.kernel.org/r/1568060037-7481-1-git-send-email-greearb@candelatech.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
station.c

index aaad079918151d2fd9dd70437dac0e6ff1ad6134..61a317d43aa69df3b6293f0c588891a797a1610f 100644 (file)
--- a/station.c
+++ b/station.c
@@ -569,6 +569,12 @@ static int print_sta_handler(struct nl_msg *msg, void *arg)
        if (sinfo[NL80211_STA_INFO_CONNECTED_TIME])
                printf("\n\tconnected time:\t%u seconds",
                        nla_get_u32(sinfo[NL80211_STA_INFO_CONNECTED_TIME]));
+       if (sinfo[NL80211_STA_INFO_ASSOC_AT_BOOTTIME]) {
+               unsigned long long bt;
+               bt = (unsigned long long)nla_get_u64(sinfo[NL80211_STA_INFO_ASSOC_AT_BOOTTIME]);
+               printf("\n\tassociated at:\t%llu.%.3llus [boottime]",
+                      bt/1000000000, (bt%1000000000)/1000000);
+       }
 
        printf("\n");
        return NL_SKIP;