mirror of
https://github.com/reactos/reactos.git
synced 2025-04-20 04:20:46 +00:00
[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 svn path=/branches/usb-bringup/; revision=51694
This commit is contained in:
parent
eb228159bc
commit
89aa9d3264
2 changed files with 18 additions and 9 deletions
|
@ -507,6 +507,10 @@ USBSTOR_SendRequest(
|
|||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
|
||||
//
|
||||
// build mdl for nonpaged pool
|
||||
//
|
||||
MmBuildMdlForNonPagedPool(Context->TransferBufferMDL);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -522,12 +526,12 @@ USBSTOR_SendRequest(
|
|||
//
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// build mdl for nonpaged pool
|
||||
//
|
||||
MmBuildMdlForNonPagedPool(Context->TransferBufferMDL);
|
||||
//
|
||||
// build mdl for nonpaged pool
|
||||
//
|
||||
MmBuildMdlForNonPagedPool(Context->TransferBufferMDL);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -917,10 +921,12 @@ USBSTOR_SendReadCmd(
|
|||
Cmd.Code = SCSIOP_READ;
|
||||
Cmd.LUN = (PDODeviceExtension->LUN & MAX_LUN);
|
||||
Cmd.ContiguousLogicBlocks = _byteswap_ushort(BlockCount);
|
||||
Cmd.LogicalBlockByte0 = pCDB->CDB10.LogicalBlockByte0;
|
||||
Cmd.LogicalBlockByte1 = pCDB->CDB10.LogicalBlockByte1;
|
||||
Cmd.LogicalBlockByte2 = pCDB->CDB10.LogicalBlockByte2;
|
||||
Cmd.LogicalBlockByte3 = pCDB->CDB10.LogicalBlockByte3;
|
||||
|
||||
RtlCopyMemory(&Cmd.LogicalBlockAddress, pCDB->READ12.LogicalBlock, sizeof(UCHAR) * 4);
|
||||
|
||||
DPRINT1("BlockAddress %lu BlockCount %lu BlockLength %lu\n", NTOHL(Cmd.LogicalBlockAddress), BlockCount, PDODeviceExtension->BlockLength);
|
||||
DPRINT1("BlockAddress %x%x%x%x BlockCount %lu BlockLength %lu\n", Cmd.LogicalBlockByte0, Cmd.LogicalBlockByte1, Cmd.LogicalBlockByte2, Cmd.LogicalBlockByte3, BlockCount, PDODeviceExtension->BlockLength);
|
||||
|
||||
//
|
||||
// send request
|
||||
|
|
|
@ -151,7 +151,10 @@ typedef struct
|
|||
{
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue