Fixed data overrun upon read commands.

svn path=/trunk/; revision=3873
This commit is contained in:
Eric Kohl 2002-12-13 19:35:12 +00:00
parent 34056f0e1c
commit 4e2f492dc0
2 changed files with 15 additions and 11 deletions

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: atapi.c,v 1.32 2002/12/10 12:18:33 ekohl Exp $ /* $Id: atapi.c,v 1.33 2002/12/13 19:35:12 ekohl Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS ATAPI miniport driver * PROJECT: ReactOS ATAPI miniport driver
@ -997,10 +997,10 @@ AtapiInterrupt(IN PVOID DeviceExtension)
} }
/* Check for data overrun */ /* Check for data overrun */
if (IDEReadStatus(CommandPortBase) & IDE_SR_DRQ) while (IDEReadStatus(CommandPortBase) & IDE_SR_DRQ)
{ {
/* FIXME: Handle error! */ DPRINT1("AtapiInterrupt(): reading overrun data!\n");
DPRINT1("AtapiInterrupt(): data overrun error!"); IDEReadWord(CommandPortBase);
} }
} }
@ -1521,7 +1521,7 @@ AtapiPolledRead(IN ULONG CommandPort,
if (Status & IDE_SR_ERR) if (Status & IDE_SR_ERR)
{ {
IDEWriteDriveControl(ControlPort, 0); IDEWriteDriveControl(ControlPort, 0);
ScsiPortStallExecution(50); ScsiPortStallExecution(50);
IDEReadStatus(CommandPort); IDEReadStatus(CommandPort);
return(IDE_ER_ABRT); return(IDE_ER_ABRT);
@ -1575,9 +1575,9 @@ AtapiPolledRead(IN ULONG CommandPort,
{ {
if (Status & IDE_SR_ERR) if (Status & IDE_SR_ERR)
{ {
IDEWriteDriveControl(ControlPort, 0); IDEWriteDriveControl(ControlPort, 0);
ScsiPortStallExecution(50); ScsiPortStallExecution(50);
IDEReadStatus(CommandPort); IDEReadStatus(CommandPort);
return(IDE_ER_ABRT); return(IDE_ER_ABRT);
} }
@ -1597,9 +1597,9 @@ AtapiPolledRead(IN ULONG CommandPort,
DPRINT("Read %lu sectors of junk!\n", DPRINT("Read %lu sectors of junk!\n",
SectorCount - SectorCnt); SectorCount - SectorCnt);
} }
IDEWriteDriveControl(ControlPort, 0); IDEWriteDriveControl(ControlPort, 0);
ScsiPortStallExecution(50); ScsiPortStallExecution(50);
IDEReadStatus(CommandPort); IDEReadStatus(CommandPort);
return(0); return(0);
} }

View file

@ -116,6 +116,10 @@ extern "C" {
(ScsiPortReadPortBufferUlong((PULONG)((Address) + IDE_REG_DATA_PORT), (PULONG)(Buffer), (Count) / 4)) (ScsiPortReadPortBufferUlong((PULONG)((Address) + IDE_REG_DATA_PORT), (PULONG)(Buffer), (Count) / 4))
#define IDEWriteBlock32(Address, Buffer, Count) \ #define IDEWriteBlock32(Address, Buffer, Count) \
(ScsiPortWritePortBufferUlong((PULONG)((Address) + IDE_REG_DATA_PORT), (PULONG)(Buffer), (Count) / 4)) (ScsiPortWritePortBufferUlong((PULONG)((Address) + IDE_REG_DATA_PORT), (PULONG)(Buffer), (Count) / 4))
#define IDEReadWord(Address) \
(ScsiPortReadPortUshort((PUSHORT)((Address) + IDE_REG_DATA_PORT)))
// //
// Access macros for control registers // Access macros for control registers
// Each macro takes an address of the control port blank and data // Each macro takes an address of the control port blank and data