/* Called when we switch away from DATA IN or DATA OUT phases.  */
static void fas216_stoptransfer(FAS216_Info *info)
/* Called when we switch away from DATA IN or DATA OUT phases.  */
static void fas216_stoptransfer(FAS216_Info *info)
{
	fas216_checkmagic(info);
	if (info->dma.transfer_type == fasdma_real_all ||
	    info->dma.transfer_type == fasdma_real_block)
		info->dma.stop(info->host, &info->scsi.SCp);
	fas216_cleanuptransfer(info);
	if (info->scsi.phase == PHASE_DATAIN) {
		unsigned int fifo;
		fifo = fas216_readb(info, REG_CFIS) & CFIS_CF;
		while (fifo && info->scsi.SCp.ptr) {
			*info->scsi.SCp.ptr = fas216_readb(info, REG_FF);
			fas216_updateptrs(info, 1);
			fifo--;
		}
	} else {
		fas216_cmd(info, CMD_FLUSHFIFO);
	}
}