FreeBSD/sys/dev/isci/scil/sati_mode_sense.c
/**
 * @brief This method indicates if the supplied page control is supported
 *        by this translation implementation.  Currently savable parameters
 *        (i.e. non-volatile) are not supported.
 *        For more information on the parameters passed to this method,
 *        please reference sati_translate_command().
 *
 * @return This method returns an indication of whether the page control
 *         specified in the SCSI CDB is supported.
 * @retval SATI_SUCCESS This value is returned if the page control is
 *         supported.
 * @retval SATI_FAILURE_CHECK_RESPONSE_DATA This value is returned if the
 *         page control is not supported.
 */
@brief This method indicates if the supplied page control is supported
by this translation implementation.  Currently savable parameters
are not supported.
For more information on the parameters passed to this method,
please reference sati_translate_command().

@return This method returns an indication of whether the page control
specified in the SCSI CDB is supported.
@retval SATI_SUCCESS This value is returned if the page control is
supported.
@retval SATI_FAILURE_CHECK_RESPONSE_DATA This value is returned if the
page control is not supported.
@brief This method indicates if the supplied page control is supported by this translation implementation . Currently savable parameters are not supported . For more information on the parameters passed to this method please reference sati_translate_command () . @return This method returns an indication of whether the page control specified in the SCSI CDB is supported . @retval SATI_SUCCESS This value is returned if the page control is supported . @retval SATI_FAILURE_CHECK_RESPONSE_DATA This value is returned if the page control is not supported .
static
SATI_STATUS sati_mode_sense_is_page_control_supported(
   SATI_TRANSLATOR_SEQUENCE_T * sequence,
   void                       * scsi_io
)
{
   U8 * cdb = sati_cb_get_cdb_address(scsi_io);
   switch (sati_get_cdb_byte(cdb, 2) >> SCSI_MODE_SENSE_PC_SHIFT)
   {
      case SCSI_MODE_SENSE_PC_CURRENT:
      case SCSI_MODE_SENSE_PC_DEFAULT:
      case SCSI_MODE_SENSE_PC_CHANGEABLE:
         return SATI_SUCCESS;
      break;
      default:
      case SCSI_MODE_SENSE_PC_SAVED:
         sati_scsi_sense_data_construct(
            sequence,
            scsi_io,
            SCSI_STATUS_CHECK_CONDITION,
            SCSI_SENSE_ILLEGAL_REQUEST,
            SCSI_ASC_SAVING_PARMS_NOT_SUPPORTED,
            SCSI_ASCQ_SAVING_PARMS_NOT_SUPPORTED
         );
         return SATI_FAILURE_CHECK_RESPONSE_DATA;
      break;
   }
}
static SATI_STATUS sati_mode_sense_is_page_control_supported ( SATI_TRANSLATOR_SEQUENCE_T * sequence , void * scsi_io ) { U8 * cdb = sati_cb_get_cdb_address ( scsi_io ) ; switch ( sati_get_cdb_byte ( cdb , 2 ) >> SCSI_MODE_SENSE_PC_SHIFT ) { case SCSI_MODE_SENSE_PC_CURRENT : case SCSI_MODE_SENSE_PC_DEFAULT : case SCSI_MODE_SENSE_PC_CHANGEABLE : return SATI_SUCCESS ; break ; default : case SCSI_MODE_SENSE_PC_SAVED : sati_scsi_sense_data_construct ( sequence , scsi_io , SCSI_STATUS_CHECK_CONDITION , SCSI_SENSE_ILLEGAL_REQUEST , SCSI_ASC_SAVING_PARMS_NOT_SUPPORTED , SCSI_ASCQ_SAVING_PARMS_NOT_SUPPORTED ) ; return SATI_FAILURE_CHECK_RESPONSE_DATA ; break ; } }
@brief This method indicates if the supplied page control is supported
        by this translation implementation.
@brief This method indicates if the supplied page control is supported by this translation implementation .