Author: fireball Date: Wed Mar 28 13:44:37 2007 New Revision: 26191
URL: http://svn.reactos.org/svn/reactos?rev=26191&view=rev Log: - Fix a few simple mistakes / typos. - Enumerating buses almost works.
Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport.c
Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport-ne... ============================================================================== --- trunk/reactos/drivers/storage/scsiport-new/scsiport.c (original) +++ trunk/reactos/drivers/storage/scsiport-new/scsiport.c Wed Mar 28 13:44:37 2007 @@ -743,6 +743,10 @@
/* Initialize the device base list */ InitializeListHead (&DeviceExtension->DeviceBaseListHead); + + /* Initialize array of LUNs */ + RtlZeroMemory(DeviceExtension->LunExtensionList, + sizeof(PSCSI_PORT_LUN_EXTENSION) * LUS_NUMBER);
/* Initialize the spin lock in the controller extension */ KeInitializeSpinLock (&DeviceExtension->IrpLock); @@ -1001,7 +1005,8 @@ IoDeleteDevice (PortDeviceObject); }
- DPRINT("ScsiPortInitialize() done!\n"); + DPRINT("ScsiPortInitialize() done, Status = 0x%08X, DeviceFound = %b!\n", + Status, DeviceFound);
return (DeviceFound == FALSE) ? Status : STATUS_SUCCESS; } @@ -1784,7 +1789,7 @@ LunExtension = DeviceExtension->LunExtensionList[(TargetId + Lun) % LUS_NUMBER];
/* Iterate it until we find what we need */ - while (!LunExtension) + while (LunExtension) { if (LunExtension->TargetId == TargetId && LunExtension->Lun == Lun && @@ -1903,6 +1908,7 @@ INQUIRYDATABUFFERSIZE);
Status = STATUS_SUCCESS; + KeepTrying = FALSE; } else { @@ -1910,14 +1916,21 @@ if (Srb.SrbStatus & SRB_STATUS_QUEUE_FROZEN) { /* Something weird happeend */ + KeepTrying = FALSE; ASSERT(FALSE); }
/* Check if data overrun happened */ if (SRB_STATUS(Srb.SrbStatus) == SRB_STATUS_DATA_OVERRUN) { - /* TODO: Implement */ - ASSERT(FALSE); + /* Nothing dramatic, just copy data, but limiting the size */ + RtlCopyMemory(LunInfo->InquiryData, + InquiryBuffer, + (Srb.DataTransferLength > INQUIRYDATABUFFERSIZE) ? + INQUIRYDATABUFFERSIZE : Srb.DataTransferLength); + + Status = STATUS_SUCCESS; + KeepTrying = FALSE; } else if ((Srb.SrbStatus & SRB_STATUS_AUTOSENSE_VALID) && SenseBuffer->SenseKey == SCSI_SENSE_ILLEGAL_REQUEST) @@ -1926,6 +1939,7 @@ Mark it as invalid anyway */
Status = STATUS_INVALID_DEVICE_REQUEST; + KeepTrying = FALSE; } else { @@ -1946,7 +1960,7 @@ if (SRB_STATUS(Srb.SrbStatus) == SRB_STATUS_BAD_FUNCTION || SRB_STATUS(Srb.SrbStatus) == SRB_STATUS_BAD_SRB_BLOCK_LENGTH) { - Status = STATUS_INVALID_DEVICE_REQUEST; + Status = STATUS_INVALID_DEVICE_REQUEST; } else {