FreeBSD/sys/dev/isci/scil/sati_util.c
/**
 * @brief This method will construct the buffer for sense data
 *        sense data buffer location.  Additionally, it will set the user's
 *        SCSI status.
 *
 * @param[in,out] scsi_io This parameter specifies the user's IO request
 *                for which to construct the buffer for sense data.
 * @param[in]     scsi_status This parameter specifies the SCSI status
 *                value for the user's IO request.
 * @param[out]    sense_data This paramater
 *
 * @return none
 */
@brief This method will construct the buffer for sense data
sense data buffer location.  Additionally, it will set the user's
SCSI status.

@param[in,out] scsi_io This parameter specifies the user's IO request
for which to construct the buffer for sense data.
@param[in]     scsi_status This parameter specifies the SCSI status
value for the user's IO request.
@param[out]    sense_data This paramater

@return none
@brief This method will construct the buffer for sense data sense data buffer location . Additionally it will set the user ' s SCSI status . @param [ in out ] scsi_io This parameter specifies the user ' s IO request for which to construct the buffer for sense data . @param [ in ] scsi_status This parameter specifies the SCSI status value for the user ' s IO request . @param [ out ] sense_data This paramater @return none
static
void sati_scsi_get_sense_data_buffer(
    SATI_TRANSLATOR_SEQUENCE_T      * sequence,
    void                            * scsi_io,
    U8                                scsi_status,
    U8                             ** sense_data,
    U32                             * sense_len)
{
#ifdef SATI_TRANSPORT_SUPPORTS_SAS
   SCI_SSP_RESPONSE_IU_T * rsp_iu = (SCI_SSP_RESPONSE_IU_T*)
                                    sati_cb_get_response_iu_address(scsi_io);
   sati_scsi_common_response_iu_construct(
      rsp_iu,
      scsi_status,
      sati_scsi_get_sense_data_length(sequence, scsi_io),
      SCSI_RESPONSE_DATA_PRES_SENSE_DATA
   );
   *sense_data                   = (U8*) rsp_iu->data;
   *sense_len                    = SSP_RESPONSE_IU_MAX_DATA * 4;  
#else
   *sense_data = sati_cb_get_sense_data_address(scsi_io);
   *sense_len  = sati_cb_get_sense_data_length(scsi_io);
   sati_cb_set_scsi_status(scsi_io, scsi_status);
#endif 
}
static void sati_scsi_get_sense_data_buffer ( SATI_TRANSLATOR_SEQUENCE_T * sequence , void * scsi_io , U8 scsi_status , U8 * * sense_data , U32 * sense_len ) { #ifdef SATI_TRANSPORT_SUPPORTS_SAS SCI_SSP_RESPONSE_IU_T * rsp_iu = ( SCI_SSP_RESPONSE_IU_T * ) sati_cb_get_response_iu_address ( scsi_io ) ; sati_scsi_common_response_iu_construct ( rsp_iu , scsi_status , sati_scsi_get_sense_data_length ( sequence , scsi_io ) , SCSI_RESPONSE_DATA_PRES_SENSE_DATA ) ; * sense_data = ( U8 * ) rsp_iu -> data ; * sense_len = SSP_RESPONSE_IU_MAX_DATA * 4 ; #else * sense_data = sati_cb_get_sense_data_address ( scsi_io ) ; * sense_len = sati_cb_get_sense_data_length ( scsi_io ) ; sati_cb_set_scsi_status ( scsi_io , scsi_status ) ; #endif }
@brief This method will construct the buffer for sense data
        sense data buffer location.
@brief This method will construct the buffer for sense data sense data buffer location .
// dwords to bytes // SATI_TRANSPORT_SUPPORTS_SAS