FreeBSD/sys/dev/isci/isci_io_request.c
/**
 * @brief This method simply returns the virtual address associated
 *        with the scsi_io and byte_offset supplied parameters.
 *
 * @note This callback is not utilized in the fast path.  The expectation
 *       is that this method is utilized for items such as SCSI to ATA
 *       translation for commands like INQUIRY, READ CAPACITY, etc.
 *
 * @param[in] scif_user_io_request This parameter points to the user's
 *            IO request object.  It is a cookie that allows the user to
 *            provide the necessary information for this callback.
 * @param[in] byte_offset This parameter specifies the offset into the data
 *            buffers pointed to by the SGL.  The byte offset starts at 0
 *            and continues until the last byte pointed to be the last SGL
 *            element.
 *
 * @return A virtual address pointer to the location specified by the
 *         parameters.
 */
@brief This method simply returns the virtual address associated
with the scsi_io and byte_offset supplied parameters.

@note This callback is not utilized in the fast path.  The expectation
is that this method is utilized for items such as SCSI to ATA
translation for commands like INQUIRY, READ CAPACITY, etc.

@param[in] scif_user_io_request This parameter points to the user's
IO request object.  It is a cookie that allows the user to
provide the necessary information for this callback.
@param[in] byte_offset This parameter specifies the offset into the data
buffers pointed to by the SGL.  The byte offset starts at 0
and continues until the last byte pointed to be the last SGL
element.

@return A virtual address pointer to the location specified by the
parameters.
@brief This method simply returns the virtual address associated with the scsi_io and byte_offset supplied parameters . @note This callback is not utilized in the fast path . The expectation is that this method is utilized for items such as SCSI to ATA translation for commands like INQUIRY READ CAPACITY etc . @param [ in ] scif_user_io_request This parameter points to the user ' s IO request object . It is a cookie that allows the user to provide the necessary information for this callback . @param [ in ] byte_offset This parameter specifies the offset into the data buffers pointed to by the SGL . The byte offset starts at 0 and continues until the last byte pointed to be the last SGL element . @return A virtual address pointer to the location specified by the parameters .
uint8_t *
scif_cb_io_request_get_virtual_address_from_sgl(void * scif_user_io_request,
    uint32_t byte_offset)
{
	struct ISCI_IO_REQUEST	*isci_request;
	union ccb		*ccb;
	isci_request = scif_user_io_request;
	ccb = isci_request->ccb;
	if ((ccb->ccb_h.flags & CAM_DATA_MASK) != CAM_DATA_VADDR)
		panic("%s: requesting pointer into unmapped ccb", __func__);
	return (ccb->csio.data_ptr + byte_offset);
}
uint8_t * scif_cb_io_request_get_virtual_address_from_sgl ( void * scif_user_io_request , uint32_t byte_offset ) { struct ISCI_IO_REQUEST * isci_request ; union ccb * ccb ; isci_request = scif_user_io_request ; ccb = isci_request -> ccb ; if ( ( ccb -> ccb_h . flags & CAM_DATA_MASK ) != CAM_DATA_VADDR ) panic ( " " , __func__ ) ; return ( ccb -> csio . data_ptr + byte_offset ) ; }
@brief This method simply returns the virtual address associated
        with the scsi_io and byte_offset supplied parameters.
@brief This method simply returns the virtual address associated with the scsi_io and byte_offset supplied parameters .
/*
	 * This callback is only invoked for SCSI/ATA translation of
	 *  PIO commands such as INQUIRY and READ_CAPACITY, to allow
	 *  the driver to write the translated data directly into the
	 *  data buffer.  It is never invoked for READ/WRITE commands.
	 *  The driver currently assumes only READ/WRITE commands will
	 *  be unmapped.
	 *
	 * As a safeguard against future changes to unmapped commands,
	 *  add an explicit panic here should the DATA_MASK != VADDR.
	 *  Otherwise, we would return some garbage pointer back to the
	 *  caller which would result in a panic or more subtle data
	 *  corruption later on.
	 */