1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * Copyright (c) 1989 Sun Microsystems, Inc. 24 */ 25 26 #pragma ident "%Z%%M% %I% %E% SMI" 27 28 /* 29 * 30 * Defines for SCSI direct access devices modified for CDROM, based on sddef.h 31 * 32 */ 33 34 /* 35 * CDROM io controls type definitions 36 */ 37 struct cdrom_msf { 38 unsigned char cdmsf_min0; /* starting minute */ 39 unsigned char cdmsf_sec0; /* starting second */ 40 unsigned char cdmsf_frame0; /* starting frame */ 41 unsigned char cdmsf_min1; /* ending minute */ 42 unsigned char cdmsf_sec1; /* ending second */ 43 unsigned char cdmsf_frame1; /* ending frame */ 44 }; 45 46 struct cdrom_ti { 47 unsigned char cdti_trk0; /* starting track */ 48 unsigned char cdti_ind0; /* starting index */ 49 unsigned char cdti_trk1; /* ending track */ 50 unsigned char cdti_ind1; /* ending index */ 51 }; 52 53 struct cdrom_tochdr { 54 unsigned char cdth_trk0; /* starting track */ 55 unsigned char cdth_trk1; /* ending track */ 56 }; 57 58 struct cdrom_tocentry { 59 unsigned char cdte_track; 60 unsigned char cdte_adr :4; 61 unsigned char cdte_ctrl :4; 62 unsigned char cdte_format; 63 union { 64 struct { 65 unsigned char minute; 66 unsigned char second; 67 unsigned char frame; 68 } msf; 69 int lba; 70 } cdte_addr; 71 unsigned char cdte_datamode; 72 }; 73 74 struct cdrom_subchnl { 75 unsigned char cdsc_format; 76 unsigned char cdsc_audiostatus; 77 unsigned char cdsc_adr: 4; 78 unsigned char cdsc_ctrl: 4; 79 unsigned char cdsc_trk; 80 unsigned char cdsc_ind; 81 union { 82 struct { 83 unsigned char minute; 84 unsigned char second; 85 unsigned char frame; 86 } msf; 87 int lba; 88 } cdsc_absaddr; 89 union { 90 struct { 91 unsigned char minute; 92 unsigned char second; 93 unsigned char frame; 94 } msf; 95 int lba; 96 } cdsc_reladdr; 97 }; 98 99 /* 100 * definition of audio volume control structure 101 */ 102 struct cdrom_volctrl { 103 unsigned char channel0; 104 unsigned char channel1; 105 unsigned char channel2; 106 unsigned char channel3; 107 }; 108 109 struct cdrom_read { 110 int cdread_lba; 111 caddr_t cdread_bufaddr; 112 int cdread_buflen; 113 }; 114 115 /* 116 * CDROM io control commands 117 */ 118 #define CDROMPAUSE _IO(c, 10) /* Pause Audio Operation */ 119 120 #define CDROMRESUME _IO(c, 11) /* Resume paused Audio Operation */ 121 122 #define CDROMPLAYMSF _IOW(c, 12, struct cdrom_msf) /* Play Audio MSF */ 123 #define CDROMPLAYTRKIND _IOW(c, 13, struct cdrom_ti) /* 124 * Play Audio 125 ` * Track/index 126 */ 127 #define CDROMREADTOCHDR \ 128 _IOR(c, 103, struct cdrom_tochdr) /* Read TOC header */ 129 #define CDROMREADTOCENTRY \ 130 _IOWR(c, 104, struct cdrom_tocentry) /* Read a TOC entry */ 131 132 #define CDROMSTOP _IO(c, 105) /* Stop the cdrom drive */ 133 134 #define CDROMSTART _IO(c, 106) /* Start the cdrom drive */ 135 136 #define CDROMEJECT _IO(c, 107) /* Ejects the cdrom caddy */ 137 138 #define CDROMVOLCTRL \ 139 _IOW(c, 14, struct cdrom_volctrl) /* control output volume */ 140 141 #define CDROMSUBCHNL \ 142 _IOWR(c, 108, struct cdrom_subchnl) /* read the subchannel data */ 143 144 #define CDROMREADMODE2 \ 145 _IOW(c, 110, struct cdrom_read) /* read CDROM mode 2 data */ 146 147 #define CDROMREADMODE1 \ 148 _IOW(c, 111, struct cdrom_read) /* read CDROM mode 1 data */ 149 150