diff --git a/src/add-ons/kernel/bus_managers/pci/pci.cpp b/src/add-ons/kernel/bus_managers/pci/pci.cpp index def68d6f82..3ef74d9fd9 100644 --- a/src/add-ons/kernel/bus_managers/pci/pci.cpp +++ b/src/add-ons/kernel/bus_managers/pci/pci.cpp @@ -13,6 +13,7 @@ #include "util/kernel_cpp.h" #include "pci_fixup.h" +#include "pci_info.h" #include "pci_private.h" #include "pci.h" @@ -414,6 +415,15 @@ pcistatus(int argc, char **argv) } +static int +pcirefresh(int argc, char **argv) +{ + gPCI->RefreshDeviceInfo(); + pci_print_info(); + return 0; +} + + // #pragma mark bus manager init/uninit @@ -450,6 +460,7 @@ pci_init(void) gPCI->InitBus(); add_debugger_command("pcistatus", &pcistatus, "dump and clear pci device status registers"); + add_debugger_command("pcirefresh", &pcirefresh, "refresh and print all pci_info"); return B_OK; } @@ -1319,6 +1330,16 @@ PCI::_ReadHeaderInfo(PCIDev *dev) } +void +PCI::RefreshDeviceInfo() +{ + if (fRootBus == NULL) + return; + + _RefreshDeviceInfo(fRootBus); +} + + void PCI::_RefreshDeviceInfo(PCIBus *bus) { diff --git a/src/add-ons/kernel/bus_managers/pci/pci.h b/src/add-ons/kernel/bus_managers/pci/pci.h index e4c66d227d..670c88d4ef 100644 --- a/src/add-ons/kernel/bus_managers/pci/pci.h +++ b/src/add-ons/kernel/bus_managers/pci/pci.h @@ -103,6 +103,8 @@ public: void ClearDeviceStatus(PCIBus *bus, bool dumpStatus); + void RefreshDeviceInfo(); + private: void _EnumerateBus(int domain, uint8 bus, uint8 *subordinateBus = NULL);