/* Update the data pointers according to the number of bytes transferred on the SCSI bus.  */
static void fas216_cleanuptransfer(FAS216_Info *info)
/* Update the data pointers according to the number of bytes transferred on the SCSI bus.  */
static void fas216_cleanuptransfer(FAS216_Info *info)
{
	unsigned long total, residual, fifo;
	fasdmatype_t dmatype = info->dma.transfer_type;
	info->dma.transfer_type = fasdma_none;
	if (dmatype == fasdma_pio || dmatype == fasdma_none)
		return;
	if (dmatype == fasdma_real_all)
		total = info->scsi.SCp.phase;
	else
		total = info->scsi.SCp.this_residual;
	residual = fas216_get_ctc(info);
	fifo = fas216_readb(info, REG_CFIS) & CFIS_CF;
	fas216_log(info, LOG_BUFFER, "cleaning up from previous "
		   "transfer: length 0x%06x, residual 0x%x, fifo %d",
		   total, residual, fifo);
	if (info->scsi.phase == PHASE_DATAOUT)
		residual += fifo;
	fas216_updateptrs(info, total - residual);
}