X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=pypcimap.py;h=0c83fa8967a9ff939f0597dd97abd528792f1dd1;hb=1ea96df9c8889e76f8f1223cc6e2e258ed19b50a;hp=9160cc04b867a87a588a541a437c59ee4efd0c3b;hpb=7dae859585f8c35f94b579923f4dcdb81090c062;p=pypcilib.git diff --git a/pypcimap.py b/pypcimap.py index 9160cc0..0c83fa8 100644 --- a/pypcimap.py +++ b/pypcimap.py @@ -36,6 +36,9 @@ import os import re +# These are modules which are only returned if no other driver is available +greylist = ["ata_generic", "eepro100", "8139too"] + class PCIMap: """Encapsulates modules.pcimap""" def __init__(self, filename): @@ -45,12 +48,15 @@ class PCIMap: """Returns a list of candidate modules for the PCI device specified in tuple""" ret = [] for i in self.list: - if ((i[1] == tuple[0] or i[1] == 0xffffffff) and - (i[2] == tuple[1] or i[2] == 0xffffffff) and - (i[3] == tuple[2] or i[3] == 0xffffffff) and - (i[4] == tuple[3] or i[4] == 0xffffffff) and + if ((i[1] == tuple[0] or i[1] == 0xffffffffL) and + (i[2] == tuple[1] or i[2] == 0xffffffffL) and + (i[3] == tuple[2] or i[3] == 0xffffffffL) and + (i[4] == tuple[3] or i[4] == 0xffffffffL) and (i[5] == (tuple[4] & i[6]))): ret.append(i[0]) + for i in greylist: + if i in ret and len(ret) > 1: + ret.remove(i) return ret def add(self, list): # FIXME: check values