Project : madwifi
Revision : 2384
Author : mentor (Matthew W. S. Bell)
Date : 2007-05-29 06:20:28 +0200 (Tue, 29 May 2007)
Log Message :
Slightly better signal level reporting (including WE < 19)
Affected Files:
* trunk/net80211/ieee80211_linux.h updated
* trunk/net80211/ieee80211_wireless.c updated
Modified: trunk/net80211/ieee80211_linux.h
===================================================================
--- trunk/net80211/ieee80211_linux.h 2007-05-28 17:07:04 UTC (rev 2383)
+++ trunk/net80211/ieee80211_linux.h 2007-05-29 04:20:28 UTC (rev 2384)
@@ -62,7 +62,8 @@
*
* The signal level is noise + rssi.
*
- * Note that the iw_quality values are 1 byte unsigned.
+ * Note that the iw_quality values are 1 byte, and can be signed, unsigned or
+ * negative depending on context.
*
*/
static __inline void
@@ -70,7 +71,7 @@
{
iq->qual = rssi;
iq->noise = noise;
- iq->level = ((rssi + noise) <= 0 ? (rssi + noise) : 0);
+ iq->level = ((((int)rssi + noise) <= 0) ? ((int)rssi + noise) : 0);
iq->updated = IW_QUAL_ALL_UPDATED;
#if WIRELESS_EXT >= 19
iq->updated |= IW_QUAL_DBM;
Modified: trunk/net80211/ieee80211_wireless.c
===================================================================
--- trunk/net80211/ieee80211_wireless.c 2007-05-28 17:07:04 UTC (rev 2383)
+++ trunk/net80211/ieee80211_wireless.c 2007-05-29 04:20:28 UTC (rev 2384)
@@ -949,18 +949,20 @@
}
}
- /* If IW_QUAL_DBM, then these values are assumed to be negative,
- * and values are taken to be in the range -max_qual .. 0. Not
- * sure about WIRELESS_EXT < 19 */
/* Atheros' RSSI value is SNR: 0 -> 60 for old chipsets. Range
* for newer chipsets is unknown. */
range->max_qual.qual = 127;
- /* Min. quality is noise + 1 */
+#if WIRELESS_EXT >= 19
+ /* XXX: This should be updated to use the current noise floor. */
+ /* These are negative full bytes.
+ * Min. quality is noise + 1 */
+ range->max_qual.updated |= IW_QUAL_DBM;
range->max_qual.level = ATH_DEFAULT_NOISE + 1;
- /* XXX: This should be updated to use the current noise floor. */
range->max_qual.noise = ATH_DEFAULT_NOISE;
-#if WIRELESS_EXT >= 19
- range->max_qual.updated |= IW_QUAL_DBM;
+#else
+ /* Values larger than the maximum are assumed to be absolute */
+ range->max_qual.level = 0;
+ range->max_qual.noise = 0;
#endif
range->sensitivity = 3;
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
|
Try Searching:
servers, voip, java, networking, microsoft ...
|
|
|
|