FreeBSD/sys/dev/isci/scil/sati_verify.c
/**
 * @brief This method performs all of the translation required for a
 *        SCSI VERIFY 16 byte CDB.
 *        This includes:
 *        - logical block address translation
 *        - transfer length (sector count) translation
 *        - translation items common to all VERIFY CDB sizes.
 *        For more information on the parameters passed to this method,
 *        please reference sati_translate_command().
 *
 * @return Indicate if the command translation was successful.
 *         For more information on return values please reference
 *         sati_move_set_sector_count(), sati_verify_translate_command()
 */
@brief This method performs all of the translation required for a
SCSI VERIFY 16 byte CDB.
This includes:
- logical block address translation
- transfer length (sector count) translation
- translation items common to all VERIFY CDB sizes.
For more information on the parameters passed to this method,
please reference sati_translate_command().

@return Indicate if the command translation was successful.
For more information on return values please reference
sati_move_set_sector_count(), sati_verify_translate_command()
@brief This method performs all of the translation required for a SCSI VERIFY 16 byte CDB . This includes : - logical block address translation - transfer length ( sector count ) translation - translation items common to all VERIFY CDB sizes . For more information on the parameters passed to this method please reference sati_translate_command () . @return Indicate if the command translation was successful . For more information on return values please reference sati_move_set_sector_count () sati_verify_translate_command ()
SATI_STATUS sati_verify_16_translate_command(
   SATI_TRANSLATOR_SEQUENCE_T * sequence,
   void                       * scsi_io,
   void                       * ata_io
)
{
   SATI_STATUS   status;
   U8          * cdb          = sati_cb_get_cdb_address(scsi_io);
   U32           sector_count = (sati_get_cdb_byte(cdb, 10) << 24) |
                                (sati_get_cdb_byte(cdb, 11) << 16) |
                                (sati_get_cdb_byte(cdb, 12) << 8)  |
                                (sati_get_cdb_byte(cdb, 13));
   if(sati_device_state_stopped(sequence, scsi_io))
   {
      return SATI_FAILURE_CHECK_RESPONSE_DATA;
   }
   else
   {
      sequence->type = SATI_SEQUENCE_VERIFY_16;
      status = sati_move_translate_64_bit_lba(sequence, scsi_io, ata_io);
      if (status != SATI_SUCCESS)
         return status;
      status = sati_move_set_sector_count(sequence,scsi_io,ata_io,sector_count,0);
      if (status != SATI_SUCCESS)
         return status;
      return sati_verify_translate_command(sequence, scsi_io, ata_io);
   }
}
SATI_STATUS sati_verify_16_translate_command ( SATI_TRANSLATOR_SEQUENCE_T * sequence , void * scsi_io , void * ata_io ) { SATI_STATUS status ; U8 * cdb = sati_cb_get_cdb_address ( scsi_io ) ; U32 sector_count = ( sati_get_cdb_byte ( cdb , 10 ) << 24 ) | ( sati_get_cdb_byte ( cdb , 11 ) << 16 ) | ( sati_get_cdb_byte ( cdb , 12 ) << 8 ) | ( sati_get_cdb_byte ( cdb , 13 ) ) ; if ( sati_device_state_stopped ( sequence , scsi_io ) ) { return SATI_FAILURE_CHECK_RESPONSE_DATA ; } else { sequence -> type = SATI_SEQUENCE_VERIFY_16 ; status = sati_move_translate_64_bit_lba ( sequence , scsi_io , ata_io ) ; if ( status != SATI_SUCCESS ) return status ; status = sati_move_set_sector_count ( sequence , scsi_io , ata_io , sector_count , 0 ) ; if ( status != SATI_SUCCESS ) return status ; return sati_verify_translate_command ( sequence , scsi_io , ata_io ) ; } }
@brief This method performs all of the translation required for a
        SCSI VERIFY 16 byte CDB.
@brief This method performs all of the translation required for a SCSI VERIFY 16 byte CDB .
// Fill in the Logical Block Address field. // Fill in the Sector Count fields.