Skip to content

Commit 49ece78

Browse files
implement probe
Signed-off-by: Pascal Bauer <pascal.bauer@rwth-aachen.de>
1 parent d35a490 commit 49ece78

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

common/include/villas/kernel/devices/pci_device.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ struct Region {
6262

6363
class PciDevice : public Device {
6464
private:
65+
static constexpr char PROBE_DEFAULT[] = "/sys/bus/pci/drivers_probe";
6566
static constexpr char OVERRIDE_DEFAULT[] = "driver_override";
6667

6768
public:
@@ -79,11 +80,11 @@ class PciDevice : public Device {
7980
std::string name() const override;
8081
std::filesystem::path override_path() const override;
8182
std::filesystem::path path() const override;
83+
void probe() const override;
8284

8385
// Bind a new LKM to the PCI device
8486
bool attachDriver(const std::string &driver) const;
8587

86-
8788
std::list<Region> getRegions() const;
8889

8990
// Write 32-bit BAR value from to the PCI configuration space

common/lib/kernel/devices/pci_device.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,3 +485,7 @@ std::filesystem::path PciDevice::override_path() const {
485485

486486
return this->path() / OVERRIDE_DEFAULT;
487487
}
488+
489+
void PciDevice::probe() const {
490+
write_to_file(this->name(), this->PROBE_DEFAULT);
491+
}

0 commit comments

Comments
 (0)