17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 57c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate * with the License. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate * and limitations under the License. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate * 207c478bd9Sstevel@tonic-gate * CDDL HEADER END 217c478bd9Sstevel@tonic-gate */ 227c478bd9Sstevel@tonic-gate /* 23*30a83a24Scth * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate #ifndef _SYS_CDIO_H 287c478bd9Sstevel@tonic-gate #define _SYS_CDIO_H 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gate #ifdef __cplusplus 337c478bd9Sstevel@tonic-gate extern "C" { 347c478bd9Sstevel@tonic-gate #endif 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate /* 377c478bd9Sstevel@tonic-gate * CDROM io controls type definitions 387c478bd9Sstevel@tonic-gate */ 397c478bd9Sstevel@tonic-gate struct cdrom_msf { 407c478bd9Sstevel@tonic-gate unsigned char cdmsf_min0; /* starting minute */ 417c478bd9Sstevel@tonic-gate unsigned char cdmsf_sec0; /* starting second */ 427c478bd9Sstevel@tonic-gate unsigned char cdmsf_frame0; /* starting frame */ 437c478bd9Sstevel@tonic-gate unsigned char cdmsf_min1; /* ending minute */ 447c478bd9Sstevel@tonic-gate unsigned char cdmsf_sec1; /* ending second */ 457c478bd9Sstevel@tonic-gate unsigned char cdmsf_frame1; /* ending frame */ 467c478bd9Sstevel@tonic-gate }; 477c478bd9Sstevel@tonic-gate 487c478bd9Sstevel@tonic-gate struct cdrom_ti { 497c478bd9Sstevel@tonic-gate unsigned char cdti_trk0; /* starting track */ 507c478bd9Sstevel@tonic-gate unsigned char cdti_ind0; /* starting index */ 517c478bd9Sstevel@tonic-gate unsigned char cdti_trk1; /* ending track */ 527c478bd9Sstevel@tonic-gate unsigned char cdti_ind1; /* ending index */ 537c478bd9Sstevel@tonic-gate }; 547c478bd9Sstevel@tonic-gate 557c478bd9Sstevel@tonic-gate struct cdrom_tochdr { 567c478bd9Sstevel@tonic-gate unsigned char cdth_trk0; /* starting track */ 577c478bd9Sstevel@tonic-gate unsigned char cdth_trk1; /* ending track */ 587c478bd9Sstevel@tonic-gate }; 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gate struct cdrom_tocentry { 617c478bd9Sstevel@tonic-gate unsigned char cdte_track; 627c478bd9Sstevel@tonic-gate unsigned cdte_adr :4; 637c478bd9Sstevel@tonic-gate unsigned cdte_ctrl :4; 647c478bd9Sstevel@tonic-gate unsigned char cdte_format; 657c478bd9Sstevel@tonic-gate union { 667c478bd9Sstevel@tonic-gate struct { 677c478bd9Sstevel@tonic-gate unsigned char minute; 687c478bd9Sstevel@tonic-gate unsigned char second; 697c478bd9Sstevel@tonic-gate unsigned char frame; 707c478bd9Sstevel@tonic-gate } msf; 717c478bd9Sstevel@tonic-gate int lba; 727c478bd9Sstevel@tonic-gate } cdte_addr; 737c478bd9Sstevel@tonic-gate unsigned char cdte_datamode; 747c478bd9Sstevel@tonic-gate }; 757c478bd9Sstevel@tonic-gate 767c478bd9Sstevel@tonic-gate /* 777c478bd9Sstevel@tonic-gate * CDROM address format definition, for use with struct cdrom_tocentry 787c478bd9Sstevel@tonic-gate */ 797c478bd9Sstevel@tonic-gate #define CDROM_LBA 0x01 807c478bd9Sstevel@tonic-gate #define CDROM_MSF 0x02 817c478bd9Sstevel@tonic-gate 827c478bd9Sstevel@tonic-gate /* 837c478bd9Sstevel@tonic-gate * Bitmask for CD-ROM data track in the cdte_ctrl field 847c478bd9Sstevel@tonic-gate * A track is either data or audio. 857c478bd9Sstevel@tonic-gate */ 867c478bd9Sstevel@tonic-gate #define CDROM_DATA_TRACK 0x04 877c478bd9Sstevel@tonic-gate 887c478bd9Sstevel@tonic-gate /* 897c478bd9Sstevel@tonic-gate * For CDROMREADTOCENTRY, set the cdte_track to CDROM_LEADOUT to get 907c478bd9Sstevel@tonic-gate * the information for the leadout track. 917c478bd9Sstevel@tonic-gate */ 927c478bd9Sstevel@tonic-gate #define CDROM_LEADOUT 0xAA 937c478bd9Sstevel@tonic-gate 947c478bd9Sstevel@tonic-gate struct cdrom_subchnl { 957c478bd9Sstevel@tonic-gate unsigned char cdsc_format; 967c478bd9Sstevel@tonic-gate unsigned char cdsc_audiostatus; 977c478bd9Sstevel@tonic-gate unsigned cdsc_adr: 4; 987c478bd9Sstevel@tonic-gate unsigned cdsc_ctrl: 4; 997c478bd9Sstevel@tonic-gate unsigned char cdsc_trk; 1007c478bd9Sstevel@tonic-gate unsigned char cdsc_ind; 1017c478bd9Sstevel@tonic-gate union { 1027c478bd9Sstevel@tonic-gate struct { 1037c478bd9Sstevel@tonic-gate unsigned char minute; 1047c478bd9Sstevel@tonic-gate unsigned char second; 1057c478bd9Sstevel@tonic-gate unsigned char frame; 1067c478bd9Sstevel@tonic-gate } msf; 1077c478bd9Sstevel@tonic-gate int lba; 1087c478bd9Sstevel@tonic-gate } cdsc_absaddr; 1097c478bd9Sstevel@tonic-gate union { 1107c478bd9Sstevel@tonic-gate struct { 1117c478bd9Sstevel@tonic-gate unsigned char minute; 1127c478bd9Sstevel@tonic-gate unsigned char second; 1137c478bd9Sstevel@tonic-gate unsigned char frame; 1147c478bd9Sstevel@tonic-gate } msf; 1157c478bd9Sstevel@tonic-gate int lba; 1167c478bd9Sstevel@tonic-gate } cdsc_reladdr; 1177c478bd9Sstevel@tonic-gate }; 1187c478bd9Sstevel@tonic-gate 1197c478bd9Sstevel@tonic-gate /* 1207c478bd9Sstevel@tonic-gate * Definition for audio status returned from Read Sub-channel 1217c478bd9Sstevel@tonic-gate */ 1227c478bd9Sstevel@tonic-gate #define CDROM_AUDIO_INVALID 0x00 /* audio status not supported */ 1237c478bd9Sstevel@tonic-gate #define CDROM_AUDIO_PLAY 0x11 /* audio play operation in progress */ 1247c478bd9Sstevel@tonic-gate #define CDROM_AUDIO_PAUSED 0x12 /* audio play operation paused */ 1257c478bd9Sstevel@tonic-gate #define CDROM_AUDIO_COMPLETED 0x13 /* audio play successfully completed */ 1267c478bd9Sstevel@tonic-gate #define CDROM_AUDIO_ERROR 0x14 /* audio play stopped due to error */ 1277c478bd9Sstevel@tonic-gate #define CDROM_AUDIO_NO_STATUS 0x15 /* no current audio status to return */ 1287c478bd9Sstevel@tonic-gate 1297c478bd9Sstevel@tonic-gate /* 1307c478bd9Sstevel@tonic-gate * definition of audio volume control structure 1317c478bd9Sstevel@tonic-gate */ 1327c478bd9Sstevel@tonic-gate struct cdrom_volctrl { 1337c478bd9Sstevel@tonic-gate unsigned char channel0; 1347c478bd9Sstevel@tonic-gate unsigned char channel1; 1357c478bd9Sstevel@tonic-gate unsigned char channel2; 1367c478bd9Sstevel@tonic-gate unsigned char channel3; 1377c478bd9Sstevel@tonic-gate }; 1387c478bd9Sstevel@tonic-gate 1397c478bd9Sstevel@tonic-gate struct cdrom_read { 1407c478bd9Sstevel@tonic-gate int cdread_lba; 1417c478bd9Sstevel@tonic-gate caddr_t cdread_bufaddr; 1427c478bd9Sstevel@tonic-gate int cdread_buflen; 1437c478bd9Sstevel@tonic-gate }; 1447c478bd9Sstevel@tonic-gate 1457c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32) 1467c478bd9Sstevel@tonic-gate 1477c478bd9Sstevel@tonic-gate struct cdrom_read32 { 1487c478bd9Sstevel@tonic-gate int cdread_lba; 1497c478bd9Sstevel@tonic-gate caddr32_t cdread_bufaddr; 1507c478bd9Sstevel@tonic-gate int cdread_buflen; 1517c478bd9Sstevel@tonic-gate }; 1527c478bd9Sstevel@tonic-gate 1537c478bd9Sstevel@tonic-gate #define cdrom_read32tocdrom_read(cdrd32, cdrd) \ 1547c478bd9Sstevel@tonic-gate cdrd->cdread_lba = cdrd32->cdread_lba; \ 1557c478bd9Sstevel@tonic-gate cdrd->cdread_bufaddr = (caddr_t)(uintptr_t)cdrd32->cdread_bufaddr; \ 1567c478bd9Sstevel@tonic-gate cdrd->cdread_buflen = cdrd32->cdread_buflen 1577c478bd9Sstevel@tonic-gate 1587c478bd9Sstevel@tonic-gate #define cdrom_readtocdrom_read32(cdrd, cdrd32) \ 1597c478bd9Sstevel@tonic-gate cdrd32->cdread_lba = cdrd->cdread_lba; \ 1607c478bd9Sstevel@tonic-gate cdrd32->cdread_bufaddr = (caddr32_t)(uintptr_t)cdrd->cdread_bufaddr; \ 1617c478bd9Sstevel@tonic-gate cdrd32->cdread_buflen = cdrd->cdread_buflen 1627c478bd9Sstevel@tonic-gate 1637c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */ 1647c478bd9Sstevel@tonic-gate 1657c478bd9Sstevel@tonic-gate /* 1667c478bd9Sstevel@tonic-gate * Definition of CD/DA structure 1677c478bd9Sstevel@tonic-gate */ 1687c478bd9Sstevel@tonic-gate struct cdrom_cdda { 1697c478bd9Sstevel@tonic-gate unsigned int cdda_addr; 1707c478bd9Sstevel@tonic-gate unsigned int cdda_length; 1717c478bd9Sstevel@tonic-gate caddr_t cdda_data; 1727c478bd9Sstevel@tonic-gate unsigned char cdda_subcode; 1737c478bd9Sstevel@tonic-gate }; 1747c478bd9Sstevel@tonic-gate 1757c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32) 1767c478bd9Sstevel@tonic-gate struct cdrom_cdda32 { 1777c478bd9Sstevel@tonic-gate unsigned int cdda_addr; 1787c478bd9Sstevel@tonic-gate unsigned int cdda_length; 1797c478bd9Sstevel@tonic-gate caddr32_t cdda_data; 1807c478bd9Sstevel@tonic-gate unsigned char cdda_subcode; 1817c478bd9Sstevel@tonic-gate }; 1827c478bd9Sstevel@tonic-gate 1837c478bd9Sstevel@tonic-gate #define cdrom_cdda32tocdrom_cdda(cdda32, cdda) \ 1847c478bd9Sstevel@tonic-gate cdda->cdda_addr = cdda32->cdda_addr; \ 1857c478bd9Sstevel@tonic-gate cdda->cdda_length = cdda32->cdda_length; \ 1867c478bd9Sstevel@tonic-gate cdda->cdda_data = (caddr_t)(uintptr_t)cdda32->cdda_data; \ 1877c478bd9Sstevel@tonic-gate cdda->cdda_subcode = cdda32->cdda_subcode 1887c478bd9Sstevel@tonic-gate 1897c478bd9Sstevel@tonic-gate #define cdrom_cddatocdrom_cdda32(cdda, cdda32) \ 1907c478bd9Sstevel@tonic-gate cdda32->cdda_addr = cdda->cdda_addr; \ 1917c478bd9Sstevel@tonic-gate cdda32->cdda_length = cdda->cdda_length; \ 1927c478bd9Sstevel@tonic-gate cdda32->cdda_data = (caddr32_t)(uintptr_t)cdda->cdda_data; \ 1937c478bd9Sstevel@tonic-gate cdda32->cdda_subcode = cdda->cdda_subcode 1947c478bd9Sstevel@tonic-gate 1957c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */ 1967c478bd9Sstevel@tonic-gate 1977c478bd9Sstevel@tonic-gate /* 1987c478bd9Sstevel@tonic-gate * Definitions for cdda_subcode field 1997c478bd9Sstevel@tonic-gate */ 2007c478bd9Sstevel@tonic-gate #define CDROM_DA_NO_SUBCODE 0x00 /* CD/DA data with no subcode */ 2017c478bd9Sstevel@tonic-gate #define CDROM_DA_SUBQ 0x01 /* CD/DA data with sub Q code */ 2027c478bd9Sstevel@tonic-gate #define CDROM_DA_ALL_SUBCODE 0x02 /* CD/DA data with all subcode */ 2037c478bd9Sstevel@tonic-gate #define CDROM_DA_SUBCODE_ONLY 0x03 /* All subcode only */ 2047c478bd9Sstevel@tonic-gate 2057c478bd9Sstevel@tonic-gate /* 2067c478bd9Sstevel@tonic-gate * Definition of CD/XA structure 2077c478bd9Sstevel@tonic-gate */ 2087c478bd9Sstevel@tonic-gate struct cdrom_cdxa { 2097c478bd9Sstevel@tonic-gate unsigned int cdxa_addr; 2107c478bd9Sstevel@tonic-gate unsigned int cdxa_length; 2117c478bd9Sstevel@tonic-gate caddr_t cdxa_data; 2127c478bd9Sstevel@tonic-gate unsigned char cdxa_format; 2137c478bd9Sstevel@tonic-gate }; 2147c478bd9Sstevel@tonic-gate 2157c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32) 2167c478bd9Sstevel@tonic-gate 2177c478bd9Sstevel@tonic-gate struct cdrom_cdxa32 { 2187c478bd9Sstevel@tonic-gate unsigned int cdxa_addr; 2197c478bd9Sstevel@tonic-gate unsigned int cdxa_length; 2207c478bd9Sstevel@tonic-gate caddr32_t cdxa_data; 2217c478bd9Sstevel@tonic-gate unsigned char cdxa_format; 2227c478bd9Sstevel@tonic-gate }; 2237c478bd9Sstevel@tonic-gate 2247c478bd9Sstevel@tonic-gate #define cdrom_cdxa32tocdrom_cdxa(cdxa32, cdxa) \ 2257c478bd9Sstevel@tonic-gate cdxa->cdxa_addr = cdxa32->cdxa_addr; \ 2267c478bd9Sstevel@tonic-gate cdxa->cdxa_length = cdxa32->cdxa_length; \ 2277c478bd9Sstevel@tonic-gate cdxa->cdxa_data = (caddr_t)(uintptr_t)cdxa32->cdxa_data; \ 2287c478bd9Sstevel@tonic-gate cdxa->cdxa_format = cdxa32->cdxa_format 2297c478bd9Sstevel@tonic-gate 2307c478bd9Sstevel@tonic-gate #define cdrom_cdxatocdrom_cdxa32(cdxa, cdxa32) \ 2317c478bd9Sstevel@tonic-gate cdxa32->cdxa_addr = cdxa->cdxa_addr; \ 2327c478bd9Sstevel@tonic-gate cdxa32->cdxa_length = cdxa->cdxa_length; \ 2337c478bd9Sstevel@tonic-gate cdxa32->cdxa_data = (caddr32_t)(uintptr_t)cdxa->cdxa_data; \ 2347c478bd9Sstevel@tonic-gate cdxa32->cdxa_format = cdxa->cdxa_format 2357c478bd9Sstevel@tonic-gate 2367c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */ 2377c478bd9Sstevel@tonic-gate 2387c478bd9Sstevel@tonic-gate /* 2397c478bd9Sstevel@tonic-gate * Definitions for cdxa_format field 2407c478bd9Sstevel@tonic-gate */ 2417c478bd9Sstevel@tonic-gate #define CDROM_XA_DATA 0x00 /* CD/XA data only */ 2427c478bd9Sstevel@tonic-gate #define CDROM_XA_SECTOR_DATA 0x01 /* CD/XA all sector data */ 2437c478bd9Sstevel@tonic-gate #define CDROM_XA_DATA_W_ERROR 0x02 /* CD/XA data with error flags data */ 2447c478bd9Sstevel@tonic-gate 2457c478bd9Sstevel@tonic-gate /* 2467c478bd9Sstevel@tonic-gate * Definition of subcode structure 2477c478bd9Sstevel@tonic-gate */ 2487c478bd9Sstevel@tonic-gate struct cdrom_subcode { 2497c478bd9Sstevel@tonic-gate unsigned int cdsc_length; 2507c478bd9Sstevel@tonic-gate caddr_t cdsc_addr; 2517c478bd9Sstevel@tonic-gate }; 2527c478bd9Sstevel@tonic-gate 2537c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32) 2547c478bd9Sstevel@tonic-gate 2557c478bd9Sstevel@tonic-gate struct cdrom_subcode32 { 2567c478bd9Sstevel@tonic-gate unsigned int cdsc_length; 2577c478bd9Sstevel@tonic-gate caddr32_t cdsc_addr; 2587c478bd9Sstevel@tonic-gate }; 2597c478bd9Sstevel@tonic-gate 2607c478bd9Sstevel@tonic-gate #define cdrom_subcode32tocdrom_subcode(cdsc32, cdsc) \ 2617c478bd9Sstevel@tonic-gate cdsc->cdsc_length = cdsc32->cdsc_length; \ 2627c478bd9Sstevel@tonic-gate cdsc->cdsc_addr = (caddr_t)(uintptr_t)cdsc32->cdsc_addr 2637c478bd9Sstevel@tonic-gate 2647c478bd9Sstevel@tonic-gate #define cdrom_subcodetocdrom_subcode32(cdsc, cdsc32) \ 2657c478bd9Sstevel@tonic-gate cdsc32->cdsc_length = cdsc->cdsc_length; \ 2667c478bd9Sstevel@tonic-gate cdsc32->cdsc_addr = (caddr32_t)(uintptr_t)cdsc->cdsc_addr 2677c478bd9Sstevel@tonic-gate 2687c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */ 2697c478bd9Sstevel@tonic-gate 2707c478bd9Sstevel@tonic-gate /* 2717c478bd9Sstevel@tonic-gate * Definitions for block size supported 2727c478bd9Sstevel@tonic-gate */ 2737c478bd9Sstevel@tonic-gate #define CDROM_BLK_512 512 2747c478bd9Sstevel@tonic-gate #define CDROM_BLK_1024 1024 2757c478bd9Sstevel@tonic-gate #define CDROM_BLK_2048 2048 2767c478bd9Sstevel@tonic-gate #define CDROM_BLK_2056 2056 2777c478bd9Sstevel@tonic-gate #define CDROM_BLK_2324 2324 2787c478bd9Sstevel@tonic-gate #define CDROM_BLK_2336 2336 2797c478bd9Sstevel@tonic-gate #define CDROM_BLK_2340 2340 2807c478bd9Sstevel@tonic-gate #define CDROM_BLK_2352 2352 2817c478bd9Sstevel@tonic-gate #define CDROM_BLK_2368 2368 2827c478bd9Sstevel@tonic-gate #define CDROM_BLK_2448 2448 2837c478bd9Sstevel@tonic-gate #define CDROM_BLK_2646 2646 2847c478bd9Sstevel@tonic-gate #define CDROM_BLK_2647 2647 2857c478bd9Sstevel@tonic-gate #define CDROM_BLK_SUBCODE 96 2867c478bd9Sstevel@tonic-gate 2877c478bd9Sstevel@tonic-gate /* 2887c478bd9Sstevel@tonic-gate * Definitions for drive speed supported 2897c478bd9Sstevel@tonic-gate */ 2907c478bd9Sstevel@tonic-gate #define CDROM_NORMAL_SPEED 0x00 2917c478bd9Sstevel@tonic-gate #define CDROM_DOUBLE_SPEED 0x01 2927c478bd9Sstevel@tonic-gate #define CDROM_QUAD_SPEED 0x03 2937c478bd9Sstevel@tonic-gate #define CDROM_TWELVE_SPEED 0x0C 2947c478bd9Sstevel@tonic-gate #define CDROM_MAXIMUM_SPEED 0xff 2957c478bd9Sstevel@tonic-gate 2967c478bd9Sstevel@tonic-gate /* 2977c478bd9Sstevel@tonic-gate * CDROM io control commands 2987c478bd9Sstevel@tonic-gate */ 2997c478bd9Sstevel@tonic-gate #define CDIOC (0x04 << 8) 3007c478bd9Sstevel@tonic-gate #define CDROMPAUSE (CDIOC|151) /* Pause Audio Operation */ 3017c478bd9Sstevel@tonic-gate #define CDROMRESUME (CDIOC|152) /* Resume paused Audio Operation */ 3027c478bd9Sstevel@tonic-gate #define CDROMPLAYMSF (CDIOC|153) /* Play Audio MSF */ 3037c478bd9Sstevel@tonic-gate #define CDROMPLAYTRKIND (CDIOC|154) /* Play Audio Track/index */ 3047c478bd9Sstevel@tonic-gate #define CDROMREADTOCHDR (CDIOC|155) /* Read TOC header */ 3057c478bd9Sstevel@tonic-gate #define CDROMREADTOCENTRY (CDIOC|156) /* Read a TOC entry */ 3067c478bd9Sstevel@tonic-gate #define CDROMSTOP (CDIOC|157) /* Stop the cdrom drive */ 3077c478bd9Sstevel@tonic-gate #define CDROMSTART (CDIOC|158) /* Start the cdrom drive */ 3087c478bd9Sstevel@tonic-gate #define CDROMEJECT (CDIOC|159) /* Ejects the cdrom caddy */ 3097c478bd9Sstevel@tonic-gate #define CDROMVOLCTRL (CDIOC|160) /* control output volume */ 3107c478bd9Sstevel@tonic-gate #define CDROMSUBCHNL (CDIOC|161) /* read the subchannel data */ 3117c478bd9Sstevel@tonic-gate #define CDROMREADMODE2 (CDIOC|162) /* read CDROM mode 2 data */ 3127c478bd9Sstevel@tonic-gate #define CDROMREADMODE1 (CDIOC|163) /* read CDROM mode 1 data */ 3137c478bd9Sstevel@tonic-gate 3147c478bd9Sstevel@tonic-gate #define CDROMREADOFFSET (CDIOC|164) /* read multi-session offset */ 3157c478bd9Sstevel@tonic-gate 3167c478bd9Sstevel@tonic-gate #define CDROMGBLKMODE (CDIOC|165) /* get current block mode */ 3177c478bd9Sstevel@tonic-gate #define CDROMSBLKMODE (CDIOC|166) /* set current block mode */ 3187c478bd9Sstevel@tonic-gate #define CDROMCDDA (CDIOC|167) /* read CD/DA data */ 3197c478bd9Sstevel@tonic-gate #define CDROMCDXA (CDIOC|168) /* read CD/XA data */ 3207c478bd9Sstevel@tonic-gate #define CDROMSUBCODE (CDIOC|169) /* read subcode */ 3217c478bd9Sstevel@tonic-gate #define CDROMGDRVSPEED (CDIOC|170) /* get current drive speed */ 3227c478bd9Sstevel@tonic-gate #define CDROMSDRVSPEED (CDIOC|171) /* set current drive speed */ 3237c478bd9Sstevel@tonic-gate 3247c478bd9Sstevel@tonic-gate #define CDROMCLOSETRAY (CDIOC|172) /* close cd tray,load media */ 3257c478bd9Sstevel@tonic-gate 3267c478bd9Sstevel@tonic-gate /* 3277c478bd9Sstevel@tonic-gate * Additional commands for CD-ROM 3287c478bd9Sstevel@tonic-gate */ 3297c478bd9Sstevel@tonic-gate /* 3307c478bd9Sstevel@tonic-gate * 3317c478bd9Sstevel@tonic-gate * Group 2 Commands 3327c478bd9Sstevel@tonic-gate * 3337c478bd9Sstevel@tonic-gate */ 334*30a83a24Scth #define SCMD_READ_SUBCHANNEL 0x42 /* optional SCSI command */ 3357c478bd9Sstevel@tonic-gate #define SCMD_READ_TOC 0x43 /* optional SCSI command */ 336*30a83a24Scth #define SCMD_READ_HEADER 0x44 /* optional SCSI command */ 337*30a83a24Scth #define SCMD_PLAYAUDIO10 0x45 /* optional SCSI command */ 3387c478bd9Sstevel@tonic-gate #define SCMD_PLAYAUDIO_MSF 0x47 /* optional SCSI command */ 3397c478bd9Sstevel@tonic-gate #define SCMD_PLAYAUDIO_TI 0x48 /* optional SCSI command */ 3407c478bd9Sstevel@tonic-gate #define SCMD_PLAYTRACK_REL10 0x49 /* optional SCSI command */ 341*30a83a24Scth #define SCMD_PAUSE_RESUME 0x4B /* optional SCSI command */ 3427c478bd9Sstevel@tonic-gate 3437c478bd9Sstevel@tonic-gate /* 3447c478bd9Sstevel@tonic-gate * 3457c478bd9Sstevel@tonic-gate * Group 5 Commands 3467c478bd9Sstevel@tonic-gate * 3477c478bd9Sstevel@tonic-gate */ 3487c478bd9Sstevel@tonic-gate #define SCMD_PLAYAUDIO12 0xA5 /* optional SCSI command */ 3497c478bd9Sstevel@tonic-gate #define SCMD_PLAYTRACK_REL12 0xA9 /* optional SCSI command */ 350*30a83a24Scth #define SCMD_SET_CDROM_SPEED 0xBB /* optional SCSI command */ 3517c478bd9Sstevel@tonic-gate #define SCMD_READ_CD 0xBE /* Universal way of accessing CD data */ 3527c478bd9Sstevel@tonic-gate 3537c478bd9Sstevel@tonic-gate /* 3547c478bd9Sstevel@tonic-gate * These defines are for SCMD_READ_CD command. 3557c478bd9Sstevel@tonic-gate * See Expected Sector Type Field Definition (SCSI MMC-2 Spec section 6.1.15) 3567c478bd9Sstevel@tonic-gate * This information is used to figure out which block size to use. 3577c478bd9Sstevel@tonic-gate */ 3587c478bd9Sstevel@tonic-gate #define READ_CD_EST_ALLTYPE 0x0 /* All Types */ 3597c478bd9Sstevel@tonic-gate #define READ_CD_EST_CDDA 0x1 /* Only CD-DA */ 3607c478bd9Sstevel@tonic-gate #define READ_CD_EST_MODE1 0x2 /* Only Yellow Book 2048 bytes */ 3617c478bd9Sstevel@tonic-gate #define READ_CD_EST_MODE2 0x3 /* Only Yellow Book 2336 byte sectors */ 3627c478bd9Sstevel@tonic-gate #define READ_CD_EST_MODE2FORM1 0x4 /* Only sectors with 2048 bytes */ 3637c478bd9Sstevel@tonic-gate #define READ_CD_EST_MODE2FORM2 0x5 /* Only sectors with 2324 bytes */ 3647c478bd9Sstevel@tonic-gate #define READ_CD_EST_RSVD1 0x6 /* reserved */ 3657c478bd9Sstevel@tonic-gate #define READ_CD_EST_RSVD2 0x7 /* reserved */ 3667c478bd9Sstevel@tonic-gate 3677c478bd9Sstevel@tonic-gate 3687c478bd9Sstevel@tonic-gate /* 3697c478bd9Sstevel@tonic-gate * 3707c478bd9Sstevel@tonic-gate * Group 6 Commands 3717c478bd9Sstevel@tonic-gate * 3727c478bd9Sstevel@tonic-gate */ 3737c478bd9Sstevel@tonic-gate #define SCMD_CD_PLAYBACK_CONTROL 0xC9 /* SONY unique SCSI command */ 3747c478bd9Sstevel@tonic-gate #define SCMD_CD_PLAYBACK_STATUS 0xC4 /* SONY unique SCSI command */ 3757c478bd9Sstevel@tonic-gate #define SCMD_READ_CDDA 0xD8 /* Vendor unique SCSI command */ 3767c478bd9Sstevel@tonic-gate #define SCMD_READ_CDXA 0xDB /* Vendor unique SCSI command */ 3777c478bd9Sstevel@tonic-gate #define SCMD_READ_ALL_SUBCODES 0xDF /* Vendor unique SCSI command */ 3787c478bd9Sstevel@tonic-gate 3797c478bd9Sstevel@tonic-gate #define CDROM_MODE2_SIZE 2336 3807c478bd9Sstevel@tonic-gate 381*30a83a24Scth /* 382*30a83a24Scth * scsi_key_strings for CDROM cdio SCMD_ definitions 383*30a83a24Scth */ 384*30a83a24Scth #define SCSI_CMDS_KEY_STRINGS_CDIO \ 385*30a83a24Scth /* 0x42 */ SCMD_READ_SUBCHANNEL, "read_subchannel", \ 386*30a83a24Scth /* 0x43 */ SCMD_READ_TOC, "read_toc", \ 387*30a83a24Scth /* 0x44 */ SCMD_REPORT_DENSITIES | \ 388*30a83a24Scth SCMD_READ_HEADER, "report_densities/read_header", \ 389*30a83a24Scth /* 0x45 */ SCMD_PLAYAUDIO10, "playaudio", \ 390*30a83a24Scth /* 0x46 */ SCMD_GET_CONFIGURATION, "get_configuration", \ 391*30a83a24Scth /* 0x47 */ SCMD_PLAYAUDIO_MSF, "playaudio_msf", \ 392*30a83a24Scth /* 0x48 */ SCMD_PLAYAUDIO_TI, "playaudio_ti", \ 393*30a83a24Scth /* 0x49 */ SCMD_PLAYTRACK_REL10, "playaudio_rel", \ 394*30a83a24Scth /* 0x4b */ SCMD_PAUSE_RESUME, "pause_resume", \ 395*30a83a24Scth \ 396*30a83a24Scth /* 0xa5 */ SCMD_PLAYAUDIO12, "playaudio(12)", \ 397*30a83a24Scth /* 0xa9 */ SCMD_PLAYTRACK_REL12, "playtrack_rel", \ 398*30a83a24Scth /* 0xbb */ SCMD_SET_CDROM_SPEED, "set_cd_speed", \ 399*30a83a24Scth /* 0xbe */ SCMD_READ_CD, "read_cd", \ 400*30a83a24Scth \ 401*30a83a24Scth /* 0xc4 */ SCMD_CD_PLAYBACK_STATUS, "cd_playback_status", \ 402*30a83a24Scth /* 0xc9 */ SCMD_CD_PLAYBACK_CONTROL, "cd_playback_control", \ 403*30a83a24Scth /* 0xd8 */ SCMD_READ_CDDA, "read_cdda", \ 404*30a83a24Scth /* 0xdb */ SCMD_READ_CDXA, "read_cdxa", \ 405*30a83a24Scth /* 0xdf */ SCMD_READ_ALL_SUBCODES, "read_all_subcodes" 406*30a83a24Scth 4077c478bd9Sstevel@tonic-gate #ifdef __cplusplus 4087c478bd9Sstevel@tonic-gate } 4097c478bd9Sstevel@tonic-gate #endif 4107c478bd9Sstevel@tonic-gate 4117c478bd9Sstevel@tonic-gate #endif /* _SYS_CDIO_H */ 412