Avago Technologies LSI53C1010 User Manual
Page 215

Byte Recovery on Target Disconnect
9-17
that was being serviced when the
phase mismatch occurred.
dsa_table is the table indirect table that
is being used for this IO
script is the actual script that was being
executed when the phase mismatch
occurred.
DATA_BUF1 is the offset into the Table
Indirect entries for the first Data
In table entry.
******************************************************/
static void HandleDataOutPM(pcidev_record *PCIDevice)
{
ULONG Current_DSP;/* holds current dsp value */
INT Current_SG_Entry;/* Used to calc. Current SG entry */
UINT DFIFO_val;
/* Holds chip DFIFO value */
UINT Bytes_remaining;/* Used to account for other bytes in chip */
/* where am I in the SG list? */
Current_DSP = IORead32(PCIDeviceIOBase+DSP) - 8;
Current_SG_Entry = (INT) (Current_DSP -
FirstDOMove_paddr) / 8;
/* now update the address and count */
buffer_table[DATA_BUF1 + Current_SG_Entry].address +=
buffer_table[DATA_BUF1 + Current_SG_Entry].count -
(IORead32(PCIDeviceIOBase+DBC) & 0x00FFFFFFl);
buffer_table[DATA_BUF1 + Current_SG_Entry].count =
IORead32(PCIDeviceIOBase+DBC) & 0x00FFFFFFl;
/* Update count and address to reflect any data left in the chip */
/* First check for data in the DMA FIFO */
/* The variable DFIFO_val is a combination of bits
/*1-0 of CTEST5 and bits 7–0 of the DFIFO register
/*this will take care of both the extended FIFO devices
/*and all others */
DFIFO_val = ((IORead8(PCIDeviceIOBase+CTEST5) & 0x03) << 8) |
(IORead8(PCIDeviceIOBase+DFIFO));
if (IORead8(PCIDeviceIOBase+CTEST5) & 0x20)/* big fifo */
Bytes_remaining = (DFIFO_val - (UINT)
IORead32(PCIDevice->base_addr2+DBC) & 0x3FF) &
0x3FF;
else
/* default FIFO size*/
Bytes_remaining = (DFIFO_val - (UINT)
IORead32(PCIDevice->base_addr2+DBC) & 0x7F) &
0x7F;
/* now check the other regs that may contain data*/
/* SODL LSB Full?*/
if (IORead8(PCIDevice->base_addr2+SSTAT0) & 0x20)
Bytes_remaining++;
/* SODL MSB Full?*/
if (IORead8(PCIDevice->base_addr2+SSTAT2) & 0x20
) Bytes_remaining++;
/* SODR LSB Full?*/
if (IORead8(PCIDevice->base_addr2+SSTAT0) & 0x40)
Bytes_remaining++;