]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: add connected time to station info
authorArik Nemtsov <arik@wizery.com>
Wed, 3 Jun 2015 08:32:23 +0000 (11:32 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 17 Jun 2015 09:18:28 +0000 (11:18 +0200)
Useful for long testing scenarios

Signed-off-by: Arik Nemtsov <arik@wizery.com>
--
As a side note, I had to change version.sh to make this compile in the
intel git. The "4.1" tag is missing here, so this line fails in
version.sh:

[ "${descr%%-*}" = "v$VERSION" ] || exit 2

station.c

index 2b2eef82e4db432e9d31c5a03c51594505eaf715..894d978f049110770fc955b3225a6c525fbfccb3 100644 (file)
--- a/station.c
+++ b/station.c
@@ -338,6 +338,10 @@ 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]));
+
        printf("\n");
        return NL_SKIP;
 }