From 423dc71cc84bd2096e621f12094098f921a65811 Mon Sep 17 00:00:00 2001 From: Liav A Date: Fri, 5 Aug 2022 13:22:01 +0300 Subject: [PATCH] Kernel/Storage: Remove the stale ATAPIDiscDevice class We don't really support ATAPI (SCSI packets over ATA channels) and it's uncertain if we ever will support such type of media. For this reason, there's basically no reason to keep this code. If we ever introduce ATAPI support into the Kernel, we can simply put this back into the codebase. --- Kernel/CMakeLists.txt | 1 - Kernel/Storage/ATA/ATAPIDiscDevice.cpp | 39 -------------------------- Kernel/Storage/ATA/ATAPIDiscDevice.h | 36 ------------------------ 3 files changed, 76 deletions(-) delete mode 100644 Kernel/Storage/ATA/ATAPIDiscDevice.cpp delete mode 100644 Kernel/Storage/ATA/ATAPIDiscDevice.h diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt index 9f32bbc8d92..6931c5cbb1b 100644 --- a/Kernel/CMakeLists.txt +++ b/Kernel/CMakeLists.txt @@ -101,7 +101,6 @@ set(KERNEL_SOURCES Storage/ATA/GenericIDE/PCIController.cpp Storage/ATA/ATADevice.cpp Storage/ATA/ATADiskDevice.cpp - Storage/ATA/ATAPIDiscDevice.cpp Storage/ATA/ATAPort.cpp Storage/NVMe/NVMeController.cpp Storage/NVMe/NVMeNameSpace.cpp diff --git a/Kernel/Storage/ATA/ATAPIDiscDevice.cpp b/Kernel/Storage/ATA/ATAPIDiscDevice.cpp deleted file mode 100644 index 91723c6304a..00000000000 --- a/Kernel/Storage/ATA/ATAPIDiscDevice.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2021, Liav A. - * - * SPDX-License-Identifier: BSD-2-Clause - */ - -#include -#include -#include -#include -#include - -namespace Kernel { - -NonnullRefPtr ATAPIDiscDevice::create(ATAController const& controller, ATADevice::Address ata_address, u16 capabilities, u64 max_addressable_block) -{ - auto minor_device_number = StorageManagement::generate_storage_minor_number(); - - auto device_name = MUST(KString::formatted("hd{:c}", 'a' + minor_device_number.value())); - - auto disc_device_or_error = DeviceManagement::try_create_device(controller, ata_address, minor_device_number.value(), capabilities, max_addressable_block, move(device_name)); - // FIXME: Find a way to propagate errors - VERIFY(!disc_device_or_error.is_error()); - return disc_device_or_error.release_value(); -} - -ATAPIDiscDevice::ATAPIDiscDevice(ATAController const& controller, ATADevice::Address ata_address, MinorNumber minor_number, u16 capabilities, u64 max_addressable_block, NonnullOwnPtr early_storage_name) - : ATADevice(controller, ata_address, minor_number, capabilities, 0, max_addressable_block, move(early_storage_name)) -{ -} - -ATAPIDiscDevice::~ATAPIDiscDevice() = default; - -StringView ATAPIDiscDevice::class_name() const -{ - return "ATAPIDiscDevice"sv; -} - -} diff --git a/Kernel/Storage/ATA/ATAPIDiscDevice.h b/Kernel/Storage/ATA/ATAPIDiscDevice.h deleted file mode 100644 index daed2e9c7e5..00000000000 --- a/Kernel/Storage/ATA/ATAPIDiscDevice.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2021, Liav A. - * - * SPDX-License-Identifier: BSD-2-Clause - */ - -#pragma once - -#include -#include -#include - -namespace Kernel { - -class IDEController; -class IDEChannel; -class ATAPIDiscDevice final : public ATADevice { - friend class IDEController; - friend class DeviceManagement; - -public: - static NonnullRefPtr create(ATAController const&, ATADevice::Address, u16 capabilities, u64 max_addressable_block); - virtual ~ATAPIDiscDevice() override; - - // ^StorageDevice - virtual CommandSet command_set() const override { return CommandSet::SCSI; } - -private: - virtual InterfaceType interface_type() const override { return InterfaceType::ATA; } - ATAPIDiscDevice(ATAController const&, Address, MinorNumber, u16, u64, NonnullOwnPtr); - - // ^DiskDevice - virtual StringView class_name() const override; -}; - -}