FreeBSD/sys/dev/isci/scil/sati_util.c
/**
 * @brief This method will construct the 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 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 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
void sati_scsi_sense_data_construct(
   SATI_TRANSLATOR_SEQUENCE_T * sequence,
   void                       * scsi_io,
   U8                           scsi_status,
   U8                           sense_key,
   U8                           additional_sense_code,
   U8                           additional_sense_code_qualifier
)
{
    U8 response_code;
    response_code = sati_scsi_get_sense_data_response_code(sequence);
    switch (response_code)
    {
    case SCSI_FIXED_CURRENT_RESPONSE_CODE:
    case SCSI_FIXED_DEFERRED_RESPONSE_CODE:
    sati_scsi_fixed_sense_data_construct(sequence, scsi_io, scsi_status, response_code,
                sense_key, additional_sense_code, additional_sense_code_qualifier);
    break;
    case SCSI_DESCRIPTOR_CURRENT_RESPONSE_CODE:
    case SCSI_DESCRIPTOR_DEFERRED_RESPONSE_CODE:
        sati_scsi_descriptor_sense_data_construct(sequence, scsi_io, scsi_status, response_code,
                sense_key, additional_sense_code, additional_sense_code_qualifier);
        break;
    }
    sequence->is_sense_response_set = TRUE;
}
void sati_scsi_sense_data_construct ( SATI_TRANSLATOR_SEQUENCE_T * sequence , void * scsi_io , U8 scsi_status , U8 sense_key , U8 additional_sense_code , U8 additional_sense_code_qualifier ) { U8 response_code ; response_code = sati_scsi_get_sense_data_response_code ( sequence ) ; switch ( response_code ) { case SCSI_FIXED_CURRENT_RESPONSE_CODE : case SCSI_FIXED_DEFERRED_RESPONSE_CODE : sati_scsi_fixed_sense_data_construct ( sequence , scsi_io , scsi_status , response_code , sense_key , additional_sense_code , additional_sense_code_qualifier ) ; break ; case SCSI_DESCRIPTOR_CURRENT_RESPONSE_CODE : case SCSI_DESCRIPTOR_DEFERRED_RESPONSE_CODE : sati_scsi_descriptor_sense_data_construct ( sequence , scsi_io , scsi_status , response_code , sense_key , additional_sense_code , additional_sense_code_qualifier ) ; break ; } sequence -> is_sense_response_set = TRUE ; }
@brief This method will construct the sense data buffer in the user's
        sense data buffer location.
@brief This method will construct the sense data buffer in the user ' s sense data buffer location .