[PATCH 1/1] UBUNTU: rt2x00: re-adjust wifi signal strength range

Colin King colin.king at canonical.com
Fri Apr 9 09:14:57 UTC 2010

From: Colin Ian King <colin.king at canonical.com>

BugLink: https://bugs.launchpad.net/bugs/557239

The range of signal strength reported by rt2x00 is very narrow and
the base offset is too low.  The original algorithm was based on a
mix of 20% from the RSSI, 40% from RX quality and 40% from TX
quality metrics.

For the rt73usb driver, the TX failure metric is a piece of fiction
and always returns success (unless there is a USB URB failure) so
this skews the TX quality metrics and hence skews the signal
strength result.

The original calculation is only really useful for a network
that you're already connected to.  The reliance on RX and TX
quality metrics when not connected to a network skews the final
signal strength since the only valid metric (RSSI) is a minor
contributor to the final calculation.

A survey of most wifi drivers show that using just the RSSI is
a common method of producing a signal strength metric, so this
fix adjusts the wifi strength to be calculated just on RSSI.

This fix also adjusts the range of the DEFAULT_RSSI_OFFSET to
correctly reflect the absolute maximum range of the RSSI.  The
original code was a little overzealous in providing enough

Signed-off-by: Colin Ian King <colin.king at canonical.com>
 .../drivers/net/wireless/rt2x00/rt2x00.h           |    6 +++---
 .../drivers/net/wireless/rt2x00/rt73usb.h          |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/updates/compat-wireless-2.6/drivers/net/wireless/rt2x00/rt2x00.h b/updates/compat-wireless-2.6/drivers/net/wireless/rt2x00/rt2x00.h
index 311b8d0..97812c8 100644
--- a/updates/compat-wireless-2.6/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/updates/compat-wireless-2.6/drivers/net/wireless/rt2x00/rt2x00.h
@@ -196,9 +196,9 @@ struct link_qual {
 	int tx_percentage;
 	int tx_success;
 	int tx_failed;
-#define WEIGHT_RSSI	20
-#define WEIGHT_RX	40
-#define WEIGHT_TX	40
+#define WEIGHT_RSSI	100
+#define WEIGHT_RX	0
+#define WEIGHT_TX	0
diff --git a/updates/compat-wireless-2.6/drivers/net/wireless/rt2x00/rt73usb.h b/updates/compat-wireless-2.6/drivers/net/wireless/rt2x00/rt73usb.h
index 60f98be..97f9503 100644
--- a/updates/compat-wireless-2.6/drivers/net/wireless/rt2x00/rt73usb.h
+++ b/updates/compat-wireless-2.6/drivers/net/wireless/rt2x00/rt73usb.h
@@ -39,7 +39,7 @@
  * Signal information.
  * Defaul offset is required for RSSI <-> dBm conversion.
  * Register layout information.

More information about the kernel-team mailing list