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 = ../../.. PATH_TO_TOP = ../../..
@ -20,6 +20,7 @@ clean:
- $(RM) base.tmp - $(RM) base.tmp
- $(RM) temp.exp - $(RM) temp.exp
- $(RM) $(TARGET).sys - $(RM) $(TARGET).sys
- $(RM) $(TARGET).sys.unstripped
.phony: clean .phony: clean

View file

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