FreeBSD/sys/dev/isci/scil/sati_util.c
/**
 * @brief This method will construct the command-specific descriptor for
 *           the descriptor sense data buffer in the user's sense data buffer
 *           location.
 *
 * @param[in]     sense_data This parameter specifies the user SCSI IO request
 *                for which to set the sense data byte.
 * @param[in]     sense_len This parameter specifies length of the sense data
 *                to be returned by SATI.
 * @param[out]    descriptor_len This parameter returns the length of constructed
 *                descriptor.
 * @param[in]     information_buff This parameter specifies the address for which
 *                to set the command-specific information buffer.
 *
 * @return none
 */
@brief This method will construct the command-specific descriptor for
the descriptor sense data buffer in the user's sense data buffer
location.

@param[in]     sense_data This parameter specifies the user SCSI IO request
for which to set the sense data byte.
@param[in]     sense_len This parameter specifies length of the sense data
to be returned by SATI.
@param[out]    descriptor_len This parameter returns the length of constructed
descriptor.
@param[in]     information_buff This parameter specifies the address for which
to set the command-specific information buffer.

@return none
@brief This method will construct the command - specific descriptor for the descriptor sense data buffer in the user ' s sense data buffer location . @param [ in ] sense_data This parameter specifies the user SCSI IO request for which to set the sense data byte . @param [ in ] sense_len This parameter specifies length of the sense data to be returned by SATI . @param [ out ] descriptor_len This parameter returns the length of constructed descriptor . @param [ in ] information_buff This parameter specifies the address for which to set the command - specific information buffer . @return none
static
void sati_scsi_command_specific_descriptor_construct(
    U8       * sense_data,
    U32        sense_len,
    U8       * information_buff)
{
    U8 i;
    sati_set_sense_data_byte(sense_data, sense_len, 0,  SCSI_CMD_SPECIFIC_DESCRIPTOR_TYPE);
    sati_set_sense_data_byte(sense_data, sense_len, 1,  SCSI_CMD_SPECIFIC_DESCRIPTOR_ADDITIONAL_LENGTH);
    sati_set_sense_data_byte(sense_data, sense_len, 2,  0);
    sati_set_sense_data_byte(sense_data, sense_len, 3,  0);
    for (i=0; i<8; i++)
        sati_set_sense_data_byte(sense_data, sense_len, 4 + i, information_buff==NULL?0xFF:information_buff[i]);
}
static void sati_scsi_command_specific_descriptor_construct ( U8 * sense_data , U32 sense_len , U8 * information_buff ) { U8 i ; sati_set_sense_data_byte ( sense_data , sense_len , 0 , SCSI_CMD_SPECIFIC_DESCRIPTOR_TYPE ) ; sati_set_sense_data_byte ( sense_data , sense_len , 1 , SCSI_CMD_SPECIFIC_DESCRIPTOR_ADDITIONAL_LENGTH ) ; sati_set_sense_data_byte ( sense_data , sense_len , 2 , 0 ) ; sati_set_sense_data_byte ( sense_data , sense_len , 3 , 0 ) ; for ( i = 0 ; i < 8 ; i ++ ) sati_set_sense_data_byte ( sense_data , sense_len , 4 + i , information_buff == NULL ? 0xFF : information_buff [ i ] ) ; }
@brief This method will construct the command-specific descriptor for
           the descriptor sense data buffer in the user's sense data buffer
           location.
@brief This method will construct the command - specific descriptor for the descriptor sense data buffer in the user ' s sense data buffer location .
// fill information buffer // SBC 5.20.1 REASSIGN BLOCKS command overview // If information about the first LBA not reassigned is not available // COMMAND-SPECIFIC INFORMATION field shall be set to FFFF_FFFF_FFFF_FFFFh