summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2021-11-20 17:28:59 +0200
committerLinus Groh <mail@linusgroh.de>2022-07-19 11:07:34 +0100
commit7719ef3a61e92effc341980b85ea4e363a61a820 (patch)
tree500281e3e39686b0263f2405c44a81a53767dd60 /Kernel
parent2c987367e6171716de07ff9d44cdedaac42ca631 (diff)
downloadserenity-7719ef3a61e92effc341980b85ea4e363a61a820.zip
Kernel/Storage: Move ATA device signature definitions to a general file
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Storage/ATA/AHCI/Definitions.h8
-rw-r--r--Kernel/Storage/ATA/AHCI/Port.cpp2
-rw-r--r--Kernel/Storage/ATA/AHCI/Port.h3
-rw-r--r--Kernel/Storage/ATA/Definitions.h11
4 files changed, 14 insertions, 10 deletions
diff --git a/Kernel/Storage/ATA/AHCI/Definitions.h b/Kernel/Storage/ATA/AHCI/Definitions.h
index 988994ea2a..ffab5a4912 100644
--- a/Kernel/Storage/ATA/AHCI/Definitions.h
+++ b/Kernel/Storage/ATA/AHCI/Definitions.h
@@ -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,
diff --git a/Kernel/Storage/ATA/AHCI/Port.cpp b/Kernel/Storage/ATA/AHCI/Port.cpp
index 33059435ec..97a77b0cdb 100644
--- a/Kernel/Storage/ATA/AHCI/Port.cpp
+++ b/Kernel/Storage/ATA/AHCI/Port.cpp
@@ -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;
diff --git a/Kernel/Storage/ATA/AHCI/Port.h b/Kernel/Storage/ATA/AHCI/Port.h
index db06200579..b2a38dd1f4 100644
--- a/Kernel/Storage/ATA/AHCI/Port.h
+++ b/Kernel/Storage/ATA/AHCI/Port.h
@@ -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; }
diff --git a/Kernel/Storage/ATA/Definitions.h b/Kernel/Storage/ATA/Definitions.h
index 92ac91f9f1..67499e6f40 100644
--- a/Kernel/Storage/ATA/Definitions.h
+++ b/Kernel/Storage/ATA/Definitions.h
@@ -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