"Fossies" - the Fresh Open Source Software Archive

Member "libcdio-2.1.0/include/cdio/mmc_hl_cmds.h" (12 Aug 2018, 4550 Bytes) of package /linux/privat/libcdio-2.1.0.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "mmc_hl_cmds.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2     Copyright (C) 2010, 2012 Rocky Bernstein <rocky@gnu.org>
    3 
    4     This program is free software: you can redistribute it and/or modify
    5     it under the terms of the GNU General Public License as published by
    6     the Free Software Foundation, either version 3 of the License, or
    7     (at your option) any later version.
    8 
    9     This program is distributed in the hope that it will be useful,
   10     but WITHOUT ANY WARRANTY; without even the implied warranty of
   11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12     GNU General Public License for more details.
   13 
   14     You should have received a copy of the GNU General Public License
   15     along with this program.  If not, see <http://www.gnu.org/licenses/>.
   16 */
   17 
   18 /**
   19    \file mmc_hl_cmds.h 
   20    
   21    \brief Higher-level MMC commands which build on top of the lower-level
   22    MMC commands.
   23  */
   24 
   25 #ifndef CDIO_MMC_HL_CMDS_H_
   26 #define CDIO_MMC_HL_CMDS_H_
   27 
   28 #include <cdio/mmc.h>
   29 
   30 #ifdef __cplusplus
   31 extern "C" {
   32 #endif /* __cplusplus */
   33 
   34   /**
   35      Close tray using a MMC START STOP UNIT command.
   36      @param p_cdio the CD object to be acted upon.
   37      @return DRIVER_OP_SUCCESS (0) if we got the status.
   38      return codes are the same as driver_return_code_t
   39   */
   40   driver_return_code_t mmc_close_tray( CdIo_t *p_cdio );
   41   
   42   /**
   43      Detects if a disc (CD or DVD) is erasable or not.
   44      
   45      @param p_cdio the CD object to be acted upon.
   46      
   47      @param b_erasable if not NULL, on return will be set indicate whether
   48      the operation was a success (DRIVER_OP_SUCCESS) or if not to some
   49      other value.
   50      
   51      @return true if the disc is detected as erasable (rewritable), false
   52      otherwise.
   53   */
   54   driver_return_code_t mmc_get_disc_erasable(const CdIo_t *p_cdio, 
   55                                              bool *b_erasable);
   56     
   57   /**
   58     Eject using MMC commands. If CD-ROM is "locked" we'll unlock it.
   59     Command is not "immediate" -- we'll wait for the command to complete.
   60     For a more general (and lower-level) routine, @see mmc_start_stop_unit.
   61 
   62    @param p_cdio the CD object to be acted upon.
   63    @return DRIVER_OP_SUCCESS (0) if we got the status.
   64    return codes are the same as driver_return_code_t  
   65   */
   66   driver_return_code_t mmc_eject_media( const CdIo_t *p_cdio );
   67   
   68   /**
   69      Detects the disc type using the SCSI-MMC GET CONFIGURATION command.
   70      
   71      @param p_cdio the CD object to be acted upon.
   72    
   73      @param i_timeout_ms number of millisections to wait before timeout
   74    
   75      @param p_disctype the disc type set on success.
   76      @return DRIVER_OP_SUCCESS (0) if we got the status.
   77    return codes are the same as driver_return_code_t
   78   */
   79   driver_return_code_t mmc_get_disctype(const CdIo_t *p_cdio, 
   80                                         unsigned int i_timeout_ms,
   81                                         cdio_mmc_feature_profile_t *p_disctype);
   82 
   83   /**
   84      Run a SCSI-MMC MODE_SENSE command (6- or 10-byte version) 
   85      and put the results in p_buf 
   86      @param p_cdio the CD object to be acted upon.
   87 
   88      @param p_buf pointer to location to store mode sense information
   89 
   90      @param i_size number of bytes allocated to p_buf
   91 
   92      @param page which "page" of the mode sense command we are interested in
   93 
   94      @return DRIVER_OP_SUCCESS if we ran the command ok.
   95   */
   96   driver_return_code_t mmc_mode_sense( CdIo_t *p_cdio, /*out*/ void *p_buf,
   97                                        unsigned int i_size, int page);
   98   
   99   /**
  100     Set the drive speed in CD-ROM speed units.
  101 
  102     @param p_cdio          CD structure set by cdio_open().
  103     @param i_drive_speed   speed in CD-ROM speed units. Note this
  104                            not Kbs as would be used in the MMC spec or
  105                            in mmc_set_speed(). To convert CD-ROM speed units 
  106                            to Kbs, multiply the number by 176 (for raw data)
  107                            and by 150 (for filesystem data). On many CD-ROM 
  108                            drives, specifying a value too large will result 
  109                            in using the fastest speed.
  110 
  111     @return the drive speed if greater than 0. -1 if we had an error. is -2
  112     returned if this is not implemented for the current driver.
  113 
  114      @see cdio_set_speed and mmc_set_speed
  115   */
  116   driver_return_code_t mmc_set_drive_speed( const CdIo_t *p_cdio, 
  117                                             int i_drive_speed );
  118 
  119 
  120 #ifdef __cplusplus
  121 }
  122 #endif /* __cplusplus */
  123 
  124 #endif /* CDIO_MMC_HL_CMDS_H_ */
  125 
  126 /* 
  127  * Local variables:
  128  *  c-file-style: "gnu"
  129  *  tab-width: 8
  130  *  indent-tabs-mode: nil
  131  * End:
  132  */