mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:48:11 +00:00
Kernel/Storage: Unify all ATA devices
There's basically no real difference in software between a SATA harddisk and IDE harddisk. The difference in the implementation is for the host bus adapter protocol and registers layout. Therefore, there's no point in putting a distinction in software to these devices. This change also greatly simplifies and removes stale APIs and removes unnecessary parameters in constructor calls, which tighten things further everywhere.
This commit is contained in:
parent
9f501d7e71
commit
741c871bc1
29 changed files with 352 additions and 276 deletions
|
@ -11,7 +11,7 @@
|
|||
#include <Kernel/Bus/PCI/API.h>
|
||||
#include <Kernel/Memory/MemoryManager.h>
|
||||
#include <Kernel/Storage/AHCIController.h>
|
||||
#include <Kernel/Storage/SATADiskDevice.h>
|
||||
#include <Kernel/Storage/AHCIPortHandler.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
@ -58,9 +58,13 @@ size_t AHCIController::devices_count() const
|
|||
return count;
|
||||
}
|
||||
|
||||
void AHCIController::start_request(const StorageDevice&, AsyncBlockDeviceRequest&)
|
||||
void AHCIController::start_request(const ATADevice& device, AsyncBlockDeviceRequest& request)
|
||||
{
|
||||
VERIFY_NOT_REACHED();
|
||||
// FIXME: For now we have one port handler, check all of them...
|
||||
VERIFY(m_handlers.size() > 0);
|
||||
auto port = m_handlers[0].port_at_index(device.ata_address().port);
|
||||
VERIFY(port);
|
||||
port->start_request(request);
|
||||
}
|
||||
|
||||
void AHCIController::complete_current_request(AsyncDeviceRequest::RequestResult)
|
||||
|
@ -80,7 +84,7 @@ volatile AHCI::HBA& AHCIController::hba() const
|
|||
}
|
||||
|
||||
AHCIController::AHCIController(PCI::DeviceIdentifier const& pci_device_identifier)
|
||||
: StorageController()
|
||||
: ATAController()
|
||||
, PCI::Device(pci_device_identifier.address())
|
||||
, m_hba_region(default_hba_region())
|
||||
, m_capabilities(capabilities())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue