mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
Kernel: Untangle StorageController from PCI::DeviceController
This commit is contained in:
parent
68c8b52612
commit
2f8b047339
3 changed files with 8 additions and 9 deletions
|
@ -68,7 +68,8 @@ void IDEController::complete_current_request(AsyncDeviceRequest::RequestResult)
|
|||
}
|
||||
|
||||
IDEController::IDEController(PCI::Address address, bool force_pio)
|
||||
: StorageController(address)
|
||||
: StorageController()
|
||||
, PCI::DeviceController(address)
|
||||
{
|
||||
initialize(force_pio);
|
||||
}
|
||||
|
|
|
@ -37,7 +37,8 @@ namespace Kernel {
|
|||
|
||||
class AsyncBlockDeviceRequest;
|
||||
|
||||
class IDEController final : public StorageController {
|
||||
class IDEController final : public StorageController
|
||||
, public PCI::DeviceController {
|
||||
AK_MAKE_ETERNAL
|
||||
public:
|
||||
public:
|
||||
|
|
|
@ -42,24 +42,21 @@ namespace Kernel {
|
|||
|
||||
class AsyncBlockDeviceRequest;
|
||||
class StorageDevice;
|
||||
class StorageController : public RefCounted<StorageController>
|
||||
, public PCI::DeviceController {
|
||||
class StorageController : public RefCounted<StorageController> {
|
||||
AK_MAKE_ETERNAL
|
||||
public:
|
||||
enum class Type : u8 {
|
||||
IDE,
|
||||
NVMe
|
||||
};
|
||||
|
||||
virtual ~StorageController() = default;
|
||||
|
||||
virtual Type type() const = 0;
|
||||
virtual RefPtr<StorageDevice> device(u32 index) const = 0;
|
||||
virtual size_t devices_count() const = 0;
|
||||
|
||||
protected:
|
||||
explicit StorageController(PCI::Address address)
|
||||
: PCI::DeviceController(address)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void start_request(const StorageDevice&, AsyncBlockDeviceRequest&) = 0;
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Add table
Reference in a new issue