mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:27:45 +00:00
Kernel: Add a method to check the type of a StorageController
Also, the device method in the StorageController class is public now.
This commit is contained in:
parent
28599af387
commit
e3b3805abf
2 changed files with 8 additions and 1 deletions
|
@ -44,6 +44,7 @@ public:
|
||||||
static NonnullRefPtr<IDEController> initialize(PCI::Address address, bool force_pio);
|
static NonnullRefPtr<IDEController> initialize(PCI::Address address, bool force_pio);
|
||||||
virtual ~IDEController() override;
|
virtual ~IDEController() override;
|
||||||
|
|
||||||
|
virtual Type type() const override { return Type::IDE; }
|
||||||
virtual RefPtr<StorageDevice> device(u32 index) override;
|
virtual RefPtr<StorageDevice> device(u32 index) override;
|
||||||
virtual bool reset() override;
|
virtual bool reset() override;
|
||||||
virtual bool shutdown() override;
|
virtual bool shutdown() override;
|
||||||
|
|
|
@ -46,13 +46,19 @@ class StorageController : public RefCounted<StorageController>
|
||||||
, public PCI::DeviceController {
|
, public PCI::DeviceController {
|
||||||
AK_MAKE_ETERNAL
|
AK_MAKE_ETERNAL
|
||||||
public:
|
public:
|
||||||
|
enum class Type : u8 {
|
||||||
|
IDE,
|
||||||
|
NVMe
|
||||||
|
};
|
||||||
|
virtual Type type() const = 0;
|
||||||
|
virtual RefPtr<StorageDevice> device(u32 index) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit StorageController(PCI::Address address)
|
explicit StorageController(PCI::Address address)
|
||||||
: PCI::DeviceController(address)
|
: PCI::DeviceController(address)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual RefPtr<StorageDevice> device(u32 index) = 0;
|
|
||||||
virtual void start_request(const StorageDevice&, AsyncBlockDeviceRequest&) = 0;
|
virtual void start_request(const StorageDevice&, AsyncBlockDeviceRequest&) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue