FreeBSD/sys/dev/isci/scil/sati_util.c
/**
 * @brief This method will return length of descriptor sense data for executed command.
 *
 * @return sense data length
 */
@brief This method will return length of descriptor sense data for executed command.
@return sense data length
@brief This method will return length of descriptor sense data for executed command . @return sense data length
static
U8 sati_scsi_get_descriptor_sense_data_length(SATI_TRANSLATOR_SEQUENCE_T * sequence,
        void * scsi_io)
{
    U8 * cdb = sati_cb_get_cdb_address(scsi_io);
    U8 length = 8;
    switch (sati_get_cdb_byte(cdb, 0))
    {
#if !defined(DISABLE_SATI_WRITE_LONG)
    case SCSI_WRITE_LONG_10:
    case SCSI_WRITE_LONG_16:
        length += SCSI_BLOCK_DESCRIPTOR_LENGTH +
            SCSI_INFORMATION_DESCRIPTOR_LENGTH;
        break;
#endif 
#if !defined(DISABLE_SATI_REASSIGN_BLOCKS)
    case SCSI_REASSIGN_BLOCKS:
        length += SCSI_CMD_SPECIFIC_DESCRIPTOR_LENGTH +
            SCSI_INFORMATION_DESCRIPTOR_LENGTH;
        break;
#endif 
    case SCSI_READ_6:
    case SCSI_READ_10:
    case SCSI_READ_12:
    case SCSI_READ_16:
    case SCSI_WRITE_6:
    case SCSI_WRITE_10:
    case SCSI_WRITE_12:
    case SCSI_WRITE_16:
#if !defined(DISABLE_SATI_VERIFY)
    case SCSI_VERIFY_10:
    case SCSI_VERIFY_12:
    case SCSI_VERIFY_16:
#endif 
#if    !defined(DISABLE_SATI_WRITE_AND_VERIFY)  \
    && !defined(DISABLE_SATI_VERIFY)            \
    && !defined(DISABLE_SATI_WRITE)
    case SCSI_WRITE_AND_VERIFY_10:
    case SCSI_WRITE_AND_VERIFY_12:
    case SCSI_WRITE_AND_VERIFY_16:
#endif 
        length += SCSI_INFORMATION_DESCRIPTOR_LENGTH;
        break;
    }
    return length;
}
static U8 sati_scsi_get_descriptor_sense_data_length ( SATI_TRANSLATOR_SEQUENCE_T * sequence , void * scsi_io ) { U8 * cdb = sati_cb_get_cdb_address ( scsi_io ) ; U8 length = 8 ; switch ( sati_get_cdb_byte ( cdb , 0 ) ) { #if ! defined ( DISABLE_SATI_WRITE_LONG ) case SCSI_WRITE_LONG_10 : case SCSI_WRITE_LONG_16 : length += SCSI_BLOCK_DESCRIPTOR_LENGTH + SCSI_INFORMATION_DESCRIPTOR_LENGTH ; break ; #endif #if ! defined ( DISABLE_SATI_REASSIGN_BLOCKS ) case SCSI_REASSIGN_BLOCKS : length += SCSI_CMD_SPECIFIC_DESCRIPTOR_LENGTH + SCSI_INFORMATION_DESCRIPTOR_LENGTH ; break ; #endif case SCSI_READ_6 : case SCSI_READ_10 : case SCSI_READ_12 : case SCSI_READ_16 : case SCSI_WRITE_6 : case SCSI_WRITE_10 : case SCSI_WRITE_12 : case SCSI_WRITE_16 : #if ! defined ( DISABLE_SATI_VERIFY ) case SCSI_VERIFY_10 : case SCSI_VERIFY_12 : case SCSI_VERIFY_16 : #endif #if ! defined ( DISABLE_SATI_WRITE_AND_VERIFY ) && ! defined ( DISABLE_SATI_VERIFY ) && ! defined ( DISABLE_SATI_WRITE ) case SCSI_WRITE_AND_VERIFY_10 : case SCSI_WRITE_AND_VERIFY_12 : case SCSI_WRITE_AND_VERIFY_16 : #endif length += SCSI_INFORMATION_DESCRIPTOR_LENGTH ; break ; } return length ; }
@brief This method will return length of descriptor sense data for executed command.
@brief This method will return length of descriptor sense data for executed command .
//Initial value is descriptor header length // !defined(DISABLE_SATI_WRITE_LONG) // !defined(DISABLE_SATI_REASSIGN_BLOCKS) // !defined(DISABLE_SATI_VERIFY) //    !defined(DISABLE_SATI_WRITE_AND_VERIFY) // && !defined(DISABLE_SATI_VERIFY) // && !defined(DISABLE_SATI_WRITE)