FreeBSD/sys/dev/isci/scil/sati_util.c
/**
 * @brief This method will construct the descriptor sense data buffer in
 *           the user's sense data buffer location.  Additionally, it will set
 *           the user's SCSI status.
 *
 * @param[in]     sequence This parameter specifies the translation sequence
 *                for which to construct the sense data.
 * @param[in,out] scsi_io This parameter specifies the user's IO request
 *                for which to construct the sense data.
 * @param[in]     scsi_status This parameter specifies the SCSI status
 *                value for the user's IO request.
 * @param[in]     sense_key This parameter specifies the sense key to
 *                be set for the user's IO request.
 * @param[in]     additional_sense_code This parameter specifies the
 *                additional sense code (ASC) key to be set for the user's
 *                IO request.
 * @param[in]     additional_sense_code_qualifier This parameter specifies
 *                the additional sense code qualifier (ASCQ) key to be set
 *                for the user's IO request.
 *
 * @return none
 */
@brief This method will construct the descriptor sense data buffer in
the user's sense data buffer location.  Additionally, it will set
the user's SCSI status.

@param[in]     sequence This parameter specifies the translation sequence
for which to construct the sense data.
@param[in,out] scsi_io This parameter specifies the user's IO request
for which to construct the sense data.
@param[in]     scsi_status This parameter specifies the SCSI status
value for the user's IO request.
@param[in]     sense_key This parameter specifies the sense key to
be set for the user's IO request.
@param[in]     additional_sense_code This parameter specifies the
additional sense code (ASC) key to be set for the user's
IO request.
@param[in]     additional_sense_code_qualifier This parameter specifies
the additional sense code qualifier (ASCQ) key to be set
for the user's IO request.

@return none
@brief This method will construct the descriptor sense data buffer in the user ' s sense data buffer location . Additionally it will set the user ' s SCSI status . @param [ in ] sequence This parameter specifies the translation sequence for which to construct the sense data . @param [ in out ] scsi_io This parameter specifies the user ' s IO request for which to construct the sense data . @param [ in ] scsi_status This parameter specifies the SCSI status value for the user ' s IO request . @param [ in ] sense_key This parameter specifies the sense key to be set for the user ' s IO request . @param [ in ] additional_sense_code This parameter specifies the additional sense code ( ASC ) key to be set for the user ' s IO request . @param [ in ] additional_sense_code_qualifier This parameter specifies the additional sense code qualifier ( ASCQ ) key to be set for the user ' s IO request . @return none
static
void sati_scsi_common_descriptor_sense_construct(
    SATI_TRANSLATOR_SEQUENCE_T * sequence,
    void                       * scsi_io,
    U8                         * sense_data,
    U32                          sense_len,
    U8                           sense_key,
    U8                           additional_sense_code,
    U8                           additional_sense_code_qualifier,
    U8                         * information_buff
)
{
    sati_set_sense_data_byte(sense_data, sense_len, 1,  sense_key);
    sati_set_sense_data_byte(sense_data, sense_len, 2,  additional_sense_code);
    sati_set_sense_data_byte(sense_data, sense_len, 3,  additional_sense_code_qualifier);
    sati_set_sense_data_byte(sense_data, sense_len, 4,  0);
    sati_set_sense_data_byte(sense_data, sense_len, 5,  0);
    sati_set_sense_data_byte(sense_data, sense_len, 6,  0);
    sati_scsi_common_descriptors_construct(scsi_io, sense_data + 8, sense_len, information_buff);
    sati_set_sense_data_byte(sense_data, sense_len, 7,  sati_scsi_get_descriptor_sense_data_length(sequence, scsi_io) - 8);
}
static void sati_scsi_common_descriptor_sense_construct ( SATI_TRANSLATOR_SEQUENCE_T * sequence , void * scsi_io , U8 * sense_data , U32 sense_len , U8 sense_key , U8 additional_sense_code , U8 additional_sense_code_qualifier , U8 * information_buff ) { sati_set_sense_data_byte ( sense_data , sense_len , 1 , sense_key ) ; sati_set_sense_data_byte ( sense_data , sense_len , 2 , additional_sense_code ) ; sati_set_sense_data_byte ( sense_data , sense_len , 3 , additional_sense_code_qualifier ) ; sati_set_sense_data_byte ( sense_data , sense_len , 4 , 0 ) ; sati_set_sense_data_byte ( sense_data , sense_len , 5 , 0 ) ; sati_set_sense_data_byte ( sense_data , sense_len , 6 , 0 ) ; sati_scsi_common_descriptors_construct ( scsi_io , sense_data + 8 , sense_len , information_buff ) ; sati_set_sense_data_byte ( sense_data , sense_len , 7 , sati_scsi_get_descriptor_sense_data_length ( sequence , scsi_io ) - 8 ) ; }
@brief This method will construct the descriptor sense data buffer in
           the user's sense data buffer location.
@brief This method will construct the descriptor sense data buffer in the user ' s sense data buffer location .