From: Felix Fietkau <nbd@openwrt.org>
To: linux-wireless@vger.kernel.org
Cc: johannes@sipsolutions.net
Subject: [PATCH 1/3] iw: dump station rx bit rate information
Date: Thu, 11 Jul 2013 14:20:37 +0200 [thread overview]
Message-ID: <1373545239-78697-1-git-send-email-nbd@openwrt.org> (raw)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
iw.h | 2 +-
link.c | 2 +-
station.c | 12 ++++++++++--
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/iw.h b/iw.h
index 8816e88..854d356 100644
--- a/iw.h
+++ b/iw.h
@@ -170,7 +170,7 @@ enum print_ie_type {
void print_ies(unsigned char *ie, int ielen, bool unknown,
enum print_ie_type ptype);
-void parse_tx_bitrate(struct nlattr *bitrate_attr, char *buf, int buflen);
+void parse_bitrate(struct nlattr *bitrate_attr, char *buf, int buflen);
DECLARE_SECTION(set);
DECLARE_SECTION(get);
diff --git a/link.c b/link.c
index b8acd5c..f7818f5 100644
--- a/link.c
+++ b/link.c
@@ -165,7 +165,7 @@ static int print_link_sta(struct nl_msg *msg, void *arg)
if (sinfo[NL80211_STA_INFO_TX_BITRATE]) {
char buf[100];
- parse_tx_bitrate(sinfo[NL80211_STA_INFO_TX_BITRATE], buf, sizeof(buf));
+ parse_bitrate(sinfo[NL80211_STA_INFO_TX_BITRATE], buf, sizeof(buf));
printf("\ttx bitrate: %s\n", buf);
}
diff --git a/station.c b/station.c
index dde552f..5a161eb 100644
--- a/station.c
+++ b/station.c
@@ -43,7 +43,7 @@ static void print_power_mode(struct nlattr *a)
}
}
-void parse_tx_bitrate(struct nlattr *bitrate_attr, char *buf, int buflen)
+void parse_bitrate(struct nlattr *bitrate_attr, char *buf, int buflen)
{
int rate = 0;
char *pos = buf;
@@ -107,6 +107,7 @@ static int print_sta_handler(struct nl_msg *msg, void *arg)
[NL80211_STA_INFO_SIGNAL] = { .type = NLA_U8 },
[NL80211_STA_INFO_T_OFFSET] = { .type = NLA_U64 },
[NL80211_STA_INFO_TX_BITRATE] = { .type = NLA_NESTED },
+ [NL80211_STA_INFO_RX_BITRATE] = { .type = NLA_NESTED },
[NL80211_STA_INFO_LLID] = { .type = NLA_U16 },
[NL80211_STA_INFO_PLID] = { .type = NLA_U16 },
[NL80211_STA_INFO_PLINK_STATE] = { .type = NLA_U8 },
@@ -177,10 +178,17 @@ static int print_sta_handler(struct nl_msg *msg, void *arg)
if (sinfo[NL80211_STA_INFO_TX_BITRATE]) {
char buf[100];
- parse_tx_bitrate(sinfo[NL80211_STA_INFO_TX_BITRATE], buf, sizeof(buf));
+ parse_bitrate(sinfo[NL80211_STA_INFO_TX_BITRATE], buf, sizeof(buf));
printf("\n\ttx bitrate:\t%s", buf);
}
+ if (sinfo[NL80211_STA_INFO_RX_BITRATE]) {
+ char buf[100];
+
+ parse_bitrate(sinfo[NL80211_STA_INFO_RX_BITRATE], buf, sizeof(buf));
+ printf("\n\trx bitrate:\t%s", buf);
+ }
+
if (sinfo[NL80211_STA_INFO_LLID])
printf("\n\tmesh llid:\t%d",
nla_get_u16(sinfo[NL80211_STA_INFO_LLID]));
--
1.8.0.2
next reply other threads:[~2013-07-11 12:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-11 12:20 Felix Fietkau [this message]
2013-07-11 12:20 ` [PATCH 2/3] iw: dump station per-chain signal strength information Felix Fietkau
2013-07-11 12:20 ` [PATCH 3/3] iw: add the active monitor flag Felix Fietkau
2013-07-11 12:27 ` [PATCH 1/3] iw: dump station rx bit rate information Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1373545239-78697-1-git-send-email-nbd@openwrt.org \
--to=nbd@openwrt.org \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).