summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/StorageKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-03-31 15:40:16 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-03-31 15:40:16 +0200
commitaaad58f2d6a56830860cb6ddef099096b089c389 (patch)
tree99c6e18b73c6c17463ffa0bd93de62edf71bcddb /dev/kernel/StorageKit
parentb3dfc99a0ac690cf3de2348a8887bfa4bef243bc (diff)
storage: unify naming for drive protocol interface
Renamed `fDriveKind` to `fProtocol` across kernel storage subsystems to clarify its purpose as a protocol identifier (e.g., "AHCI", "ATA-") rather than a general "kind" classification. Updated all affected header and source files: - DriveMgr, HeFS, AHCI, ATADeviceInterface, and NeFS now consistently reference `fProtocol()` instead of `fDriveKind()`. - Added streaming operators (`<<`, `>>`) to AHCI and ATA device interfaces for improved mountpoint interaction. - Promoted `GetPortsImplemented()` and `SetPortsImplemented()` to public for AHCI device configuration. - Added null checks and protocol verification logic in stream operators. This refactor improves clarity and consistency when working with storage devices across the kernel. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/StorageKit')
-rw-r--r--dev/kernel/StorageKit/AHCI.h32
1 files changed, 11 insertions, 21 deletions
diff --git a/dev/kernel/StorageKit/AHCI.h b/dev/kernel/StorageKit/AHCI.h
index caf75991..d6aeaee8 100644
--- a/dev/kernel/StorageKit/AHCI.h
+++ b/dev/kernel/StorageKit/AHCI.h
@@ -27,27 +27,17 @@ namespace Kernel
const Char* Name() const override;
- const UInt16& GetPortsImplemented()
- {
- return this->fPortsImplemented;
- }
-
- Void SetPortsImplemented(const UInt16& pi)
- {
- MUST_PASS(pi > 0);
- this->fPortsImplemented = pi;
- }
-
- const UInt32& GetIndex()
- {
- return this->fDriveIndex;
- }
-
- Void SetIndex(const UInt32& drv)
- {
- MUST_PASS(MountpointInterface::kDriveIndexInvalid != drv);
- this->fDriveIndex = drv;
- }
+ const UInt16& GetPortsImplemented();
+
+ Void SetPortsImplemented(const UInt16& pi);
+
+ const UInt32& GetIndex();
+
+ Void SetIndex(const UInt32& drv);
+
+ public:
+ AHCIDeviceInterface& operator<<(MountpointInterface* Data) override;
+ AHCIDeviceInterface& operator>>(MountpointInterface* Data) override;
private:
Void (*fCleanup)(Void) = {nullptr};