This commit is contained in:
chemicstry
2023-01-23 18:03:34 +02:00
parent 2e5a437e59
commit b5b1802a57
11 changed files with 381 additions and 187 deletions

View File

@ -2,10 +2,9 @@
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::subclass::scsi::commands::inquiry::InquiryCommand;
use crate::class::msc::transport::{self, CommandSetHandler};
pub struct Scsi<B: BlockDevice> {
@ -21,6 +20,15 @@ impl<B: BlockDevice> CommandSetHandler for Scsi<B> {
) -> Result<(), transport::CommandError> {
assert!(lun == 0, "LUNs are not supported");
let op_code = cmd[0];
match op_code {
InquiryCommand::OPCODE => {
let cmd = InquiryCommand::from_bytes(cmd);
// info!("inquiry: {:#?}", cmd);
}
_ => warn!("Unknown opcode: {}", op_code),
}
Ok(())
}