sys/bus/cam/scsi/scsi_target.c
/* Convert CAM status to errno values */
Convert CAM status to errno values
Convert CAM status to errno values
static int
targcamstatus(cam_status status)
{
	switch (status & CAM_STATUS_MASK) {
	case CAM_REQ_CMP:	
		return (0);
	case CAM_REQ_INPROG:	
		return (EINPROGRESS);
	case CAM_REQ_CMP_ERR:	
		return (EIO);
	case CAM_PROVIDE_FAIL:	
		return (ENOTTY);
	case CAM_FUNC_NOTAVAIL:	
		return (ENOTSUP);
	case CAM_LUN_ALRDY_ENA:	
		return (EADDRINUSE);
	case CAM_PATH_INVALID:	
	case CAM_DEV_NOT_THERE:	
		return (ENOENT);
	case CAM_REQ_ABORTED:	
		return (ECANCELED);
	case CAM_CMD_TIMEOUT:	
		return (ETIMEDOUT);
	case CAM_REQUEUE_REQ:	
		return (EAGAIN);
	case CAM_REQ_INVALID:	
		return (EINVAL);
	case CAM_RESRC_UNAVAIL:	
		return (ENOMEM);
	case CAM_BUSY:		
	case CAM_UA_ABORT:	
		return (EBUSY);
	default:
		return (ENXIO);
	}
}
static int targcamstatus ( cam_status status ) { switch ( status & CAM_STATUS_MASK ) { case CAM_REQ_CMP : return ( 0 ) ; case CAM_REQ_INPROG : return ( EINPROGRESS ) ; case CAM_REQ_CMP_ERR : return ( EIO ) ; case CAM_PROVIDE_FAIL : return ( ENOTTY ) ; case CAM_FUNC_NOTAVAIL : return ( ENOTSUP ) ; case CAM_LUN_ALRDY_ENA : return ( EADDRINUSE ) ; case CAM_PATH_INVALID : case CAM_DEV_NOT_THERE : return ( ENOENT ) ; case CAM_REQ_ABORTED : return ( ECANCELED ) ; case CAM_CMD_TIMEOUT : return ( ETIMEDOUT ) ; case CAM_REQUEUE_REQ : return ( EAGAIN ) ; case CAM_REQ_INVALID : return ( EINVAL ) ; case CAM_RESRC_UNAVAIL : return ( ENOMEM ) ; case CAM_BUSY : case CAM_UA_ABORT : return ( EBUSY ) ; default : return ( ENXIO ) ; } }
Convert CAM status to errno values
Convert CAM status to errno values
/* CCB request completed without error */ /* CCB request is in progress */ /* CCB request completed with an error */ /* Unable to provide requested capability */ /* The requested function is not available */ /* LUN is already enabled for target mode */ /* Supplied Path ID is invalid */ /* SCSI Device Not Installed/there */ /* CCB request aborted by the host */ /* Command timeout */ /* Requeue to preserve transaction ordering */ /* CCB request was invalid */ /* Resource Unavailable */ /* CAM subsytem is busy */ /* Unable to abort CCB request */