iwinfo: nl80211: add more stats to assoclist.
authorDaniel Danzberger <daniel@dd-wrt.com>
Tue, 3 Jul 2018 13:32:10 +0000 (15:32 +0200)
committerJohn Crispin <john@phrozen.org>
Mon, 16 Jul 2018 07:01:23 +0000 (09:01 +0200)
+ 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>
include/iwinfo.h
iwinfo_nl80211.c

index 929f6974f0eb215629a2048f8c834d748f9fd6d3..411120515391336d0cc1ed99e0fba10e5cf451e1 100644 (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;
index ecd2d6ac834a1b1808dca32fa7d3e6ac78023aec..0e0206b81330c028c3efa277455b8c960e6396ea 100644 (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]);