UNREFERENCED_PARAMETER(DeviceObject);
UNREFERENCED_PARAMETER(Irp);
- DPRINT(("floppy: MapRegisterCallback Called\n"));
+ DPRINT("floppy: MapRegisterCallback Called\n");
ControllerInfo->MapRegisterBase = MapRegisterBase;
KeSetEvent(&ControllerInfo->SynchEvent, 0, FALSE);
* it onto the irp queue
*/
{
- DPRINT(("floppy: ReadWrite called\n"));
+ DPRINT("floppy: ReadWrite called\n");
ASSERT(DeviceObject);
ASSERT(Irp);
if(!Irp->MdlAddress)
{
- DPRINT(("floppy: ReadWrite(): MDL not found in IRP - Completing with STATUS_INVALID_PARAMETER\n"));
+ DPRINT("floppy: ReadWrite(): MDL not found in IRP - Completing with STATUS_INVALID_PARAMETER\n");
Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
PAGED_CODE();
- DPRINT(("floppy: RWDetermineMediaType called\n"));
+ DPRINT("floppy: RWDetermineMediaType called\n");
/*
* This algorithm assumes that a 1.44MB floppy is in the drive. If it's not,
/* Program data rate */
if(HwSetDataRate(DriveInfo->ControllerInfo, DRSR_DSEL_500KBPS) != STATUS_SUCCESS)
{
- DPRINT(("floppy: RWDetermineMediaType(): unable to set data rate\n"));
+ DPRINT("floppy: RWDetermineMediaType(): unable to set data rate\n");
return STATUS_UNSUCCESSFUL;
}
/* Don't disable DMA --> enable dma (dumb & confusing) */
if(HwSpecify(DriveInfo->ControllerInfo, HeadLoadTime, HeadUnloadTime, StepRateTime, FALSE) != STATUS_SUCCESS)
{
- DPRINT(("floppy: RWDetermineMediaType(): specify failed\n"));
+ DPRINT("floppy: RWDetermineMediaType(): specify failed\n");
return STATUS_UNSUCCESSFUL;
}
if(HwRecalibrate(DriveInfo) != STATUS_SUCCESS)
{
- DPRINT(("floppy: RWDetermineMediaType(): Recalibrate failed\n"));
+ DPRINT("floppy: RWDetermineMediaType(): Recalibrate failed\n");
return STATUS_UNSUCCESSFUL;
}
if(i == 1) /* failed for 2nd time */
{
- DPRINT(("floppy: RWDetermineMediaType(): RecalibrateResult failed\n"));
+ DPRINT("floppy: RWDetermineMediaType(): RecalibrateResult failed\n");
return STATUS_UNSUCCESSFUL;
}
}
/* Try to read an ID */
if(HwReadId(DriveInfo, 0) != STATUS_SUCCESS) /* read the first ID we find, from head 0 */
{
- DPRINT(("floppy: RWDetermineMediaType(): ReadId failed\n"));
+ DPRINT("floppy: RWDetermineMediaType(): ReadId failed\n");
return STATUS_UNSUCCESSFUL; /* if we can't even write to the controller, it's hopeless */
}
if(HwReadIdResult(DriveInfo->ControllerInfo, NULL, NULL) != STATUS_SUCCESS)
{
- DPRINT(("floppy: RWDetermineMediaType(): ReadIdResult failed; continuing\n"));
+ DPRINT("floppy: RWDetermineMediaType(): ReadIdResult failed; continuing\n");
continue;
}
/* Found the media; populate the geometry now */
- DPRINT(("FIXME: Hardcoded media type!\n"));
- DPRINT(("floppy: RWDetermineMediaType(): Found 1.44 media; returning success\n"));
+ DPRINT("FIXME: Hardcoded media type!\n");
+ DPRINT("floppy: RWDetermineMediaType(): Found 1.44 media; returning success\n");
DriveInfo->DiskGeometry.MediaType = GEOMETRY_144_MEDIATYPE;
DriveInfo->DiskGeometry.Cylinders.QuadPart = GEOMETRY_144_CYLINDERS;
DriveInfo->DiskGeometry.TracksPerCylinder = GEOMETRY_144_TRACKSPERCYLINDER;
}
while(FALSE);
- DPRINT(("floppy: RWDetermineMediaType(): failed to find media\n"));
+ DPRINT("floppy: RWDetermineMediaType(): failed to find media\n");
return STATUS_UNRECOGNIZED_MEDIA;
}
PAGED_CODE();
- DPRINT(("floppy: RWSeekToCylinder called drive 0x%x cylinder %d\n", DriveInfo, Cylinder));
+ DPRINT("floppy: RWSeekToCylinder called drive 0x%x cylinder %d\n", DriveInfo, Cylinder);
/* Clear any spurious interrupts */
KeClearEvent(&DriveInfo->ControllerInfo->SynchEvent);
/* queue seek command */
if(HwSeek(DriveInfo, Cylinder) != STATUS_SUCCESS)
{
- DPRINT(("floppy: RWSeekToTrack(): unable to seek\n"));
+ DPRINT("floppy: RWSeekToTrack(): unable to seek\n");
return STATUS_UNSUCCESSFUL;
}
if(HwSenseInterruptStatus(DriveInfo->ControllerInfo) != STATUS_SUCCESS)
{
- DPRINT(("floppy: RWSeekToTrack(): unable to get seek results\n"));
+ DPRINT("floppy: RWSeekToTrack(): unable to get seek results\n");
return STATUS_UNSUCCESSFUL;
}
/* read ID mark from head 0 to verify */
if(HwReadId(DriveInfo, 0) != STATUS_SUCCESS)
{
- DPRINT(("floppy: RWSeekToTrack(): unable to queue ReadId\n"));
+ DPRINT("floppy: RWSeekToTrack(): unable to queue ReadId\n");
return STATUS_UNSUCCESSFUL;
}
if(HwReadIdResult(DriveInfo->ControllerInfo, &CurCylinder, NULL) != STATUS_SUCCESS)
{
- DPRINT(("floppy: RWSeekToTrack(): unable to get ReadId result\n"));
+ DPRINT("floppy: RWSeekToTrack(): unable to get ReadId result\n");
return STATUS_UNSUCCESSFUL;
}
if(CurCylinder != Cylinder)
{
- DPRINT(("floppy: RWSeekToTrack(): Seeek to track failed; current cylinder is 0x%x\n", CurCylinder));
+ DPRINT("floppy: RWSeekToTrack(): Seeek to track failed; current cylinder is 0x%x\n", CurCylinder);
return STATUS_UNSUCCESSFUL;
}
- DPRINT(("floppy: RWSeekToCylinder: returning successfully, now on cyl %d\n", Cylinder));
+ DPRINT("floppy: RWSeekToCylinder: returning successfully, now on cyl %d\n", Cylinder);
return STATUS_SUCCESS;
}
ULONG AbsoluteSector;
UCHAR SectorsPerCylinder = (UCHAR)DriveInfo->DiskGeometry.SectorsPerTrack * (UCHAR)DriveInfo->DiskGeometry.TracksPerCylinder;
- DPRINT(("floppy: RWComputeCHS: Called with offset 0x%x\n", DiskByteOffset));
+ DPRINT("floppy: RWComputeCHS: Called with offset 0x%x\n", DiskByteOffset);
/* First calculate the 1-based "absolute sector" based on the byte offset */
ASSERT(!(DiskByteOffset % DriveInfo->DiskGeometry.BytesPerSector)); /* FIXME: Only handle full sector transfers atm */
*/
*Sector = ((UCHAR)(AbsoluteSector % SectorsPerCylinder) + 1) - ((*Head) * (UCHAR)DriveInfo->DiskGeometry.SectorsPerTrack);
- DPRINT(("floppy: RWComputeCHS: offset 0x%x is c:0x%x h:0x%x s:0x%x\n", DiskByteOffset, *Cylinder, *Head, *Sector));
+ DPRINT("floppy: RWComputeCHS: offset 0x%x is c:0x%x h:0x%x s:0x%x\n", DiskByteOffset, *Cylinder, *Head, *Sector);
/* Sanity checking */
ASSERT(*Cylinder <= DriveInfo->DiskGeometry.Cylinders.QuadPart);
PAGED_CODE();
- DPRINT(("floppy: ReadWritePassive called to %s 0x%x bytes from offset 0x%x\n",
+ DPRINT("floppy: ReadWritePassive called to %s 0x%x bytes from offset 0x%x\n",
(Stack->MajorFunction == IRP_MJ_READ ? "read" : "write"),
(Stack->MajorFunction == IRP_MJ_READ ? Stack->Parameters.Read.Length : Stack->Parameters.Write.Length),
(Stack->MajorFunction == IRP_MJ_READ ? Stack->Parameters.Read.ByteOffset.u.LowPart :
- Stack->Parameters.Write.ByteOffset.u.LowPart)));
+ Stack->Parameters.Write.ByteOffset.u.LowPart));
/* Default return codes */
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
*/
if(DeviceObject->Flags & DO_VERIFY_VOLUME && !(DeviceObject->Flags & SL_OVERRIDE_VERIFY_VOLUME))
{
- DPRINT(("floppy: ReadWritePassive(): DO_VERIFY_VOLUME set; Completing with STATUS_VERIFY_REQUIRED\n"));
+ DPRINT("floppy: ReadWritePassive(): DO_VERIFY_VOLUME set; Completing with STATUS_VERIFY_REQUIRED\n");
Irp->IoStatus.Status = STATUS_VERIFY_REQUIRED;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return;
StartMotor(DriveInfo);
if(HwDiskChanged(DeviceObject->DeviceExtension, &DiskChanged) != STATUS_SUCCESS)
{
- DPRINT(("floppy: ReadWritePassive(): unable to detect disk change; Completing with STATUS_UNSUCCESSFUL\n"));
+ DPRINT("floppy: ReadWritePassive(): unable to detect disk change; Completing with STATUS_UNSUCCESSFUL\n");
IoCompleteRequest(Irp, IO_NO_INCREMENT);
StopMotor(DriveInfo->ControllerInfo);
return;
if(DiskChanged)
{
- DPRINT(("floppy: ReadWritePhase1(): signalling media changed; Completing with STATUS_MEDIA_CHANGED\n"));
+ DPRINT("floppy: ReadWritePhase1(): signalling media changed; Completing with STATUS_MEDIA_CHANGED\n");
/* The following call sets IoStatus.Status and IoStatus.Information */
SignalMediaChanged(DeviceObject, Irp);
{
if(RWDetermineMediaType(DriveInfo) != STATUS_SUCCESS)
{
- DPRINT(("floppy: ReadWritePassive(): unable to determine media type; completing with STATUS_UNSUCCESSFUL\n"));
+ DPRINT("floppy: ReadWritePassive(): unable to determine media type; completing with STATUS_UNSUCCESSFUL\n");
IoCompleteRequest(Irp, IO_NO_INCREMENT);
StopMotor(DriveInfo->ControllerInfo);
return;
if(DriveInfo->DiskGeometry.MediaType == Unknown)
{
- DPRINT(("floppy: ReadWritePassive(): Unknown media in drive; completing with STATUS_UNRECOGNIZED_MEDIA\n"));
+ DPRINT("floppy: ReadWritePassive(): Unknown media in drive; completing with STATUS_UNRECOGNIZED_MEDIA\n");
Irp->IoStatus.Status = STATUS_UNRECOGNIZED_MEDIA;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
StopMotor(DriveInfo->ControllerInfo);
if(Status != STATUS_SUCCESS)
{
- DPRINT(("floppy: ReadWritePassive(): unable allocate an adapter channel; completing with STATUS_UNSUCCESSFUL\n"));
+ DPRINT("floppy: ReadWritePassive(): unable allocate an adapter channel; completing with STATUS_UNSUCCESSFUL\n");
IoCompleteRequest(Irp, IO_NO_INCREMENT);
StopMotor(DriveInfo->ControllerInfo);
return ;
ULONG CurrentTransferBytes;
UCHAR CurrentTransferSectors;
- DPRINT(("floppy: ReadWritePassive(): iterating in while (TransferByteOffset = 0x%x of 0x%x total) - allocating %d registers\n",
- TransferByteOffset, Length, DriveInfo->ControllerInfo->MapRegisters));
+ DPRINT("floppy: ReadWritePassive(): iterating in while (TransferByteOffset = 0x%x of 0x%x total) - allocating %d registers\n",
+ TransferByteOffset, Length, DriveInfo->ControllerInfo->MapRegisters);
KeClearEvent(&DriveInfo->ControllerInfo->SynchEvent);
*/
if(RWComputeCHS(DriveInfo, DiskByteOffset+TransferByteOffset, &Cylinder, &Head, &StartSector) != STATUS_SUCCESS)
{
- DPRINT(("floppy: ReadWritePassive(): unable to compute CHS; completing with STATUS_UNSUCCESSFUL\n"));
+ DPRINT("floppy: ReadWritePassive(): unable to compute CHS; completing with STATUS_UNSUCCESSFUL\n");
RWFreeAdapterChannel(DriveInfo->ControllerInfo->AdapterObject);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
StopMotor(DriveInfo->ControllerInfo);
{
if(RWSeekToCylinder(DriveInfo, Cylinder) != STATUS_SUCCESS)
{
- DPRINT(("floppy: ReadWritePassive(): unable to seek; completing with STATUS_UNSUCCESSFUL\n"));
+ DPRINT("floppy: ReadWritePassive(): unable to seek; completing with STATUS_UNSUCCESSFUL\n");
RWFreeAdapterChannel(DriveInfo->ControllerInfo->AdapterObject);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
StopMotor(DriveInfo->ControllerInfo);
* We can only ask for a transfer up to the end of the track. Then we have to re-seek and do more.
* TODO: Support the MT bit
*/
- DPRINT(("floppy: ReadWritePassive(): computing number of sectors to transfer (StartSector 0x%x): ", StartSector));
+ DPRINT("floppy: ReadWritePassive(): computing number of sectors to transfer (StartSector 0x%x): ", StartSector);
/* 1-based sector number */
if( (((DriveInfo->DiskGeometry.TracksPerCylinder - Head) * DriveInfo->DiskGeometry.SectorsPerTrack - StartSector) + 1 ) <
CurrentTransferSectors = (UCHAR)((Length - TransferByteOffset) / DriveInfo->DiskGeometry.BytesPerSector);
}
- DPRINT(("0x%x\n", CurrentTransferSectors));
+ DPRINT("0x%x\n", CurrentTransferSectors);
CurrentTransferBytes = CurrentTransferSectors * DriveInfo->DiskGeometry.BytesPerSector;
* Adjust to map registers
* BUG: Does this take into account page crossings?
*/
- DPRINT(("floppy: ReadWritePassive(): Trying to transfer 0x%x bytes\n", CurrentTransferBytes));
+ DPRINT("floppy: ReadWritePassive(): Trying to transfer 0x%x bytes\n", CurrentTransferBytes);
ASSERT(CurrentTransferBytes);
CurrentTransferBytes = CurrentTransferSectors * DriveInfo->DiskGeometry.BytesPerSector;
- DPRINT(("floppy: ReadWritePassive: limiting transfer to 0x%x bytes (0x%x sectors) due to map registers\n",
- CurrentTransferBytes, CurrentTransferSectors));
+ DPRINT("floppy: ReadWritePassive: limiting transfer to 0x%x bytes (0x%x sectors) due to map registers\n",
+ CurrentTransferBytes, CurrentTransferSectors);
}
/* set up this round's dma operation */
if(HwReadWriteData(DriveInfo->ControllerInfo, !WriteToDevice, DriveInfo->UnitNumber, Cylinder, Head, StartSector,
DriveInfo->BytesPerSectorCode, DriveInfo->DiskGeometry.SectorsPerTrack, Gap, 0xff) != STATUS_SUCCESS)
{
- DPRINT(("floppy: ReadWritePassive(): HwReadWriteData returned failure; unable to read; completing with STATUS_UNSUCCESSFUL\n"));
+ DPRINT("floppy: ReadWritePassive(): HwReadWriteData returned failure; unable to read; completing with STATUS_UNSUCCESSFUL\n");
RWFreeAdapterChannel(DriveInfo->ControllerInfo->AdapterObject);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
StopMotor(DriveInfo->ControllerInfo);
return ;
}
- DPRINT(("floppy: ReadWritePassive(): HwReadWriteData returned -- waiting on event\n"));
+ DPRINT("floppy: ReadWritePassive(): HwReadWriteData returned -- waiting on event\n");
/*
* At this point, we block and wait for an interrupt
/* Read the results from the drive */
if(HwReadWriteResult(DriveInfo->ControllerInfo) != STATUS_SUCCESS)
{
- DPRINT(("floppy: ReadWritePassive(): HwReadWriteResult returned failure; unable to read; completing with STATUS_UNSUCCESSFUL\n"));
+ DPRINT("floppy: ReadWritePassive(): HwReadWriteResult returned failure; unable to read; completing with STATUS_UNSUCCESSFUL\n");
HwDumpRegisters(DriveInfo->ControllerInfo);
RWFreeAdapterChannel(DriveInfo->ControllerInfo->AdapterObject);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
RWFreeAdapterChannel(DriveInfo->ControllerInfo->AdapterObject);
/* That's all folks! */
- DPRINT(("floppy: ReadWritePassive(): success; Completing with STATUS_SUCCESS\n"));
+ DPRINT("floppy: ReadWritePassive(): success; Completing with STATUS_SUCCESS\n");
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = Length;
IoCompleteRequest(Irp, IO_NO_INCREMENT);