Package: wmwave
Version: 0.4-8
Followup-For: Bug #406947

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.
--- wmwave.c.orig	2007-06-10 12:25:37.207137439 +0100
+++ wmwave.c	2007-06-10 12:26:32.708692414 +0100
@@ -164,14 +164,15 @@
 
 
       /* 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);
+	  level = 128.0+(float)(stats.qual.level - 0x100);
+	  max_level = 128.0;
 
-	  noise = (float)(stats.qual.noise - 0x100);
-	  max_noise = (float)(range.max_qual.noise - 0x100);
+	  noise = 128.0+(float)(stats.qual.noise - 0x100);
+	  max_noise = 128.0;
 	}
       else
 	{

Reply via email to