FreeBSD/sys/cam/ctl/ctl.c
/*
 * Primary command inlet from frontend ports.  All SCSI and task I/O
 * requests must go through this function.
 */
Primary command inlet from frontend ports.  All SCSI and task I/O
requests must go through this function.
Primary command inlet from frontend ports . All SCSI and task I / O requests must go through this function .
int
ctl_queue(union ctl_io *io)
{
	struct ctl_port *port;
	CTL_DEBUG_PRINT(("ctl_queue cdb[0]=%02X\n", io->scsiio.cdb[0]));
#ifdef CTL_TIME_IO
	io->io_hdr.start_time = time_uptime;
	getbinuptime(&io->io_hdr.start_bt);
#endif 
	port = ctl_io_port(&io->io_hdr);
	io->io_hdr.nexus.targ_mapped_lun =
	    ctl_lun_map_from_port(port, io->io_hdr.nexus.targ_lun);
	switch (io->io_hdr.io_type) {
	case CTL_IO_SCSI:
	case CTL_IO_TASK:
		if (ctl_debug & CTL_DEBUG_CDB)
			ctl_io_print(io);
		ctl_enqueue_incoming(io);
		break;
	default:
		printf("ctl_queue: unknown I/O type %d\n", io->io_hdr.io_type);
		return (EINVAL);
	}
	return (CTL_RETVAL_COMPLETE);
}
int ctl_queue ( union ctl_io * io ) { struct ctl_port * port ; CTL_DEBUG_PRINT ( ( " \n " , io -> scsiio . cdb [ 0 ] ) ) ; #ifdef CTL_TIME_IO io -> io_hdr . start_time = time_uptime ; getbinuptime ( & io -> io_hdr . start_bt ) ; #endif port = ctl_io_port ( & io -> io_hdr ) ; io -> io_hdr . nexus . targ_mapped_lun = ctl_lun_map_from_port ( port , io -> io_hdr . nexus . targ_lun ) ; switch ( io -> io_hdr . io_type ) { case CTL_IO_SCSI : case CTL_IO_TASK : if ( ctl_debug & CTL_DEBUG_CDB ) ctl_io_print ( io ) ; ctl_enqueue_incoming ( io ) ; break ; default : printf ( " \n " , io -> io_hdr . io_type ) ; return ( EINVAL ) ; } return ( CTL_RETVAL_COMPLETE ) ; }
Primary command inlet from frontend ports.
Primary command inlet from frontend ports .
/* CTL_TIME_IO */ /* Map FE-specific LUN ID into global one. */