From 7d5a8e2e07c1f39306bb0256dbc20e13546f056e Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Mon, 21 Jun 2004 21:00:37 +0000 Subject: [PATCH] - Reduced the necessary size of inquiry data to 4 byte. - Incremented the active irp counters in SpiAddActiveIrp, because the valid value is necessary in this function while starting new irp's. - Do not set the command queueing enable flag in SpiAddActiveIrp, because this is the job of a driver above scsiport. svn path=/trunk/; revision=9806 --- reactos/drivers/storage/scsiport/scsiport.c | 34 ++++++++++++--------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/reactos/drivers/storage/scsiport/scsiport.c b/reactos/drivers/storage/scsiport/scsiport.c index 996b2988256..2caa7671ba7 100644 --- a/reactos/drivers/storage/scsiport/scsiport.c +++ b/reactos/drivers/storage/scsiport/scsiport.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: scsiport.c,v 1.61 2004/06/15 09:29:41 hbirr Exp $ +/* $Id: scsiport.c,v 1.62 2004/06/21 21:00:37 hbirr Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -48,6 +48,8 @@ /* GLOBALS *******************************************************************/ +static ULONG InternalDebugLevel = 0; + static VOID SpiProcessRequests(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, PIRP NextIrp); @@ -202,10 +204,8 @@ ScsiDebugPrint(IN ULONG DebugPrintLevel, char Buffer[256]; va_list ap; -#if 0 - if (DebugPrintLevel > InternalDebugLevel) + if (DebugPrintLevel >= InternalDebugLevel) return; -#endif va_start(ap, DebugMessage); vsprintf(Buffer, DebugMessage, ap); @@ -1787,8 +1787,6 @@ SpiAllocateSrbExtension(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, { DeviceExtension->CurrentSrbExtensions++; Srb->SrbExtension = DeviceExtension->VirtualAddress + index * DeviceExtension->SrbExtensionSize; -// Srb->QueueTag = i; -// Srb->QueueAction = SRB_SIMPLE_TAG_REQUEST; } } DPRINT("%x\n", Srb->SrbExtension); @@ -2042,7 +2040,14 @@ SpiScanAdapter (IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension) if (NT_SUCCESS(ScanData->Status) && (Srb->SrbStatus == SRB_STATUS_SUCCESS || (Srb->SrbStatus == SRB_STATUS_DATA_OVERRUN && - Srb->DataTransferLength >= INQUIRYDATABUFFERSIZE)) && + /* + * FIXME: + * The NT 4.0 driver from an inic950 based scsi controller + * returns only 4 byte of inquiry data, but the device name + * is visible on NT 4.0. We must implement an other way + * to get the complete inquiry data. + */ + Srb->DataTransferLength >= /*INQUIRYDATABUFFERSIZE*/4)) && ((PINQUIRYDATA)Srb->DataBuffer)->DeviceTypeQualifier == 0) { /* Copy inquiry data */ @@ -2777,13 +2782,10 @@ SpiAddActiveIrp(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, PSCSI_REQUEST_BLOCK Srb; LunExtension = Irp->Tail.Overlay.DriverContext[2]; Srb = Irp->Tail.Overlay.DriverContext[3]; - Srb->SrbFlags |= SRB_FLAGS_IS_ACTIVE; Irp->Tail.Overlay.DriverContext[0] = (PVOID)DeviceExtension->NextIrp; InterlockedExchangePointer(&DeviceExtension->NextIrp, Irp); Irp->Tail.Overlay.DriverContext[1] = (PVOID)LunExtension->NextIrp; InterlockedExchangePointer(&LunExtension->NextIrp, Irp); - InterlockedIncrement((PLONG)&LunExtension->ActiveIrpCount); - InterlockedIncrement((PLONG)&DeviceExtension->ActiveIrpCount); } static VOID @@ -2838,10 +2840,6 @@ SpiProcessRequests(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, * FIXME: * Is this the right place to set this flag ? */ - if (DeviceExtension->PortConfig->MultipleRequestPerLu) - { - Srb->SrbFlags |= SRB_FLAGS_QUEUE_ACTION_ENABLE; - } NextIrp->Tail.Overlay.DriverContext[2] = (PVOID)Srb->QueueSortKey; LunExtension = Srb->OriginalRequest; @@ -3021,6 +3019,10 @@ SpiProcessRequests(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, { LunExtension->PendingIrpCount--; DeviceExtension->PendingIrpCount--; + Srb->SrbFlags |= SRB_FLAGS_IS_ACTIVE; + LunExtension->ActiveIrpCount++; + DeviceExtension->ActiveIrpCount++; + RemoveEntryList((PLIST_ENTRY)&Irp->Tail.Overlay.DriverContext[0]); Irp->Tail.Overlay.DriverContext[2] = LunExtension; Srb->OriginalRequest = Irp; @@ -3058,6 +3060,10 @@ SpiProcessRequests(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, LunExtension->PendingIrpCount--; DeviceExtension->PendingIrpCount--; + Srb->SrbFlags |= SRB_FLAGS_IS_ACTIVE; + LunExtension->ActiveIrpCount++; + DeviceExtension->ActiveIrpCount++; + SpiAllocateSrbExtension(DeviceExtension, Srb); KeReleaseSpinLockFromDpcLevel(&DeviceExtension->Lock);