Author: janderwald
Date: Fri May 13 14:04:38 2011
New Revision: 51694
URL:
http://svn.reactos.org/svn/reactos?rev=51694&view=rev
Log:
[USBSTOR]
- Fix bug in read command, which uses wrong format. LBA address is stored in the CDB10
struct
- Don't build the mdl for nonpaged pool if the driver passes an mdl (i/o paging
requests)
- Usbstor can now list disk contents and browse files when used in Windows XP
- Need to implement SCSIOP_WRITE to write files
Modified:
branches/usb-bringup/drivers/usb/usbstor/scsi.c
branches/usb-bringup/drivers/usb/usbstor/usbstor.h
Modified: branches/usb-bringup/drivers/usb/usbstor/scsi.c
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbstor…
==============================================================================
--- branches/usb-bringup/drivers/usb/usbstor/scsi.c [iso-8859-1] (original)
+++ branches/usb-bringup/drivers/usb/usbstor/scsi.c [iso-8859-1] Fri May 13 14:04:38 2011
@@ -507,6 +507,10 @@
return STATUS_INSUFFICIENT_RESOURCES;
}
+ //
+ // build mdl for nonpaged pool
+ //
+ MmBuildMdlForNonPagedPool(Context->TransferBufferMDL);
}
}
else
@@ -522,12 +526,12 @@
//
return STATUS_INSUFFICIENT_RESOURCES;
}
+
+ //
+ // build mdl for nonpaged pool
+ //
+ MmBuildMdlForNonPagedPool(Context->TransferBufferMDL);
}
-
- //
- // build mdl for nonpaged pool
- //
- MmBuildMdlForNonPagedPool(Context->TransferBufferMDL);
}
//
@@ -917,10 +921,12 @@
Cmd.Code = SCSIOP_READ;
Cmd.LUN = (PDODeviceExtension->LUN & MAX_LUN);
Cmd.ContiguousLogicBlocks = _byteswap_ushort(BlockCount);
-
- RtlCopyMemory(&Cmd.LogicalBlockAddress, pCDB->READ12.LogicalBlock,
sizeof(UCHAR) * 4);
-
- DPRINT1("BlockAddress %lu BlockCount %lu BlockLength %lu\n",
NTOHL(Cmd.LogicalBlockAddress), BlockCount, PDODeviceExtension->BlockLength);
+ Cmd.LogicalBlockByte0 = pCDB->CDB10.LogicalBlockByte0;
+ Cmd.LogicalBlockByte1 = pCDB->CDB10.LogicalBlockByte1;
+ Cmd.LogicalBlockByte2 = pCDB->CDB10.LogicalBlockByte2;
+ Cmd.LogicalBlockByte3 = pCDB->CDB10.LogicalBlockByte3;
+
+ DPRINT1("BlockAddress %x%x%x%x BlockCount %lu BlockLength %lu\n",
Cmd.LogicalBlockByte0, Cmd.LogicalBlockByte1, Cmd.LogicalBlockByte2,
Cmd.LogicalBlockByte3, BlockCount, PDODeviceExtension->BlockLength);
//
// send request
Modified: branches/usb-bringup/drivers/usb/usbstor/usbstor.h
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbstor…
==============================================================================
--- branches/usb-bringup/drivers/usb/usbstor/usbstor.h [iso-8859-1] (original)
+++ branches/usb-bringup/drivers/usb/usbstor/usbstor.h [iso-8859-1] Fri May 13 14:04:38
2011
@@ -151,7 +151,10 @@
{
UCHAR Code; // operation code
UCHAR LUN; // lun
- ULONG LogicalBlockAddress; // logical block
address
+ UCHAR LogicalBlockByte0; // lba byte 0
+ UCHAR LogicalBlockByte1; // lba byte 1
+ UCHAR LogicalBlockByte2; // lba byte 2
+ UCHAR LogicalBlockByte3; // lba byte 3
UCHAR Reserved; // reserved 0x00
USHORT ContiguousLogicBlocks; // num of contiguous
logical blocks
UCHAR Reserved1[3]; // reserved 0x00