mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +00:00
fixed drive reset bug!
svn path=/trunk/; revision=333
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user