Fixed floppy driver bug!

The floppy controler is now recognized properly!!

svn path=/trunk/; revision=1455
This commit is contained in:
Eric Kohl 2000-12-08 00:43:45 +00:00
parent 3d521d0a20
commit 07127c18af
2 changed files with 66 additions and 58 deletions

View file

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.4 2000/10/07 13:41:54 dwelch Exp $
# $Id: Makefile,v 1.5 2000/12/08 00:43:45 ekohl Exp $
#
#
PATH_TO_TOP = ../../..
@ -20,6 +20,7 @@ clean:
- $(RM) base.tmp
- $(RM) temp.exp
- $(RM) $(TARGET).sys
- $(RM) $(TARGET).sys.unstripped
.phony: clean

View file

@ -100,7 +100,7 @@ FloppyReadSTAT(ULONG PortBase)
/* waits until the fdc becomes ready */
static int
FloppyWaitUntilReady(WORD PortBase)
FloppyWaitUntilReady(ULONG PortBase)
{
int Retries;
int Status;
@ -125,14 +125,14 @@ FloppyWaitUntilReady(WORD PortBase)
}
static VOID
FloppyWriteData(WORD PortBase, BYTE Byte)
FloppyWriteData(ULONG PortBase, BYTE Byte)
{
WRITE_PORT_UCHAR((PUCHAR)(PortBase + FLOPPY_DATA), Byte);
}
/* sends a command byte to the fdc */
static BOOLEAN
FloppyWriteCommandByte(WORD PortBase, BYTE Byte)
FloppyWriteCommandByte(ULONG PortBase, BYTE Byte)
{
int Status;
@ -144,7 +144,7 @@ FloppyWriteCommandByte(WORD PortBase, BYTE Byte)
if ((Status & (STATUS_READY|STATUS_DIR|STATUS_DMA)) == STATUS_READY)
{
FloppyWriteData(PortBase, Byte);
return 0;
return TRUE;
}
if (FloppyInitialized)
@ -160,7 +160,7 @@ FloppyWriteCommandByte(WORD PortBase, BYTE Byte)
/* gets the response from the fdc */
static int
FloppyReadResultCode(WORD PortBase, PUCHAR Result)
FloppyReadResultCode(ULONG PortBase, PUCHAR Result)
{
int Replies;
int Status;
@ -178,10 +178,11 @@ FloppyReadResultCode(WORD PortBase, PUCHAR Result)
}
if (Status == (STATUS_DIR | STATUS_READY | STATUS_BUSY))
{
Result[Replies] = READ_PORT_UCHAR((PUCHAR)FLOPPY_DATA);
Result[Replies] = READ_PORT_UCHAR((PUCHAR)(PortBase + FLOPPY_DATA));
}
else
{
DPRINT("FloppyReadResultCode: break\n");
break;
}
}
@ -200,7 +201,7 @@ FloppyReadResultCode(WORD PortBase, PUCHAR Result)
#define MORE_OUTPUT -2
/* does the fdc need more output? */
static int
FloppyNeedsMoreOutput(WORD PortBase, PUCHAR Result)
FloppyNeedsMoreOutput(ULONG PortBase, PUCHAR Result)
{
int Status;
@ -215,7 +216,7 @@ FloppyNeedsMoreOutput(WORD PortBase, PUCHAR Result)
}
static BOOLEAN
FloppyConfigure(WORD PortBase, BOOLEAN DisableFIFO, BYTE FIFODepth)
FloppyConfigure(ULONG PortBase, BOOLEAN DisableFIFO, BYTE FIFODepth)
{
BYTE Result[FLOPPY_MAX_REPLIES];
@ -257,8 +258,8 @@ static BOOLEAN
FloppyGetControllerVersion(IN PFLOPPY_CONTROLLER_PARAMETERS ControllerParameters,
OUT PFLOPPY_CONTROLLER_TYPE ControllerType)
{
ULONG ResultLength;
UCHAR Result[FLOPPY_MAX_REPLIES];
int ResultLength;
/* 82072 and better know DUMPREGS */
if (!FloppyWriteCommandByte(ControllerParameters->PortBase,
@ -480,29 +481,33 @@ FloppyCreateController(PDRIVER_OBJECT DriverObject,
ConfigInfo = IoGetConfigurationInformation ();
ConfigInfo->FloppyCount++;
return STATUS_SUCCESS;
return TRUE;
}
VOID FloppyStartIo(PDEVICE_OBJECT DeviceObject,
VOID STDCALL FloppyStartIo(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
DPRINT("FloppyStartIo\n");
}
NTSTATUS FloppyDispatchOpenClose(PDEVICE_OBJECT DeviceObject,
NTSTATUS STDCALL FloppyDispatchOpenClose(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
DPRINT("FloppyDispatchOpenClose\n");
return(STATUS_UNSUCCESSFUL);
}
NTSTATUS FloppyDispatchReadWrite(PDEVICE_OBJECT DeviceObject,
NTSTATUS STDCALL FloppyDispatchReadWrite(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
DPRINT("FloppyDispatchReadWrite\n");
return(STATUS_UNSUCCESSFUL);
}
NTSTATUS FloppyDispatchDeviceControl(PDEVICE_OBJECT DeviceObject,
NTSTATUS STDCALL FloppyDispatchDeviceControl(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
DPRINT("FloppyDispatchDeviceControl\n");
return(STATUS_UNSUCCESSFUL);
}
@ -550,3 +555,5 @@ NTSTATUS STDCALL DriverEntry(IN PDRIVER_OBJECT DriverObject,
return STATUS_SUCCESS;
}
/* EOF */