diff --git a/common/include/villas/kernel/devices/generic_driver.hpp b/common/include/villas/kernel/devices/generic_driver.hpp index 8413b63ad..71dbce8d7 100644 --- a/common/include/villas/kernel/devices/generic_driver.hpp +++ b/common/include/villas/kernel/devices/generic_driver.hpp @@ -1,4 +1,4 @@ -/* GenericDriver - Works for standard Linux drivers +/* Implementation of driver interface for Linux/Unix based operation system drivers. * * Author: Pascal Bauer * @@ -17,7 +17,7 @@ namespace villas { namespace kernel { namespace devices { -class GenericDriver : public Driver { +class LinuxDriver : public Driver { private: static constexpr char BIND_DEFAULT[] = "bind"; static constexpr char UNBIND_DEFAULT[] = "unbind"; @@ -30,13 +30,13 @@ private: const std::filesystem::path unbind_path; public: - GenericDriver(const std::filesystem::path path) - : GenericDriver(path, path / std::filesystem::path(BIND_DEFAULT), - path / std::filesystem::path(UNBIND_DEFAULT)){}; + LinuxDriver(const std::filesystem::path path) + : LinuxDriver(path, path / std::filesystem::path(BIND_DEFAULT), + path / std::filesystem::path(UNBIND_DEFAULT)){}; - GenericDriver(const std::filesystem::path path, - const std::filesystem::path bind_path, - const std::filesystem::path unbind_path) + LinuxDriver(const std::filesystem::path path, + const std::filesystem::path bind_path, + const std::filesystem::path unbind_path) : path(path), bind_path(bind_path), unbind_path(unbind_path){}; public: diff --git a/common/lib/kernel/devices/generic_driver.cpp b/common/lib/kernel/devices/generic_driver.cpp index a79ac23b3..68afa4368 100644 --- a/common/lib/kernel/devices/generic_driver.cpp +++ b/common/lib/kernel/devices/generic_driver.cpp @@ -1,4 +1,4 @@ -/* GenericDriver +/* LinuxDriver * * Author: Pascal Bauer * @@ -11,10 +11,10 @@ #include #include -using villas::kernel::devices::Device, villas::kernel::devices::GenericDriver; +using villas::kernel::devices::Device, villas::kernel::devices::LinuxDriver; using villas::utils::write_to_file; -void GenericDriver::attach(const Device &device) const { +void LinuxDriver::attach(const Device &device) const { if (device.driver().has_value()) { device.driver().value()->unbind(device); } @@ -22,19 +22,19 @@ void GenericDriver::attach(const Device &device) const { device.probe(); } -void GenericDriver::bind(const Device &device) const { +void LinuxDriver::bind(const Device &device) const { write_to_file(device.name(), this->bind_path); } -std::string GenericDriver::name() const { +std::string LinuxDriver::name() const { size_t pos = path.u8string().rfind('/'); return path.u8string().substr(pos + 1); } -void GenericDriver::override(const Device &device) const { +void LinuxDriver::override(const Device &device) const { write_to_file(this->name(), device.override_path()); } -void GenericDriver::unbind(const Device &device) const { +void LinuxDriver::unbind(const Device &device) const { write_to_file(device.name(), this->unbind_path); } diff --git a/common/lib/kernel/devices/platform_device.cpp b/common/lib/kernel/devices/platform_device.cpp index f0834887b..9cbbdb929 100644 --- a/common/lib/kernel/devices/platform_device.cpp +++ b/common/lib/kernel/devices/platform_device.cpp @@ -10,7 +10,7 @@ #include #include -using villas::kernel::devices::Driver, villas::kernel::devices::GenericDriver; +using villas::kernel::devices::Driver, villas::kernel::devices::LinuxDriver; using villas::kernel::devices::PlatformDevice; using villas::utils::write_to_file; @@ -23,7 +23,7 @@ std::optional> PlatformDevice::driver() const { std::filesystem::path driver_path = std::filesystem::canonical(driver_symlink); - return std::make_optional(std::make_unique(driver_path)); + return std::make_optional(std::make_unique(driver_path)); } std::optional PlatformDevice::iommu_group() const {