diff options
author | Daniel Danzberger <daniel@dd-wrt.com> | 2018-07-03 15:32:10 +0200 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2018-07-16 09:01:23 +0200 |
commit | 2c5c641aabac92932b3855207fb911fdea58eafe (patch) | |
tree | 7e6ea21bd71886934ba563cf5fda4abc96f0cd5f | |
parent | e59f9253aa09a340d235dac074a10a4fe48b62fd (diff) | |
download | iwinfo-2c5c641aabac92932b3855207fb911fdea58eafe.tar.gz |
iwinfo: nl80211: add more stats to assoclist.
+ NL80211_STA_INFO_SIGNAL_AVG
+ NL80211_STA_INFO_RX_DROP_MISC
+ NL80211_STA_INFO_CONNECTED_TIME
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
-rw-r--r-- | include/iwinfo.h | 3 | ||||
-rw-r--r-- | iwinfo_nl80211.c | 12 |
2 files changed, 15 insertions, 0 deletions
diff --git a/include/iwinfo.h b/include/iwinfo.h index 929f697..4111205 100644 --- a/include/iwinfo.h +++ b/include/iwinfo.h @@ -105,10 +105,13 @@ struct iwinfo_rate_entry { struct iwinfo_assoclist_entry { uint8_t mac[6]; int8_t signal; + int8_t signal_avg; int8_t noise; uint32_t inactive; + uint32_t connected_time; uint32_t rx_packets; uint32_t tx_packets; + uint64_t rx_drop_misc; struct iwinfo_rate_entry rx_rate; struct iwinfo_rate_entry tx_rate; uint32_t rx_bytes; diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c index ecd2d6a..0e0206b 100644 --- a/iwinfo_nl80211.c +++ b/iwinfo_nl80211.c @@ -1694,10 +1694,13 @@ static int nl80211_get_assoclist_cb(struct nl_msg *msg, void *arg) [NL80211_STA_INFO_RX_BITRATE] = { .type = NLA_NESTED }, [NL80211_STA_INFO_TX_BITRATE] = { .type = NLA_NESTED }, [NL80211_STA_INFO_SIGNAL] = { .type = NLA_U8 }, + [NL80211_STA_INFO_SIGNAL_AVG] = { .type = NLA_U8 }, [NL80211_STA_INFO_RX_BYTES] = { .type = NLA_U32 }, [NL80211_STA_INFO_TX_BYTES] = { .type = NLA_U32 }, [NL80211_STA_INFO_TX_RETRIES] = { .type = NLA_U32 }, [NL80211_STA_INFO_TX_FAILED] = { .type = NLA_U32 }, + [NL80211_STA_INFO_CONNECTED_TIME]= { .type = NLA_U32 }, + [NL80211_STA_INFO_RX_DROP_MISC] = { .type = NLA_U64 }, [NL80211_STA_INFO_T_OFFSET] = { .type = NLA_U64 }, [NL80211_STA_INFO_STA_FLAGS] = { .minlen = sizeof(struct nl80211_sta_flag_update) }, @@ -1725,9 +1728,15 @@ static int nl80211_get_assoclist_cb(struct nl_msg *msg, void *arg) if (sinfo[NL80211_STA_INFO_SIGNAL]) e->signal = nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL]); + if (sinfo[NL80211_STA_INFO_SIGNAL_AVG]) + e->signal_avg = nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL_AVG]); + if (sinfo[NL80211_STA_INFO_INACTIVE_TIME]) e->inactive = nla_get_u32(sinfo[NL80211_STA_INFO_INACTIVE_TIME]); + if (sinfo[NL80211_STA_INFO_CONNECTED_TIME]) + e->connected_time = nla_get_u32(sinfo[NL80211_STA_INFO_CONNECTED_TIME]); + if (sinfo[NL80211_STA_INFO_RX_PACKETS]) e->rx_packets = nla_get_u32(sinfo[NL80211_STA_INFO_RX_PACKETS]); @@ -1759,6 +1768,9 @@ static int nl80211_get_assoclist_cb(struct nl_msg *msg, void *arg) if (sinfo[NL80211_STA_INFO_T_OFFSET]) e->t_offset = nla_get_u64(sinfo[NL80211_STA_INFO_T_OFFSET]); + if (sinfo[NL80211_STA_INFO_RX_DROP_MISC]) + e->rx_drop_misc = nla_get_u64(sinfo[NL80211_STA_INFO_RX_DROP_MISC]); + if (sinfo[NL80211_STA_INFO_EXPECTED_THROUGHPUT]) e->thr = nla_get_u32(sinfo[NL80211_STA_INFO_EXPECTED_THROUGHPUT]); |