FreeBSD/sys/cam/ctl/ctl.c
/*
 * Process a datamove request from the other controller.  This is used for
 * XFER mode only, not SER_ONLY mode.  For writes, we DMA into local memory
 * first.  Once that is complete, the data gets DMAed into the remote
 * controller's memory.  For reads, we DMA from the remote controller's
 * memory into our memory first, and then move it out to the FETD.
 */
Process a datamove request from the other controller.  This is used for
XFER mode only, not SER_ONLY mode.  For writes, we DMA into local memory
first.  Once that is complete, the data gets DMAed into the remote
controller's memory.  For reads, we DMA from the remote controller's
memory into our memory first, and then move it out to the FETD.
Process a datamove request from the other controller . This is used for XFER mode only not SER_ONLY mode . For writes we DMA into local memory first . Once that is complete the data gets DMAed into the remote controller ' s memory . For reads we DMA from the remote controller ' s memory into our memory first and then move it out to the FETD .
static void
ctl_datamove_remote(union ctl_io *io)
{
	mtx_assert(&control_softc->ctl_lock, MA_NOTOWNED);
	if (io->io_hdr.flags & CTL_FLAG_FAILOVER) {
		ctl_failover_io(io,  0);
		return;
	}
	if (io->io_hdr.flags & CTL_FLAG_ABORT) {
		printf("%s: tag 0x%04x on (%u:%u:%u) aborted\n", __func__,
		       io->scsiio.tag_num, io->io_hdr.nexus.initid,
		       io->io_hdr.nexus.targ_port,
		       io->io_hdr.nexus.targ_lun);
		io->io_hdr.port_status = 31338;
		ctl_send_datamove_done(io,  0);
		return;
	}
	if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_OUT)
		ctl_datamove_remote_write(io);
	else if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_IN)
		ctl_datamove_remote_read(io);
	else {
		io->io_hdr.port_status = 31339;
		ctl_send_datamove_done(io,  0);
	}
}
static void ctl_datamove_remote ( union ctl_io * io ) { mtx_assert ( & control_softc -> ctl_lock , MA_NOTOWNED ) ; if ( io -> io_hdr . flags & CTL_FLAG_FAILOVER ) { ctl_failover_io ( io , 0 ) ; return ; } if ( io -> io_hdr . flags & CTL_FLAG_ABORT ) { printf ( " \n " , __func__ , io -> scsiio . tag_num , io -> io_hdr . nexus . initid , io -> io_hdr . nexus . targ_port , io -> io_hdr . nexus . targ_lun ) ; io -> io_hdr . port_status = 31338 ; ctl_send_datamove_done ( io , 0 ) ; return ; } if ( ( io -> io_hdr . flags & CTL_FLAG_DATA_MASK ) == CTL_FLAG_DATA_OUT ) ctl_datamove_remote_write ( io ) ; else if ( ( io -> io_hdr . flags & CTL_FLAG_DATA_MASK ) == CTL_FLAG_DATA_IN ) ctl_datamove_remote_read ( io ) ; else { io -> io_hdr . port_status = 31339 ; ctl_send_datamove_done ( io , 0 ) ; } }
Process a datamove request from the other controller.
Process a datamove request from the other controller .
/*have_lock*/ /*
	 * Note that we look for an aborted I/O here, but don't do some of
	 * the other checks that ctl_datamove() normally does.
	 * We don't need to run the datamove delay code, since that should
	 * have been done if need be on the other controller.
	 */ /*have_lock*/ /*have_lock*/