kernel: add wifi suspend fix to kernel-module-(hostap|orinoco)-cs. Closes 3664.
authorRolf Leggewie <oe-devel@rolf.leggewie.biz>
Thu, 24 Jan 2008 17:49:06 +0000 (17:49 +0000)
committerRolf Leggewie <oe-devel@rolf.leggewie.biz>
Thu, 24 Jan 2008 17:49:06 +0000 (17:49 +0000)
* applies only to kernel later than 2.6.17
* added base_version_less_or_equal function to base.bbclass (thanks, zecke and mickey!)
  to do the comparison.  This does not change existing functionality.  Skipped RFC.

classes/base.bbclass
classes/kernel.bbclass

index d48d2a5..c8ee756 100644 (file)
@@ -128,6 +128,14 @@ def base_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
        else:
                return falsevalue
 
+def base_version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
+    import bb
+    result = bb.vercmp(bb.data.getVar(variable,d,True), checkvalue)
+    if result <= 0:
+        return truevalue
+    else:
+        return falsevalue
+
 def base_contains(variable, checkvalues, truevalue, falsevalue, d):
        import bb
        matches = 0
index 8724ad2..047a3ec 100644 (file)
@@ -180,6 +180,8 @@ FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
 FILES_kernel-dev = "/boot/System.map* /boot/config*"
 FILES_kernel-vmlinux = "/boot/vmlinux*"
 RDEPENDS_kernel = "kernel-base"
+RRECOMMENDS_kernel-module-hostap-cs += '${@base_version_less_or_equal("KERNEL_VERSION", "2.6.17", "", "apm-wifi-suspendfix", d)}'
+RRECOMMENDS_kernel-module-orinoco-cs += '${@base_version_less_or_equal("KERNEL_VERSION", "2.6.17", "", "apm-wifi-suspendfix", d)}'
 # Allow machines to override this dependency if kernel image files are 
 # not wanted in images as standard
 RDEPENDS_kernel-base ?= "kernel-image"