Author: cgutman Date: Sun Nov 9 09:21:59 2008 New Revision: 37261
URL: http://svn.reactos.org/svn/reactos?rev=37261&view=rev Log: - Mark the irp pending before adding it to the queue - Fix a few comments - Return a better status when a drive isn't present - Complete the read/write irp with IO_DISK_INCREMENT instead of IO_NO_INCREMENT
Modified: trunk/reactos/drivers/storage/floppy/csqrtns.c trunk/reactos/drivers/storage/floppy/floppy.c trunk/reactos/drivers/storage/floppy/readwrite.c
Modified: trunk/reactos/drivers/storage/floppy/csqrtns.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/floppy/csqr... ============================================================================== --- trunk/reactos/drivers/storage/floppy/csqrtns.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/floppy/csqrtns.c [iso-8859-1] Sun Nov 9 09:21:59 2008 @@ -175,5 +175,6 @@ TRACE_(FLOPPY, "CSQ: Inserting IRP 0x%p\n", Irp); InsertTailList(&IrpQueue, &Irp->Tail.Overlay.ListEntry); KeReleaseSemaphore(&QueueSemaphore, 0, 1, FALSE); + IoMarkIrpPending(Irp); }
Modified: trunk/reactos/drivers/storage/floppy/floppy.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/floppy/flop... ============================================================================== --- trunk/reactos/drivers/storage/floppy/floppy.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/floppy/floppy.c [iso-8859-1] Sun Nov 9 09:21:59 2008 @@ -686,16 +686,16 @@ return STATUS_IO_DEVICE_ERROR; }
-/* Check if floppy drive exists */ + /* Check if floppy drive exists */ if(HwSenseInterruptStatus(ControllerInfo) != STATUS_SUCCESS) - { - WARN_(FLOPPY, "Floppy drive not detected! Returning STATUS_IO_DEVICE_ERROR\n"); - return STATUS_IO_DEVICE_ERROR; - } + { + WARN_(FLOPPY, "Floppy drive not detected!\n"); + return STATUS_NO_SUCH_DEVICE; + }
INFO_(FLOPPY, "InitController: resetting the controller after floppy detection\n");
- /* Reset the controller */ + /* Reset the controller again after drive detection */ if(HwReset(ControllerInfo) != STATUS_SUCCESS) { WARN_(FLOPPY, "InitController: unable to reset controller\n"); @@ -984,6 +984,9 @@
/* 3i: Now that we're done, set the Initialized flag so we know to free this in Unload */ gControllerInfo[i].DriveInfo[j].Initialized = TRUE; + + /* 3j: Clear the DO_DEVICE_INITIALIZING flag */ + gControllerInfo[i].DriveInfo[j].DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING; } }
Modified: trunk/reactos/drivers/storage/floppy/readwrite.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/floppy/read... ============================================================================== --- trunk/reactos/drivers/storage/floppy/readwrite.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/floppy/readwrite.c [iso-8859-1] Sun Nov 9 09:21:59 2008 @@ -758,7 +758,7 @@ INFO_(FLOPPY, "ReadWritePassive(): success; Completing with STATUS_SUCCESS\n"); Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = Length; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + IoCompleteRequest(Irp, IO_DISK_INCREMENT); StopMotor(DriveInfo->ControllerInfo); }