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>
This commit is contained in:
Daniel Danzberger 2018-07-03 15:32:10 +02:00 committed by John Crispin
parent e59f9253aa
commit 2c5c641aab
2 changed files with 15 additions and 0 deletions

View file

@ -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;

View file

@ -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]);