FreeBSD/sys/dev/isci/scil/sati_passthrough.c
/**
 * @brief This method will verify that the T_DIR bit matches the protocol bit.
 *        It will additionally set the direction on the sequence.
 *
 * @param[in,out] sequence This parameter specifies the translation sequence
 *                for which to construct the sense data.
 * @param[in]     cdb The CDB containing the passthrough command
 *
 * @return none
 */
@brief This method will verify that the T_DIR bit matches the protocol bit.
It will additionally set the direction on the sequence.

@param[in,out] sequence This parameter specifies the translation sequence
for which to construct the sense data.
@param[in]     cdb The CDB containing the passthrough command

@return none
@brief This method will verify that the T_DIR bit matches the protocol bit . It will additionally set the direction on the sequence . @param [ in out ] sequence This parameter specifies the translation sequence for which to construct the sense data . @param [ in ] cdb The CDB containing the passthrough command @return none
static
SATI_STATUS sati_passthrough_check_direction(
   SATI_TRANSLATOR_SEQUENCE_T * sequence,
   U8           * cdb
)
{
   if ((sequence->protocol == PASSTHROUGH_PIO_DATA_IN) ||
       (sequence->protocol == PASSTHROUGH_UDMA_DATA_IN))
   {
      if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x0)
      {
         return SATI_FAILURE;
      }
      else
      {
         sequence->data_direction = SATI_DATA_DIRECTION_IN;
      }
   }
   else if ((sequence->protocol == PASSTHROUGH_PIO_DATA_OUT) ||
            (sequence->protocol == PASSTHROUGH_UDMA_DATA_OUT))
   {
      if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x1)
      {
         return SATI_FAILURE;
      }
      else
      {
         sequence->data_direction = SATI_DATA_DIRECTION_OUT;
      }
   }
   else
   {
      sequence->data_direction = SATI_DATA_DIRECTION_NONE;
   }
   return SATI_COMPLETE;
}
static SATI_STATUS sati_passthrough_check_direction ( SATI_TRANSLATOR_SEQUENCE_T * sequence , U8 * cdb ) { if ( ( sequence -> protocol == PASSTHROUGH_PIO_DATA_IN ) || ( sequence -> protocol == PASSTHROUGH_UDMA_DATA_IN ) ) { if ( PASSTHROUGH_CDB_T_DIR ( cdb ) == 0x0 ) { return SATI_FAILURE ; } else { sequence -> data_direction = SATI_DATA_DIRECTION_IN ; } } else if ( ( sequence -> protocol == PASSTHROUGH_PIO_DATA_OUT ) || ( sequence -> protocol == PASSTHROUGH_UDMA_DATA_OUT ) ) { if ( PASSTHROUGH_CDB_T_DIR ( cdb ) == 0x1 ) { return SATI_FAILURE ; } else { sequence -> data_direction = SATI_DATA_DIRECTION_OUT ; } } else { sequence -> data_direction = SATI_DATA_DIRECTION_NONE ; } return SATI_COMPLETE ; }
@brief This method will verify that the T_DIR bit matches the protocol bit.
@brief This method will verify that the T_DIR bit matches the protocol bit .