Move AHCI driver into separate drivers/ directory

This commit is contained in:
Justin C. Miller
2018-05-23 00:15:10 -07:00
parent 57829e1b79
commit 2fb92e8592
10 changed files with 28 additions and 6 deletions

View File

@@ -3,16 +3,20 @@
#include "log.h"
#include "pci.h"
namespace ahci {
ahci_driver::ahci_driver()
driver::driver()
{
}
void
ahci_driver::register_device(pci_device *device)
driver::register_device(pci_device *device)
{
log::info(logs::driver, "AHCI registering device %d:%d:%d:",
device->bus(), device->device(), device->function());
ahci::hba &hba = m_devices.emplace(device);
}
} // namespace

View File

@@ -6,13 +6,15 @@
class pci_device;
namespace ahci {
/// Basic AHCI driver
class ahci_driver
class driver
{
public:
/// Constructor.
ahci_driver();
driver();
/// Register a device with the driver
/// \arg device The PCI device to handle
@@ -26,3 +28,4 @@ private:
kutil::vector<ahci::hba> m_devices;
};
} // namespace

View File

@@ -1,10 +1,10 @@
#include <stddef.h>
#include <stdint.h>
#include "ahci/driver.h"
#include "kutil/assert.h"
#include "kutil/memory.h"
#include "acpi_tables.h"
#include "ahci/driver.h"
#include "apic.h"
#include "console.h"
#include "device_manager.h"
@@ -17,7 +17,6 @@
static const char expected_signature[] = "RSD PTR ";
device_manager device_manager::s_instance(nullptr);
ahci_driver ahcid;
struct acpi1_rsdp
{
@@ -292,6 +291,7 @@ device_manager::init_drivers()
{
// Eventually this should be e.g. a lookup into a loadable driver list
// for now, just look for AHCI devices
/*
for (auto &device : m_devices) {
if (device.devclass() != 1 || device.subclass() != 6)
continue;
@@ -303,6 +303,7 @@ device_manager::init_drivers()
ahcid.register_device(&device);
}
*/
}
bool