Blame include/cdio/mmc_hl_cmds.h

Packit dd8086
/*
Packit dd8086
    Copyright (C) 2010, 2012 Rocky Bernstein <rocky@gnu.org>
Packit dd8086
Packit dd8086
    This program is free software: you can redistribute it and/or modify
Packit dd8086
    it under the terms of the GNU General Public License as published by
Packit dd8086
    the Free Software Foundation, either version 3 of the License, or
Packit dd8086
    (at your option) any later version.
Packit dd8086
Packit dd8086
    This program is distributed in the hope that it will be useful,
Packit dd8086
    but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit dd8086
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit dd8086
    GNU General Public License for more details.
Packit dd8086
Packit dd8086
    You should have received a copy of the GNU General Public License
Packit dd8086
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit dd8086
*/
Packit dd8086
Packit dd8086
/**
Packit dd8086
   \file mmc_hl_cmds.h 
Packit dd8086
   
Packit dd8086
   \brief Higher-level MMC commands which build on top of the lower-level
Packit dd8086
   MMC commands.
Packit dd8086
 */
Packit dd8086
Packit dd8086
#ifndef CDIO_MMC_HL_CMDS_H_
Packit dd8086
#define CDIO_MMC_HL_CMDS_H_
Packit dd8086
Packit dd8086
#include <cdio/mmc.h>
Packit dd8086
Packit dd8086
#ifdef __cplusplus
Packit dd8086
extern "C" {
Packit dd8086
#endif /* __cplusplus */
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Close tray using a MMC START STOP UNIT command.
Packit dd8086
     @param p_cdio the CD object to be acted upon.
Packit dd8086
     @return DRIVER_OP_SUCCESS (0) if we got the status.
Packit dd8086
     return codes are the same as driver_return_code_t
Packit dd8086
  */
Packit dd8086
  driver_return_code_t mmc_close_tray( CdIo_t *p_cdio );
Packit dd8086
  
Packit dd8086
  /**
Packit dd8086
     Detects if a disc (CD or DVD) is erasable or not.
Packit dd8086
     
Packit dd8086
     @param p_cdio the CD object to be acted upon.
Packit dd8086
     
Packit dd8086
     @param b_erasable if not NULL, on return will be set indicate whether
Packit dd8086
     the operation was a success (DRIVER_OP_SUCCESS) or if not to some
Packit dd8086
     other value.
Packit dd8086
     
Packit dd8086
     @return true if the disc is detected as erasable (rewritable), false
Packit dd8086
     otherwise.
Packit dd8086
  */
Packit dd8086
  driver_return_code_t mmc_get_disc_erasable(const CdIo_t *p_cdio, 
Packit dd8086
                                             bool *b_erasable);
Packit dd8086
    
Packit dd8086
  /**
Packit dd8086
    Eject using MMC commands. If CD-ROM is "locked" we'll unlock it.
Packit dd8086
    Command is not "immediate" -- we'll wait for the command to complete.
Packit dd8086
    For a more general (and lower-level) routine, @see mmc_start_stop_unit.
Packit dd8086
Packit dd8086
   @param p_cdio the CD object to be acted upon.
Packit dd8086
   @return DRIVER_OP_SUCCESS (0) if we got the status.
Packit dd8086
   return codes are the same as driver_return_code_t  
Packit dd8086
  */
Packit dd8086
  driver_return_code_t mmc_eject_media( const CdIo_t *p_cdio );
Packit dd8086
  
Packit dd8086
  /**
Packit dd8086
     Detects the disc type using the SCSI-MMC GET CONFIGURATION command.
Packit dd8086
     
Packit dd8086
     @param p_cdio the CD object to be acted upon.
Packit dd8086
   
Packit dd8086
     @param i_timeout_ms number of millisections to wait before timeout
Packit dd8086
   
Packit dd8086
     @param p_disctype the disc type set on success.
Packit dd8086
     @return DRIVER_OP_SUCCESS (0) if we got the status.
Packit dd8086
   return codes are the same as driver_return_code_t
Packit dd8086
  */
Packit dd8086
  driver_return_code_t mmc_get_disctype(const CdIo_t *p_cdio, 
Packit dd8086
                                        unsigned int i_timeout_ms,
Packit dd8086
                                        cdio_mmc_feature_profile_t *p_disctype);
Packit dd8086
Packit dd8086
  /**
Packit dd8086
     Run a SCSI-MMC MODE_SENSE command (6- or 10-byte version) 
Packit dd8086
     and put the results in p_buf 
Packit dd8086
     @param p_cdio the CD object to be acted upon.
Packit dd8086
Packit dd8086
     @param p_buf pointer to location to store mode sense information
Packit dd8086
Packit dd8086
     @param i_size number of bytes allocated to p_buf
Packit dd8086
Packit dd8086
     @param page which "page" of the mode sense command we are interested in
Packit dd8086
Packit dd8086
     @return DRIVER_OP_SUCCESS if we ran the command ok.
Packit dd8086
  */
Packit dd8086
  driver_return_code_t mmc_mode_sense( CdIo_t *p_cdio, /*out*/ void *p_buf,
Packit dd8086
                                       unsigned int i_size, int page);
Packit dd8086
  
Packit dd8086
  /**
Packit dd8086
    Set the drive speed in CD-ROM speed units.
Packit dd8086
Packit dd8086
    @param p_cdio          CD structure set by cdio_open().
Packit dd8086
    @param i_drive_speed   speed in CD-ROM speed units. Note this
Packit dd8086
                           not Kbs as would be used in the MMC spec or
Packit dd8086
                           in mmc_set_speed(). To convert CD-ROM speed units 
Packit dd8086
                           to Kbs, multiply the number by 176 (for raw data)
Packit dd8086
                           and by 150 (for filesystem data). On many CD-ROM 
Packit dd8086
                           drives, specifying a value too large will result 
Packit dd8086
                           in using the fastest speed.
Packit dd8086
Packit dd8086
    @return the drive speed if greater than 0. -1 if we had an error. is -2
Packit dd8086
    returned if this is not implemented for the current driver.
Packit dd8086
Packit dd8086
     @see cdio_set_speed and mmc_set_speed
Packit dd8086
  */
Packit dd8086
  driver_return_code_t mmc_set_drive_speed( const CdIo_t *p_cdio, 
Packit dd8086
                                            int i_drive_speed );
Packit dd8086
Packit dd8086
Packit dd8086
#ifdef __cplusplus
Packit dd8086
}
Packit dd8086
#endif /* __cplusplus */
Packit dd8086
Packit dd8086
#endif /* CDIO_MMC_HL_CMDS_H_ */
Packit dd8086

Packit dd8086
/* 
Packit dd8086
 * Local variables:
Packit dd8086
 *  c-file-style: "gnu"
Packit dd8086
 *  tab-width: 8
Packit dd8086
 *  indent-tabs-mode: nil
Packit dd8086
 * End:
Packit dd8086
 */