1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 04:25:07 +00:00
serenity/Kernel/Storage/ATADevice.cpp
Liav A 741c871bc1 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.
2021-10-09 01:39:55 +02:00

35 lines
1 KiB
C++

/*
* Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/StringView.h>
#include <Kernel/Sections.h>
#include <Kernel/Storage/ATADevice.h>
#include <Kernel/Storage/IDEChannel.h>
#include <Kernel/Storage/IDEController.h>
#include <Kernel/Storage/StorageManagement.h>
namespace Kernel {
ATADevice::ATADevice(const ATAController& controller, ATADevice::Address ata_address, unsigned minor_number, u16 capabilities, u16 logical_sector_size, u64 max_addressable_block, NonnullOwnPtr<KString> early_storage_name)
: StorageDevice(StorageManagement::major_number(), minor_number, logical_sector_size, max_addressable_block, move(early_storage_name))
, m_controller(controller)
, m_ata_address(ata_address)
, m_capabilities(capabilities)
{
}
ATADevice::~ATADevice()
{
}
void ATADevice::start_request(AsyncBlockDeviceRequest& request)
{
auto controller = m_controller.strong_ref();
VERIFY(controller);
controller->start_request(*this, request);
}
}