FreeBSD/sys/dev/isci/scil/sati_unmap.c
/**
 * @brief This method will translate the ATA command register FIS
 *        response into an appropriate SCSI response for Unmap.
 *        For more information on the parameters passed to this method,
 *        please reference sati_translate_response().
 *
 * @return Indicate if the response translation succeeded.
 * @retval SATI_SUCCESS This is returned if the command translation was
 *         successful.
 * @retval SATI_COMPLETE This is returned if the command translation was
 *         successful and no ATA commands need to be set.
 * @retval SATI_FAILURE_CHECK_RESPONSE_DATA This value is returned if
 *         sense data has been created as a result of something specified
 *         in the parameter data fields.
 */
@brief This method will translate the ATA command register FIS
response into an appropriate SCSI response for Unmap.
For more information on the parameters passed to this method,
please reference sati_translate_response().

@return Indicate if the response translation succeeded.
@retval SATI_SUCCESS This is returned if the command translation was
successful.
@retval SATI_COMPLETE This is returned if the command translation was
successful and no ATA commands need to be set.
@retval SATI_FAILURE_CHECK_RESPONSE_DATA This value is returned if
sense data has been created as a result of something specified
in the parameter data fields.
@brief This method will translate the ATA command register FIS response into an appropriate SCSI response for Unmap . For more information on the parameters passed to this method please reference sati_translate_response () . @return Indicate if the response translation succeeded . @retval SATI_SUCCESS This is returned if the command translation was successful . @retval SATI_COMPLETE This is returned if the command translation was successful and no ATA commands need to be set . @retval SATI_FAILURE_CHECK_RESPONSE_DATA This value is returned if sense data has been created as a result of something specified in the parameter data fields .
SATI_STATUS sati_unmap_translate_response(
   SATI_TRANSLATOR_SEQUENCE_T * sequence,
   void                       * scsi_io,
   void                       * ata_io
)
{
   U8 * register_fis = sati_cb_get_d2h_register_fis_address(ata_io);
   SATI_UNMAP_PROCESSING_STATE_T * unmap_process_state;
   SATI_STATUS sati_status = SATI_COMPLETE;
   unmap_process_state = &sequence->command_specific_data.unmap_process_state;
   if (sati_get_ata_status(register_fis) & ATA_STATUS_REG_ERROR_BIT)
   {
      sequence->state = SATI_SEQUENCE_STATE_FINAL;
      sati_scsi_sense_data_construct(
         sequence,
         scsi_io,
         SCSI_STATUS_CHECK_CONDITION,
         SCSI_SENSE_ABORTED_COMMAND,
         SCSI_ASC_NO_ADDITIONAL_SENSE,
         SCSI_ASCQ_NO_ADDITIONAL_SENSE
      );
      sati_unmap_terminate(sequence, scsi_io, ata_io);
   }
   else
   {
      if (sequence->state != SATI_SEQUENCE_STATE_INCOMPLETE)
      {
          sati_unmap_terminate(sequence, scsi_io, ata_io);
      }
      else
      {
          sati_status = SATI_SEQUENCE_STATE_INCOMPLETE;
      }
   }
   return sati_status;
}
SATI_STATUS sati_unmap_translate_response ( SATI_TRANSLATOR_SEQUENCE_T * sequence , void * scsi_io , void * ata_io ) { U8 * register_fis = sati_cb_get_d2h_register_fis_address ( ata_io ) ; SATI_UNMAP_PROCESSING_STATE_T * unmap_process_state ; SATI_STATUS sati_status = SATI_COMPLETE ; unmap_process_state = & sequence -> command_specific_data . unmap_process_state ; if ( sati_get_ata_status ( register_fis ) & ATA_STATUS_REG_ERROR_BIT ) { sequence -> state = SATI_SEQUENCE_STATE_FINAL ; sati_scsi_sense_data_construct ( sequence , scsi_io , SCSI_STATUS_CHECK_CONDITION , SCSI_SENSE_ABORTED_COMMAND , SCSI_ASC_NO_ADDITIONAL_SENSE , SCSI_ASCQ_NO_ADDITIONAL_SENSE ) ; sati_unmap_terminate ( sequence , scsi_io , ata_io ) ; } else { if ( sequence -> state != SATI_SEQUENCE_STATE_INCOMPLETE ) { sati_unmap_terminate ( sequence , scsi_io , ata_io ) ; } else { sati_status = SATI_SEQUENCE_STATE_INCOMPLETE ; } } return sati_status ; }
@brief This method will translate the ATA command register FIS
        response into an appropriate SCSI response for Unmap.
@brief This method will translate the ATA command register FIS response into an appropriate SCSI response for Unmap .
// All done, terminate the translation // All done, terminate the translation // Still translating