FreeBSD/sys/dev/isci/scil/sati_unmap.c
/**
 * @brief This method will translate the SCSI Unmap command
 *        into corresponding ATA commands.  Depending upon the capabilities
 *        supported by the target different ATA commands can be selected.
 *        Additionally, in some cases more than a single ATA command may
 *        be required.
 *
 * @return Indicate if the command 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 SCSI Unmap command
into corresponding ATA commands.  Depending upon the capabilities
supported by the target different ATA commands can be selected.
Additionally, in some cases more than a single ATA command may
be required.

@return Indicate if the command 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 SCSI Unmap command into corresponding ATA commands . Depending upon the capabilities supported by the target different ATA commands can be selected . Additionally in some cases more than a single ATA command may be required . @return Indicate if the command 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_command(
   SATI_TRANSLATOR_SEQUENCE_T * sequence,
   void                       * scsi_io,
   void                       * ata_io
)
{
   SATI_STATUS status = SATI_FAILURE_CHECK_RESPONSE_DATA;
   SATI_UNMAP_PROCESSING_STATE_T * unmap_process_state;
   unmap_process_state = &sequence->command_specific_data.unmap_process_state;
   if ( sequence->state == SATI_SEQUENCE_STATE_INITIAL )
   {
       status = sati_unmap_initial_processing(sequence,scsi_io,ata_io);
       if (status != SATI_COMPLETE)
       {
          return status;
       }
   }
   return sati_unmap_process(sequence, scsi_io, ata_io);
}
SATI_STATUS sati_unmap_translate_command ( SATI_TRANSLATOR_SEQUENCE_T * sequence , void * scsi_io , void * ata_io ) { SATI_STATUS status = SATI_FAILURE_CHECK_RESPONSE_DATA ; SATI_UNMAP_PROCESSING_STATE_T * unmap_process_state ; unmap_process_state = & sequence -> command_specific_data . unmap_process_state ; if ( sequence -> state == SATI_SEQUENCE_STATE_INITIAL ) { status = sati_unmap_initial_processing ( sequence , scsi_io , ata_io ) ; if ( status != SATI_COMPLETE ) { return status ; } } return sati_unmap_process ( sequence , scsi_io , ata_io ) ; }
@brief This method will translate the SCSI Unmap command
        into corresponding ATA commands.
@brief This method will translate the SCSI Unmap command into corresponding ATA commands .
// Determine if this is the first step in the unmap sequence // Translate the next portion of the UNMAP request