Kernel/Storage: Move IDE bus master handling code into a separate class

If the user requests to force PIO mode, we just create IDEChannel
objects which are capable of sending PIO commands only.
However, if the user doesn't force PIO mode, we create BMIDEChannel
objects, which are sending DMA commands.

This change is somewhat simplifying the code, so each class is
supporting its type of operation - PIO or DMA. The PATADiskDevice
should not care if DMA is enabled or not.

Later on, we could write an IDEChannel class for UDMA modes,
that are available and documented on Intel specifications for their IDE
controllers.
This commit is contained in:
Liav A 2021-03-27 09:01:00 +03:00 committed by Andreas Kling
commit 833a6bd047
Notes: sideshowbarker 2024-07-18 21:02:02 +09:00
7 changed files with 341 additions and 163 deletions

View file

@ -58,8 +58,7 @@ const char* PATADiskDevice::class_name() const
void PATADiskDevice::start_request(AsyncBlockDeviceRequest& request)
{
bool use_dma = !m_channel->m_io_group.bus_master_base().is_null() && m_channel->m_dma_enabled.resource();
m_channel->start_request(request, use_dma, is_slave(), m_capabilities);
m_channel->start_request(request, is_slave(), m_capabilities);
}
String PATADiskDevice::device_name() const