]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blobdiff - releases/3.6.7/rt2800-validate-step-value-for-temperature-compensation.patch
Linux 3.6.7
[thirdparty/kernel/stable-queue.git] / releases / 3.6.7 / rt2800-validate-step-value-for-temperature-compensation.patch
diff --git a/releases/3.6.7/rt2800-validate-step-value-for-temperature-compensation.patch b/releases/3.6.7/rt2800-validate-step-value-for-temperature-compensation.patch
new file mode 100644 (file)
index 0000000..80c2fb8
--- /dev/null
@@ -0,0 +1,34 @@
+From bf7e1abe434ba9e22e8dc04a4cba4ab504b788b8 Mon Sep 17 00:00:00 2001
+From: Stanislaw Gruszka <sgruszka@redhat.com>
+Date: Thu, 25 Oct 2012 09:51:39 +0200
+Subject: rt2800: validate step value for temperature compensation
+
+From: Stanislaw Gruszka <sgruszka@redhat.com>
+
+commit bf7e1abe434ba9e22e8dc04a4cba4ab504b788b8 upstream.
+
+Some hardware has correct (!= 0xff) value of tssi_bounds[4] in the
+EEPROM, but step is equal to 0xff. This results on ridiculous delta
+calculations and completely broke TX power settings.
+
+Reported-and-tested-by: Pavel Lucik <pavel.lucik@gmail.com>
+Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
+Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
+Signed-off-by: John W. Linville <linville@tuxdriver.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/wireless/rt2x00/rt2800lib.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/rt2x00/rt2800lib.c
++++ b/drivers/net/wireless/rt2x00/rt2800lib.c
+@@ -2395,7 +2395,7 @@ static int rt2800_get_gain_calibration_d
+       /*
+        * Check if temperature compensation is supported.
+        */
+-      if (tssi_bounds[4] == 0xff)
++      if (tssi_bounds[4] == 0xff || step == 0xff)
+               return 0;
+       /*