diff options
author | Daniel Golle <daniel@makrotopia.org> | 2018-02-14 21:37:44 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2018-02-15 04:50:28 +0100 |
commit | 223e09bf3f180797aeea0f6dc1721e5a55215e66 (patch) | |
tree | 83379be65099ee920eccc700e3b9d6139472f056 /iwinfo_nl80211.c | |
parent | fb749bf51a7855ee955fc221acdc51b94231db2b (diff) | |
download | iwinfo-223e09bf3f180797aeea0f6dc1721e5a55215e66.tar.gz |
add support for expected throughput
cfg80211 allows drivers to announce the to-be-expected layer-2 datarate
using the NL80211_STA_INFO_EXPECTED_THROUGHPUT field.
This information is useful as a metric for user-space routing daemons,
so grab it via nl80211 and make it available in both C and Lua APIs,
and show expected throughput on CLI interface assoclist.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'iwinfo_nl80211.c')
-rw-r--r-- | iwinfo_nl80211.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c index 99177e7..738e2f5 100644 --- a/iwinfo_nl80211.c +++ b/iwinfo_nl80211.c @@ -1701,6 +1701,7 @@ static int nl80211_get_assoclist_cb(struct nl_msg *msg, void *arg) [NL80211_STA_INFO_T_OFFSET] = { .type = NLA_U64 }, [NL80211_STA_INFO_STA_FLAGS] = { .minlen = sizeof(struct nl80211_sta_flag_update) }, + [NL80211_STA_INFO_EXPECTED_THROUGHPUT] = { .type = NLA_U32 }, }; static struct nla_policy rate_policy[NL80211_RATE_INFO_MAX + 1] = { @@ -1758,6 +1759,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_EXPECTED_THROUGHPUT]) + e->thr = nla_get_u32(sinfo[NL80211_STA_INFO_EXPECTED_THROUGHPUT]); + /* Station flags */ if (sinfo[NL80211_STA_INFO_STA_FLAGS]) { |