^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) ============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) Summary of CDROM ioctl calls
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) ============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) - Edward A. Falk <efalk@google.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) November, 2004
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) This document attempts to describe the ioctl(2) calls supported by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) the CDROM layer. These are by-and-large implemented (as of Linux 2.6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) in drivers/cdrom/cdrom.c and drivers/block/scsi_ioctl.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) ioctl values are listed in <linux/cdrom.h>. As of this writing, they
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) are as follows:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) ====================== ===============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) CDROMPAUSE Pause Audio Operation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) CDROMRESUME Resume paused Audio Operation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) CDROMPLAYMSF Play Audio MSF (struct cdrom_msf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) CDROMPLAYTRKIND Play Audio Track/index (struct cdrom_ti)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) CDROMREADTOCHDR Read TOC header (struct cdrom_tochdr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) CDROMREADTOCENTRY Read TOC entry (struct cdrom_tocentry)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) CDROMSTOP Stop the cdrom drive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) CDROMSTART Start the cdrom drive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) CDROMEJECT Ejects the cdrom media
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) CDROMVOLCTRL Control output volume (struct cdrom_volctrl)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) CDROMSUBCHNL Read subchannel data (struct cdrom_subchnl)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) CDROMREADMODE2 Read CDROM mode 2 data (2336 Bytes)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) (struct cdrom_read)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) CDROMREADMODE1 Read CDROM mode 1 data (2048 Bytes)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) (struct cdrom_read)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) CDROMREADAUDIO (struct cdrom_read_audio)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) CDROMEJECT_SW enable(1)/disable(0) auto-ejecting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) CDROMMULTISESSION Obtain the start-of-last-session
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) address of multi session disks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) (struct cdrom_multisession)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) CDROM_GET_MCN Obtain the "Universal Product Code"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) if available (struct cdrom_mcn)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) CDROM_GET_UPC Deprecated, use CDROM_GET_MCN instead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) CDROMRESET hard-reset the drive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) CDROMVOLREAD Get the drive's volume setting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) (struct cdrom_volctrl)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) CDROMREADRAW read data in raw mode (2352 Bytes)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) (struct cdrom_read)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) CDROMREADCOOKED read data in cooked mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) CDROMSEEK seek msf address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) CDROMPLAYBLK scsi-cd only, (struct cdrom_blk)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) CDROMREADALL read all 2646 bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) CDROMGETSPINDOWN return 4-bit spindown value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) CDROMSETSPINDOWN set 4-bit spindown value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) CDROMCLOSETRAY pendant of CDROMEJECT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) CDROM_SET_OPTIONS Set behavior options
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) CDROM_CLEAR_OPTIONS Clear behavior options
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) CDROM_SELECT_SPEED Set the CD-ROM speed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) CDROM_SELECT_DISC Select disc (for juke-boxes)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) CDROM_MEDIA_CHANGED Check is media changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) CDROM_DRIVE_STATUS Get tray position, etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) CDROM_DISC_STATUS Get disc type, etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) CDROM_CHANGER_NSLOTS Get number of slots
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) CDROM_LOCKDOOR lock or unlock door
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) CDROM_DEBUG Turn debug messages on/off
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) CDROM_GET_CAPABILITY get capabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) CDROMAUDIOBUFSIZ set the audio buffer size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) DVD_READ_STRUCT Read structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) DVD_WRITE_STRUCT Write structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) DVD_AUTH Authentication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) CDROM_SEND_PACKET send a packet to the drive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) CDROM_NEXT_WRITABLE get next writable block
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) CDROM_LAST_WRITTEN get last block written on disc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) ====================== ===============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) The information that follows was determined from reading kernel source
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) code. It is likely that some corrections will be made over time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) ------------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) General:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) Unless otherwise specified, all ioctl calls return 0 on success
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) and -1 with errno set to an appropriate value on error. (Some
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) ioctls return non-negative data values.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) Unless otherwise specified, all ioctl calls return -1 and set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) errno to EFAULT on a failed attempt to copy data to or from user
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) address space.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) Individual drivers may return error codes not listed here.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) Unless otherwise specified, all data structures and constants
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) are defined in <linux/cdrom.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) ------------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) CDROMPAUSE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) Pause Audio Operation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) ioctl(fd, CDROMPAUSE, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) - ENOSYS cd drive not audio-capable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) CDROMRESUME
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) Resume paused Audio Operation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) ioctl(fd, CDROMRESUME, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) - ENOSYS cd drive not audio-capable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) CDROMPLAYMSF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) Play Audio MSF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) (struct cdrom_msf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) struct cdrom_msf msf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) ioctl(fd, CDROMPLAYMSF, &msf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) cdrom_msf structure, describing a segment of music to play
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) - ENOSYS cd drive not audio-capable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) - MSF stands for minutes-seconds-frames
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) - LBA stands for logical block address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) - Segment is described as start and end times, where each time
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) is described as minutes:seconds:frames.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) A frame is 1/75 of a second.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) CDROMPLAYTRKIND
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) Play Audio Track/index
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) (struct cdrom_ti)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) struct cdrom_ti ti;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) ioctl(fd, CDROMPLAYTRKIND, &ti);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) cdrom_ti structure, describing a segment of music to play
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) - ENOSYS cd drive not audio-capable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) - Segment is described as start and end times, where each time
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) is described as a track and an index.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) CDROMREADTOCHDR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) Read TOC header
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) (struct cdrom_tochdr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) cdrom_tochdr header;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) ioctl(fd, CDROMREADTOCHDR, &header);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) cdrom_tochdr structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) cdrom_tochdr structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) - ENOSYS cd drive not audio-capable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) CDROMREADTOCENTRY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) Read TOC entry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) (struct cdrom_tocentry)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) struct cdrom_tocentry entry;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) ioctl(fd, CDROMREADTOCENTRY, &entry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) cdrom_tocentry structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) cdrom_tocentry structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) - ENOSYS cd drive not audio-capable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) - EINVAL entry.cdte_format not CDROM_MSF or CDROM_LBA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) - EINVAL requested track out of bounds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) - EIO I/O error reading TOC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) - TOC stands for Table Of Contents
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) - MSF stands for minutes-seconds-frames
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) - LBA stands for logical block address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) CDROMSTOP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) Stop the cdrom drive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) ioctl(fd, CDROMSTOP, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) - ENOSYS cd drive not audio-capable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) - Exact interpretation of this ioctl depends on the device,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) but most seem to spin the drive down.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) CDROMSTART
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) Start the cdrom drive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) ioctl(fd, CDROMSTART, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) - ENOSYS cd drive not audio-capable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) - Exact interpretation of this ioctl depends on the device,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) but most seem to spin the drive up and/or close the tray.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) Other devices ignore the ioctl completely.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) CDROMEJECT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) - Ejects the cdrom media
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) ioctl(fd, CDROMEJECT, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) error returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) - ENOSYS cd drive not capable of ejecting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) - EBUSY other processes are accessing drive, or door is locked
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) - See CDROM_LOCKDOOR, below.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) CDROMCLOSETRAY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) pendant of CDROMEJECT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) ioctl(fd, CDROMCLOSETRAY, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) error returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) - ENOSYS cd drive not capable of closing the tray
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) - EBUSY other processes are accessing drive, or door is locked
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) - See CDROM_LOCKDOOR, below.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) CDROMVOLCTRL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) Control output volume (struct cdrom_volctrl)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) struct cdrom_volctrl volume;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) ioctl(fd, CDROMVOLCTRL, &volume);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) cdrom_volctrl structure containing volumes for up to 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) channels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) - ENOSYS cd drive not audio-capable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) CDROMVOLREAD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) Get the drive's volume setting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) (struct cdrom_volctrl)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) struct cdrom_volctrl volume;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) ioctl(fd, CDROMVOLREAD, &volume);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) The current volume settings.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) - ENOSYS cd drive not audio-capable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) CDROMSUBCHNL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) Read subchannel data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) (struct cdrom_subchnl)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) struct cdrom_subchnl q;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) ioctl(fd, CDROMSUBCHNL, &q);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) cdrom_subchnl structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) cdrom_subchnl structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) - ENOSYS cd drive not audio-capable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) - EINVAL format not CDROM_MSF or CDROM_LBA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) - Format is converted to CDROM_MSF or CDROM_LBA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) as per user request on return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) CDROMREADRAW
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) read data in raw mode (2352 Bytes)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) (struct cdrom_read)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) struct cdrom_msf msf; /* input */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) char buffer[CD_FRAMESIZE_RAW]; /* return */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) } arg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) ioctl(fd, CDROMREADRAW, &arg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) cdrom_msf structure indicating an address to read.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) Only the start values are significant.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) Data written to address provided by user.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) - EINVAL address less than 0, or msf less than 0:2:0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) - ENOMEM out of memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) - As of 2.6.8.1, comments in <linux/cdrom.h> indicate that this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) ioctl accepts a cdrom_read structure, but actual source code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) reads a cdrom_msf structure and writes a buffer of data to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) the same address.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) - MSF values are converted to LBA values via this formula::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) lba = (((m * CD_SECS) + s) * CD_FRAMES + f) - CD_MSF_OFFSET;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) CDROMREADMODE1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) Read CDROM mode 1 data (2048 Bytes)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) (struct cdrom_read)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) Identical to CDROMREADRAW except that block size is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) CD_FRAMESIZE (2048) bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) CDROMREADMODE2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) Read CDROM mode 2 data (2336 Bytes)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) (struct cdrom_read)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) Identical to CDROMREADRAW except that block size is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) CD_FRAMESIZE_RAW0 (2336) bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) CDROMREADAUDIO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) (struct cdrom_read_audio)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) struct cdrom_read_audio ra;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) ioctl(fd, CDROMREADAUDIO, &ra);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) cdrom_read_audio structure containing read start
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) point and length
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) audio data, returned to buffer indicated by ra
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) - EINVAL format not CDROM_MSF or CDROM_LBA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) - EINVAL nframes not in range [1 75]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) - ENXIO drive has no queue (probably means invalid fd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) - ENOMEM out of memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) CDROMEJECT_SW
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) enable(1)/disable(0) auto-ejecting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531) int val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) ioctl(fd, CDROMEJECT_SW, val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536) Flag specifying auto-eject flag.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544) - ENOSYS Drive is not capable of ejecting.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545) - EBUSY Door is locked
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550) CDROMMULTISESSION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551) Obtain the start-of-last-session address of multi session disks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553) (struct cdrom_multisession)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557) struct cdrom_multisession ms_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559) ioctl(fd, CDROMMULTISESSION, &ms_info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) cdrom_multisession structure containing desired
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) format.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567) cdrom_multisession structure is filled with last_session
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568) information.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571) - EINVAL format not CDROM_MSF or CDROM_LBA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) CDROM_GET_MCN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575) Obtain the "Universal Product Code"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576) if available
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) (struct cdrom_mcn)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583) struct cdrom_mcn mcn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585) ioctl(fd, CDROM_GET_MCN, &mcn);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592) Universal Product Code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596) - ENOSYS Drive is not capable of reading MCN data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598) notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599) - Source code comments state::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601) The following function is implemented, although very few
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602) audio discs give Universal Product Code information, which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603) should just be the Medium Catalog Number on the box. Note,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604) that the way the code is written on the CD is /not/ uniform
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605) across all discs!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610) CDROM_GET_UPC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611) CDROM_GET_MCN (deprecated)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 612)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 613)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 614) Not implemented, as of 2.6.8.1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 615)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 616)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 617)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 618) CDROMRESET
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 619) hard-reset the drive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 620)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 621)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 622) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 623)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 624) ioctl(fd, CDROMRESET, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 625)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 626)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 627) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 628) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 629)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 630)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 631) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 632) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 633)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 634)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 635) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 636) - EACCES Access denied: requires CAP_SYS_ADMIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 637) - ENOSYS Drive is not capable of resetting.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 638)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 639)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 640)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 641)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 642) CDROMREADCOOKED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 643) read data in cooked mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 644)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 645)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 646) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 647)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 648) u8 buffer[CD_FRAMESIZE]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 649)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 650) ioctl(fd, CDROMREADCOOKED, buffer);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 651)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 652) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 653) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 654)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 655)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 656) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 657) 2048 bytes of data, "cooked" mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 658)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 659)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 660) notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 661) Not implemented on all drives.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 662)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 663)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 664)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 665)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 666)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 667) CDROMREADALL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 668) read all 2646 bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 669)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 670)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 671) Same as CDROMREADCOOKED, but reads 2646 bytes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 672)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 673)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 674)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 675) CDROMSEEK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 676) seek msf address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 677)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 678)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 679) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 680)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 681) struct cdrom_msf msf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 682)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 683) ioctl(fd, CDROMSEEK, &msf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 684)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 685) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 686) MSF address to seek to.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 687)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 688)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 689) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 690) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 691)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 692)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 693)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 694)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 695) CDROMPLAYBLK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 696) scsi-cd only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 697)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 698) (struct cdrom_blk)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 699)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 700)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 701) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 702)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 703) struct cdrom_blk blk;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 704)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 705) ioctl(fd, CDROMPLAYBLK, &blk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 706)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 707) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 708) Region to play
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 709)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 710)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 711) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 712) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 713)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 714)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 715)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 716)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 717) CDROMGETSPINDOWN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 718) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 719)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 720) char spindown;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 721)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 722) ioctl(fd, CDROMGETSPINDOWN, &spindown);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 723)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 724) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 725) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 726)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 727)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 728) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 729) The value of the current 4-bit spindown value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 730)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 731)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 732)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 733)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 734)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 735) CDROMSETSPINDOWN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 736) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 737)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 738) char spindown
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 739)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 740) ioctl(fd, CDROMSETSPINDOWN, &spindown);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 741)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 742) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 743) 4-bit value used to control spindown (TODO: more detail here)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 744)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 745)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 746) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 747) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 748)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 749)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 750)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 751)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 752)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 753)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 754) CDROM_SET_OPTIONS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 755) Set behavior options
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 756)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 757)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 758) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 759)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 760) int options;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 761)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 762) ioctl(fd, CDROM_SET_OPTIONS, options);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 763)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 764) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 765) New values for drive options. The logical 'or' of:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 766)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 767) ============== ==================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 768) CDO_AUTO_CLOSE close tray on first open(2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 769) CDO_AUTO_EJECT open tray on last release
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 770) CDO_USE_FFLAGS use O_NONBLOCK information on open
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 771) CDO_LOCK lock tray on open files
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 772) CDO_CHECK_TYPE check type on open for data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 773) ============== ==================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 774)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 775) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 776) Returns the resulting options settings in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 777) ioctl return value. Returns -1 on error.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 778)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 779) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 780) - ENOSYS selected option(s) not supported by drive.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 781)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 782)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 783)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 784)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 785) CDROM_CLEAR_OPTIONS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 786) Clear behavior options
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 787)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 788)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 789) Same as CDROM_SET_OPTIONS, except that selected options are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 790) turned off.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 791)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 792)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 793)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 794) CDROM_SELECT_SPEED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 795) Set the CD-ROM speed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 796)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 797)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 798) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 799)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 800) int speed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 801)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 802) ioctl(fd, CDROM_SELECT_SPEED, speed);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 803)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 804) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 805) New drive speed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 806)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 807)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 808) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 809) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 810)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 811)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 812) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 813) - ENOSYS speed selection not supported by drive.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 814)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 815)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 816)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 817) CDROM_SELECT_DISC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 818) Select disc (for juke-boxes)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 819)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 820)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 821) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 822)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 823) int disk;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 824)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 825) ioctl(fd, CDROM_SELECT_DISC, disk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 826)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 827) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 828) Disk to load into drive.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 829)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 830)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 831) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 832) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 833)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 834)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 835) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 836) - EINVAL Disk number beyond capacity of drive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 837)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 838)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 839)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 840) CDROM_MEDIA_CHANGED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 841) Check is media changed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 842)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 843)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 844) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 845)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 846) int slot;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 847)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 848) ioctl(fd, CDROM_MEDIA_CHANGED, slot);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 849)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 850) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 851) Slot number to be tested, always zero except for jukeboxes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 852)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 853) May also be special values CDSL_NONE or CDSL_CURRENT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 854)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 855) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 856) Ioctl return value is 0 or 1 depending on whether the media
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 857)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 858) has been changed, or -1 on error.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 859)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 860) error returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 861) - ENOSYS Drive can't detect media change
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 862) - EINVAL Slot number beyond capacity of drive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 863) - ENOMEM Out of memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 864)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 865)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 866)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 867) CDROM_DRIVE_STATUS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 868) Get tray position, etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 869)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 870)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 871) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 872)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 873) int slot;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 874)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 875) ioctl(fd, CDROM_DRIVE_STATUS, slot);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 876)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 877) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 878) Slot number to be tested, always zero except for jukeboxes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 879)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 880) May also be special values CDSL_NONE or CDSL_CURRENT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 881)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 882) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 883) Ioctl return value will be one of the following values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 884)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 885) from <linux/cdrom.h>:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 886)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 887) =================== ==========================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 888) CDS_NO_INFO Information not available.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 889) CDS_NO_DISC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 890) CDS_TRAY_OPEN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 891) CDS_DRIVE_NOT_READY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 892) CDS_DISC_OK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 893) -1 error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 894) =================== ==========================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 895)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 896) error returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 897) - ENOSYS Drive can't detect drive status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 898) - EINVAL Slot number beyond capacity of drive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 899) - ENOMEM Out of memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 900)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 901)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 902)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 903)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 904) CDROM_DISC_STATUS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 905) Get disc type, etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 906)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 907)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 908) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 909)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 910) ioctl(fd, CDROM_DISC_STATUS, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 911)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 912)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 913) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 914) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 915)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 916)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 917) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 918) Ioctl return value will be one of the following values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 919)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 920) from <linux/cdrom.h>:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 921)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 922) - CDS_NO_INFO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 923) - CDS_AUDIO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 924) - CDS_MIXED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 925) - CDS_XA_2_2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 926) - CDS_XA_2_1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 927) - CDS_DATA_1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 928)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 929) error returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 930) none at present
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 931)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 932) notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 933) - Source code comments state::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 934)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 935)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 936) Ok, this is where problems start. The current interface for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 937) the CDROM_DISC_STATUS ioctl is flawed. It makes the false
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 938) assumption that CDs are all CDS_DATA_1 or all CDS_AUDIO, etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 939) Unfortunately, while this is often the case, it is also
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 940) very common for CDs to have some tracks with data, and some
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 941) tracks with audio. Just because I feel like it, I declare
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 942) the following to be the best way to cope. If the CD has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 943) ANY data tracks on it, it will be returned as a data CD.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 944) If it has any XA tracks, I will return it as that. Now I
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 945) could simplify this interface by combining these returns with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 946) the above, but this more clearly demonstrates the problem
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 947) with the current interface. Too bad this wasn't designed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 948) to use bitmasks... -Erik
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 949)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 950) Well, now we have the option CDS_MIXED: a mixed-type CD.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 951) User level programmers might feel the ioctl is not very
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 952) useful.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 953) ---david
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 954)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 955)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 956)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 957)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 958) CDROM_CHANGER_NSLOTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 959) Get number of slots
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 960)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 961)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 962) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 963)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 964) ioctl(fd, CDROM_CHANGER_NSLOTS, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 965)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 966)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 967) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 968) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 969)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 970)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 971) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 972) The ioctl return value will be the number of slots in a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 973) CD changer. Typically 1 for non-multi-disk devices.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 974)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 975) error returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 976) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 977)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 978)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 979)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 980) CDROM_LOCKDOOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 981) lock or unlock door
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 982)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 983)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 984) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 985)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 986) int lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 987)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 988) ioctl(fd, CDROM_LOCKDOOR, lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 989)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 990) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 991) Door lock flag, 1=lock, 0=unlock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 992)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 993)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 994) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 995) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 996)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 997)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 998) error returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 999) - EDRIVE_CANT_DO_THIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1001) Door lock function not supported.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1002) - EBUSY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1003)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1004) Attempt to unlock when multiple users
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1005) have the drive open and not CAP_SYS_ADMIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1006)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1007) notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1008) As of 2.6.8.1, the lock flag is a global lock, meaning that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1009) all CD drives will be locked or unlocked together. This is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1010) probably a bug.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1011)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1012) The EDRIVE_CANT_DO_THIS value is defined in <linux/cdrom.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1013) and is currently (2.6.8.1) the same as EOPNOTSUPP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1014)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1015)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1016)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1017) CDROM_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1018) Turn debug messages on/off
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1019)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1020)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1021) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1022)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1023) int debug;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1024)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1025) ioctl(fd, CDROM_DEBUG, debug);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1026)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1027) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1028) Cdrom debug flag, 0=disable, 1=enable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1029)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1030)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1031) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1032) The ioctl return value will be the new debug flag.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1033)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1034)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1035) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1036) - EACCES Access denied: requires CAP_SYS_ADMIN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1037)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1038)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1039)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1040) CDROM_GET_CAPABILITY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1041) get capabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1042)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1043)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1044) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1045)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1046) ioctl(fd, CDROM_GET_CAPABILITY, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1047)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1048)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1049) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1050) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1051)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1052)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1053) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1054) The ioctl return value is the current device capability
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1055) flags. See CDC_CLOSE_TRAY, CDC_OPEN_TRAY, etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1056)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1057)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1058)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1059) CDROMAUDIOBUFSIZ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1060) set the audio buffer size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1061)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1062)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1063) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1064)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1065) int arg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1066)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1067) ioctl(fd, CDROMAUDIOBUFSIZ, val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1068)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1069) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1070) New audio buffer size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1071)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1072)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1073) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1074) The ioctl return value is the new audio buffer size, or -1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1075) on error.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1076)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1077) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1078) - ENOSYS Not supported by this driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1079)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1080) notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1081) Not supported by all drivers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1082)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1083)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1084)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1085)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1086) DVD_READ_STRUCT Read structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1087)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1088) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1089)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1090) dvd_struct s;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1091)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1092) ioctl(fd, DVD_READ_STRUCT, &s);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1093)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1094) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1095) dvd_struct structure, containing:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1096)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1097) =================== ==========================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1098) type specifies the information desired, one of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1099) DVD_STRUCT_PHYSICAL, DVD_STRUCT_COPYRIGHT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1100) DVD_STRUCT_DISCKEY, DVD_STRUCT_BCA,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1101) DVD_STRUCT_MANUFACT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1102) physical.layer_num desired layer, indexed from 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1103) copyright.layer_num desired layer, indexed from 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1104) disckey.agid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1105) =================== ==========================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1106)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1107) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1108) dvd_struct structure, containing:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1109)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1110) =================== ================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1111) physical for type == DVD_STRUCT_PHYSICAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1112) copyright for type == DVD_STRUCT_COPYRIGHT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1113) disckey.value for type == DVD_STRUCT_DISCKEY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1114) bca.{len,value} for type == DVD_STRUCT_BCA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1115) manufact.{len,valu} for type == DVD_STRUCT_MANUFACT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1116) =================== ================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1117)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1118) error returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1119) - EINVAL physical.layer_num exceeds number of layers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1120) - EIO Received invalid response from drive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1121)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1123)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1124) DVD_WRITE_STRUCT Write structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1125)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1126) Not implemented, as of 2.6.8.1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1127)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1128)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1129)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1130) DVD_AUTH Authentication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1131)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1132) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1133)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1134) dvd_authinfo ai;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1135)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1136) ioctl(fd, DVD_AUTH, &ai);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1137)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1138) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1139) dvd_authinfo structure. See <linux/cdrom.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1140)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1141)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1142) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1143) dvd_authinfo structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1144)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1145)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1146) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1147) - ENOTTY ai.type not recognized.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1148)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1149)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1150)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1151) CDROM_SEND_PACKET
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1152) send a packet to the drive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1153)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1154)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1155) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1157) struct cdrom_generic_command cgc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1158)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1159) ioctl(fd, CDROM_SEND_PACKET, &cgc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1160)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1161) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1162) cdrom_generic_command structure containing the packet to send.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1163)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1164)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1165) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1166) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1167)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1168) cdrom_generic_command structure containing results.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1169)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1170) error return:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1171) - EIO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1172)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1173) command failed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1174) - EPERM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1175)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1176) Operation not permitted, either because a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1177) write command was attempted on a drive which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1178) is opened read-only, or because the command
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1179) requires CAP_SYS_RAWIO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1180) - EINVAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1181)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1182) cgc.data_direction not set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1183)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1184)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1185)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1186) CDROM_NEXT_WRITABLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1187) get next writable block
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1189)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1190) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1191)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1192) long next;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1193)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1194) ioctl(fd, CDROM_NEXT_WRITABLE, &next);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1195)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1196) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1197) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1198)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1199)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1200) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1201) The next writable block.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1202)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1203)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1204) notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1205) If the device does not support this ioctl directly, the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1206)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1207) ioctl will return CDROM_LAST_WRITTEN + 7.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1208)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1209)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1210)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1211) CDROM_LAST_WRITTEN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1212) get last block written on disc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1213)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1214)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1215) usage::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1216)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1217) long last;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1218)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1219) ioctl(fd, CDROM_LAST_WRITTEN, &last);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1220)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1221) inputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1222) none
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1223)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1224)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1225) outputs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1226) The last block written on disc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1227)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1228)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1229) notes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1230) If the device does not support this ioctl directly, the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1231) result is derived from the disc's table of contents. If the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1232) table of contents can't be read, this ioctl returns an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1233) error.