fixed drive reset bug!

svn path=/trunk/; revision=333
This commit is contained in:
Eric Kohl 1999-03-23 21:23:50 +00:00
parent 4f928dad27
commit 00f2fc414e
2 changed files with 8 additions and 4 deletions

View file

@ -401,6 +401,12 @@ IDEResetController(IN WORD CommandPort,
// Assert drive reset line
IDEWriteDriveControl(ControlPort, IDE_DC_SRST);
// Wait for min. 25 microseconds
KeStallExecutionProcessor(IDE_RESET_PULSE_LENGTH);
// Negate drive reset line
IDEWriteDriveControl(ControlPort, 0);
// Wait for BUSY assertion
for (Retries = 0; Retries < IDE_MAX_BUSY_RETRIES; Retries++)
{
@ -415,9 +421,6 @@ IDEResetController(IN WORD CommandPort,
return FALSE;
}
// Negate drive reset line
IDEWriteDriveControl(ControlPort, 0);
// Wait for BUSY negation
for (Retries = 0; Retries < IDE_RESET_BUSY_TIMEOUT * 1000; Retries++)
{
@ -439,7 +442,7 @@ IDEResetController(IN WORD CommandPort,
IDEReadSectorNum(CommandPort) == 1 &&
IDEReadCylinderLow(CommandPort) == 0 &&
IDEReadCylinderHigh(CommandPort) == 0 &&
IDEReadDriveHead(CommandPort) == 0;
(IDEReadDriveHead(CommandPort) & 0x1F) == 0;
}
// IDECreateDevices

View file

@ -27,6 +27,7 @@ extern "C" {
#define IDE_MAX_DRQ_RETRIES 10000
#define IDE_MAX_CMD_RETRIES 1
#define IDE_CMD_TIMEOUT 5
#define IDE_RESET_PULSE_LENGTH 500 /* maybe a little too long */
#define IDE_RESET_BUSY_TIMEOUT 31
#define IDE_RESET_DRDY_TIMEOUT 120