FreeBSD/sys/dev/mvs/mvs.c
/* Must be called with channel locked. */
Must be called with channel locked.
Must be called with channel locked .
static int
mvs_check_collision(device_t dev, union ccb *ccb)
{
	struct mvs_channel *ch = device_get_softc(dev);
	if (ccb->ccb_h.func_code == XPT_ATA_IO) {
		if (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) {
			if (ch->numdslots != 0)
				return (1);
			if (ch->numpslots != 0)
				return (1);
			if (!ch->fbs_enabled) {
				if (ch->numtslots != 0 &&
				    ch->taggedtarget != ccb->ccb_h.target_id)
					return (1);
			}
		} else if (ccb->ataio.cmd.flags & CAM_ATAIO_DMA) {
			if (ch->numtslots != 0)
				return (1);
			if (ch->numpslots != 0)
				return (1);
		} else {
			if (ch->numrslots != 0)
				return (1);
		}
		if (ccb->ataio.cmd.flags & (CAM_ATAIO_CONTROL | CAM_ATAIO_NEEDRESULT)) {
			if (ch->numrslots != 0)
				return (1);
		}
	} else { 
		if (ch->numrslots != 0)
			return (1);
	}
	if (ch->aslots != 0)
		return (1);
	return (0);
}
static int mvs_check_collision ( device_t dev , union ccb * ccb ) { struct mvs_channel * ch = device_get_softc ( dev ) ; if ( ccb -> ccb_h . func_code == XPT_ATA_IO ) { if ( ccb -> ataio . cmd . flags & CAM_ATAIO_FPDMA ) { if ( ch -> numdslots != 0 ) return ( 1 ) ; if ( ch -> numpslots != 0 ) return ( 1 ) ; if ( ! ch -> fbs_enabled ) { if ( ch -> numtslots != 0 && ch -> taggedtarget != ccb -> ccb_h . target_id ) return ( 1 ) ; } } else if ( ccb -> ataio . cmd . flags & CAM_ATAIO_DMA ) { if ( ch -> numtslots != 0 ) return ( 1 ) ; if ( ch -> numpslots != 0 ) return ( 1 ) ; } else { if ( ch -> numrslots != 0 ) return ( 1 ) ; } if ( ccb -> ataio . cmd . flags & ( CAM_ATAIO_CONTROL | CAM_ATAIO_NEEDRESULT ) ) { if ( ch -> numrslots != 0 ) return ( 1 ) ; } } else { if ( ch -> numrslots != 0 ) return ( 1 ) ; } if ( ch -> aslots != 0 ) return ( 1 ) ; return ( 0 ) ; }
Must be called with channel locked.
Must be called with channel locked .
/* NCQ DMA */ /* Can't mix NCQ and non-NCQ DMA commands. */ /* Can't mix NCQ and PIO commands. */ /* If we have no FBS */ /* Tagged command while tagged to other target is active. */ /* Non-NCQ DMA */ /* Can't mix non-NCQ DMA and NCQ commands. */ /* Can't mix non-NCQ DMA and PIO commands. */ /* PIO */ /* Can't mix PIO with anything. */ /* Atomic command while anything active. */ /* ATAPI */ /* ATAPI goes without EDMA, so can't mix it with anything. */ /* We have some atomic command running. */