]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: print expected throughput when dumping station
authorAntonio Quartulli <antonio@open-mesh.com>
Sat, 17 May 2014 18:17:12 +0000 (20:17 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 3 Jun 2014 19:46:36 +0000 (21:46 +0200)
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
station.c

index 07acdbc7cba71d5d39cb719198ca031ff776ec3b..2b2eef82e4db432e9d31c5a03c51594505eaf715 100644 (file)
--- a/station.c
+++ b/station.c
@@ -226,6 +226,17 @@ static int print_sta_handler(struct nl_msg *msg, void *arg)
                printf("\n\trx bitrate:\t%s", buf);
        }
 
+       if (sinfo[NL80211_STA_INFO_EXPECTED_THROUGHPUT]) {
+               uint32_t thr;
+
+               thr = nla_get_u32(sinfo[NL80211_STA_INFO_EXPECTED_THROUGHPUT]);
+               /* convert in Mbps but scale by 1000 to save kbps units */
+               thr = thr * 1000 / 1024;
+
+               printf("\n\texpected throughput:\t%u.%uMbps",
+                      thr / 1000, thr % 1000);
+       }
+
        if (sinfo[NL80211_STA_INFO_LLID])
                printf("\n\tmesh llid:\t%d",
                        nla_get_u16(sinfo[NL80211_STA_INFO_LLID]));