FreeBSD/sys/dev/isci/scil/sati_log_sense.c
/**
 * @brief This method translates the ATA Extended SMART self-test log into
 *        SCSI Sense Key, Additional Sense Code, and Additional Sense code
 *        qualifiers based on the self test status byte in the appropriate
 *        descriptor entry.
 *
 * @return n/a
 *
 */
@brief This method translates the ATA Extended SMART self-test log into
SCSI Sense Key, Additional Sense Code, and Additional Sense code
qualifiers based on the self test status byte in the appropriate
descriptor entry.

@return n/a
@brief This method translates the ATA Extended SMART self - test log into SCSI Sense Key Additional Sense Code and Additional Sense code qualifiers based on the self test status byte in the appropriate descriptor entry . @return n / a
static
void sati_translate_sense_values(
   SATI_TRANSLATOR_SEQUENCE_T * sequence,
   void                       * scsi_io,
   U8                           self_test_status_byte
)
{
   sati_set_data_byte(
      sequence,
      scsi_io,
      21,
      SCSI_DIAGNOSTIC_FAILURE_ON_COMPONENT
   );
   switch(self_test_status_byte)
   {
      case 1:
         sati_set_data_byte(sequence, scsi_io, 20, SCSI_SENSE_ABORTED_COMMAND);
         sati_set_data_byte(sequence, scsi_io, 22, 0x81);
         break;
      case 2:
         sati_set_data_byte(sequence, scsi_io, 20, SCSI_SENSE_ABORTED_COMMAND);
         sati_set_data_byte(sequence, scsi_io, 22, 0x82);
         break;
      case 3:
         sati_set_data_byte(sequence, scsi_io, 20, SCSI_SENSE_ABORTED_COMMAND);
         sati_set_data_byte(sequence, scsi_io, 22, 0x83);
         break;
      case 4:
         sati_set_data_byte(sequence, scsi_io, 20, SCSI_SENSE_HARDWARE_ERROR);
         sati_set_data_byte(sequence, scsi_io, 22, 0x84);
         break;
      case 5:
         sati_set_data_byte(sequence, scsi_io, 20, SCSI_SENSE_HARDWARE_ERROR);
         sati_set_data_byte(sequence, scsi_io, 22, 0x85);
         break;
      case 6:
         sati_set_data_byte(sequence, scsi_io, 20, SCSI_SENSE_HARDWARE_ERROR);
         sati_set_data_byte(sequence, scsi_io, 22, 0x86);
         break;
      case 7:
         sati_set_data_byte(sequence, scsi_io, 20, SCSI_SENSE_MEDIUM_ERROR);
         sati_set_data_byte(sequence, scsi_io, 22, 0x87);
         break;
      case 8:
         sati_set_data_byte(sequence, scsi_io, 20, SCSI_SENSE_HARDWARE_ERROR);
         sati_set_data_byte(sequence, scsi_io, 22, 0x88);
         break;
      default:
         sati_set_data_byte(sequence, scsi_io, 20, SCSI_SENSE_NO_SENSE);
         sati_set_data_byte(sequence, scsi_io, 21, SCSI_ASC_NO_ADDITIONAL_SENSE);
         sati_set_data_byte(sequence, scsi_io, 22, 0x00);
         break;
   }
}
static void sati_translate_sense_values ( SATI_TRANSLATOR_SEQUENCE_T * sequence , void * scsi_io , U8 self_test_status_byte ) { sati_set_data_byte ( sequence , scsi_io , 21 , SCSI_DIAGNOSTIC_FAILURE_ON_COMPONENT ) ; switch ( self_test_status_byte ) { case 1 : sati_set_data_byte ( sequence , scsi_io , 20 , SCSI_SENSE_ABORTED_COMMAND ) ; sati_set_data_byte ( sequence , scsi_io , 22 , 0x81 ) ; break ; case 2 : sati_set_data_byte ( sequence , scsi_io , 20 , SCSI_SENSE_ABORTED_COMMAND ) ; sati_set_data_byte ( sequence , scsi_io , 22 , 0x82 ) ; break ; case 3 : sati_set_data_byte ( sequence , scsi_io , 20 , SCSI_SENSE_ABORTED_COMMAND ) ; sati_set_data_byte ( sequence , scsi_io , 22 , 0x83 ) ; break ; case 4 : sati_set_data_byte ( sequence , scsi_io , 20 , SCSI_SENSE_HARDWARE_ERROR ) ; sati_set_data_byte ( sequence , scsi_io , 22 , 0x84 ) ; break ; case 5 : sati_set_data_byte ( sequence , scsi_io , 20 , SCSI_SENSE_HARDWARE_ERROR ) ; sati_set_data_byte ( sequence , scsi_io , 22 , 0x85 ) ; break ; case 6 : sati_set_data_byte ( sequence , scsi_io , 20 , SCSI_SENSE_HARDWARE_ERROR ) ; sati_set_data_byte ( sequence , scsi_io , 22 , 0x86 ) ; break ; case 7 : sati_set_data_byte ( sequence , scsi_io , 20 , SCSI_SENSE_MEDIUM_ERROR ) ; sati_set_data_byte ( sequence , scsi_io , 22 , 0x87 ) ; break ; case 8 : sati_set_data_byte ( sequence , scsi_io , 20 , SCSI_SENSE_HARDWARE_ERROR ) ; sati_set_data_byte ( sequence , scsi_io , 22 , 0x88 ) ; break ; default : sati_set_data_byte ( sequence , scsi_io , 20 , SCSI_SENSE_NO_SENSE ) ; sati_set_data_byte ( sequence , scsi_io , 21 , SCSI_ASC_NO_ADDITIONAL_SENSE ) ; sati_set_data_byte ( sequence , scsi_io , 22 , 0x00 ) ; break ; } }
@brief This method translates the ATA Extended SMART self-test log into
        SCSI Sense Key, Additional Sense Code, and Additional Sense code
        qualifiers based on the self test status byte in the appropriate
        descriptor entry.
@brief This method translates the ATA Extended SMART self - test log into SCSI Sense Key Additional Sense Code and Additional Sense code qualifiers based on the self test status byte in the appropriate descriptor entry .
//byte 17 //byte 16 //byte 18 //byte 16 //byte 18 //byte 16 //byte 18 //byte 16 //byte 18 //byte 16 //byte 18 //byte 16 //byte 18 //byte 16 //byte 18 //byte 16 //byte 18 //byte 16 //byte 17 //byte 18