aboutsummaryrefslogtreecommitdiffstats
path: root/package/iwinfo/src/iwinfo_madwifi.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-02-22 13:39:16 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-02-22 13:39:16 +0000
commit64cc700dccc92924467f6a147a29ceb7550e7059 (patch)
treee75e5d5b3e0ac2625ef3014228a99c22a4c023a4 /package/iwinfo/src/iwinfo_madwifi.c
parenta18a8217334edd0a00cfb5559c1440cff208fdae (diff)
downloadupstream-64cc700dccc92924467f6a147a29ceb7550e7059.tar.gz
upstream-64cc700dccc92924467f6a147a29ceb7550e7059.tar.bz2
upstream-64cc700dccc92924467f6a147a29ceb7550e7059.zip
iwinfo: add per-station rate and mcs info to assoclist op
SVN-Revision: 30682
Diffstat (limited to 'package/iwinfo/src/iwinfo_madwifi.c')
-rw-r--r--package/iwinfo/src/iwinfo_madwifi.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/package/iwinfo/src/iwinfo_madwifi.c b/package/iwinfo/src/iwinfo_madwifi.c
index fcd6c8c987..043cf53e83 100644
--- a/package/iwinfo/src/iwinfo_madwifi.c
+++ b/package/iwinfo/src/iwinfo_madwifi.c
@@ -726,9 +726,29 @@ int madwifi_get_assoclist(const char *ifname, char *buf, int *len)
do {
si = (struct ieee80211req_sta_info *) cp;
+ memset(&entry, 0, sizeof(entry));
+
entry.signal = (si->isi_rssi - 95);
entry.noise = noise;
memcpy(entry.mac, &si->isi_macaddr, 6);
+
+ entry.inactive = si->isi_inact * 1000;
+
+ entry.tx_packets = (si->isi_txseqs[0] & IEEE80211_SEQ_SEQ_MASK)
+ >> IEEE80211_SEQ_SEQ_SHIFT;
+
+ entry.rx_packets = (si->isi_rxseqs[0] & IEEE80211_SEQ_SEQ_MASK)
+ >> IEEE80211_SEQ_SEQ_SHIFT;
+
+ entry.tx_rate.rate =
+ (si->isi_rates[si->isi_txrate] & IEEE80211_RATE_VAL) * 500;
+
+ /* XXX: this is just a guess */
+ entry.rx_rate.rate = entry.tx_rate.rate;
+
+ entry.rx_rate.mcs = -1;
+ entry.tx_rate.mcs = -1;
+
memcpy(&buf[bl], &entry, sizeof(struct iwinfo_assoclist_entry));
bl += sizeof(struct iwinfo_assoclist_entry);