FreeBSD/sys/dev/isci/scil/sati_mode_select.c
/**
 * @brief This method will get medium type parameter field per CDB size.
 *
 * @param[in] scsi_io This parameter specifies the user's SCSI IO object
 *            for which to calculate the mode page header.
 * @param[in] cdb_size This parameter specifies the number of bytes
 *            associated with the CDB for which to calculate the header.
 *
 * @return This method returns the medium type for the mode page header.
 */
@brief This method will get medium type parameter field per CDB size.
@param[in] scsi_io This parameter specifies the user's SCSI IO object
for which to calculate the mode page header.
@param[in] cdb_size This parameter specifies the number of bytes
associated with the CDB for which to calculate the header.

@return This method returns the medium type for the mode page header.
@brief This method will get medium type parameter field per CDB size . @param [ in ] scsi_io This parameter specifies the user ' s SCSI IO object for which to calculate the mode page header . @param [ in ] cdb_size This parameter specifies the number of bytes associated with the CDB for which to calculate the header . @return This method returns the medium type for the mode page header .
static
U8 sati_mode_select_get_medium_type(
   U8 * mode_parameters,
   U32  cdb_size
)
{
   U8  medium_type =0xFF;
   SCSI_MODE_SELECT_MODE_PARAMETER_HEADER_6_T * mode_parameters_6;
   SCSI_MODE_SELECT_MODE_PARAMETER_HEADER_10_T * mode_parameters_10;
   if(cdb_size == 6)
   {
      mode_parameters_6 = (SCSI_MODE_SELECT_MODE_PARAMETER_HEADER_6_T *) mode_parameters;
      medium_type = mode_parameters_6->medium_type;
   }
   else if(cdb_size == 10)
   {
      mode_parameters_10 = (SCSI_MODE_SELECT_MODE_PARAMETER_HEADER_10_T *) mode_parameters;
      medium_type = mode_parameters_10->medium_type;
   }
   return medium_type;
}
static U8 sati_mode_select_get_medium_type ( U8 * mode_parameters , U32 cdb_size ) { U8 medium_type = 0xFF ; SCSI_MODE_SELECT_MODE_PARAMETER_HEADER_6_T * mode_parameters_6 ; SCSI_MODE_SELECT_MODE_PARAMETER_HEADER_10_T * mode_parameters_10 ; if ( cdb_size == 6 ) { mode_parameters_6 = ( SCSI_MODE_SELECT_MODE_PARAMETER_HEADER_6_T * ) mode_parameters ; medium_type = mode_parameters_6 -> medium_type ; } else if ( cdb_size == 10 ) { mode_parameters_10 = ( SCSI_MODE_SELECT_MODE_PARAMETER_HEADER_10_T * ) mode_parameters ; medium_type = mode_parameters_10 -> medium_type ; } return medium_type ; }
@brief This method will get medium type parameter field per CDB size.
@brief This method will get medium type parameter field per CDB size .