From 50ce312adac770b79263b008d576e5ba017dc074 Mon Sep 17 00:00:00 2001 From: Reyk Floeter Date: Fri, 23 Jun 2006 21:34:16 +0000 Subject: add an optional max_rssi attribute to the ieee80211com structure and allow to export the RSSI Max value with ioctls and by radiotap headers. ok damien@ jsg@ description: we currently use "dB" as an indication for the signal strength in ifconfig and in the radiotap headers. it means "decibel difference from an arbitrary, fixed reference". this is quite confusing, because different chipsets have different references for the dB/rssi values. we can use the plain RSSI which is described in IEEE 802.11: "The receive signal strength indicator (RSSI) is an optional parameter that has a value of 0 through RSSI Max.". all wireless chipsets have something like a RSSI (normally as a Rx descriptor field), but the value for RSSI Max is chipset-specific. if we know the RSSI Max, we can calculate a percentage which is much easier to understand for the user. we even don't have to use the absolute RSSI Max, we can use an average RSSI Max, figured out by monitoring and tuning the RSSI Max of the drivers. if the user gets a signal of 110%, it would mean "better than the average Max signal". there's no need to do any RSSI calculations in the kernel, it just passes the the relative rssi and max_rssi values to userspace. this is done in the ieee80211_nodereq ioctl structure and possible with a new radiotap header. the radiotap RSSI header allows to get a flexible but common signal indicator instead of the complex and unrelated dB/dBm signal fields. it must include two 8bit values current rssi and RSSI max. --- sys/net80211/ieee80211_ioctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/net80211/ieee80211_ioctl.c') diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index a7cfab1e26f..7d7e79c7dc5 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_ioctl.c,v 1.13 2005/09/13 12:11:03 reyk Exp $ */ +/* $OpenBSD: ieee80211_ioctl.c,v 1.14 2006/06/23 21:34:15 reyk Exp $ */ /* $NetBSD: ieee80211_ioctl.c,v 1.15 2004/05/06 02:58:16 dyoung Exp $ */ /*- @@ -81,6 +81,7 @@ ieee80211_node2req(struct ieee80211com *ic, struct ieee80211_node *ni, /* Node status information */ nr->nr_rssi = (*ic->ic_node_getrssi)(ic, ni); + nr->nr_max_rssi = ic->ic_max_rssi; bcopy(ni->ni_tstamp, nr->nr_tstamp, sizeof(nr->nr_tstamp)); nr->nr_intval = ni->ni_intval; nr->nr_capinfo = ni->ni_capinfo; -- cgit v1.2.3