summaryrefslogtreecommitdiff
path: root/Kernel/Storage/ATA/ATAPIDiscDevice.h
blob: daed2e9c7e529fefc38362abd6afde8de9de014e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <Kernel/Interrupts/IRQHandler.h>
#include <Kernel/Locking/Mutex.h>
#include <Kernel/Storage/ATA/ATADevice.h>

namespace Kernel {

class IDEController;
class IDEChannel;
class ATAPIDiscDevice final : public ATADevice {
    friend class IDEController;
    friend class DeviceManagement;

public:
    static NonnullRefPtr<ATAPIDiscDevice> create(ATAController const&, ATADevice::Address, u16 capabilities, u64 max_addressable_block);
    virtual ~ATAPIDiscDevice() override;

    // ^StorageDevice
    virtual CommandSet command_set() const override { return CommandSet::SCSI; }

private:
    virtual InterfaceType interface_type() const override { return InterfaceType::ATA; }
    ATAPIDiscDevice(ATAController const&, Address, MinorNumber, u16, u64, NonnullOwnPtr<KString>);

    // ^DiskDevice
    virtual StringView class_name() const override;
};

}