Set a better value for gap3 on read/write requests.
authorHartmut Birr <osexpert@googlemail.com>
Sun, 10 Apr 2005 16:44:00 +0000 (16:44 +0000)
committerHartmut Birr <osexpert@googlemail.com>
Sun, 10 Apr 2005 16:44:00 +0000 (16:44 +0000)
svn path=/trunk/; revision=14578

reactos/drivers/storage/floppy/readwrite.c

index c703b23..5cea9bb 100644 (file)
@@ -430,6 +430,7 @@ VOID NTAPI ReadWritePassive(PDRIVE_INFO DriveInfo,
   NTSTATUS Status;
   BOOLEAN DiskChanged;
   ULONG_PTR TransferByteOffset;
+  UCHAR Gap;
 
   PAGED_CODE();
 
@@ -522,6 +523,15 @@ VOID NTAPI ReadWritePassive(PDRIVE_INFO DriveInfo,
       WriteToDevice = TRUE;
     }
 
+  /* 
+   * FIXME:
+   *   FloppyDeviceData.ReadWriteGapLength specify the value for the physical drive. 
+   *   We should set this value depend on the format of the inserted disk and possible
+   *   depend on the request (read or write). A value of 0 results in one rotation
+   *   between the sectors (7.2sec for reading a track).
+   */
+  Gap = DriveInfo->FloppyDeviceData.ReadWriteGapLength;
+
   /* 
    * Set up DMA transfer 
    *
@@ -703,7 +713,7 @@ VOID NTAPI ReadWritePassive(PDRIVE_INFO DriveInfo,
 
       /* Issue the read/write command to the controller.  Note that it expects the opposite of WriteToDevice. */ 
       if(HwReadWriteData(DriveInfo->ControllerInfo, !WriteToDevice, DriveInfo->UnitNumber, Cylinder, Head, StartSector, 
-                        DriveInfo->BytesPerSectorCode, DriveInfo->DiskGeometry.SectorsPerTrack, 0, 0xff) != STATUS_SUCCESS)
+                        DriveInfo->BytesPerSectorCode, DriveInfo->DiskGeometry.SectorsPerTrack, Gap, 0xff) != STATUS_SUCCESS)
        {
          KdPrint(("floppy: ReadWritePassive(): HwReadWriteData returned failure; unable to read; completing with STATUS_UNSUCCESSFUL\n"));
          RWFreeAdapterChannel(DriveInfo->ControllerInfo->AdapterObject);