From: Brian Norris Date: Thu, 29 Nov 2018 02:38:48 +0000 (-0800) Subject: iw: dump 'rx bitrate' in link stats X-Git-Tag: v5.0~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c01d5a08d3d3ae0f0ad9cc1ae77f0fe6bf7b8a4;p=thirdparty%2Fiw.git iw: dump 'rx bitrate' in link stats We include it in 'station dump' but not 'link'. Signed-off-by: Brian Norris Signed-off-by: Johannes Berg --- diff --git a/link.c b/link.c index 0a32392..1ed7f63 100644 --- 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];