On 06/04/2016 17:31, David Young wrote:
> On Wed, Apr 06, 2016 at 02:42:16PM +0000, Roy Marples wrote:
>> Module Name: src
>> Committed By:        roy
>> Date:                Wed Apr  6 14:42:16 UTC 2016
>>
>> Modified Files:
>>      src/sys/net80211: ieee80211_ioctl.h ieee80211_node.c ieee80211_node.h
>>          ieee80211_rssadapt.h ieee80211_var.h
>>
>> Log Message:
>> ieee80211 users in Other OS export rssi and noise as int8_t.
>> We should not be the odd one out for no good reason and the majority
>> of the ieee80211 drivers treat rssi as int8_t.
> 
> This may be a more difficult change to make properly than you
> anticipated.  Drivers like rtw(4) assume 0 <= RSSI <= UINT8_MAX.  If you
> put those RSSI into an int8_t, then for high signal strengths the number
> may change sign instead of increase in magnitude.

You're correct, sorry about that.
Still, in the hope that one day I can display my pretty bars we need
some way of telling userland something about the units of RSSI as known
to the driver - maybe we can expose some driver capabilities and do it
there?

struct ieee80211_drivercaps_req {
        uint32_t        dc_drivercaps;
        uint32_t        dc_cryptocaps;
        uint8_t         dc_rssi_min;
        uint8_t         dc_rssi_max;
}
#define IEEE80211_C_RSSI_DBM

So userland can know the minimum and maximum values for RSSI and
optionally what they mean - in this case I want to know that my iwi(4)
and iwn(4) report values in dBm.

Ideally I want to extend ieee80211_input to accept noise (if known) as
well. FreeBSD simply dropped rstamp in the function whereas OpenBSD
converted the last field to a struct which has rssi and rstamp, but
obviously nosie could be added there as well.

Thoughts on this are welcome.

Roy

Reply via email to