pub struct AtaDriver { /* private fields */ }Expand description
ATA (IDE) driver implementation
Implementations§
Source§impl AtaDriver
impl AtaDriver
Sourcepub fn new(
name: String,
base_port: u16,
is_master: bool,
device_info: DeviceInfo,
) -> Self
pub fn new( name: String, base_port: u16, is_master: bool, device_info: DeviceInfo, ) -> Self
Create a new ATA driver
Sourcepub fn init(&mut self) -> Result<(), KernelError>
pub fn init(&mut self) -> Result<(), KernelError>
Initialize ATA device
Trait Implementations§
Source§impl Driver for AtaDriver
impl Driver for AtaDriver
Source§fn supported_classes(&self) -> Vec<DeviceClass>
fn supported_classes(&self) -> Vec<DeviceClass>
Get supported device classes
Source§fn supports_device(&self, device: &DeviceInfo) -> bool
fn supports_device(&self, device: &DeviceInfo) -> bool
Check if driver supports a device
Source§fn probe(&mut self, _device: &DeviceInfo) -> Result<(), KernelError>
fn probe(&mut self, _device: &DeviceInfo) -> Result<(), KernelError>
Probe device
Source§fn attach(&mut self, _device: &DeviceInfo) -> Result<(), KernelError>
fn attach(&mut self, _device: &DeviceInfo) -> Result<(), KernelError>
Attach to device
Source§fn detach(&mut self, _device: &DeviceInfo) -> Result<(), KernelError>
fn detach(&mut self, _device: &DeviceInfo) -> Result<(), KernelError>
Detach from device
Source§fn suspend(&mut self) -> Result<(), KernelError>
fn suspend(&mut self) -> Result<(), KernelError>
Suspend device
Source§fn resume(&mut self) -> Result<(), KernelError>
fn resume(&mut self) -> Result<(), KernelError>
Resume device
Source§fn handle_interrupt(&mut self, _irq: u8) -> Result<(), KernelError>
fn handle_interrupt(&mut self, _irq: u8) -> Result<(), KernelError>
Handle interrupt
Source§fn read(&mut self, offset: u64, buffer: &mut [u8]) -> Result<usize, KernelError>
fn read(&mut self, offset: u64, buffer: &mut [u8]) -> Result<usize, KernelError>
Read from device
Source§fn write(&mut self, offset: u64, data: &[u8]) -> Result<usize, KernelError>
fn write(&mut self, offset: u64, data: &[u8]) -> Result<usize, KernelError>
Write to device
Source§fn ioctl(&mut self, cmd: u32, _arg: u64) -> Result<u64, KernelError>
fn ioctl(&mut self, cmd: u32, _arg: u64) -> Result<u64, KernelError>
Device control (ioctl)
Source§impl StorageDevice for AtaDriver
impl StorageDevice for AtaDriver
Source§fn get_info(&self) -> StorageInfo
fn get_info(&self) -> StorageInfo
Get device information
Source§fn get_stats(&self) -> StorageStats
fn get_stats(&self) -> StorageStats
Get device statistics
Source§fn reset_stats(&mut self)
fn reset_stats(&mut self)
Reset statistics
Source§fn read_sectors(
&mut self,
lba: u64,
count: u32,
buffer: &mut [u8],
) -> Result<u32, KernelError>
fn read_sectors( &mut self, lba: u64, count: u32, buffer: &mut [u8], ) -> Result<u32, KernelError>
Read sectors
Source§fn write_sectors(
&mut self,
lba: u64,
count: u32,
data: &[u8],
) -> Result<u32, KernelError>
fn write_sectors( &mut self, lba: u64, count: u32, data: &[u8], ) -> Result<u32, KernelError>
Write sectors
Source§fn flush(&mut self) -> Result<(), KernelError>
fn flush(&mut self) -> Result<(), KernelError>
Flush cache
Source§fn max_transfer_sectors(&self) -> u32
fn max_transfer_sectors(&self) -> u32
Get maximum transfer size in sectors