iw: Add support to print station retry counters
[openwrt/svn-archive/archive.git] / package / iw / patches / 302-sta-retries.patch
1 iw: print station retry counters
2
3 From: Bruno Randolf <br1@einfach.org>
4
5 Signed-off-by: Bruno Randolf <br1@einfach.org>
6 ---
7 station.c | 8 ++++++++
8 1 files changed, 8 insertions(+), 0 deletions(-)
9
10 diff --git a/station.c b/station.c
11 index 8cf038d..7639553 100644
12 --- a/station.c
13 +++ b/station.c
14 @@ -48,6 +48,8 @@ static int print_sta_handler(struct nl_msg *msg, void *arg)
15 [NL80211_STA_INFO_LLID] = { .type = NLA_U16 },
16 [NL80211_STA_INFO_PLID] = { .type = NLA_U16 },
17 [NL80211_STA_INFO_PLINK_STATE] = { .type = NLA_U8 },
18 + [NL80211_STA_INFO_TX_RETRIES] = { .type = NLA_U32 },
19 + [NL80211_STA_INFO_TX_FAILED] = { .type = NLA_U32 },
20 };
21
22 static struct nla_policy rate_policy[NL80211_RATE_INFO_MAX + 1] = {
23 @@ -96,6 +98,12 @@ static int print_sta_handler(struct nl_msg *msg, void *arg)
24 if (sinfo[NL80211_STA_INFO_TX_PACKETS])
25 printf("\n\ttx packets:\t%u",
26 nla_get_u32(sinfo[NL80211_STA_INFO_TX_PACKETS]));
27 + if (sinfo[NL80211_STA_INFO_TX_RETRIES])
28 + printf("\n\ttx retries:\t%u",
29 + nla_get_u32(sinfo[NL80211_STA_INFO_TX_RETRIES]));
30 + if (sinfo[NL80211_STA_INFO_TX_FAILED])
31 + printf("\n\ttx failed:\t%u",
32 + nla_get_u32(sinfo[NL80211_STA_INFO_TX_FAILED]));
33 if (sinfo[NL80211_STA_INFO_SIGNAL])
34 printf("\n\tsignal: \t%d dBm",
35 (int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL]));