FreeBSD/sys/cam/ctl/ctl.c
/*
 * Backend "memory move is complete" callback for requests that never
 * make it down to say RAIDCore's configuration code.
 */
Backend "memory move is complete" callback for requests that never
make it down to say RAIDCore's configuration code.
Backend " memory move is complete " callback for requests that never make it down to say RAIDCore ' s configuration code .
int
ctl_config_move_done(union ctl_io *io)
{
	int retval;
	CTL_DEBUG_PRINT(("ctl_config_move_done\n"));
	KASSERT(io->io_hdr.io_type == CTL_IO_SCSI,
	    ("Config I/O type isn't CTL_IO_SCSI (%d)!", io->io_hdr.io_type));
	if ((io->io_hdr.port_status != 0) &&
	    ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE ||
	     (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) {
		ctl_set_internal_failure(&io->scsiio,
					  1,
					 io->io_hdr.port_status);
	}
	if (ctl_debug & CTL_DEBUG_CDB_DATA)
		ctl_data_print(io);
	if (((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_IN) ||
	    ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE &&
	     (io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS) ||
	    ((io->io_hdr.flags & CTL_FLAG_ABORT) != 0)) {
		if (io->io_hdr.flags & CTL_FLAG_ALLOCATED)
			free(io->scsiio.kern_data_ptr, M_CTL);
		ctl_done(io);
		retval = CTL_RETVAL_COMPLETE;
	} else {
		retval = ctl_scsiio(&io->scsiio);
	}
	return (retval);
}
int ctl_config_move_done ( union ctl_io * io ) { int retval ; CTL_DEBUG_PRINT ( ( " \n " ) ) ; KASSERT ( io -> io_hdr . io_type == CTL_IO_SCSI , ( " " , io -> io_hdr . io_type ) ) ; if ( ( io -> io_hdr . port_status != 0 ) && ( ( io -> io_hdr . status & CTL_STATUS_MASK ) == CTL_STATUS_NONE || ( io -> io_hdr . status & CTL_STATUS_MASK ) == CTL_SUCCESS ) ) { ctl_set_internal_failure ( & io -> scsiio , 1 , io -> io_hdr . port_status ) ; } if ( ctl_debug & CTL_DEBUG_CDB_DATA ) ctl_data_print ( io ) ; if ( ( ( io -> io_hdr . flags & CTL_FLAG_DATA_MASK ) == CTL_FLAG_DATA_IN ) || ( ( io -> io_hdr . status & CTL_STATUS_MASK ) != CTL_STATUS_NONE && ( io -> io_hdr . status & CTL_STATUS_MASK ) != CTL_SUCCESS ) || ( ( io -> io_hdr . flags & CTL_FLAG_ABORT ) != 0 ) ) { if ( io -> io_hdr . flags & CTL_FLAG_ALLOCATED ) free ( io -> scsiio . kern_data_ptr , M_CTL ) ; ctl_done ( io ) ; retval = CTL_RETVAL_COMPLETE ; } else { retval = ctl_scsiio ( & io -> scsiio ) ; } return ( retval ) ; }
Backend "memory move is complete" callback for requests that never
 make it down to say RAIDCore's configuration code.
Backend " memory move is complete " callback for requests that never make it down to say RAIDCore ' s configuration code .
/*
		 * For hardware error sense keys, the sense key
		 * specific value is defined to be a retry count,
		 * but we use it to pass back an internal FETD
		 * error code.  XXX KDM  Hopefully the FETD is only
		 * using 16 bits for an error code, since that's
		 * all the space we have in the sks field.
		 */ /*sks_valid*/ /*retry_count*/ /*
		 * XXX KDM just assuming a single pointer here, and not a
		 * S/G list.  If we start using S/G lists for config data,
		 * we'll need to know how to clean them up here as well.
		 */ /*
		 * XXX KDM now we need to continue data movement.  Some
		 * options:
		 * - call ctl_scsiio() again?  We don't do this for data
		 *   writes, because for those at least we know ahead of
		 *   time where the write will go and how long it is.  For
		 *   config writes, though, that information is largely
		 *   contained within the write itself, thus we need to
		 *   parse out the data again.
		 *
		 * - Call some other function once the data is in?
		 */ /*
		 * XXX KDM call ctl_scsiio() again for now, and check flag
		 * bits to see whether we're allocated or not.
		 */