FreeBSD/sys/cam/ctl/ctl.c
/*
 * This gets called by a backend driver when it is done with a
 * configuration write.
 */
This gets called by a backend driver when it is done with a
configuration write.
This gets called by a backend driver when it is done with a configuration write .
void
ctl_config_write_done(union ctl_io *io)
{
	uint8_t *buf;
	if ((io->io_hdr.flags & CTL_FLAG_IO_CONT) &&
	    (io->io_hdr.flags & CTL_FLAG_ABORT) == 0 &&
	    ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE ||
	     (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) {
		io->scsiio.io_cont(io);
		return;
	}
	if (io->io_hdr.flags & CTL_FLAG_ALLOCATED)
		buf = io->scsiio.kern_data_ptr;
	else
		buf = NULL;
	ctl_done(io);
	if (buf)
		free(buf, M_CTL);
}
void ctl_config_write_done ( union ctl_io * io ) { uint8_t * buf ; if ( ( io -> io_hdr . flags & CTL_FLAG_IO_CONT ) && ( io -> io_hdr . flags & CTL_FLAG_ABORT ) == 0 && ( ( io -> io_hdr . status & CTL_STATUS_MASK ) == CTL_STATUS_NONE || ( io -> io_hdr . status & CTL_STATUS_MASK ) == CTL_SUCCESS ) ) { io -> scsiio . io_cont ( io ) ; return ; } if ( io -> io_hdr . flags & CTL_FLAG_ALLOCATED ) buf = io -> scsiio . kern_data_ptr ; else buf = NULL ; ctl_done ( io ) ; if ( buf ) free ( buf , M_CTL ) ; }
This gets called by a backend driver when it is done with a
 configuration write.
This gets called by a backend driver when it is done with a configuration write .
/*
	 * If the IO_CONT flag is set, we need to call the supplied
	 * function to continue processing the I/O, instead of completing
	 * the I/O just yet.
	 *
	 * If there is an error, though, we don't want to keep processing.
	 * Instead, just send status back to the initiator.
	 */ /*
	 * Since a configuration write can be done for commands that actually
	 * have data allocated, like write buffer, and commands that have
	 * no data, like start/stop unit, we need to check here.
	 */