mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Fixed minor bugs.
svn path=/trunk/; revision=2744
This commit is contained in:
parent
4b81987f15
commit
ff879e4069
1 changed files with 9 additions and 11 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: class2.c,v 1.10 2002/03/08 11:59:49 ekohl Exp $
|
/* $Id: class2.c,v 1.11 2002/03/20 19:55:08 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -144,7 +144,7 @@ ScsiClassBuildRequest(PDEVICE_OBJECT DeviceObject,
|
||||||
StartingOffset = CurrentIrpStack->Parameters.Read.ByteOffset;
|
StartingOffset = CurrentIrpStack->Parameters.Read.ByteOffset;
|
||||||
|
|
||||||
/* calculate logical block address */
|
/* calculate logical block address */
|
||||||
StartingBlock.QuadPart = StartingOffset.QuadPart / 512; // >> deviceExtension->SectorShift;
|
StartingBlock.QuadPart = StartingOffset.QuadPart >> DeviceExtension->SectorShift;
|
||||||
LogicalBlockAddress = (ULONG)StartingBlock.u.LowPart;
|
LogicalBlockAddress = (ULONG)StartingBlock.u.LowPart;
|
||||||
|
|
||||||
DPRINT("Logical block address: %lu\n", LogicalBlockAddress);
|
DPRINT("Logical block address: %lu\n", LogicalBlockAddress);
|
||||||
|
@ -161,7 +161,7 @@ ScsiClassBuildRequest(PDEVICE_OBJECT DeviceObject,
|
||||||
Srb->TargetId = DeviceExtension->TargetId;
|
Srb->TargetId = DeviceExtension->TargetId;
|
||||||
Srb->Lun = DeviceExtension->Lun;
|
Srb->Lun = DeviceExtension->Lun;
|
||||||
Srb->Function = SRB_FUNCTION_EXECUTE_SCSI;
|
Srb->Function = SRB_FUNCTION_EXECUTE_SCSI;
|
||||||
Srb->DataBuffer = MmGetMdlVirtualAddress(Irp->MdlAddress);
|
Srb->DataBuffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
|
||||||
Srb->DataTransferLength = CurrentIrpStack->Parameters.Read.Length;
|
Srb->DataTransferLength = CurrentIrpStack->Parameters.Read.Length;
|
||||||
Srb->QueueAction = SRB_SIMPLE_TAG_REQUEST;
|
Srb->QueueAction = SRB_SIMPLE_TAG_REQUEST;
|
||||||
Srb->QueueSortKey = LogicalBlockAddress;
|
Srb->QueueSortKey = LogicalBlockAddress;
|
||||||
|
@ -480,7 +480,7 @@ ScsiClassGetCapabilities(PDEVICE_OBJECT PortDeviceObject,
|
||||||
PIRP Irp;
|
PIRP Irp;
|
||||||
|
|
||||||
*PortCapabilities = NULL;
|
*PortCapabilities = NULL;
|
||||||
Buffer = ExAllocatePool(NonPagedPool, /* FIXME: use paged pool */
|
Buffer = ExAllocatePool(NonPagedPool,
|
||||||
sizeof(IO_SCSI_CAPABILITIES));
|
sizeof(IO_SCSI_CAPABILITIES));
|
||||||
if (Buffer == NULL)
|
if (Buffer == NULL)
|
||||||
{
|
{
|
||||||
|
@ -541,7 +541,7 @@ ScsiClassGetInquiryData(PDEVICE_OBJECT PortDeviceObject,
|
||||||
KEVENT Event;
|
KEVENT Event;
|
||||||
PIRP Irp;
|
PIRP Irp;
|
||||||
|
|
||||||
DPRINT1("ScsiClassGetInquiryData() called\n");
|
DPRINT("ScsiClassGetInquiryData() called\n");
|
||||||
|
|
||||||
*ConfigInfo = NULL;
|
*ConfigInfo = NULL;
|
||||||
Buffer = ExAllocatePool(NonPagedPool,
|
Buffer = ExAllocatePool(NonPagedPool,
|
||||||
|
@ -591,7 +591,7 @@ ScsiClassGetInquiryData(PDEVICE_OBJECT PortDeviceObject,
|
||||||
*ConfigInfo = Buffer;
|
*ConfigInfo = Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT1("ScsiClassGetInquiryData() done\n");
|
DPRINT("ScsiClassGetInquiryData() done\n");
|
||||||
|
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
|
@ -814,7 +814,7 @@ ScsiClassReadDriveCapacity(IN PDEVICE_OBJECT DeviceObject)
|
||||||
|
|
||||||
DeviceExtension = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
DeviceExtension = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||||
|
|
||||||
CapacityBuffer = ExAllocatePool(NonPagedPool, //NonPagedPoolCacheAligned,
|
CapacityBuffer = ExAllocatePool(NonPagedPool,
|
||||||
sizeof(READ_CAPACITY_DATA));
|
sizeof(READ_CAPACITY_DATA));
|
||||||
if (CapacityBuffer == NULL)
|
if (CapacityBuffer == NULL)
|
||||||
{
|
{
|
||||||
|
@ -1063,8 +1063,6 @@ ScsiClassReadWrite(IN PDEVICE_OBJECT DeviceObject,
|
||||||
|
|
||||||
TransferLength = IrpStack->Parameters.Read.Length;
|
TransferLength = IrpStack->Parameters.Read.Length;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ((DeviceObject->Flags & DO_VERIFY_VOLUME) &&
|
if ((DeviceObject->Flags & DO_VERIFY_VOLUME) &&
|
||||||
!(IrpStack->Flags & SL_OVERRIDE_VERIFY_VOLUME))
|
!(IrpStack->Flags & SL_OVERRIDE_VERIFY_VOLUME))
|
||||||
{
|
{
|
||||||
|
@ -1129,10 +1127,10 @@ ScsiClassReadWrite(IN PDEVICE_OBJECT DeviceObject,
|
||||||
IrpStack->Parameters.Read.Length);
|
IrpStack->Parameters.Read.Length);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (IrpStack->Parameters.Read.Length > maximumTransferLength ||
|
if (TransferLength > maximumTransferLength ||
|
||||||
TransferPages > DeviceExtension->PortCapabilities->MaximumPhysicalPages)
|
TransferPages > DeviceExtension->PortCapabilities->MaximumPhysicalPages)
|
||||||
{
|
{
|
||||||
|
/* FIXME: split request */
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue