aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-03-25 20:50:39 +0100
committerErwan Velu <erwan.velu@free.fr>2009-03-26 18:28:35 +0100
commitaba85bbc1d1ca6960f14e7e7ccf3520541e2c7ea (patch)
tree2f63ac601d38d7193687bfbb0a17d9b0019b1021 /com32
parent1cabb1459d419c93867ed4d7c92c7781f0656bce (diff)
downloadsyslinux.git-aba85bbc1d1ca6960f14e7e7ccf3520541e2c7ea.tar.gz
syslinux.git-aba85bbc1d1ca6960f14e7e7ccf3520541e2c7ea.tar.xz
syslinux.git-aba85bbc1d1ca6960f14e7e7ccf3520541e2c7ea.zip
hdt: Workaround for PXE detection
Impact: The PCI device matching could fails in some cases In some cases, trying to find the exact bus/dev/fun/vendor/product fails reported by the pxe rom fails. In such case, that workaround will only look at the vendor/product id
Diffstat (limited to 'com32')
-rw-r--r--com32/hdt/hdt-common.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/com32/hdt/hdt-common.c b/com32/hdt/hdt-common.c
index f6f82c7f..d067d114 100644
--- a/com32/hdt/hdt-common.c
+++ b/com32/hdt/hdt-common.c
@@ -297,6 +297,8 @@ int detect_pxe(struct s_hardware *hardware)
}
/* Let's try to find the associated pci device */
detect_pci(hardware);
+
+ /* The firt pass try to find the exact pci device */
hardware->pxe.pci_device = NULL;
hardware->pxe.pci_device_pos = 0;
struct pci_device *pci_device;
@@ -313,8 +315,34 @@ int detect_pxe(struct s_hardware *hardware)
hardware->pxe.pci_device = pci_device;
hardware->pxe.pci_device_pos =
pci_number;
+ return 0;
}
}
+
+ /* If we reach that part, it means the pci device pointed by
+ * the pxe rom wasn't found in our list.
+ * Let's try to find the device only by its pci ids.
+ * The pci device we'll match is maybe not exactly the good one
+ * as we can have the same pci id several times.
+ * At least, the pci id, the vendor/product will be right.
+ * That's clearly a workaround for some weird cases.
+ * This should happend very unlikely */
+ hardware->pxe.pci_device = NULL;
+ hardware->pxe.pci_device_pos = 0;
+ pci_number = 0;
+ for_each_pci_func(pci_device, hardware->pci_domain) {
+ pci_number++;
+ if ((pci_device->vendor ==
+ hardware->pxe.vendor_id)
+ && (pci_device->product ==
+ hardware->pxe.product_id)) {
+ hardware->pxe.pci_device = pci_device;
+ hardware->pxe.pci_device_pos =
+ pci_number;
+ return 0;
+ }
+ }
+
}
}
return 0;