FreeBSD/sys/dev/isci/scil/sati_util.c
/**
 * @brief This method performs a copy operation using an offset into the
 *        source buffer, an offset into the destination buffer, and a length.
 *        It will perform the byte swap from the 16-bit identify field
 *        into the network byte order SCSI location.
 *
 * @param[in]  sequence This parameter specifies the translation sequence
 *             for which to copy and swap the data.
 * @param[out] destination_scsi_io This parameter specifies the SCSI IO
 *             request containing the destination buffer into which to copy.
 * @param[in]  destination_offset This parameter specifies the offset into
 *             the data buffer where the information will be copied to.
 * @param[in]  source_buffer This parameter specifies the source buffer from
 *             which the data will be copied.
 * @param[in]  source_offset This parameter specifies the offset into the
 *             source buffer where the copy shall begin.
 * @param[in]  length This parameter specifies the number of bytes to copy
 *             during this operation.
 * @param[in]  use_printable_chars This parameter indicates if the copy should
 *             ensure that the value copied is considered an ASCII printable
 *             character (e.g. A, B, " ", etc.).  These characters reside
 *             in the 0x20 - 0x7E ASCII range.
 *
 * @return none
 */
@brief This method performs a copy operation using an offset into the
source buffer, an offset into the destination buffer, and a length.
It will perform the byte swap from the 16-bit identify field
into the network byte order SCSI location.

@param[in]  sequence This parameter specifies the translation sequence
for which to copy and swap the data.
@param[out] destination_scsi_io This parameter specifies the SCSI IO
request containing the destination buffer into which to copy.
@param[in]  destination_offset This parameter specifies the offset into
the data buffer where the information will be copied to.
@param[in]  source_buffer This parameter specifies the source buffer from
which the data will be copied.
@param[in]  source_offset This parameter specifies the offset into the
source buffer where the copy shall begin.
@param[in]  length This parameter specifies the number of bytes to copy
during this operation.
@param[in]  use_printable_chars This parameter indicates if the copy should
ensure that the value copied is considered an ASCII printable
character .  These characters reside
in the 0x20 - 0x7E ASCII range.

@return none
@brief This method performs a copy operation using an offset into the source buffer an offset into the destination buffer and a length . It will perform the byte swap from the 16 - bit identify field into the network byte order SCSI location . @param [ in ] sequence This parameter specifies the translation sequence for which to copy and swap the data . @param [ out ] destination_scsi_io This parameter specifies the SCSI IO request containing the destination buffer into which to copy . @param [ in ] destination_offset This parameter specifies the offset into the data buffer where the information will be copied to . @param [ in ] source_buffer This parameter specifies the source buffer from which the data will be copied . @param [ in ] source_offset This parameter specifies the offset into the source buffer where the copy shall begin . @param [ in ] length This parameter specifies the number of bytes to copy during this operation . @param [ in ] use_printable_chars This parameter indicates if the copy should ensure that the value copied is considered an ASCII printable character . These characters reside in the 0x20 - 0x7E ASCII range . @return none
void sati_ata_identify_device_copy_data(
   SATI_TRANSLATOR_SEQUENCE_T * sequence,
   void                       * destination_scsi_io,
   U32                          destination_offset,
   U8                         * source_buffer,
   U32                          source_offset,
   U32                          length,
   BOOL                         use_printable_chars
)
{
   source_buffer += source_offset;
   while (length > 0)
   {
      sati_set_ascii_data_byte(
         sequence,
         destination_scsi_io,
         destination_offset,
         *(source_buffer+1),
         use_printable_chars
      );
      sati_set_ascii_data_byte(
         sequence,
         destination_scsi_io,
         destination_offset+1,
         *source_buffer,
         use_printable_chars
      );
      destination_offset += 2;
      source_buffer      += 2;
      length             -= 2;
   }
}
void sati_ata_identify_device_copy_data ( SATI_TRANSLATOR_SEQUENCE_T * sequence , void * destination_scsi_io , U32 destination_offset , U8 * source_buffer , U32 source_offset , U32 length , BOOL use_printable_chars ) { source_buffer += source_offset ; while ( length > 0 ) { sati_set_ascii_data_byte ( sequence , destination_scsi_io , destination_offset , * ( source_buffer + 1 ) , use_printable_chars ) ; sati_set_ascii_data_byte ( sequence , destination_scsi_io , destination_offset + 1 , * source_buffer , use_printable_chars ) ; destination_offset += 2 ; source_buffer += 2 ; length -= 2 ; } }
@brief This method performs a copy operation using an offset into the
        source buffer, an offset into the destination buffer, and a length.
@brief This method performs a copy operation using an offset into the source buffer an offset into the destination buffer and a length .