From eb5639c43ec74cf0fd714685a6add1c54a2388ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Thu, 29 Aug 2013 18:30:48 +0200 Subject: [PATCH] device_manager: tune the search paths * the Virtio RNG PCI device has the class 0, so can't be found using usual paths. Add 0 to _AlwaysRegisterDynamic() and "busses/virtio" in _GetNextDriverPath() for non generic drivers to help finding virtio_pci. * The RNG Virtio device is generic and needs "busses/random" to find virtio_rng. --- src/system/kernel/device_manager/device_manager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/system/kernel/device_manager/device_manager.cpp b/src/system/kernel/device_manager/device_manager.cpp index fff96268c5..e73c025e95 100644 --- a/src/system/kernel/device_manager/device_manager.cpp +++ b/src/system/kernel/device_manager/device_manager.cpp @@ -1608,6 +1608,7 @@ device_node::_GetNextDriverPath(void*& cookie, KPath& _path) _AddPath(*stack, "busses/pci"); _AddPath(*stack, "bus_managers"); } else if (!generic) { + _AddPath(*stack, "busses", "virtio"); _AddPath(*stack, "drivers"); } else { // For generic drivers, we only allow busses when the @@ -1619,7 +1620,8 @@ device_node::_GetNextDriverPath(void*& cookie, KPath& _path) _AddPath(*stack, "busses"); } _AddPath(*stack, "drivers", sGenericContextPath); - _AddPath(*stack, "busses/scsi"); + _AddPath(*stack, "busses/scsi"); + _AddPath(*stack, "busses/random"); } break; } @@ -1736,7 +1738,7 @@ device_node::_AlwaysRegisterDynamic() get_attr_uint16(this, B_DEVICE_TYPE, &type, false); get_attr_uint16(this, B_DEVICE_SUB_TYPE, &subType, false); - return type == PCI_serial_bus || type == PCI_bridge; + return type == PCI_serial_bus || type == PCI_bridge || type == 0; // TODO: we may want to be a bit more specific in the future } @@ -2308,4 +2310,3 @@ device_manager_init_post_modules(struct kernel_args* args) RecursiveLocker _(sLock); return sRootNode->Reprobe(); } -