mirror of
https://github.com/reactos/reactos.git
synced 2024-07-28 23:29:19 +00:00
[UNIATA]
- Really perform a controller hard-reset if it can't recover from a soft reset. Fixes VirtualBox one IDE controller configuration (master - IDE, slave - ATAPI). See issue #5145 for more details. svn path=/trunk/; revision=45869
This commit is contained in:
parent
ebfc115694
commit
eb6bae0c08
|
@ -2723,6 +2723,7 @@ CheckDevice(
|
||||||
signatureHigh;
|
signatureHigh;
|
||||||
UCHAR statusByte;
|
UCHAR statusByte;
|
||||||
ULONG RetVal=0;
|
ULONG RetVal=0;
|
||||||
|
ULONG waitCount = 10000;
|
||||||
|
|
||||||
KdPrint2((PRINT_PREFIX "CheckDevice: Device %#x\n",
|
KdPrint2((PRINT_PREFIX "CheckDevice: Device %#x\n",
|
||||||
deviceNumber));
|
deviceNumber));
|
||||||
|
@ -2745,7 +2746,22 @@ CheckDevice(
|
||||||
// Perform hard-reset.
|
// Perform hard-reset.
|
||||||
KdPrint2((PRINT_PREFIX
|
KdPrint2((PRINT_PREFIX
|
||||||
"CheckDevice: BUSY\n"));
|
"CheckDevice: BUSY\n"));
|
||||||
|
|
||||||
|
AtapiWritePort1(chan, IDX_IO2_o_Control, IDE_DC_RESET_CONTROLLER );
|
||||||
|
AtapiStallExecution(500 * 1000);
|
||||||
|
AtapiWritePort1(chan, IDX_IO2_o_Control, IDE_DC_REENABLE_CONTROLLER);
|
||||||
|
SelectDrive(chan, deviceNumber & 0x01);
|
||||||
|
|
||||||
|
do {
|
||||||
|
// Wait for Busy to drop.
|
||||||
|
AtapiStallExecution(100);
|
||||||
|
GetStatus(chan, statusByte);
|
||||||
|
|
||||||
|
} while ((statusByte & IDE_STATUS_BUSY) && waitCount--);
|
||||||
|
|
||||||
GetBaseStatus(chan, statusByte);
|
GetBaseStatus(chan, statusByte);
|
||||||
|
KdPrint2((PRINT_PREFIX
|
||||||
|
"CheckDevice: status after hard reset %x\n", statusByte));
|
||||||
}
|
}
|
||||||
|
|
||||||
if((statusByte | IDE_STATUS_BUSY) == 0xff) {
|
if((statusByte | IDE_STATUS_BUSY) == 0xff) {
|
||||||
|
|
Loading…
Reference in a new issue