From: Ben Greear Date: Mon, 9 Sep 2019 20:13:56 +0000 (-0700) Subject: iw: Support associated-at station statistic. X-Git-Tag: v5.4~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0b39c408d7002de0255e7b7956c6c7d54763fa01;p=thirdparty%2Fiw.git iw: Support associated-at station statistic. This can be helpful for calculating roaming time and other higher precision stats. Signed-off-by: Ben Greear Link: https://lore.kernel.org/r/1568060037-7481-1-git-send-email-greearb@candelatech.com Signed-off-by: Johannes Berg --- diff --git a/station.c b/station.c index aaad079..61a317d 100644 --- 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;