mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
working past scsi inquiry response issue
This commit is contained in:
parent
17831fe82b
commit
5c5bed2722
5 changed files with 22 additions and 1 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -4408,6 +4408,7 @@ version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"embedded-hal",
|
"embedded-hal",
|
||||||
"itm_logger",
|
"itm_logger",
|
||||||
|
"log",
|
||||||
"nb 0.1.3",
|
"nb 0.1.3",
|
||||||
"packing 0.2.0",
|
"packing 0.2.0",
|
||||||
"typenum",
|
"typenum",
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ pub(crate) fn main_hw() -> ! {
|
||||||
|
|
||||||
let mut ums = usbd_scsi::Scsi::new(
|
let mut ums = usbd_scsi::Scsi::new(
|
||||||
&ums_alloc,
|
&ums_alloc,
|
||||||
16,
|
64,
|
||||||
bd,
|
bd,
|
||||||
"Kosagi".as_bytes(),
|
"Kosagi".as_bytes(),
|
||||||
"Kosagi Precursor".as_bytes(),
|
"Kosagi Precursor".as_bytes(),
|
||||||
|
|
|
||||||
|
|
@ -175,6 +175,9 @@ impl<B: UsbBus> BulkOnlyTransport<'_, B> {
|
||||||
data_done: false,
|
data_done: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
pub fn debug(&self) {
|
||||||
|
log::debug!("data_i: {}, buffer_i: {}, buf: {:x?}", self.data_i, self.buffer_i, self.buffer);
|
||||||
|
}
|
||||||
|
|
||||||
fn max_packet_size(&self) -> u16 {
|
fn max_packet_size(&self) -> u16 {
|
||||||
self.inner.max_packet_size()
|
self.inner.max_packet_size()
|
||||||
|
|
@ -338,6 +341,7 @@ impl<B: UsbBus> BulkOnlyTransport<'_, B> {
|
||||||
let e = s + len;
|
let e = s + len;
|
||||||
|
|
||||||
self.buffer_i += len;
|
self.buffer_i += len;
|
||||||
|
self.command_status_wrapper.data_residue = self.buffer_i as u32;
|
||||||
|
|
||||||
Ok(&mut self.buffer[s..e])
|
Ok(&mut self.buffer[s..e])
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -391,6 +395,15 @@ impl<B: UsbBus> BulkOnlyTransport<'_, B> {
|
||||||
|
|
||||||
let end = start + len;
|
let end = start + len;
|
||||||
|
|
||||||
|
log::debug!("write_packet: start {} end {} buffer_i {} data_i {} residue {} packet_size{}, buf {:x?}",
|
||||||
|
start, end,
|
||||||
|
self.buffer_i,
|
||||||
|
self.data_i,
|
||||||
|
residue,
|
||||||
|
packet_size,
|
||||||
|
self.buffer,
|
||||||
|
);
|
||||||
|
|
||||||
let bytes = self.inner.write_packet(&self.buffer[start..end])?;
|
let bytes = self.inner.write_packet(&self.buffer[start..end])?;
|
||||||
|
|
||||||
self.last_packet_full = bytes == packet_size;
|
self.last_packet_full = bytes == packet_size;
|
||||||
|
|
@ -445,7 +458,9 @@ impl<B: UsbBus> BulkOnlyTransport<'_, B> {
|
||||||
|
|
||||||
fn end_data_transfer(&mut self) -> Result<(), Error> {
|
fn end_data_transfer(&mut self) -> Result<(), Error> {
|
||||||
// Get the csw ready to send
|
// Get the csw ready to send
|
||||||
|
log::debug!("data_i: {}, buffer_i: {}, buf: {:x?}", self.data_i, self.buffer_i, self.buffer);
|
||||||
self.pack_csw();
|
self.pack_csw();
|
||||||
|
log::debug!("data_i: {}, buffer_i: {}, buf: {:x?}", self.data_i, self.buffer_i, self.buffer);
|
||||||
|
|
||||||
// We only send a zero length packet if the last write was a full packet AND we are sending
|
// We only send a zero length packet if the last write was a full packet AND we are sending
|
||||||
// less total bytes than the command header asked for
|
// less total bytes than the command header asked for
|
||||||
|
|
@ -489,6 +504,7 @@ impl<B: UsbBus> BulkOnlyTransport<'_, B> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_end_data_transfer(&mut self) -> Result<(), Error> {
|
fn check_end_data_transfer(&mut self) -> Result<(), Error> {
|
||||||
|
self.flush()?;
|
||||||
match self.state {
|
match self.state {
|
||||||
State::ReceivingDataFromHost => {
|
State::ReceivingDataFromHost => {
|
||||||
// Check if we've read everything we were expecting
|
// Check if we've read everything we were expecting
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ uf2_block = { version = "0.1.0", path = "../uf2_block" }
|
||||||
usbd_mass_storage = { version = "0.1.0", path = "../usbd_mass_storage" }
|
usbd_mass_storage = { version = "0.1.0", path = "../usbd_mass_storage" }
|
||||||
packing = { version = "0.2.0", path = "../packing/packing" }
|
packing = { version = "0.2.0", path = "../packing/packing" }
|
||||||
usbd_bulk_only_transport = { version = "0.1.0", path = "../usbd_bulk_only_transport" }
|
usbd_bulk_only_transport = { version = "0.1.0", path = "../usbd_bulk_only_transport" }
|
||||||
|
log = "0.4.17"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
trace-bot-headers = [ "usbd_bulk_only_transport/trace-bot-headers" ]
|
trace-bot-headers = [ "usbd_bulk_only_transport/trace-bot-headers" ]
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,10 @@ impl<B: UsbBus, BD: BlockDevice> Scsi<'_, B, BD> {
|
||||||
// for descriptor based response data.
|
// for descriptor based response data.
|
||||||
Command::Inquiry(_) => {
|
Command::Inquiry(_) => {
|
||||||
let buf = self.inner.take_buffer_space(InquiryResponse::BYTES)?;
|
let buf = self.inner.take_buffer_space(InquiryResponse::BYTES)?;
|
||||||
|
log::debug!("{:x?}", buf);
|
||||||
self.inquiry_response.pack(buf)?;
|
self.inquiry_response.pack(buf)?;
|
||||||
|
log::debug!("{:x?}", buf);
|
||||||
|
log::debug!("{:x?}", self.inquiry_response);
|
||||||
Done
|
Done
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue