mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 22:45:07 +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
|
@ -10,9 +10,9 @@
|
|||
#include <Kernel/Bus/PCI/API.h>
|
||||
#include <Kernel/FileSystem/ProcFS.h>
|
||||
#include <Kernel/Sections.h>
|
||||
#include <Kernel/Storage/ATADiskDevice.h>
|
||||
#include <Kernel/Storage/BMIDEChannel.h>
|
||||
#include <Kernel/Storage/IDEController.h>
|
||||
#include <Kernel/Storage/PATADiskDevice.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
@ -41,8 +41,18 @@ size_t IDEController::devices_count() const
|
|||
return count;
|
||||
}
|
||||
|
||||
void IDEController::start_request(const StorageDevice&, AsyncBlockDeviceRequest&)
|
||||
void IDEController::start_request(const ATADevice& device, AsyncBlockDeviceRequest& request)
|
||||
{
|
||||
auto& address = device.ata_address();
|
||||
VERIFY(address.subport < 2);
|
||||
switch (address.port) {
|
||||
case 0:
|
||||
m_channels[0].start_request(request, address.subport == 0 ? false : true, device.ata_capabilites());
|
||||
return;
|
||||
case 1:
|
||||
m_channels[1].start_request(request, address.subport == 0 ? false : true, device.ata_capabilites());
|
||||
return;
|
||||
}
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
|
@ -52,7 +62,7 @@ void IDEController::complete_current_request(AsyncDeviceRequest::RequestResult)
|
|||
}
|
||||
|
||||
UNMAP_AFTER_INIT IDEController::IDEController(PCI::DeviceIdentifier const& device_identifier, bool force_pio)
|
||||
: StorageController()
|
||||
: ATAController()
|
||||
, PCI::Device(device_identifier.address())
|
||||
, m_prog_if(device_identifier.prog_if())
|
||||
, m_interrupt_line(device_identifier.interrupt_line())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue