]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: dump 'rx bitrate' in link stats
authorBrian Norris <briannorris@chromium.org>
Thu, 29 Nov 2018 02:38:48 +0000 (18:38 -0800)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 18 Dec 2018 12:09:17 +0000 (13:09 +0100)
We include it in 'station dump' but not 'link'.

Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
link.c

diff --git a/link.c b/link.c
index 0a323920ff2ff0b1c547cc298fba4d50ec4b05d5..1ed7f631a121a0e41b0b4ba9312c2d23cb136365 100644 (file)
--- a/link.c
+++ b/link.c
@@ -121,6 +121,7 @@ static int print_link_sta(struct nl_msg *msg, void *arg)
                [NL80211_STA_INFO_RX_PACKETS] = { .type = NLA_U32 },
                [NL80211_STA_INFO_TX_PACKETS] = { .type = NLA_U32 },
                [NL80211_STA_INFO_SIGNAL] = { .type = NLA_U8 },
+               [NL80211_STA_INFO_RX_BITRATE] = { .type = NLA_NESTED },
                [NL80211_STA_INFO_TX_BITRATE] = { .type = NLA_NESTED },
                [NL80211_STA_INFO_LLID] = { .type = NLA_U16 },
                [NL80211_STA_INFO_PLID] = { .type = NLA_U16 },
@@ -160,6 +161,12 @@ static int print_link_sta(struct nl_msg *msg, void *arg)
                printf("\tsignal: %d dBm\n",
                        (int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL]));
 
+       if (sinfo[NL80211_STA_INFO_RX_BITRATE]) {
+               char buf[100];
+
+               parse_bitrate(sinfo[NL80211_STA_INFO_RX_BITRATE], buf, sizeof(buf));
+               printf("\trx bitrate: %s\n", buf);
+       }
        if (sinfo[NL80211_STA_INFO_TX_BITRATE]) {
                char buf[100];