aboutsummaryrefslogtreecommitdiff
path: root/kapi
diff options
context:
space:
mode:
Diffstat (limited to 'kapi')
-rw-r--r--kapi/kapi/devices/bus.hpp12
-rw-r--r--kapi/kapi/devices/bus_protocol.hpp3
2 files changed, 12 insertions, 3 deletions
diff --git a/kapi/kapi/devices/bus.hpp b/kapi/kapi/devices/bus.hpp
index 0d679c4e..26b46830 100644
--- a/kapi/kapi/devices/bus.hpp
+++ b/kapi/kapi/devices/bus.hpp
@@ -4,6 +4,7 @@
// IWYU pragma: private, include <kapi/devices.hpp>
#include <kapi/capabilities/facet_id.hpp>
+#include <kapi/devices/bus_protocol.hpp>
#include <kapi/devices/device.hpp>
#include <kstd/memory.hpp>
@@ -28,7 +29,13 @@ namespace kapi::devices
//! Construct a bus with the given name.
//!
//! @param name The name of the bus.
- explicit bus(kstd::string const & name);
+ bus(kstd::string const & name);
+
+ //! Construct a bus with the given name and protocol.
+ //!
+ //! @param name The name of the bus.
+ //! @param protocol The bus protocol to use.
+ bus(kstd::string const & name, bus_protocol & protocol);
//! Attach a child device to this bus.
//!
@@ -47,7 +54,8 @@ namespace kapi::devices
auto query_facet(kapi::capabilities::facet_id facet) -> void * override;
private:
- kstd::vector<kstd::shared_ptr<device>> m_devices;
+ bus_protocol * m_protocol{};
+ kstd::vector<kstd::shared_ptr<device>> m_devices{};
};
//! @}
diff --git a/kapi/kapi/devices/bus_protocol.hpp b/kapi/kapi/devices/bus_protocol.hpp
index cc1f2e5b..5d63a388 100644
--- a/kapi/kapi/devices/bus_protocol.hpp
+++ b/kapi/kapi/devices/bus_protocol.hpp
@@ -4,7 +4,6 @@
// IWYU pragma: private, include <kapi/devices.hpp>
#include <kapi/capabilities/facet_id.hpp>
-#include <kapi/devices/bus.hpp>
#include <kapi/devices/device.hpp>
#include <kapi/devices/driver.hpp>
@@ -15,6 +14,8 @@
namespace kapi::devices
{
+ struct bus;
+
//! Bus specific behavior.
//!
//! A bus protocol defines how a bus discovers its attached children, and how drivers are matched against devices. It