]> git.pld-linux.org Git - projects/geninitrd.git/blobdiff - mod-sata.sh
there is no bitwise matching only DEVICE_ANY
[projects/geninitrd.git] / mod-sata.sh
index 70bb30b3e39ce8c733116250666b51a6d4897a3d..1262e9d9f2cf86bb32abf38f8fb29cc47f6ca156 100644 (file)
@@ -29,14 +29,12 @@ find_modules_by_class() {
 
        set -- $($lspci -n | awk -vclass=$class '$2 == class":" {split($3, p, ":"); printf("0x0000%s 0x0000%s\n", p[1], p[2])}')
 
-       local pci_module vendor device subvendor subdevice class class_mask driver_data
+       local PCI_ANY_ID=0x0000ffff pci_module vendor device subvendor subdevice class class_mask driver_data
        while read pci_module vendor device subvendor subdevice class class_mask driver_data; do
-               # vendor match is exact
+               # match vendor
                [ "$1" = "$vendor" ] || continue
-               # bitwise mask device first
-               device=$(printf "0x%08x" $(($2 & $device)))
-               # then compare exact match
-               [ "$2" = $device ] || continue
+               # match device, allow PCI_ANY_ID
+               [ "$2" = "$device" -o $device = $PCI_ANY_ID ] || continue
 
                echo "$pci_module"
        done < $pcimap
This page took 0.075038 seconds and 4 git commands to generate.