00001 /* 00002 $Id: dvd_8h-source.html,v 1.10 2006/10/27 11:16:41 rocky Exp $ 00003 00004 Copyright (C) 2004 Rocky Bernstein <rocky@panix.com> 00005 Modeled after GNU/Linux definitions in linux/cdrom.h 00006 00007 This program is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 */ 00021 00027 #ifndef __CDIO_DVD_H__ 00028 #define __CDIO_DVD_H__ 00029 00030 #include <cdio/types.h> 00031 00034 #define CDIO_DVD_STRUCT_PHYSICAL 0x00 00035 #define CDIO_DVD_STRUCT_COPYRIGHT 0x01 00036 #define CDIO_DVD_STRUCT_DISCKEY 0x02 00037 #define CDIO_DVD_STRUCT_BCA 0x03 00038 #define CDIO_DVD_STRUCT_MANUFACT 0x04 00039 00041 #define CDIO_DVD_BOOK_DVD_ROM 0 00042 #define CDIO_DVD_BOOK_DVD_RAM 1 00043 #define CDIO_DVD_BOOK_DVD_R 2 00044 #define CDIO_DVD_BOOK_DVD_RW 3 00045 #define CDIO_DVD_BOOK_DVD_PR 8 00046 #define CDIO_DVD_BOOK_DVD_PRW 9 00048 typedef struct cdio_dvd_layer { 00049 uint8_t book_version : 4; 00050 uint8_t book_type : 4; 00051 uint8_t min_rate : 4; 00052 uint8_t disc_size : 4; 00053 uint8_t layer_type : 4; 00054 uint8_t track_path : 1; 00055 uint8_t nlayers : 2; 00056 uint8_t track_density : 4; 00057 uint8_t linear_density: 4; 00058 uint8_t bca : 1; 00059 uint32_t start_sector; 00060 uint32_t end_sector; 00061 uint32_t end_sector_l0; 00062 } cdio_dvd_layer_t; 00063 00065 #define CDIO_DVD_MAX_LAYERS 4 00066 00067 typedef struct cdio_dvd_physical { 00068 uint8_t type; 00069 uint8_t layer_num; 00070 cdio_dvd_layer_t layer[CDIO_DVD_MAX_LAYERS]; 00071 } cdio_dvd_physical_t; 00072 00073 typedef struct cdio_dvd_copyright { 00074 uint8_t type; 00075 00076 uint8_t layer_num; 00077 uint8_t cpst; 00078 uint8_t rmi; 00079 } cdio_dvd_copyright_t; 00080 00081 typedef struct cdio_dvd_disckey { 00082 uint8_t type; 00083 00084 unsigned agid : 2; 00085 uint8_t value[2048]; 00086 } cdio_dvd_disckey_t; 00087 00088 typedef struct cdio_dvd_bca { 00089 uint8_t type; 00090 00091 int len; 00092 uint8_t value[188]; 00093 } cdio_dvd_bca_t; 00094 00095 typedef struct cdio_dvd_manufact { 00096 uint8_t type; 00097 00098 uint8_t layer_num; 00099 int len; 00100 uint8_t value[2048]; 00101 } cdio_dvd_manufact_t; 00102 00103 typedef union { 00104 uint8_t type; 00105 00106 cdio_dvd_physical_t physical; 00107 cdio_dvd_copyright_t copyright; 00108 cdio_dvd_disckey_t disckey; 00109 cdio_dvd_bca_t bca; 00110 cdio_dvd_manufact_t manufact; 00111 } cdio_dvd_struct_t; 00112 00113 #endif /* __SCSI_MMC_H__ */