FreeBSD/sys/dev/esp/ncr53c9x.c
/*
 * Clear all commands for a specific target.
 */
Clear all commands for a specific target.
Clear all commands for a specific target .
static void
ncr53c9x_clear_target(struct ncr53c9x_softc *sc, int target,
    cam_status result)
{
	struct ncr53c9x_ecb *ecb;
	struct ncr53c9x_linfo *li;
	int i;
	NCR_LOCK_ASSERT(sc, MA_OWNED);
	LIST_FOREACH(li, &sc->sc_tinfo[target].luns, link) {
		ecb = li->untagged;
		if (ecb != NULL) {
			li->untagged = NULL;
			li->busy = 0;
			ecb->ccb->ccb_h.status = result;
			ncr53c9x_done(sc, ecb);
		}
		for (i = 0; i < NCR_TAG_DEPTH; i++) {
			ecb = li->queued[i];
			if (ecb != NULL) {
				li->queued[i] = NULL;
				ecb->ccb->ccb_h.status = result;
				ncr53c9x_done(sc, ecb);
			}
		}
		li->used = 0;
	}
}
static void ncr53c9x_clear_target ( struct ncr53c9x_softc * sc , int target , cam_status result ) { struct ncr53c9x_ecb * ecb ; struct ncr53c9x_linfo * li ; int i ; NCR_LOCK_ASSERT ( sc , MA_OWNED ) ; LIST_FOREACH ( li , & sc -> sc_tinfo [ target ] . luns , link ) { ecb = li -> untagged ; if ( ecb != NULL ) { li -> untagged = NULL ; li -> busy = 0 ; ecb -> ccb -> ccb_h . status = result ; ncr53c9x_done ( sc , ecb ) ; } for ( i = 0 ; i < NCR_TAG_DEPTH ; i ++ ) { ecb = li -> queued [ i ] ; if ( ecb != NULL ) { li -> queued [ i ] = NULL ; ecb -> ccb -> ccb_h . status = result ; ncr53c9x_done ( sc , ecb ) ; } } li -> used = 0 ; } }
Clear all commands for a specific target.
Clear all commands for a specific target .
/* Cancel outstanding disconnected commands on each LUN. */ /*
			 * XXX should we terminate a command
			 * that never reached the disk?
			 */