FreeBSD/sys/dev/isci/scil/sati_mode_select.c
/**
 * @brief This method will call Mode Select 10 translation command
 *        For more information on the parameters passed to this method,
 *        please reference sati_translate_command().
 *
 * @return Indicate if the command translation succeeded.
 * @retval SCI_SUCCESS This is returned if the command translation was
 *         successful.
 * @retval SCI_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 call Mode Select 10 translation command
For more information on the parameters passed to this method,
please reference sati_translate_command().

@return Indicate if the command translation succeeded.
@retval SCI_SUCCESS This is returned if the command translation was
successful.
@retval SCI_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 call Mode Select 10 translation command For more information on the parameters passed to this method please reference sati_translate_command () . @return Indicate if the command translation succeeded . @retval SCI_SUCCESS This is returned if the command translation was successful . @retval SCI_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_mode_select_10_translate_command(
   SATI_TRANSLATOR_SEQUENCE_T * sequence,
   void                       * scsi_io,
   void                       * ata_io
)
{
   SATI_STATUS status=SATI_FAILURE;
   U8 * cdb = sati_cb_get_cdb_address(scsi_io);
   if ((sati_get_cdb_byte(cdb, 1) & SCSI_MODE_SELECT_PF_MASK) == !SCSI_MODE_SELECT_PF_BIT)
   {
      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
      );
      status = SATI_FAILURE_CHECK_RESPONSE_DATA;
      return status;
   }
   status=sati_mode_select_translate_command(
             sequence,
             scsi_io,
             ata_io,
             10
          );
   if(status == SATI_FAILURE_CHECK_RESPONSE_DATA)
   {
      sati_scsi_sense_data_construct(
         sequence,
         scsi_io,
         SCSI_STATUS_CHECK_CONDITION,
         SCSI_SENSE_ILLEGAL_REQUEST,
         SCSI_ASC_INVALID_FIELD_IN_PARM_LIST,
         SCSI_ASCQ_INVALID_FIELD_IN_PARM_LIST
      );
   }
   return status;
}
SATI_STATUS sati_mode_select_10_translate_command ( SATI_TRANSLATOR_SEQUENCE_T * sequence , void * scsi_io , void * ata_io ) { SATI_STATUS status = SATI_FAILURE ; U8 * cdb = sati_cb_get_cdb_address ( scsi_io ) ; if ( ( sati_get_cdb_byte ( cdb , 1 ) & SCSI_MODE_SELECT_PF_MASK ) == ! SCSI_MODE_SELECT_PF_BIT ) { 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 ) ; status = SATI_FAILURE_CHECK_RESPONSE_DATA ; return status ; } status = sati_mode_select_translate_command ( sequence , scsi_io , ata_io , 10 ) ; if ( status == SATI_FAILURE_CHECK_RESPONSE_DATA ) { sati_scsi_sense_data_construct ( sequence , scsi_io , SCSI_STATUS_CHECK_CONDITION , SCSI_SENSE_ILLEGAL_REQUEST , SCSI_ASC_INVALID_FIELD_IN_PARM_LIST , SCSI_ASCQ_INVALID_FIELD_IN_PARM_LIST ) ; } return status ; }
@brief This method will call Mode Select 10 translation command
        For more information on the parameters passed to this method,
        please reference sati_translate_command().
@brief This method will call Mode Select 10 translation command For more information on the parameters passed to this method please reference sati_translate_command () .
//PF bit needs to be 1 byte1 bit ???1????