FreeBSD/sys/dev/isci/scil/sati_util.c
/**
 * @brief This method checks to make sure that the translation isn't
 *        exceeding the allocation length specified in the CDB while
 *        translating payload data into the user's buffer.
 *
 * @param[in]     sequence This parameter specifies the translation sequence
 *                for which to set the user payload data dword.
 * @param[in,out] scsi_io This parameter specifies the user's IO request
 *                for which to set the user payload data dword.
 * @param[in]     byte_offset This parameter specifies the offset into
 *                the user's payload buffer at which to write the supplied
 *                value.
 * @param[in]     value This parameter specifies the new value to be
 *                written out into the user's payload buffer.
 *
 * @return none
 */
@brief This method checks to make sure that the translation isn't
exceeding the allocation length specified in the CDB while
translating payload data into the user's buffer.

@param[in]     sequence This parameter specifies the translation sequence
for which to set the user payload data dword.
@param[in,out] scsi_io This parameter specifies the user's IO request
for which to set the user payload data dword.
@param[in]     byte_offset This parameter specifies the offset into
the user's payload buffer at which to write the supplied
value.
@param[in]     value This parameter specifies the new value to be
written out into the user's payload buffer.

@return none
@brief This method checks to make sure that the translation isn ' t exceeding the allocation length specified in the CDB while translating payload data into the user ' s buffer . @param [ in ] sequence This parameter specifies the translation sequence for which to set the user payload data dword . @param [ in out ] scsi_io This parameter specifies the user ' s IO request for which to set the user payload data dword . @param [ in ] byte_offset This parameter specifies the offset into the user ' s payload buffer at which to write the supplied value . @param [ in ] value This parameter specifies the new value to be written out into the user ' s payload buffer . @return none
void sati_set_data_dword(
   SATI_TRANSLATOR_SEQUENCE_T * sequence,
   void                       * scsi_io,
   U32                          byte_offset,
   U32                          value
)
{
   sati_set_data_byte(sequence, scsi_io, byte_offset, (U8)value & 0xFF);
       byte_offset++;
   sati_set_data_byte(sequence, scsi_io, byte_offset, (U8)(value >> 8) & 0xFF);
       byte_offset++;
   sati_set_data_byte(sequence, scsi_io, byte_offset, (U8)(value >> 16) & 0xFF);
       byte_offset++;
   sati_set_data_byte(sequence, scsi_io, byte_offset, (U8)(value >> 24) & 0xFF);
}
void sati_set_data_dword ( SATI_TRANSLATOR_SEQUENCE_T * sequence , void * scsi_io , U32 byte_offset , U32 value ) { sati_set_data_byte ( sequence , scsi_io , byte_offset , ( U8 ) value & 0xFF ) ; byte_offset ++ ; sati_set_data_byte ( sequence , scsi_io , byte_offset , ( U8 ) ( value >> 8 ) & 0xFF ) ; byte_offset ++ ; sati_set_data_byte ( sequence , scsi_io , byte_offset , ( U8 ) ( value >> 16 ) & 0xFF ) ; byte_offset ++ ; sati_set_data_byte ( sequence , scsi_io , byte_offset , ( U8 ) ( value >> 24 ) & 0xFF ) ; }
@brief This method checks to make sure that the translation isn't
        exceeding the allocation length specified in the CDB while
        translating payload data into the user's buffer.
@brief This method checks to make sure that the translation isn ' t exceeding the allocation length specified in the CDB while translating payload data into the user ' s buffer .
/// @todo Check to ensure that the bytes appear correctly (SAS Address).