Author: dgorbachev
Date: Mon Apr 23 08:54:13 2007
New Revision: 26470
URL:
http://svn.reactos.org/svn/reactos?rev=26470&view=rev
Log:
Do not wait so long for drive reset.
Modified:
trunk/reactos/drivers/storage/ide/atapi/atapi.h
Modified: trunk/reactos/drivers/storage/ide/atapi/atapi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/atapi/…
==============================================================================
--- trunk/reactos/drivers/storage/ide/atapi/atapi.h (original)
+++ trunk/reactos/drivers/storage/ide/atapi/atapi.h Mon Apr 23 08:54:13 2007
@@ -418,10 +418,12 @@
#define AtapiSoftReset(BaseIoAddress,DeviceNumber) \
{\
UCHAR statusByte; \
+ ULONG i = 1000*1000;\
ScsiPortWritePortUchar(&BaseIoAddress->DriveSelect,(UCHAR)(((DeviceNumber
& 0x1) << 4) | 0xA0)); \
ScsiPortStallExecution(500);\
ScsiPortWritePortUchar(&BaseIoAddress->Command, IDE_COMMAND_ATAPI_RESET); \
- ScsiPortStallExecution(1000*1000);\
+ while ((ScsiPortReadPortUchar(&BaseIoAddress->Command) & IDE_STATUS_BUSY)
&& i--)\
+ ScsiPortStallExecution(30);\
ScsiPortWritePortUchar(&BaseIoAddress->DriveSelect,(UCHAR)((DeviceNumber
<< 4) | 0xA0)); \
WaitOnBusy( ((PIDE_REGISTERS_2)((PUCHAR)BaseIoAddress + 0x206)), statusByte); \
ScsiPortStallExecution(500);\