FreeBSD/sys/dev/aacraid/aacraid_cam.c
/*
 * Start as much queued I/O as possible on the controller
 */
Start as much queued I/O as possible on the controller
Start as much queued I / O as possible on the controller
void
aacraid_startio(struct aac_softc *sc)
{
	struct aac_command *cm;
	fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
	for (;;) {
		if (sc->aac_state & AAC_STATE_RESET) {
			fwprintf(sc, HBA_FLAGS_DBG_ERROR_B, "AAC_STATE_RESET");
			break;
		}
		if (sc->flags & AAC_QUEUE_FRZN) {
			fwprintf(sc, HBA_FLAGS_DBG_ERROR_B, "AAC_QUEUE_FRZN");
			break;
		}
		if (sc->flags & AAC_FLAGS_SYNC_MODE) {
			if (sc->aac_sync_cm) 
				break;
			cm = aac_dequeue_ready(sc);
			sc->aac_sync_cm = cm;
		} else {
			cm = aac_dequeue_ready(sc);
		}
		if (cm == NULL)
			break;
		if (cm->cm_flags & AAC_CMD_MAPPED)
			panic("aac: command %p already mapped", cm);
		if (cm->cm_datalen)
			aac_load_map_command_sg(sc, cm);
		else
			aacraid_map_command_sg(cm, NULL, 0, 0);
	}
}
void aacraid_startio ( struct aac_softc * sc ) { struct aac_command * cm ; fwprintf ( sc , HBA_FLAGS_DBG_FUNCTION_ENTRY_B , " " ) ; for ( ; ; ) { if ( sc -> aac_state & AAC_STATE_RESET ) { fwprintf ( sc , HBA_FLAGS_DBG_ERROR_B , " " ) ; break ; } if ( sc -> flags & AAC_QUEUE_FRZN ) { fwprintf ( sc , HBA_FLAGS_DBG_ERROR_B , " " ) ; break ; } if ( sc -> flags & AAC_FLAGS_SYNC_MODE ) { if ( sc -> aac_sync_cm ) break ; cm = aac_dequeue_ready ( sc ) ; sc -> aac_sync_cm = cm ; } else { cm = aac_dequeue_ready ( sc ) ; } if ( cm == NULL ) break ; if ( cm -> cm_flags & AAC_CMD_MAPPED ) panic ( " " , cm ) ; if ( cm -> cm_datalen ) aac_load_map_command_sg ( sc , cm ) ; else aacraid_map_command_sg ( cm , NULL , 0 , 0 ) ; } }
Start as much queued I/O as possible on the controller
Start as much queued I / O as possible on the controller
/*
		 * This flag might be set if the card is out of resources.
		 * Checking it here prevents an infinite loop of deferrals.
		 */ /*
		 * Try to get a command that's been put off for lack of
		 * resources
		 */ /* sync. transfer mode */ /* nothing to do? */ /* don't map more than once */ /*
		 * Set up the command to go to the controller.  If there are no
		 * data buffers associated with the command then it can bypass
		 * busdma.
		 */