linux_cdrom.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /* $OpenBSD: linux_cdrom.h,v 1.2 1997/12/10 00:01:40 provos Exp $ */
  2. /*
  3. * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de>
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. * 1. Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. * 2. Redistributions in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the distribution.
  14. * 3. All advertising materials mentioning features or use of this software
  15. * must display the following acknowledgement:
  16. * This product includes software developed by Niels Provos.
  17. * 4. The name of the author may not be used to endorse or promote products
  18. * derived from this software without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  21. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  22. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  23. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  24. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  25. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  26. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  27. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  28. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  29. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. */
  31. struct linux_cdrom_blk
  32. {
  33. unsigned from;
  34. unsigned short len;
  35. };
  36. struct linux_cdrom_msf
  37. {
  38. u_char cdmsf_min0; /* start */
  39. u_char cdmsf_sec0;
  40. u_char cdmsf_frame0;
  41. u_char cdmsf_min1; /* end */
  42. u_char cdmsf_sec1;
  43. u_char cdmsf_frame1;
  44. };
  45. struct linux_cdrom_ti
  46. {
  47. u_char cdti_trk0; /* start */
  48. u_char cdti_ind0;
  49. u_char cdti_trk1; /* end */
  50. u_char cdti_ind1;
  51. };
  52. struct linux_cdrom_tochdr
  53. {
  54. u_char cdth_trk0; /* start */
  55. u_char cdth_trk1; /* end */
  56. };
  57. struct linux_cdrom_msf0
  58. {
  59. u_char minute;
  60. u_char second;
  61. u_char frame;
  62. };
  63. union linux_cdrom_addr
  64. {
  65. struct linux_cdrom_msf0 msf;
  66. int lba;
  67. };
  68. struct linux_cdrom_tocentry
  69. {
  70. u_char cdte_track;
  71. u_char cdte_adr :4;
  72. u_char cdte_ctrl :4;
  73. u_char cdte_format;
  74. union linux_cdrom_addr cdte_addr;
  75. u_char cdte_datamode;
  76. };
  77. #define LINUX_CDROM_LBA 0x01
  78. #define LINUX_CDROM_MSF 0x02
  79. #define LINUX_CDROM_DATA_TRACK 0x04
  80. #define LINUX_CDROM_LEADOUT 0xAA
  81. struct linux_cdrom_subchnl
  82. {
  83. u_char cdsc_format;
  84. u_char cdsc_audiostatus;
  85. u_char cdsc_adr: 4;
  86. u_char cdsc_ctrl: 4;
  87. u_char cdsc_trk;
  88. u_char cdsc_ind;
  89. union linux_cdrom_addr cdsc_absaddr;
  90. union linux_cdrom_addr cdsc_reladdr;
  91. };
  92. struct linux_cdrom_mcn {
  93. u_char medium_catalog_number[14];
  94. };
  95. struct linux_cdrom_volctrl
  96. {
  97. u_char channel0;
  98. u_char channel1;
  99. u_char channel2;
  100. u_char channel3;
  101. };
  102. struct linux_cdrom_read
  103. {
  104. int cdread_lba;
  105. caddr_t cdread_bufaddr;
  106. int cdread_buflen;
  107. };
  108. #define LINUX_CDROMPAUSE 0x5301
  109. #define LINUX_CDROMRESUME 0x5302
  110. #define LINUX_CDROMPLAYMSF 0x5303
  111. #define LINUX_CDROMPLAYTRKIND 0x5304
  112. #define LINUX_CDROMREADTOCHDR 0x5305
  113. #define LINUX_CDROMREADTOCENTRY 0x5306
  114. #define LINUX_CDROMSTOP 0x5307
  115. #define LINUX_CDROMSTART 0x5308
  116. #define LINUX_CDROMEJECT 0x5309
  117. #define LINUX_CDROMVOLCTRL 0x530a
  118. #define LINUX_CDROMSUBCHNL 0x530b
  119. #define LINUX_CDROMREADMODE2 0x530c
  120. #define LINUX_CDROMREADMODE1 0x530d
  121. #define LINUX_CDROMREADAUDIO 0x530e
  122. #define LINUX_CDROMEJECT_SW 0x530f
  123. #define LINUX_CDROMMULTISESSION 0x5310
  124. #define LINUX_CDROM_GET_UPC 0x5311
  125. #define LINUX_CDROMRESET 0x5312
  126. #define LINUX_CDROMVOLREAD 0x5313
  127. #define LINUX_CDROMPLAYBLK 0x5317