summaryrefslogtreecommitdiffstats
path: root/src/core/main.c
diff options
context:
space:
mode:
authorMichael Brown2005-04-12 20:04:03 +0200
committerMichael Brown2005-04-12 20:04:03 +0200
commit762fa9a4787a6594e29cb9f90ec99d7396cc2bad (patch)
tree8acdd71ea7414900a91bcbe319f906705071d997 /src/core/main.c
parentUse pci_{vendor,device}_id instead of just pci_{vendor,device}, to avoid (diff)
downloadipxe-762fa9a4787a6594e29cb9f90ec99d7396cc2bad.tar.gz
ipxe-762fa9a4787a6594e29cb9f90ec99d7396cc2bad.tar.xz
ipxe-762fa9a4787a6594e29cb9f90ec99d7396cc2bad.zip
Fix up find_pci_device so that it can be used for scanning for devices
*other* than the main boot device.
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/core/main.c b/src/core/main.c
index ab3ea42f..19802d9d 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -176,7 +176,7 @@ int main ( void ) {
*
*/
for ( ; ; disable ( &dev ), call_reset_fns() ) {
-
+
/* Get next boot device */
if ( ! probe ( &dev ) ) {
/* Reached end of device list */
@@ -210,6 +210,24 @@ void exit(int status)
}
+/*
+ * Set PCI device to use.
+ *
+ * This routine can be called by e.g. the ROM prefix to specify that
+ * the first device to be tried should be the device on which the ROM
+ * was physically located.
+ *
+ * Note that this is deliberately in main.c rather than pci.c, because
+ * this function should generalise to other bus types (e.g. ISAPnP),
+ * and we don't want to end up dragging in pci.o unnecessarily.
+ */
+void set_pci_device ( uint16_t busdevfn ) {
+ dev.devid.bus_type = PCI_BUS_TYPE;
+ dev.pci.busdevfn = busdevfn;
+ dev.pci.already_tried = 0;
+}
+
+
#if 0
static int main_loop(int state)