[packages] utils/collectd: Updated wireless compatibility patch to support more drivers
authorSteven Barth <cyrus@openwrt.org>
Thu, 5 Jun 2008 20:07:52 +0000 (20:07 +0000)
committerSteven Barth <cyrus@openwrt.org>
Thu, 5 Jun 2008 20:07:52 +0000 (20:07 +0000)
SVN-Revision: 11371

utils/collectd/patches/200-wireless-brcm2.4-compat.patch [deleted file]
utils/collectd/patches/200-wireless-compat.patch [new file with mode: 0644]

diff --git a/utils/collectd/patches/200-wireless-brcm2.4-compat.patch b/utils/collectd/patches/200-wireless-brcm2.4-compat.patch
deleted file mode 100644 (file)
index 064b75d..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
---- collectd-4.4.0.orig/src/wireless.c 2008-05-26 20:13:05.000000000 +0200
-+++ collectd-4.4.0/src/wireless.c      2008-05-26 20:15:16.000000000 +0200
-@@ -128,7 +128,9 @@
-                       power = 1.0; /* invalid */
-               else if ((power >= 0.0) && (power <= 100.0))
-                       power = wireless_percent_to_power (power);
--              else if (power > 100.0)
-+              else if ((power > 100.0) && (power <= 256.0))
-+                      power = power - 256.0;
-+              else
-                       power = 1.0; /* invalid */
-               /* noise [dBm] < 0.0 */
-@@ -137,7 +139,9 @@
-                       noise = 1.0; /* invalid */
-               else if ((noise >= 0.0) && (noise <= 100.0))
-                       noise = wireless_percent_to_power (noise);
--              else if (noise > 100.0)
-+              else if ((noise > 100.0) && (noise <= 256.0))
-+                      noise = noise - 256.0;
-+              else
-                       noise = 1.0; /* invalid */
-               wireless_submit (device, "signal_quality", quality);
diff --git a/utils/collectd/patches/200-wireless-compat.patch b/utils/collectd/patches/200-wireless-compat.patch
new file mode 100644 (file)
index 0000000..72fe43f
--- /dev/null
@@ -0,0 +1,26 @@
+Index: collectd-4.4.0/src/wireless.c
+===================================================================
+--- collectd-4.4.0.orig/src/wireless.c 2008-06-05 21:47:01.000000000 +0200
++++ collectd-4.4.0/src/wireless.c      2008-06-05 21:48:33.000000000 +0200
+@@ -128,7 +128,9 @@
+                       power = 1.0; /* invalid */
+               else if ((power >= 0.0) && (power <= 100.0))
+                       power = wireless_percent_to_power (power);
+-              else if (power > 100.0)
++              else if ((power > 100.0) && (power <= 256.0))
++                      power = power - 256.0;
++              else if (power > 0.0)
+                       power = 1.0; /* invalid */
+               /* noise [dBm] < 0.0 */
+@@ -137,7 +139,9 @@
+                       noise = 1.0; /* invalid */
+               else if ((noise >= 0.0) && (noise <= 100.0))
+                       noise = wireless_percent_to_power (noise);
+-              else if (noise > 100.0)
++              else if ((noise > 100.0) && (noise <= 256.0))
++                      noise = noise - 256.0;
++              else if (noise > 0.0)
+                       noise = 1.0; /* invalid */
+               wireless_submit (device, "signal_quality", quality);