usb: work on SCSI

This commit is contained in:
chemicstry
2023-01-23 15:35:05 +02:00
parent 7515369984
commit 2e5a437e59
14 changed files with 455 additions and 5 deletions

View File

@ -0,0 +1,37 @@
// pub mod bitfield;
pub mod block_device;
pub mod commands;
pub mod enums;
pub mod packet;
pub mod responses;
use self::block_device::BlockDevice;
use crate::class::msc::transport::{self, CommandSetHandler};
pub struct Scsi<B: BlockDevice> {
device: B,
}
impl<B: BlockDevice> CommandSetHandler for Scsi<B> {
async fn command_out(
&mut self,
lun: u8,
cmd: &[u8],
pipe: &mut impl transport::DataPipeOut,
) -> Result<(), transport::CommandError> {
assert!(lun == 0, "LUNs are not supported");
Ok(())
}
async fn command_in(
&mut self,
lun: u8,
cmd: &[u8],
pipe: &mut impl transport::DataPipeIn,
) -> Result<(), transport::CommandError> {
assert!(lun == 0, "LUNs are not supported");
Ok(())
}
}