if (di->flags == 0) {
if (! di->active) {
isadma_done(chan)	int chan;{	struct dma_info *di;	u_char tc;#ifdef DIAGNOSTIC	if (chan < 0 || chan > 7)		panic("isadma_done: impossible request");#endif	di = dma_info+chan;	if (di->flags == 0) {		log(LOG_ERR,"isadma_done: no request active on %d\n",chan);		return;	}	/* check that the terminal count was reached */	if ((chan & 4) == 0)		tc = inb(DMA1_SR) & (1 << chan);	else		tc = inb(DMA2_SR) & (1 << (chan & 3));	if (tc == 0)		/* XXX probably should panic or something */		log(LOG_ERR, "dma channel %d not finished\n", chan);	/* mask channel */	if ((chan & 4) == 0)		outb(DMA1_SMSK, DMA37SM_SET | chan);	else		outb(DMA2_SMSK, DMA37SM_SET | (chan & 3));	/* XXX Will this do what we want with DMAMODE_LOOP?  */	if (di->flags & DMAMODE_READ)		isadma_copyfrombuf(di->addr, di->nbytes, 1, di->phys);	isadma_unmap(di->addr, di->nbytes, 1, di->phys);	di->flags = 0;}