FreeBSD/sys/dev/isci/scil/sati_mode_sense.c
/**
 * @brief This method simply copies the mode sense data into the buffer
 *        at the location specified by page_start.  The buffer copied is
 *        determined by page_control (e.g. current, default, or changeable
 *        values).
 *        For more information on the parameters passed to this method,
 *        please reference sati_translate_command().
 *
 * @param[in] page_start This parameter specifies the starting offset at
 *            which to copy the mode page data.
 * @param[in] page_control This parameter specifies the page control
 *            indicating the source buffer to be copied.
 * @param[in] page_code This specifies the mode sense page to copy.
 *
 * @return This method returns the size of the mode page data being copied.
 */
@brief This method simply copies the mode sense data into the buffer
at the location specified by page_start.  The buffer copied is
determined by page_control .
For more information on the parameters passed to this method,
please reference sati_translate_command().

@param[in] page_start This parameter specifies the starting offset at
which to copy the mode page data.
@param[in] page_control This parameter specifies the page control
indicating the source buffer to be copied.
@param[in] page_code This specifies the mode sense page to copy.

@return This method returns the size of the mode page data being copied.
@brief This method simply copies the mode sense data into the buffer at the location specified by page_start . The buffer copied is determined by page_control . For more information on the parameters passed to this method please reference sati_translate_command () . @param [ in ] page_start This parameter specifies the starting offset at which to copy the mode page data . @param [ in ] page_control This parameter specifies the page control indicating the source buffer to be copied . @param [ in ] page_code This specifies the mode sense page to copy . @return This method returns the size of the mode page data being copied .
U32 sati_mode_sense_copy_initial_data(
   SATI_TRANSLATOR_SEQUENCE_T * sequence,
   void                       * scsi_io,
   U32                          page_start,
   U8                           page_control,
   U8                           page_code
)
{
   U16 page_index  = sati_mode_page_get_page_index(page_code);
   U32 page_length = sat_mode_page_sizes[page_index];
   if (page_control == SCSI_MODE_SENSE_PC_CHANGEABLE)
   {
      sati_copy_data(
         sequence,
         scsi_io,
         page_start,
         sat_changeable_mode_pages[page_index],
         page_length
      );
   }
   else
   {
      sati_copy_data(
         sequence,
         scsi_io,
         page_start,
         sat_default_mode_pages[page_index],
         page_length
      );
   }
   return page_length;
}
U32 sati_mode_sense_copy_initial_data ( SATI_TRANSLATOR_SEQUENCE_T * sequence , void * scsi_io , U32 page_start , U8 page_control , U8 page_code ) { U16 page_index = sati_mode_page_get_page_index ( page_code ) ; U32 page_length = sat_mode_page_sizes [ page_index ] ; if ( page_control == SCSI_MODE_SENSE_PC_CHANGEABLE ) { sati_copy_data ( sequence , scsi_io , page_start , sat_changeable_mode_pages [ page_index ] , page_length ) ; } else { sati_copy_data ( sequence , scsi_io , page_start , sat_default_mode_pages [ page_index ] , page_length ) ; } return page_length ; }
@brief This method simply copies the mode sense data into the buffer
        at the location specified by page_start.
@brief This method simply copies the mode sense data into the buffer at the location specified by page_start .
// Find out if the current values are requested or if the default // values are being requested. // Copy the changeable mode page information. // Copy the default static values template to the user data area.