Hi Paul, thanks for reopening, I see there's still a problem: On Sun, Jun 10, 2007 at 12:33:46PM +0100, Paul Martin wrote: > There's a bug in wmwave's interpretation of dBm figures. With dBm, the > range values are zero. The following patch will give reasonable > indications. The patch assumes that the absolute minimum value for level > and noise is -128.0dBm. My atheros card reports -96dBm as being the > noise level. What does your card return as range.max_qual.level? Zero?
[..snip..] > /* dBm values need a special treatment */ > - if (stats.qual.updated & IW_QUAL_DBM) > + if ((stats.qual.updated & IW_QUAL_DBM) || > + (stats.qual.level > range.max_qual.level)) > { This part is fine. > - level = (float)(stats.qual.level - 0x100); > - max_level = (float)(range.max_qual.level - 0x100); > + level = 128.0+(float)(stats.qual.level - 0x100); > + max_level = 128.0; I think this isn't correct - except for the case when range.max_qual.level is 0 - what's the value for stats.qual.level (typically)? Does this help: diff --git a/wmwave.c b/wmwave.c index f9fa011..2e0caff 100644 --- a/wmwave.c +++ b/wmwave.c @@ -164,14 +164,20 @@ void DisplayWireless(void) { /* dBm values need a special treatment */ - if (stats.qual.updated & IW_QUAL_DBM) + if ((stats.qual.updated & IW_QUAL_DBM) || + (stats.qual.level > range.max_qual.level)) { - level = (float)(stats.qual.level - 0x100); - max_level = (float)(range.max_qual.level - 0x100); + if(range.max_qual.level) + max_level = (float)(range.max_qual.level - 0x100); + else + max_level = -128.0; noise = (float)(stats.qual.noise - 0x100); - max_noise = (float)(range.max_qual.noise - 0x100); + if(range.max_qual.noise) + max_noise = (float)(range.max_qual.noise - 0x100); + else + max_noise = -128.0; } else { -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]