FreeBSD/sys/dev/isci/scil/sati_verify.c
/**
 * @brief This method performs the SCSI VERIFY command translation
 *        functionality common to all VERIFY command sizes.
 *        This includes:
 *        - setting the command register
 *        - setting the device head register
 *        - filling in fields in the SATI_TRANSLATOR_SEQUENCE object.
 *        For more information on the parameters passed to this method,
 *        please reference sati_translate_command().
 *
 * @return Indicate if the method was successfully completed.
 * @retval SATI_SUCCESS This is returned in all other cases.
 */
@brief This method performs the SCSI VERIFY command translation
functionality common to all VERIFY command sizes.
This includes:
- setting the command register
- setting the device head register
- filling in fields in the SATI_TRANSLATOR_SEQUENCE object.
For more information on the parameters passed to this method,
please reference sati_translate_command().

@return Indicate if the method was successfully completed.
@retval SATI_SUCCESS This is returned in all other cases.
@brief This method performs the SCSI VERIFY command translation functionality common to all VERIFY command sizes . This includes : - setting the command register - setting the device head register - filling in fields in the SATI_TRANSLATOR_SEQUENCE object . For more information on the parameters passed to this method please reference sati_translate_command () . @return Indicate if the method was successfully completed . @retval SATI_SUCCESS This is returned in all other cases .
static
SATI_STATUS sati_verify_translate_command(
   SATI_TRANSLATOR_SEQUENCE_T * sequence,
   void                       * scsi_io,
   void                       * ata_io
)
{
   U8 * cdb          = sati_cb_get_cdb_address(scsi_io);
   U8 * register_fis = sati_cb_get_h2d_register_fis_address(ata_io);
   if ((sati_get_cdb_byte(cdb, 1) & SCSI_VERIFY_BYTCHK_ENABLED))
   {
      sati_scsi_sense_data_construct(
         sequence,
         scsi_io,
         SCSI_STATUS_CHECK_CONDITION,
         SCSI_SENSE_ILLEGAL_REQUEST,
         SCSI_ASC_INVALID_FIELD_IN_CDB,
         SCSI_ASCQ_INVALID_FIELD_IN_CDB
      );
      return SATI_FAILURE_CHECK_RESPONSE_DATA;
   }
   sequence->protocol       = SAT_PROTOCOL_NON_DATA;
   sequence->data_direction = SATI_DATA_DIRECTION_NONE;
   sati_set_ata_device_head(register_fis, ATA_DEV_HEAD_REG_LBA_MODE_ENABLE);
   if (sequence->device->capabilities & SATI_DEVICE_CAP_48BIT_ENABLE)
      sati_set_ata_command(register_fis, ATA_READ_VERIFY_SECTORS_EXT);
   else
      sati_set_ata_command(register_fis, ATA_READ_VERIFY_SECTORS);
   return SATI_SUCCESS;
}
static SATI_STATUS sati_verify_translate_command ( SATI_TRANSLATOR_SEQUENCE_T * sequence , void * scsi_io , void * ata_io ) { U8 * cdb = sati_cb_get_cdb_address ( scsi_io ) ; U8 * register_fis = sati_cb_get_h2d_register_fis_address ( ata_io ) ; if ( ( sati_get_cdb_byte ( cdb , 1 ) & SCSI_VERIFY_BYTCHK_ENABLED ) ) { sati_scsi_sense_data_construct ( sequence , scsi_io , SCSI_STATUS_CHECK_CONDITION , SCSI_SENSE_ILLEGAL_REQUEST , SCSI_ASC_INVALID_FIELD_IN_CDB , SCSI_ASCQ_INVALID_FIELD_IN_CDB ) ; return SATI_FAILURE_CHECK_RESPONSE_DATA ; } sequence -> protocol = SAT_PROTOCOL_NON_DATA ; sequence -> data_direction = SATI_DATA_DIRECTION_NONE ; sati_set_ata_device_head ( register_fis , ATA_DEV_HEAD_REG_LBA_MODE_ENABLE ) ; if ( sequence -> device -> capabilities & SATI_DEVICE_CAP_48BIT_ENABLE ) sati_set_ata_command ( register_fis , ATA_READ_VERIFY_SECTORS_EXT ) ; else sati_set_ata_command ( register_fis , ATA_READ_VERIFY_SECTORS ) ; return SATI_SUCCESS ; }
@brief This method performs the SCSI VERIFY command translation
        functionality common to all VERIFY command sizes.
@brief This method performs the SCSI VERIFY command translation functionality common to all VERIFY command sizes .
/**
    * The translator doesn't support performing the byte check operation.
    * As a result, error the request if the BYTCHK bit is set.
    */ // Ensure the device supports the 48 bit feature set.