mirror of
https://github.com/reactos/reactos.git
synced 2025-07-09 17:47:56 +00:00
fixed drive reset bug!
svn path=/trunk/; revision=333
This commit is contained in:
parent
4f928dad27
commit
00f2fc414e
2 changed files with 8 additions and 4 deletions
|
@ -401,6 +401,12 @@ IDEResetController(IN WORD CommandPort,
|
||||||
// Assert drive reset line
|
// Assert drive reset line
|
||||||
IDEWriteDriveControl(ControlPort, IDE_DC_SRST);
|
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
|
// Wait for BUSY assertion
|
||||||
for (Retries = 0; Retries < IDE_MAX_BUSY_RETRIES; Retries++)
|
for (Retries = 0; Retries < IDE_MAX_BUSY_RETRIES; Retries++)
|
||||||
{
|
{
|
||||||
|
@ -415,9 +421,6 @@ IDEResetController(IN WORD CommandPort,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Negate drive reset line
|
|
||||||
IDEWriteDriveControl(ControlPort, 0);
|
|
||||||
|
|
||||||
// Wait for BUSY negation
|
// Wait for BUSY negation
|
||||||
for (Retries = 0; Retries < IDE_RESET_BUSY_TIMEOUT * 1000; Retries++)
|
for (Retries = 0; Retries < IDE_RESET_BUSY_TIMEOUT * 1000; Retries++)
|
||||||
{
|
{
|
||||||
|
@ -439,7 +442,7 @@ IDEResetController(IN WORD CommandPort,
|
||||||
IDEReadSectorNum(CommandPort) == 1 &&
|
IDEReadSectorNum(CommandPort) == 1 &&
|
||||||
IDEReadCylinderLow(CommandPort) == 0 &&
|
IDEReadCylinderLow(CommandPort) == 0 &&
|
||||||
IDEReadCylinderHigh(CommandPort) == 0 &&
|
IDEReadCylinderHigh(CommandPort) == 0 &&
|
||||||
IDEReadDriveHead(CommandPort) == 0;
|
(IDEReadDriveHead(CommandPort) & 0x1F) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDECreateDevices
|
// IDECreateDevices
|
||||||
|
|
|
@ -27,6 +27,7 @@ extern "C" {
|
||||||
#define IDE_MAX_DRQ_RETRIES 10000
|
#define IDE_MAX_DRQ_RETRIES 10000
|
||||||
#define IDE_MAX_CMD_RETRIES 1
|
#define IDE_MAX_CMD_RETRIES 1
|
||||||
#define IDE_CMD_TIMEOUT 5
|
#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_BUSY_TIMEOUT 31
|
||||||
#define IDE_RESET_DRDY_TIMEOUT 120
|
#define IDE_RESET_DRDY_TIMEOUT 120
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue