diff options
-rw-r--r-- | src/device/device.c | 7 | ||||
-rw-r--r-- | src/include/device/device.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/device/device.c b/src/device/device.c index bf97997f55..8337d55300 100644 --- a/src/device/device.c +++ b/src/device/device.c @@ -21,6 +21,13 @@ extern struct device *last_dev; /** Linked list of free resources */ struct resource *free_resources = NULL; +/* Disable a PCI device based on bus, device and function. */ +void devfn_disable(const struct bus *bus, unsigned int devfn) +{ + struct device *dev = pcidev_path_behind(bus, devfn); + if (dev) + dev->enabled = 0; +} /** * Initialize all chips of statically known devices. diff --git a/src/include/device/device.h b/src/include/device/device.h index afa6a4090a..8f0650ffd4 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -178,6 +178,8 @@ void dev_initialize(void); void dev_optimize(void); void dev_finalize(void); void dev_finalize_chips(void); +/* Function used to override device state */ +void devfn_disable(const struct bus *bus, unsigned int devfn); /* Generic device helper functions */ int reset_bus(struct bus *bus); |