Skip to main content

AsyncScsiDisk

Trait AsyncScsiDisk 

Source
pub trait AsyncScsiDisk:
    Send
    + Sync
    + Inspect
    + ScsiSaveRestore {
    // Required method
    fn execute_scsi<'a>(
        &'a self,
        external_data: &'a RequestBuffers<'a>,
        request: &'a Request,
    ) -> StackFuture<'a, ScsiResult, { ASYNC_SCSI_DISK_STACK_SIZE }>;

    // Provided method
    fn clear_nexus_state(&self) { ... }
}
Expand description

Trait for issuing SCSI device requests.

Required Methods§

Source

fn execute_scsi<'a>( &'a self, external_data: &'a RequestBuffers<'a>, request: &'a Request, ) -> StackFuture<'a, ScsiResult, { ASYNC_SCSI_DISK_STACK_SIZE }>

Executes a SCSI request.

Provided Methods§

Source

fn clear_nexus_state(&self)

Drops the state that belongs to the initiator, called when the I_T nexus is lost.

SAM defines several pieces of device state as scoped to the nexus rather than to the device: pending sense data, unit attention conditions, and the PREVENT ALLOW MEDIUM REMOVAL setting. When the initiator goes away, so should they, or the next initiator inherits decisions it never made.

State describing the DEVICE rather than the nexus does not belong here. An ejected tray stays ejected and a persistent reservation survives, which is what real hardware does across a bus reset.

The default does nothing, for a device holding no nexus-scoped state.

Implementors§