mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
Kernel/Storage: Move ATA device signature definitions to a general file
This commit is contained in:
parent
2c987367e6
commit
7719ef3a61
Notes:
sideshowbarker
2024-07-17 08:47:08 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/7719ef3a61 Pull-request: https://github.com/SerenityOS/serenity/pull/11081 Reviewed-by: https://github.com/Panky-codes Reviewed-by: https://github.com/linusg ✅
4 changed files with 14 additions and 10 deletions
|
@ -264,14 +264,6 @@ struct [[gnu::packed]] HBADefinedCapabilities {
|
|||
bool devsleep_entrance_from_slumber_only : 1 { false };
|
||||
};
|
||||
|
||||
enum DeviceSignature : u32 {
|
||||
ATA = 0x00000101,
|
||||
ATAPI = 0xEB140101,
|
||||
EnclosureManagementBridge = 0xC33C0101,
|
||||
PortMultiplier = 0x96690101,
|
||||
Unconnected = 0xFFFFFFFF
|
||||
};
|
||||
|
||||
enum class DeviceDetectionInitialization {
|
||||
NoActionRequested,
|
||||
PerformInterfaceInitializationSequence,
|
||||
|
|
|
@ -686,7 +686,7 @@ bool AHCIPort::identify_device()
|
|||
command_table.descriptors[0].byte_count = 512 - 1;
|
||||
auto& fis = *(volatile FIS::HostToDevice::Register*)command_table.command_fis;
|
||||
fis.header.fis_type = (u8)FIS::Type::RegisterHostToDevice;
|
||||
fis.command = m_port_registers.sig == AHCI::DeviceSignature::ATAPI ? ATA_CMD_IDENTIFY_PACKET : ATA_CMD_IDENTIFY;
|
||||
fis.command = m_port_registers.sig == ATA::DeviceSignature::ATAPI ? ATA_CMD_IDENTIFY_PACKET : ATA_CMD_IDENTIFY;
|
||||
fis.device = 0;
|
||||
fis.header.port_muliplier = fis.header.port_muliplier | (u8)FIS::HeaderAttributes::C;
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <Kernel/Storage/ATA/AHCI/Definitions.h>
|
||||
#include <Kernel/Storage/ATA/AHCI/InterruptHandler.h>
|
||||
#include <Kernel/Storage/ATA/ATADevice.h>
|
||||
#include <Kernel/Storage/ATA/Definitions.h>
|
||||
#include <Kernel/WaitQueue.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
@ -41,7 +42,7 @@ public:
|
|||
u32 port_index() const { return m_port_index; }
|
||||
u32 representative_port_index() const { return port_index() + 1; }
|
||||
bool is_operable() const;
|
||||
bool is_atapi_attached() const { return m_port_registers.sig == (u32)AHCI::DeviceSignature::ATAPI; };
|
||||
bool is_atapi_attached() const { return m_port_registers.sig == (u32)ATA::DeviceSignature::ATAPI; };
|
||||
|
||||
RefPtr<StorageDevice> connected_device() const { return m_connected_device; }
|
||||
|
||||
|
|
|
@ -6,6 +6,17 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
namespace Kernel::ATA {
|
||||
|
||||
enum DeviceSignature : u32 {
|
||||
ATA = 0x00000101,
|
||||
ATAPI = 0xEB140101,
|
||||
EnclosureManagementBridge = 0xC33C0101,
|
||||
PortMultiplier = 0x96690101,
|
||||
Unconnected = 0xFFFFFFFF
|
||||
};
|
||||
}
|
||||
|
||||
#define ATA_SR_BSY 0x80
|
||||
#define ATA_SR_DRDY 0x40
|
||||
#define ATA_SR_DF 0x20
|
||||
|
|
Loading…
Reference in a new issue