From 9d16687539c3c8c9f53e4d07ed8dd2bb4f162fbe Mon Sep 17 00:00:00 2001 From: Pascal Bauer Date: Sat, 24 Aug 2024 12:19:44 +0200 Subject: [PATCH] implement probe Signed-off-by: Pascal Bauer --- common/include/villas/kernel/devices/pci_device.hpp | 3 ++- common/lib/kernel/devices/pci_device.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/common/include/villas/kernel/devices/pci_device.hpp b/common/include/villas/kernel/devices/pci_device.hpp index b62595202..8f6a10cf5 100644 --- a/common/include/villas/kernel/devices/pci_device.hpp +++ b/common/include/villas/kernel/devices/pci_device.hpp @@ -62,6 +62,7 @@ struct Region { class PciDevice : public Device { private: + static constexpr char PROBE_DEFAULT[] = "/sys/bus/pci/drivers_probe"; static constexpr char OVERRIDE_DEFAULT[] = "driver_override"; public: @@ -79,11 +80,11 @@ public: std::string name() const override; std::filesystem::path override_path() const override; std::filesystem::path path() const override; + void probe() const override; // Bind a new LKM to the PCI device bool attachDriver(const std::string &driver) const; - std::list getRegions() const; // Write 32-bit BAR value from to the PCI configuration space diff --git a/common/lib/kernel/devices/pci_device.cpp b/common/lib/kernel/devices/pci_device.cpp index 6f2161f3f..425c2ee3b 100644 --- a/common/lib/kernel/devices/pci_device.cpp +++ b/common/lib/kernel/devices/pci_device.cpp @@ -485,3 +485,7 @@ std::filesystem::path PciDevice::override_path() const { return this->path() / OVERRIDE_DEFAULT; } + +void PciDevice::probe() const { + write_to_file(this->name(), this->PROBE_DEFAULT); +}