FreeBSD/sys/dev/isci/scil/sati_mode_select.c
/**
 * @brief This method will find the starting byte location for a page.
 *
 * @param[in] block_descriptor_length This parameter passes in the length of
 *            block descriptor.
 * @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 offset, for the mode page.
 */
@brief This method will find the starting byte location for a page.
@param[in] block_descriptor_length This parameter passes in the length of
block descriptor.
@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 offset, for the mode page.
@brief This method will find the starting byte location for a page . @param [ in ] block_descriptor_length This parameter passes in the length of block descriptor . @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 offset for the mode page .
static
U32 sati_mode_select_get_mode_page_offset(
    U32 block_descriptor_length,
    U32 cdb_size
    )
{
   U32 mode_page_offset;
   if(cdb_size == 6)
   {
      mode_page_offset =  sizeof(SCSI_MODE_SELECT_MODE_PARAMETER_HEADER_6_T) +  block_descriptor_length;
   }
   else if(cdb_size == 10)
   {
      mode_page_offset =  sizeof(SCSI_MODE_SELECT_MODE_PARAMETER_HEADER_10_T) +  block_descriptor_length;
   }
   else
   {
      mode_page_offset = 0;
   }
   return mode_page_offset;
}
static U32 sati_mode_select_get_mode_page_offset ( U32 block_descriptor_length , U32 cdb_size ) { U32 mode_page_offset ; if ( cdb_size == 6 ) { mode_page_offset = sizeof ( SCSI_MODE_SELECT_MODE_PARAMETER_HEADER_6_T ) + block_descriptor_length ; } else if ( cdb_size == 10 ) { mode_page_offset = sizeof ( SCSI_MODE_SELECT_MODE_PARAMETER_HEADER_10_T ) + block_descriptor_length ; } else { mode_page_offset = 0 ; } return mode_page_offset ; }
@brief This method will find the starting byte location for a page.
@brief This method will find the starting byte location for a page .