Skip to content

Commit a723828

Browse files
committed
AtaPassThru: Add read_pio method for AtaRequestBuilder
1 parent d75facc commit a723828

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

uefi/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# uefi - [Unreleased]
22

33
## Added
4+
- Added `proto::ata::AtaRequestBuilder::read_pio()`.
45

56
## Changed
67

uefi/src/proto/ata/mod.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,32 @@ impl<'a> AtaRequestBuilder<'a> {
8787
})
8888
}
8989

90+
// # PIO
91+
// ########################################################################
92+
93+
/// Creates a builder for a PIO write operation.
94+
///
95+
/// This is the protocol variant with the highest compatibility, so probing
96+
/// (sending ATA IDENTIFY commands to device ports to find out whether there
97+
/// is actually a device connected to it) should probably be done using this
98+
/// method most of the time.
99+
///
100+
/// # Arguments
101+
/// - `io_align`: The I/O buffer alignment required for the ATA controller.
102+
/// - `command`: The ATA command byte specifying the write operation.
103+
///
104+
/// # Returns
105+
/// `Result<Self, LayoutError>` indicating success or memory allocation failure.
106+
///
107+
/// # Errors
108+
/// This method can fail due to alignment or memory allocation issues.
109+
pub fn read_pio(io_align: u32, command: u8) -> Result<Self, LayoutError> {
110+
Self::new(io_align, command, AtaPassThruCommandProtocol::PIO_DATA_IN)
111+
}
112+
113+
// # UDMA
114+
// ########################################################################
115+
90116
/// Creates a builder for a UDMA read operation.
91117
///
92118
/// # Arguments

0 commit comments

Comments
 (0)