mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 17:45:41 +00:00
Silenced it.
svn path=/trunk/; revision=2685
This commit is contained in:
parent
339287ad60
commit
c10817479d
1 changed files with 48 additions and 19 deletions
|
@ -1,4 +1,22 @@
|
||||||
/* $Id: class2.c,v 1.9 2002/03/04 22:31:22 ekohl Exp $
|
/*
|
||||||
|
* ReactOS kernel
|
||||||
|
* Copyright (C) 2001, 2002 ReactOS Team
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
*/
|
||||||
|
/* $Id: class2.c,v 1.10 2002/03/08 11:59:49 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -129,7 +147,7 @@ ScsiClassBuildRequest(PDEVICE_OBJECT DeviceObject,
|
||||||
StartingBlock.QuadPart = StartingOffset.QuadPart / 512; // >> deviceExtension->SectorShift;
|
StartingBlock.QuadPart = StartingOffset.QuadPart / 512; // >> deviceExtension->SectorShift;
|
||||||
LogicalBlockAddress = (ULONG)StartingBlock.u.LowPart;
|
LogicalBlockAddress = (ULONG)StartingBlock.u.LowPart;
|
||||||
|
|
||||||
DPRINT1("Logical block address: %lu\n", LogicalBlockAddress);
|
DPRINT("Logical block address: %lu\n", LogicalBlockAddress);
|
||||||
|
|
||||||
/* allocate and initialize an SRB */
|
/* allocate and initialize an SRB */
|
||||||
/* FIXME: use lookaside list instead */
|
/* FIXME: use lookaside list instead */
|
||||||
|
@ -180,14 +198,14 @@ ScsiClassBuildRequest(PDEVICE_OBJECT DeviceObject,
|
||||||
|
|
||||||
if (CurrentIrpStack->MajorFunction == IRP_MJ_READ)
|
if (CurrentIrpStack->MajorFunction == IRP_MJ_READ)
|
||||||
{
|
{
|
||||||
DPRINT1("ScsiClassBuildRequest: Read Command\n");
|
DPRINT("ScsiClassBuildRequest: Read Command\n");
|
||||||
|
|
||||||
Srb->SrbFlags |= SRB_FLAGS_DATA_IN;
|
Srb->SrbFlags |= SRB_FLAGS_DATA_IN;
|
||||||
Cdb->CDB10.OperationCode = SCSIOP_READ;
|
Cdb->CDB10.OperationCode = SCSIOP_READ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINT1("ScsiClassBuildRequest: Write Command\n");
|
DPRINT("ScsiClassBuildRequest: Write Command\n");
|
||||||
|
|
||||||
Srb->SrbFlags |= SRB_FLAGS_DATA_OUT;
|
Srb->SrbFlags |= SRB_FLAGS_DATA_OUT;
|
||||||
Cdb->CDB10.OperationCode = SCSIOP_WRITE;
|
Cdb->CDB10.OperationCode = SCSIOP_WRITE;
|
||||||
|
@ -223,7 +241,7 @@ ScsiClassBuildRequest(PDEVICE_OBJECT DeviceObject,
|
||||||
CurrentIrpStack->Parameters.Others.Argument4 = (PVOID)MAXIMUM_RETRIES;
|
CurrentIrpStack->Parameters.Others.Argument4 = (PVOID)MAXIMUM_RETRIES;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DPRINT1("IoSetCompletionRoutine (Irp %p Srb %p)\n", Irp, Srb);
|
DPRINT("IoSetCompletionRoutine (Irp %p Srb %p)\n", Irp, Srb);
|
||||||
IoSetCompletionRoutine(Irp,
|
IoSetCompletionRoutine(Irp,
|
||||||
ScsiClassIoComplete,
|
ScsiClassIoComplete,
|
||||||
Srb,
|
Srb,
|
||||||
|
@ -523,6 +541,8 @@ ScsiClassGetInquiryData(PDEVICE_OBJECT PortDeviceObject,
|
||||||
KEVENT Event;
|
KEVENT Event;
|
||||||
PIRP Irp;
|
PIRP Irp;
|
||||||
|
|
||||||
|
DPRINT1("ScsiClassGetInquiryData() called\n");
|
||||||
|
|
||||||
*ConfigInfo = NULL;
|
*ConfigInfo = NULL;
|
||||||
Buffer = ExAllocatePool(NonPagedPool,
|
Buffer = ExAllocatePool(NonPagedPool,
|
||||||
INQUIRY_DATA_SIZE);
|
INQUIRY_DATA_SIZE);
|
||||||
|
@ -571,6 +591,8 @@ ScsiClassGetInquiryData(PDEVICE_OBJECT PortDeviceObject,
|
||||||
*ConfigInfo = Buffer;
|
*ConfigInfo = Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DPRINT1("ScsiClassGetInquiryData() done\n");
|
||||||
|
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -607,6 +629,8 @@ ScsiClassInitialize(PVOID Argument1,
|
||||||
|
|
||||||
ConfigInfo = IoGetConfigurationInformation();
|
ConfigInfo = IoGetConfigurationInformation();
|
||||||
|
|
||||||
|
DPRINT("ScsiPorts: %lu\n", ConfigInfo->ScsiPortCount);
|
||||||
|
|
||||||
/* look for ScsiPortX scsi port devices */
|
/* look for ScsiPortX scsi port devices */
|
||||||
for (PortNumber = 0; PortNumber < ConfigInfo->ScsiPortCount; PortNumber++)
|
for (PortNumber = 0; PortNumber < ConfigInfo->ScsiPortCount; PortNumber++)
|
||||||
{
|
{
|
||||||
|
@ -635,9 +659,13 @@ ScsiClassInitialize(PVOID Argument1,
|
||||||
DiskFound = TRUE;
|
DiskFound = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DbgPrint("Couldn't find ScsiPort%lu (Status %lx)\n", PortNumber, Status);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT1("ScsiClassInitialize() done!\n");
|
DPRINT("ScsiClassInitialize() done!\n");
|
||||||
|
|
||||||
return((DiskFound == TRUE) ? STATUS_SUCCESS : STATUS_NO_SUCH_DEVICE);
|
return((DiskFound == TRUE) ? STATUS_SUCCESS : STATUS_NO_SUCH_DEVICE);
|
||||||
}
|
}
|
||||||
|
@ -681,12 +709,12 @@ ScsiClassIoComplete(PDEVICE_OBJECT DeviceObject,
|
||||||
PSCSI_REQUEST_BLOCK Srb;
|
PSCSI_REQUEST_BLOCK Srb;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
DPRINT1("ScsiClassIoComplete(DeviceObject %p Irp %p Context %p) called\n",
|
DPRINT("ScsiClassIoComplete(DeviceObject %p Irp %p Context %p) called\n",
|
||||||
DeviceObject, Irp, Context);
|
DeviceObject, Irp, Context);
|
||||||
|
|
||||||
DeviceExtension = DeviceObject->DeviceExtension;
|
DeviceExtension = DeviceObject->DeviceExtension;
|
||||||
Srb = (PSCSI_REQUEST_BLOCK)Context;
|
Srb = (PSCSI_REQUEST_BLOCK)Context;
|
||||||
DPRINT1("Srb %p\n", Srb);
|
DPRINT("Srb %p\n", Srb);
|
||||||
|
|
||||||
IrpStack = IoGetCurrentIrpStackLocation(Irp);
|
IrpStack = IoGetCurrentIrpStackLocation(Irp);
|
||||||
|
|
||||||
|
@ -710,7 +738,7 @@ ScsiClassIoComplete(PDEVICE_OBJECT DeviceObject,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* FIXME: use lookaside list instead */
|
/* FIXME: use lookaside list instead */
|
||||||
DPRINT1("Freed SRB %p\n", IrpStack->Parameters.Scsi.Srb);
|
DPRINT("Freed SRB %p\n", IrpStack->Parameters.Scsi.Srb);
|
||||||
ExFreePool(IrpStack->Parameters.Scsi.Srb);
|
ExFreePool(IrpStack->Parameters.Scsi.Srb);
|
||||||
|
|
||||||
// Irp->IoStatus.Status = Status;
|
// Irp->IoStatus.Status = Status;
|
||||||
|
@ -738,7 +766,7 @@ ScsiClassIoComplete(PDEVICE_OBJECT DeviceObject,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT1("ScsiClassIoComplete() done (Status %lx)\n", Status);
|
DPRINT("ScsiClassIoComplete() done (Status %lx)\n", Status);
|
||||||
|
|
||||||
// return(Status);
|
// return(Status);
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
|
@ -825,7 +853,8 @@ ScsiClassReadDriveCapacity(IN PDEVICE_OBJECT DeviceObject)
|
||||||
DeviceExtension->DiskGeometry->BytesPerSector = SectorSize;
|
DeviceExtension->DiskGeometry->BytesPerSector = SectorSize;
|
||||||
|
|
||||||
DeviceExtension->PartitionLength.QuadPart = (LONGLONG)(LastSector + 1);
|
DeviceExtension->PartitionLength.QuadPart = (LONGLONG)(LastSector + 1);
|
||||||
WHICH_BIT(DeviceExtension->DiskGeometry->BytesPerSector, DeviceExtension->SectorShift);
|
WHICH_BIT(DeviceExtension->DiskGeometry->BytesPerSector,
|
||||||
|
DeviceExtension->SectorShift);
|
||||||
DeviceExtension->PartitionLength.QuadPart =
|
DeviceExtension->PartitionLength.QuadPart =
|
||||||
(DeviceExtension->PartitionLength.QuadPart << DeviceExtension->SectorShift);
|
(DeviceExtension->PartitionLength.QuadPart << DeviceExtension->SectorShift);
|
||||||
|
|
||||||
|
@ -841,12 +870,12 @@ ScsiClassReadDriveCapacity(IN PDEVICE_OBJECT DeviceObject)
|
||||||
DeviceExtension->DiskGeometry->SectorsPerTrack = 32;
|
DeviceExtension->DiskGeometry->SectorsPerTrack = 32;
|
||||||
DeviceExtension->DiskGeometry->TracksPerCylinder = 64;
|
DeviceExtension->DiskGeometry->TracksPerCylinder = 64;
|
||||||
|
|
||||||
DPRINT1("SectorSize: %lu SectorCount: %lu\n", SectorSize, LastSector + 1);
|
DPRINT("SectorSize: %lu SectorCount: %lu\n", SectorSize, LastSector + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ExFreePool(CapacityBuffer);
|
ExFreePool(CapacityBuffer);
|
||||||
|
|
||||||
DPRINT1("ScsiClassReadDriveCapacity() done\n");
|
DPRINT("ScsiClassReadDriveCapacity() done\n");
|
||||||
|
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
|
@ -938,7 +967,7 @@ ScsiClassSendSrbSynchronous(PDEVICE_OBJECT DeviceObject,
|
||||||
&IoStatusBlock);
|
&IoStatusBlock);
|
||||||
if (Irp == NULL)
|
if (Irp == NULL)
|
||||||
{
|
{
|
||||||
DPRINT("IoBuildDeviceIoControlRequest() failed\n");
|
DPRINT1("IoBuildDeviceIoControlRequest() failed\n");
|
||||||
return(STATUS_INSUFFICIENT_RESOURCES);
|
return(STATUS_INSUFFICIENT_RESOURCES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -974,7 +1003,7 @@ ScsiClassSendSrbSynchronous(PDEVICE_OBJECT DeviceObject,
|
||||||
Status = STATUS_SUCCESS;
|
Status = STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT1("ScsiClassSendSrbSynchronous() done\n");
|
DPRINT("ScsiClassSendSrbSynchronous() done\n");
|
||||||
|
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
|
@ -1023,12 +1052,12 @@ ScsiClassReadWrite(IN PDEVICE_OBJECT DeviceObject,
|
||||||
ULONG TransferPages;
|
ULONG TransferPages;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
DPRINT1("ScsiClassReadWrite() called\n");
|
DPRINT("ScsiClassReadWrite() called\n");
|
||||||
|
|
||||||
DeviceExtension = DeviceObject->DeviceExtension;
|
DeviceExtension = DeviceObject->DeviceExtension;
|
||||||
IrpStack = IoGetCurrentIrpStackLocation(Irp);
|
IrpStack = IoGetCurrentIrpStackLocation(Irp);
|
||||||
|
|
||||||
DPRINT1("Relative Offset: %I64u Length: %lu\n",
|
DPRINT("Relative Offset: %I64u Length: %lu\n",
|
||||||
IrpStack->Parameters.Read.ByteOffset.QuadPart,
|
IrpStack->Parameters.Read.ByteOffset.QuadPart,
|
||||||
IrpStack->Parameters.Read.Length);
|
IrpStack->Parameters.Read.Length);
|
||||||
|
|
||||||
|
@ -1079,7 +1108,7 @@ ScsiClassReadWrite(IN PDEVICE_OBJECT DeviceObject,
|
||||||
|
|
||||||
if (DeviceExtension->ClassStartIo != NULL)
|
if (DeviceExtension->ClassStartIo != NULL)
|
||||||
{
|
{
|
||||||
DPRINT1("ScsiClassReadWrite() starting packet\n");
|
DPRINT("ScsiClassReadWrite() starting packet\n");
|
||||||
|
|
||||||
IoMarkIrpPending(Irp);
|
IoMarkIrpPending(Irp);
|
||||||
IoStartPacket(DeviceObject,
|
IoStartPacket(DeviceObject,
|
||||||
|
@ -1110,7 +1139,7 @@ ScsiClassReadWrite(IN PDEVICE_OBJECT DeviceObject,
|
||||||
ScsiClassBuildRequest(DeviceObject,
|
ScsiClassBuildRequest(DeviceObject,
|
||||||
Irp);
|
Irp);
|
||||||
|
|
||||||
DPRINT1("ScsiClassReadWrite() done\n");
|
DPRINT("ScsiClassReadWrite() done\n");
|
||||||
|
|
||||||
/* Call the port driver */
|
/* Call the port driver */
|
||||||
return(IoCallDriver(DeviceExtension->PortDeviceObject,
|
return(IoCallDriver(DeviceExtension->PortDeviceObject,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue