summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_node.c
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2011-04-08 09:20:45 +0000
committeradrian <adrian@FreeBSD.org>2011-04-08 09:20:45 +0000
commit04a664ee1baf82bf5944c99c19b983121b136b2b (patch)
treef9e05b144f48a3d203c359da6d5d69c1a7c22daa /sys/net80211/ieee80211_node.c
parent416bdcba5e6296557c941806cd8ce943d47a90ff (diff)
downloadFreeBSD-src-04a664ee1baf82bf5944c99c19b983121b136b2b.zip
FreeBSD-src-04a664ee1baf82bf5944c99c19b983121b136b2b.tar.gz
Add initial support for MIMO statistics to net80211.
This introduces struct ieee80211_rx_stats - which stores the various kinds of RX statistics which a MIMO and non-MIMO 802.11 device can export. It also fleshes out the mimo export to userland (node_getmimoinfo()). It assumes that MIMO radios (for now) export both ctl and ext channels. Non-11n MIMO radios are possible (and I believe Atheros made at least one), so if that chipset support is added, extra flags to the struct ieee80211_rx_stats can be added to extend this support. Two new input functions have been added - ieee80211_input_mimo() and ieee80211_input_mimo_all() - which MIMO-aware devices can call with MIMO specific statistics. 802.11 devices calling the non-MIMO input functions will still function.
Diffstat (limited to 'sys/net80211/ieee80211_node.c')
-rw-r--r--sys/net80211/ieee80211_node.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index 104513a..71f97f0 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -1085,7 +1085,26 @@ static void
node_getmimoinfo(const struct ieee80211_node *ni,
struct ieee80211_mimo_info *info)
{
- /* XXX zero data? */
+ int i;
+ uint32_t avgrssi;
+ int32_t rssi;
+
+ bzero(info, sizeof(*info));
+
+ for (i = 0; i < ni->ni_mimo_chains; i++) {
+ avgrssi = ni->ni_mimo_rssi_ctl[i];
+ if (avgrssi == IEEE80211_RSSI_DUMMY_MARKER) {
+ info->rssi[i] = 0;
+ } else {
+ rssi = IEEE80211_RSSI_GET(avgrssi);
+ info->rssi[i] = rssi < 0 ? 0 : rssi > 127 ? 127 : rssi;
+ }
+ info->noise[i] = ni->ni_mimo_noise_ctl[i];
+ }
+
+ /* XXX ext radios? */
+
+ /* XXX EVM? */
}
struct ieee80211_node *
OpenPOWER on IntegriCloud