From 6984ca0592769695b3df0f8b61081f4ffea742b6 Mon Sep 17 00:00:00 2001 From: Julien CLEMENT Date: Mon, 12 Dec 2022 10:19:55 +0100 Subject: [PATCH] Fix scsi send_packet to parse words a little endian Signed-off-by: Julien CLEMENT --- src/drivers/atapi/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/drivers/atapi/mod.rs b/src/drivers/atapi/mod.rs index 5cc2f64..b66db0e 100644 --- a/src/drivers/atapi/mod.rs +++ b/src/drivers/atapi/mod.rs @@ -117,7 +117,7 @@ impl ATABus { } let mut secondary_bus = ATABus::new(ATA_BUS_SECONDARY); - + unsafe { secondary_bus.dcr.write(ATA_SRST); primary_bus.dcr.write(ATA_INTERRUPT_DISABLE); @@ -190,7 +190,7 @@ impl ATABus { self.wait_packet_request(); for i in (0..raw_packet.len()).step_by(2) { - let word = u16::from_be_bytes(raw_packet[i..i+2].try_into().unwrap()); + let word = u16::from_le_bytes(raw_packet[i..i+2].try_into().unwrap()); unsafe { self.data.write(word); } @@ -251,4 +251,4 @@ impl SCSIPacket { fn serialize(&self) -> heapless::Vec { to_vec(&self).unwrap() } -} \ No newline at end of file +}