Import Upstream version 0.7.0
Dominique Dumont
6 years ago
0 | pkgconfigdir=$(libdir)/pkgconfig | |
0 | ||
1 | # ts A90315 : LIBBURNIA_PKGCONFDIR is defined OS specific in acinclude.m4 | |
2 | # was: pkgconfigdir=$(libdir)/pkgconfig | |
3 | pkgconfigdir=$(LIBBURNIA_PKGCONFDIR) | |
4 | ||
1 | 5 | libincludedir=$(includedir)/libburn |
2 | 6 | |
3 | 7 | lib_LTLIBRARIES = libburn/libburn.la |
102 | 106 | test_structest_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS) |
103 | 107 | test_structest_SOURCES = test/structest.c |
104 | 108 | |
105 | ## cdrskin construction site - ts A60816 - A90313 | |
109 | ## cdrskin construction site - ts A60816 - A90507 | |
106 | 110 | cdrskin_cdrskin_CPPFLAGS = -Ilibburn |
107 | cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_0_6_4 | |
111 | cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_0_7_0 | |
108 | 112 | |
109 | 113 | # cdrskin_cdrskin_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS) |
110 | 114 | # ts A80123, change proposed by Simon Huggins to cause dynamic libburn linking |
204 | 204 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ |
205 | 205 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ |
206 | 206 | LDFLAGS = @LDFLAGS@ |
207 | LIBBURNIA_PKGCONFDIR = @LIBBURNIA_PKGCONFDIR@ | |
207 | 208 | LIBBURN_ARCH_LIBS = @LIBBURN_ARCH_LIBS@ |
208 | 209 | LIBOBJS = @LIBOBJS@ |
209 | 210 | LIBS = @LIBS@ |
285 | 286 | target_cpu = @target_cpu@ |
286 | 287 | target_os = @target_os@ |
287 | 288 | target_vendor = @target_vendor@ |
288 | pkgconfigdir = $(libdir)/pkgconfig | |
289 | ||
290 | # ts A90315 : LIBBURNIA_PKGCONFDIR is defined OS specific in acinclude.m4 | |
291 | # was: pkgconfigdir=$(libdir)/pkgconfig | |
292 | pkgconfigdir = $(LIBBURNIA_PKGCONFDIR) | |
289 | 293 | libincludedir = $(includedir)/libburn |
290 | 294 | lib_LTLIBRARIES = libburn/libburn.la |
291 | 295 | |
371 | 375 | test_structest_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS) |
372 | 376 | test_structest_SOURCES = test/structest.c |
373 | 377 | cdrskin_cdrskin_CPPFLAGS = -Ilibburn |
374 | cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_0_6_4 | |
378 | cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_0_7_0 | |
375 | 379 | |
376 | 380 | # cdrskin_cdrskin_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS) |
377 | 381 | # ts A80123, change proposed by Simon Huggins to cause dynamic libburn linking |
10 | 10 | and Ben Jansens <xor@orodu.net> |
11 | 11 | Copyright (C) 2002-2006 Derek Foreman and Ben Jansens |
12 | 12 | |
13 | http://files.libburnia-project.org/releases/libburn-0.6.4.pl00.tar.gz | |
13 | http://files.libburnia-project.org/releases/libburn-0.7.0.pl00.tar.gz | |
14 | 14 | |
15 | 15 | ------------------------------------------------------------------------------ |
16 | 16 | |
18 | 18 | |
19 | 19 | From tarball |
20 | 20 | |
21 | Obtain libburn-0.6.4.pl00.tar.gz, take it to a directory of your choice and do: | |
22 | ||
23 | tar xzf libburn-0.6.4.pl00.tar.gz | |
24 | cd libburn-0.6.4 | |
21 | Obtain libburn-0.7.0.pl00.tar.gz, take it to a directory of your choice and do: | |
22 | ||
23 | tar xzf libburn-0.7.0.pl00.tar.gz | |
24 | cd libburn-0.7.0 | |
25 | 25 | ./configure --prefix=/usr |
26 | 26 | make |
27 | 27 | |
46 | 46 | snapshot you will need autotools of at least version 1.7. |
47 | 47 | Do in a directory of your choice: |
48 | 48 | |
49 | svn co http://svn.libburnia-project.org/libburn/trunk libburn-0.6.3 | |
50 | cd libburn-0.6.3 | |
49 | svn co http://svn.libburnia-project.org/libburn/trunk libburn-svn | |
50 | cd libburn-svn | |
51 | 51 | ./bootstrap |
52 | 52 | ./configure --prefix=/usr |
53 | 53 | make |
387 | 387 | operations on "stdio:" pseudo drives. Nevertheless this allowed to lift the |
388 | 388 | ban to build libburn on operating systems other than Linux and FreeBSD. |
389 | 389 | |
390 | - 16 Mar 2009 libisoburn-0.3.6: xorriso uses RRIP version 1.10 as default | |
391 | in order to be mountable where mkisofs images are mountable. | |
392 | ||
393 | - 17 Apr 2009 libisofs-0.6.18 introduces content filtering of data files. | |
394 | Built-in filters allow compression to formats gzip and zisofs. External | |
395 | filter processes allow arbitrary data conversions like encryption. | |
396 | ||
397 | - 19 Apr 2009 libisoburn-0.3.8 makes use of the new libisofs capability to | |
398 | perform content filtering of data files. | |
399 | ||
400 | - 08 May 2009 libburn-0.6.6 fixes a bug with aborting on broken output pipe | |
401 | and a bug with device scan on FreeBSD. | |
402 | ||
403 | - 31 May 2009 libisofs-0.6.20 can record hard link relations in ISO images | |
404 | and offers support with restoring them to disk. Current Linux kernels will | |
405 | mount images with such hard links but will attribute a unique inode number | |
406 | to each file. | |
407 | ||
408 | - 28 Jun 2009 libisoburn-0.4.0: xorriso can record and restore hard link | |
409 | relations of files. Performance of data reading has been improved. Option | |
410 | -find now supports logical operators with its tests. | |
411 | ||
412 | - 14 Jul 2009 libburn-0.6.8 fixes bugs and shortcommings with old MMC-1 drives | |
413 | and with large SCSI bus numbers as handed out by Linux for USB drives. | |
414 | ||
415 | - 20 Jul 2009 libisoburn-0.4.0.pl01 fixes a regression in xorriso which caused | |
416 | data loss in older sessions if xorriso was used underneath growisofs. | |
417 | Affected are releases since libisoburn-0.3.2 in january 2009. | |
418 | ||
419 | - 25 Aug 2009 libisofs-0.6.22 can record MD5 checksums for the whole session | |
420 | and for each single data file. Checksum tags allow to verify superblock and | |
421 | directory tree before importing them. | |
422 | ||
423 | - 27 Aug 2009 libburn-0.7.0 allows to calm down a drive and to inquire its | |
424 | supported profiles. It works around some pitfalls with U3 enhanced memory | |
425 | sticks which emulate a CD-ROM. | |
426 | ||
390 | 427 | |
391 | 428 | ------------------------------------------------------------------------------ |
392 | 429 |
0 | 0 | AC_DEFUN([TARGET_SHIZZLE], |
1 | 1 | [ |
2 | 2 | ARCH="" |
3 | LIBBURNIA_PKGCONFDIR="$libdir"/pkgconfig | |
3 | 4 | |
4 | 5 | AC_MSG_CHECKING([target operating system]) |
5 | 6 | |
7 | ||
6 | 8 | case $target in |
7 | 9 | *-*-linux*) |
8 | 10 | ARCH=linux |
11 | 13 | *-*-freebsd*) |
12 | 14 | ARCH=freebsd |
13 | 15 | LIBBURN_ARCH_LIBS=-lcam |
16 | LIBBURNIA_PKGCONFDIR=$(echo "$libdir" | sed 's/\/lib$/\/libdata/')/pkgconfig | |
14 | 17 | ;; |
15 | 18 | *) |
16 | 19 | ARCH= |
21 | 24 | |
22 | 25 | AC_MSG_RESULT([$ARCH]) |
23 | 26 | ]) |
27 | ||
28 | ||
29 | dnl LIBBURNIA_SET_PKGCONFIG determines the install directory for the *.pc file. | |
30 | dnl Important: Must be performed _after_ TARGET_SHIZZLE | |
31 | dnl | |
32 | AC_DEFUN([LIBBURNIA_SET_PKGCONFIG], | |
33 | [ | |
34 | ### for testing --enable-libdir-pkgconfig on Linux | |
35 | ### LIBBURNIA_PKGCONFDIR="$libdir"data/pkgconfig | |
36 | ||
37 | if test "x$LIBBURNIA_PKGCONFDIR" = "x$libdir"/pkgconfig | |
38 | then | |
39 | dummy=dummy | |
40 | else | |
41 | AC_ARG_ENABLE(libdir-pkgconfig, | |
42 | [ --enable-libdir-pkgconfig Install to $libdir/pkgconfig on any OS, default=no], | |
43 | , enable_libdir_pkgconfig="no") | |
44 | AC_MSG_CHECKING([for --enable-libdir-pkgconfig]) | |
45 | if test "x$enable_libdir_pkgconfig" = xyes | |
46 | then | |
47 | LIBBURNIA_PKGCONFDIR="$libdir"/pkgconfig | |
48 | fi | |
49 | AC_MSG_RESULT([$enable_libdir_pkgconfig]) | |
50 | fi | |
51 | ||
52 | libburnia_pkgconfig_override="no" | |
53 | AC_ARG_ENABLE(pkgconfig-path, | |
54 | [ --enable-pkgconfig-path=DIR Absolute path of directory for libisofs-*.pc], | |
55 | libburnia_pkgconfig_override="yes" , enable_pkgconfig_path="none") | |
56 | AC_MSG_CHECKING([for overridden pkgconfig directory path]) | |
57 | if test "x$enable_pkgconfig_path" = xno | |
58 | then | |
59 | libburnia_pkgconfig_override="no" | |
60 | fi | |
61 | if test "x$enable_pkgconfig_path" = x -o "x$enable_pkgconfig_path" = xyes | |
62 | then | |
63 | libburnia_pkgconfig_override="invalid argument" | |
64 | fi | |
65 | if test "x$libburnia_pkgconfig_override" = xyes | |
66 | then | |
67 | LIBBURNIA_PKGCONFDIR="$enable_pkgconfig_path" | |
68 | AC_MSG_RESULT([$LIBBURNIA_PKGCONFDIR]) | |
69 | else | |
70 | AC_MSG_RESULT([$libburnia_pkgconfig_override]) | |
71 | fi | |
72 | AC_SUBST(LIBBURNIA_PKGCONFDIR) | |
73 | ||
74 | dnl For debugging only | |
75 | ### AC_MSG_RESULT([LIBBURNIA_PKGCONFDIR = $LIBBURNIA_PKGCONFDIR]) | |
76 | ||
77 | ]) | |
78 |
3 | 3 | cdrskin. By Thomas Schmitt <scdbackup@gmx.net> |
4 | 4 | Integrated sub project of libburnia-project.org but also published via: |
5 | 5 | http://scdbackup.sourceforge.net/cdrskin_eng.html |
6 | http://scdbackup.sourceforge.net/cdrskin-0.6.4.pl00.tar.gz | |
6 | http://scdbackup.sourceforge.net/cdrskin-0.7.0.pl00.tar.gz | |
7 | ||
7 | 8 | Copyright (C) 2006-2009 Thomas Schmitt, provided under GPL version 2. |
8 | 9 | ------------------------------------------------------------------------------ |
9 | 10 | |
13 | 14 | |
14 | 15 | Currently it is supported on Linux with kernels >= 2.4 and on FreeBSD versions |
15 | 16 | with ATAPI/CAM support enabled in the kernel, see atapicam(4). |
16 | On other X/Open compliant systems there will only be pseudo drives, but no | |
17 | On other X/Open compliant systems there will only be emulated drives, but no | |
17 | 18 | direct MMC operation on real CD/DVD/BD drives. |
18 | 19 | |
19 | 20 | By using this software you agree to the disclaimer at the end of this text |
22 | 23 | |
23 | 24 | Compilation, First Glimpse, Installation |
24 | 25 | |
25 | Obtain cdrskin-0.6.4.pl00.tar.gz, take it to a directory of your choice and do: | |
26 | ||
27 | tar xzf cdrskin-0.6.4.pl00.tar.gz | |
28 | cd cdrskin-0.6.4 | |
26 | Obtain cdrskin-0.7.0.pl00.tar.gz, take it to a directory of your choice and do: | |
27 | ||
28 | tar xzf cdrskin-0.7.0.pl00.tar.gz | |
29 | cd cdrskin-0.7.0 | |
29 | 30 | |
30 | 31 | Within that directory execute: |
31 | 32 |
1 | 1 | .\" First parameter, NAME, should be all caps |
2 | 2 | .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection |
3 | 3 | .\" other parameters are allowed: see man(7), man(1) |
4 | .TH CDRSKIN 1 "Jan 07, 2009" | |
4 | .TH CDRSKIN 1 "May 07, 2009" | |
5 | 5 | .\" Please adjust this date whenever revising the manpage. |
6 | 6 | .\" |
7 | 7 | .\" Some roff macros, for reference: |
66 | 66 | .br |
67 | 67 | Recordable CD Media |
68 | 68 | .br |
69 | Sequentially Recordable DVD Media | |
69 | Sequentially Recordable DVD or BD Media | |
70 | 70 | .br |
71 | 71 | Overwriteable DVD or BD Media |
72 | 72 | .br |
253 | 253 | .SS |
254 | 254 | .B Drive preparation and addressing: |
255 | 255 | .br |
256 | The drives, either CD burners or DVD burners, are accessed via addresses which | |
256 | The drives, CD, DVD, or BD burners, are accessed via addresses which | |
257 | 257 | are specific to libburn and the operating system. Those addresses get listed |
258 | 258 | by a run of \fBcdrskin --devices\fP. |
259 | 259 | .br |
637 | 637 | accompanied by option --grow_overwriteable_iso. |
638 | 638 | .TP |
639 | 639 | .BI \-multi |
640 | This option keeps the CD or unformatted DVD-R[W] appendable after the current | |
641 | session has been written. | |
640 | This option keeps CD, unformatted DVD-R[W], DVD+R, or BD-R appendable | |
641 | after the current session has been written. | |
642 | 642 | Without it the disc gets closed and may not be written any more - unless it |
643 | 643 | is a -RW and gets blanked which causes loss of its content. |
644 | 644 | .br |
686 | 686 | One should use it only if inavoidable. |
687 | 687 | .TP |
688 | 688 | .BI \-sao |
689 | Write CD in Session At Once mode, a sequential DVD-R[W] in Disc-at-once | |
690 | (DAO) mode, or a DVD+R[/DL]. | |
689 | Write CD in Session At Once mode or sequential DVD-R[W] in Disc-at-once | |
690 | (DAO) mode. | |
691 | 691 | .br |
692 | 692 | With CD this mode is able to put several audio tracks on media without |
693 | 693 | producing audible gaps between them. |
695 | 695 | With DVD-R[W] this mode can only write a single track. |
696 | 696 | No -multi is allowed with DVD-R[W] -sao. |
697 | 697 | .br |
698 | -sao is permissible with overwriteable DVD, BD or DVD+R[/DL] but actually | |
698 | -sao is permissible with overwriteable DVD, or DVD+R[/DL], or BD but actually | |
699 | 699 | only imposes restrictions without providing known advantages. |
700 | 700 | .br |
701 | 701 | -sao can only be used for tracks of fixely predicted size. This implies that |
1238 | 1238 | .br |
1239 | 1239 | blank=as_needed padsize=300k - |
1240 | 1240 | .SS |
1241 | .B Write multi-session to the same CD, DVD-R[W] or DVD+R[/DL]: | |
1242 | .br | |
1243 | cdrskin dev=/dev/hdc -v padsize=300k -multi 1.iso | |
1244 | .br | |
1245 | cdrskin dev=/dev/hdc -v padsize=300k -multi 2.iso | |
1246 | .br | |
1247 | cdrskin dev=/dev/hdc -v padsize=300k -multi 3.iso | |
1248 | .br | |
1249 | cdrskin dev=/dev/hdc -v padsize=300k 4.iso | |
1241 | .B Write multi-session to the same CD, DVD-R[W], DVD+R[/DL], or BD-R: | |
1242 | .br | |
1243 | cdrskin dev=/dev/sr0 -v padsize=300k -multi 1.iso | |
1244 | .br | |
1245 | cdrskin dev=/dev/sr0 -v padsize=300k -multi 2.iso | |
1246 | .br | |
1247 | cdrskin dev=/dev/sr0 -v padsize=300k -multi 3.iso | |
1248 | .br | |
1249 | cdrskin dev=/dev/sr0 -v padsize=300k 4.iso | |
1250 | 1250 | .SS |
1251 | 1251 | .B Get multi-session info for option -C of program mkisofs: |
1252 | 1252 | .br |
87 | 87 | |
88 | 88 | /** The official program version */ |
89 | 89 | #ifndef Cdrskin_prog_versioN |
90 | #define Cdrskin_prog_versioN "0.6.4" | |
90 | #define Cdrskin_prog_versioN "0.7.0" | |
91 | 91 | #endif |
92 | 92 | |
93 | 93 | /** The official libburn interface revision to use. |
97 | 97 | #define Cdrskin_libburn_majoR 0 |
98 | 98 | #endif |
99 | 99 | #ifndef Cdrskin_libburn_minoR |
100 | #define Cdrskin_libburn_minoR 6 | |
100 | #define Cdrskin_libburn_minoR 7 | |
101 | 101 | #endif |
102 | 102 | #ifndef Cdrskin_libburn_micrO |
103 | #define Cdrskin_libburn_micrO 4 | |
103 | #define Cdrskin_libburn_micrO 0 | |
104 | 104 | #endif |
105 | 105 | |
106 | 106 | |
134 | 134 | #endif /* Cdrskin_libburn_cvs_A60220_tS */ |
135 | 135 | |
136 | 136 | |
137 | #ifdef Cdrskin_libburn_0_6_4 | |
138 | #define Cdrskin_libburn_versioN "0.6.4" | |
137 | #ifdef Cdrskin_libburn_0_7_0 | |
138 | #define Cdrskin_libburn_versioN "0.7.0" | |
139 | 139 | #define Cdrskin_libburn_from_pykix_svN 1 |
140 | #endif /* Cdrskin_libburn_0_6_4 */ | |
141 | ||
142 | #ifdef Cdrskin_libburn_0_6_5 | |
143 | #define Cdrskin_libburn_versioN "0.6.5" | |
140 | #endif /* Cdrskin_libburn_0_7_0 */ | |
141 | ||
142 | #ifdef Cdrskin_libburn_0_7_1 | |
143 | #define Cdrskin_libburn_versioN "0.7.1" | |
144 | 144 | #define Cdrskin_libburn_from_pykix_svN 1 |
145 | 145 | |
146 | 146 | /* Place novelty switch macros here. |
147 | 147 | Move them down to Cdrskin_libburn_from_pykix_svN on version leap |
148 | 148 | */ |
149 | 149 | |
150 | /* there are no libburn novelties in 0.6.5 yet */ | |
151 | ||
152 | #endif /* Cdrskin_libburn_0_6_5 */ | |
150 | ||
151 | #endif /* Cdrskin_libburn_0_7_1 */ | |
153 | 152 | |
154 | 153 | #ifndef Cdrskin_libburn_versioN |
155 | #define Cdrskin_libburn_0_6_4 | |
156 | #define Cdrskin_libburn_versioN "0.6.4" | |
154 | #define Cdrskin_libburn_0_7_0 | |
155 | #define Cdrskin_libburn_versioN "0.7.0" | |
157 | 156 | #define Cdrskin_libburn_from_pykix_svN 1 |
158 | 157 | #endif |
159 | 158 | |
160 | #ifdef Cdrskin_libburn_0_6_4 | |
159 | #ifdef Cdrskin_libburn_0_7_0 | |
161 | 160 | #undef Cdrskin_libburn_majoR |
162 | 161 | #undef Cdrskin_libburn_minoR |
163 | 162 | #undef Cdrskin_libburn_micrO |
164 | 163 | #define Cdrskin_libburn_majoR 0 |
165 | #define Cdrskin_libburn_minoR 6 | |
166 | #define Cdrskin_libburn_micrO 4 | |
167 | #endif | |
168 | #ifdef Cdrskin_libburn_0_6_5 | |
164 | #define Cdrskin_libburn_minoR 7 | |
165 | #define Cdrskin_libburn_micrO 0 | |
166 | #endif | |
167 | #ifdef Cdrskin_libburn_0_7_1 | |
169 | 168 | #undef Cdrskin_libburn_majoR |
170 | 169 | #undef Cdrskin_libburn_minoR |
171 | 170 | #undef Cdrskin_libburn_micrO |
172 | 171 | #define Cdrskin_libburn_majoR 0 |
173 | #define Cdrskin_libburn_minoR 6 | |
174 | #define Cdrskin_libburn_micrO 5 | |
172 | #define Cdrskin_libburn_minoR 7 | |
173 | #define Cdrskin_libburn_micrO 1 | |
175 | 174 | #endif |
176 | 175 | |
177 | 176 | |
4407 | 4406 | int Cdrskin_scanbus(struct CdrskiN *skin, int flag) |
4408 | 4407 | { |
4409 | 4408 | int ret,i,busno,first_on_bus,pseudo_transport_group= 0,skipped_devices= 0; |
4410 | int busmax= 16; | |
4409 | int busmax= 16, busidx; | |
4411 | 4410 | char shellsafe[5*Cdrskin_strleN+2],perms[40],btldev[Cdrskin_adrleN]; |
4412 | 4411 | char adr[Cdrskin_adrleN],*raw_dev,*drives_shown= NULL; |
4412 | int *drives_busses= NULL; | |
4413 | 4413 | struct stat stbuf; |
4414 | 4414 | |
4415 | 4415 | drives_shown= malloc(skin->n_drives+1); |
4416 | if(drives_shown==NULL) | |
4416 | drives_busses= malloc((skin->n_drives+1) * sizeof(int)); | |
4417 | if(drives_shown == NULL || drives_busses == NULL) | |
4417 | 4418 | {ret= -1; goto ex;} |
4418 | 4419 | for(i=0;i<skin->n_drives;i++) |
4419 | 4420 | drives_shown[i]= 0; |
4471 | 4472 | if(skin->preskin->old_pseudo_scsi_adr) |
4472 | 4473 | printf("cdrskin: NOTE : The printed addresses are not cdrecord compatible !\n"); |
4473 | 4474 | |
4474 | for(busno= 0;busno<=busmax;busno++) { | |
4475 | for(i=0;i<skin->n_drives;i++) { | |
4476 | drives_busses[i]= -1; | |
4477 | ret= Cdrskin_driveno_to_btldev(skin,i,btldev,1); | |
4478 | if(ret >= pseudo_transport_group && | |
4479 | ret < pseudo_transport_group + 1000000) { | |
4480 | drives_busses[i]= ret - pseudo_transport_group; | |
4481 | if(ret > pseudo_transport_group + busmax) | |
4482 | busmax= 1 + ret - pseudo_transport_group; | |
4483 | } | |
4484 | } | |
4485 | for(busidx= 0; busidx < skin->n_drives + 1; busidx++) { | |
4486 | if(busidx < skin->n_drives) | |
4487 | busno= drives_busses[busidx]; | |
4488 | else | |
4489 | busno= busmax; | |
4490 | if(busno < 0) | |
4491 | continue; | |
4492 | for(i= 0; i < busidx; i++) | |
4493 | if(drives_busses[i] == busno) | |
4494 | break; | |
4495 | if(i < busidx) | |
4496 | continue; | |
4475 | 4497 | first_on_bus= 1; |
4476 | 4498 | for(i=0;i<skin->n_drives;i++) { |
4477 | 4499 | ret= Cdrskin_driveno_to_btldev(skin,i,btldev,1); |
4509 | 4531 | ex:; |
4510 | 4532 | if(drives_shown!=NULL) |
4511 | 4533 | free((char *) drives_shown); |
4534 | if(drives_busses!=NULL) | |
4535 | free((char *) drives_busses); | |
4512 | 4536 | return(ret); |
4513 | 4537 | } |
4514 | 4538 | |
4735 | 4759 | return(0); |
4736 | 4760 | } |
4737 | 4761 | |
4762 | int Cdrskin_print_all_profiles(struct CdrskiN *skin, struct burn_drive *drive, | |
4763 | int flag) | |
4764 | { | |
4765 | int num_profiles, profiles[64], i, ret; | |
4766 | char is_current[64], profile_name[80]; | |
4767 | ||
4768 | burn_drive_get_all_profiles(drive, &num_profiles, profiles, is_current); | |
4769 | for(i= 0; i < num_profiles; i++) { | |
4770 | ret= burn_obtain_profile_name(profiles[i], profile_name); | |
4771 | if(ret <= 0) | |
4772 | strcpy(profile_name, "unknown"); | |
4773 | printf("Profile: 0x%4.4X (%s)%s\n", (unsigned int) profiles[i], | |
4774 | profile_name, is_current[i] ? " (current)" : ""); | |
4775 | } | |
4776 | return(1); | |
4777 | } | |
4778 | ||
4738 | 4779 | |
4739 | 4780 | /** Perform -atip . |
4740 | 4781 | @param flag Bitfield for control purposes: |
4760 | 4801 | if(s==BURN_DISC_APPENDABLE && skin->no_blank_appendable) { |
4761 | 4802 | is_not_really_erasable= 1; |
4762 | 4803 | } else if(s==BURN_DISC_EMPTY) { |
4763 | if(skin->verbosity>=Cdrskin_verbose_progresS) | |
4804 | if(skin->verbosity>=Cdrskin_verbose_progresS) { | |
4764 | 4805 | printf("Current: none\n"); |
4806 | Cdrskin_print_all_profiles(skin, drive, 0); | |
4807 | } | |
4765 | 4808 | ret= 0; goto ex; |
4766 | 4809 | } |
4767 | 4810 | |
4871 | 4914 | printf("Current: CD-RW\n"); |
4872 | 4915 | else |
4873 | 4916 | printf("Current: CD-R\n"); |
4874 | } | |
4917 | Cdrskin_print_all_profiles(skin, drive, 0); | |
4918 | } | |
4919 | ||
4875 | 4920 | if(strstr(profile_name,"DVD")==profile_name) { |
4876 | 4921 | /* These are dummy messages for project scdbackup, so its media recognition |
4877 | 4922 | gets a hint that the media is suitable and not in need of blanking. |
33 | 33 | |
34 | 34 | <P> |
35 | 35 | <H2>Hardware requirements:</H2> |
36 | A CD/DVD/BD recorder suitable for | |
37 | <A HREF="http://libburnia-project.org">http://libburnia-project.org</A> <BR> | |
38 | (SCSI , ATA , USB , or SATA writers compliant to standard MMC-3 for CD | |
39 | and to MMC-5 for DVD or BD). | |
36 | About any CD, DVD, or BD recorder produced in the recent ten years. | |
37 | <BR> | |
38 | <A HREF="http://libburnia-project.org">libburn</A> | |
39 | supports recorders which are compliant to standards MMC-1 for CD and | |
40 | MMC-5 for DVD or BD. Linux and FreeBSD allow to access drives connected | |
41 | via SCSI, PATA (aka IDE, ATA), USB, or SATA. | |
40 | 42 | <BR> |
41 | 43 | </P> |
42 | 44 | |
58 | 60 | GPL software included:<BR> |
59 | 61 | </H2> |
60 | 62 | <DL> |
61 | <DT>libburn-0.6.4</DT> | |
63 | <DT>libburn-0.7.0</DT> | |
62 | 64 | <DD>(founded by Derek Foreman and Ben Jansens, |
63 | 65 | developed and maintained since August 2006 by |
64 | 66 | Thomas Schmitt from team of libburnia-project.org) |
176 | 178 | <DL> |
177 | 179 | <DT>Learn to know a more versatile way to burn ISO 9660 formatted data</DT> |
178 | 180 | <DD> |
179 | Standalone ISO 9660 multi-session CD/DVD tool | |
181 | Standalone ISO 9660 multi-session CD/DVD/BD tool | |
180 | 182 | <A HREF="http://scdbackup.sourceforge.net/xorriso_eng.html">xorriso</A>. |
181 | 183 | </DD> |
182 | 184 | </DL> |
183 | 185 | |
184 | Testers wanted who are willing to risk some DVD-R DL media | |
185 | or to do experiments on BD-R media. | |
186 | ||
187 | 186 | </P> |
188 | 187 | |
189 | 188 | <HR> |
193 | 192 | <P> |
194 | 193 | <DL> |
195 | 194 | <DT>Download as source code (see README):</DT> |
196 | <DD><A HREF="cdrskin-0.6.4.pl00.tar.gz">cdrskin-0.6.4.pl00.tar.gz</A> | |
197 | (750 KB). | |
195 | <DD><A HREF="cdrskin-0.7.0.pl00.tar.gz">cdrskin-0.7.0.pl00.tar.gz</A> | |
196 | (820 KB). | |
198 | 197 | </DD> |
199 | 198 | <DD> |
200 | 199 | The cdrskin tarballs are source code identical with libburn releases |
243 | 242 | <HR> |
244 | 243 | |
245 | 244 | <P> |
246 | Enhancements towards previous stable version cdrskin-0.6.2.pl00: | |
245 | Enhancements towards previous stable version cdrskin-0.6.8.pl00: | |
247 | 246 | <UL> |
248 | <LI>New operating system adapter "dummy" for stdio on general X/Open systems | |
249 | </LI> | |
250 | <LI>New stream recording mode with start address</LI> | |
251 | <LI></LI> | |
247 | <LI>Adapted to pitfalls of U3 memory sticks which appear as CD-ROM drives</LI> | |
248 | <LI>Listing all supported profiles with option -atip -v</LI> | |
252 | 249 | <!-- |
253 | 250 | <LI>none</LI> |
254 | 251 | --> |
255 | 252 | </UL> |
256 | 253 | |
257 | Bug fixes towards cdrskin-0.6.2.pl00: | |
254 | Bug fixes towards cdrskin-0.6.8.pl00: | |
258 | 255 | <UL> |
259 | 256 | <LI>none</LI> |
260 | 257 | <!-- |
261 | <LI>none</LI> | |
262 | 258 | --> |
263 | 259 | </UL> |
264 | 260 | |
266 | 262 | |
267 | 263 | <P> |
268 | 264 | <DL> |
269 | <DT><H3>Development snapshot, version 0.6.5 :</H3></DT> | |
270 | <DD>Enhancements towards current stable version 0.6.4.pl00: | |
265 | <DT><H3>Development snapshot, version 0.7.1 :</H3></DT> | |
266 | <DD>Enhancements towards current stable version 0.7.0.pl00: | |
271 | 267 | <UL> |
272 | 268 | <LI>none yet</LI> |
273 | 269 | <!-- |
275 | 271 | |
276 | 272 | </UL> |
277 | 273 | </DD> |
274 | ||
275 | <DD>Bug fixes towards cdrskin-0.7.0.pl00: | |
276 | <UL> | |
277 | <LI>none yet</LI> | |
278 | <!-- | |
279 | --> | |
280 | </UL> | |
281 | </DD> | |
282 | ||
278 | 283 | <DD> </DD> |
279 | <DD><A HREF="README_cdrskin_devel">README 0.6.5</A> | |
280 | <DD><A HREF="cdrskin__help_devel">cdrskin_0.6.5 --help</A></DD> | |
281 | <DD><A HREF="cdrskin_help_devel">cdrskin_0.6.5 -help</A></DD> | |
282 | <DD><A HREF="man_1_cdrskin_devel.html">man cdrskin (as of 0.6.5)</A></DD> | |
284 | <DD><A HREF="README_cdrskin_devel">README 0.7.1</A> | |
285 | <DD><A HREF="cdrskin__help_devel">cdrskin_0.7.1 --help</A></DD> | |
286 | <DD><A HREF="cdrskin_help_devel">cdrskin_0.7.1 -help</A></DD> | |
287 | <DD><A HREF="man_1_cdrskin_devel.html">man cdrskin (as of 0.7.1)</A></DD> | |
283 | 288 | <DD> </DD> |
284 | 289 | <DT>Maintainers of cdrskin unstable packages please use SVN of |
285 | 290 | <A HREF="http://libburnia-project.org"> libburnia-project.org</A></DT> |
299 | 304 | <A HREF="README_cdrskin_devel">upcoming README</A> ): |
300 | 305 | </DD> |
301 | 306 | <DD> |
302 | <A HREF="cdrskin-0.6.5.tar.gz">cdrskin-0.6.5.tar.gz</A> | |
303 | (750 KB). | |
307 | <A HREF="cdrskin-0.7.1.tar.gz">cdrskin-0.7.1.tar.gz</A> | |
308 | (820 KB). | |
304 | 309 | </DD> |
305 | 310 | |
306 | 311 | <!-- This is not offered any more since spring 2008 |
333 | 338 | <BR> |
334 | 339 | Very special thanks to Andy Polyakov whose |
335 | 340 | <A HREF="http://fy.chalmers.se/~appro/linux/DVD+RW/tools">dvd+rw-tools</A> |
336 | provide libburn with invaluable examples on how to deal with DVD media. | |
341 | provide libburn with invaluable examples on how to deal with DVD and BD media. | |
337 | 342 | </P> |
338 | 343 | |
339 | 344 | <HR> |
495 | 500 | <A href="http://sourceforge.net"> |
496 | 501 | <IMG src="sflogo-88-1.png" BORDER="0" ALT="SourceForge Logo"></A> |
497 | 502 | <!-- on sourceforge use : <IMG src="http://sourceforge.net/sflogo.php?group_id=16010" width="88" height="31" border="0" alt="SourceForge Logo"></A> --> |
503 | <P> | |
504 | Enjoying a FreeBSD shell account with the opportunity to | |
505 | build and install cdrskin at<BR> | |
506 | <A HREF="http://www.en.free-shells.com.ar">free-shells.com.ar</A> | |
507 | </P> | |
498 | 508 | </FONT></CENTER> |
499 | 509 | <HR> |
500 | 510 | <DL> |
501 | 511 | <DT>Links to my other published software projects : |
502 | 512 | <DD><A HREF="http://scdbackup.webframe.org/xorriso_eng.html"> |
503 | xorriso, a standalone ISO 9660 multi-session CD/DVD burn tool. | |
513 | xorriso, a standalone ISO 9660 multi-session CD/DVD/BD burn tool. | |
504 | 514 | No mkisofs needed. |
505 | 515 | <DL> |
506 | 516 | <DD> |
6243 | 6243 | * Formatting and writing of BD-R media |
6244 | 6244 | * New API function burn_get_read_capacity() |
6245 | 6245 | |
6246 | 03 Jan 2009 [] | |
6246 | 2009.01.04.112716 [2351] | |
6247 | 6247 | COPYRIGHT |
6248 | 6248 | libburn/libdax_msgs.c |
6249 | 6249 | libburn/libdax_msgs.h |
6250 | 6250 | test/libburner.c |
6251 | 6251 | Updated copyright claims to year 2009 |
6252 | 6252 | |
6253 | [] | |
6253 | 2009.01.04.113401 [2352] | |
6254 | 6254 | Makefile.am |
6255 | 6255 | configure.ac |
6256 | 6256 | README |
6260 | 6260 | cdrskin/compile_cdrskin.sh |
6261 | 6261 | cdrskin/cdrskin_timestamp.h |
6262 | 6262 | cdrskin/cdrskin_eng.html |
6263 | Made number transition to 0.6.0 | |
6264 | ||
6265 | 03 Jan 2009 [] | |
6263 | Made number transition to 0.6.1 | |
6264 | ||
6265 | 04 Jan 2009 [2353] | |
6266 | 6266 | - cdrskin/add_ts_changes_to_libburn_0_5_8 |
6267 | 6267 | - cdrskin/add_ts_changes_to_libburn_0_5_9 |
6268 | 6268 | + cdrskin/add_ts_changes_to_libburn_0_6_0 |
6269 | 6269 | + cdrskin/add_ts_changes_to_libburn_0_6_1 |
6270 | 6270 | Updated cdrskin tarball generator |
6271 | 6271 | |
6272 | 03 Jan 2009 [] | |
6272 | 03 Jan 2009 [2354] | |
6273 | 6273 | cdrskin/changelog.txt |
6274 | 6274 | Documented changes and release timestamp |
6275 | 6275 | |
6276 | ||
6277 | ------------------------------------ cycle - cdrskin-0.6.1 - | |
6278 | ------------------------------------ cycle - cdrskin-0.6.1 - | |
6279 | ||
6280 | ||
6281 | [] | |
6276 | ------------------------------------ cycle - cdrskin-0.6.1 - 2009.01.04.113401 | |
6277 | ||
6278 | 04 Jan 2009 [2356] | |
6279 | svn move | |
6280 | http://svn.libburnia-project.org/libburn/branches/ZeroSixZero | |
6281 | http://svn.libburnia-project.org/libburn/tags/ZeroSixZero | |
6282 | libburn release 0.6.0 is ready | |
6283 | ||
6284 | 2009.01.06.122534 [2366] | |
6282 | 6285 | libburn/spc.c |
6283 | 6286 | Error texts for ASC 73 : power calibration and program memory |
6284 | 6287 | |
6288 | 2009.01.06.122808 [2367] [2369] | |
6289 | libburn/async.c | |
6290 | libburn/libdax_msgs.h | |
6291 | Complaining and refusing more early with unformatted BD-RE | |
6292 | ||
6293 | 7 Jan 2009 [2370] | |
6294 | cdrskin/cdrskin.1 | |
6295 | Clarification about one-time DVD and BD media | |
6296 | ||
6297 | 2009.01.07.154414 [2371] | |
6298 | libburn/write.c | |
6299 | Bug fix: BD-R were not correctly finalized | |
6300 | ||
6301 | 7 Jan 2009 [2372] | |
6302 | cdrskin/cdrskin_eng.html | |
6303 | Mentioned bug fix and pl01 | |
6304 | ||
6305 | ------------------------------------ cycle - cdrskin-0.6.1 - 2009.01.07.154414 | |
6306 | ||
6307 | 7 Jan 2009 [2373] | |
6308 | svn copy -m "Branching for libburn bugfix release 0.6.0.pl01" \ | |
6309 | http://svn.libburnia-project.org/libburn/ \ | |
6310 | http://svn.libburnia-project.org/libburn/ | |
6311 | ||
6312 | 7 Jan 2009 [2374] | |
6313 | svn rm -m 'Removing falsly copied tag' \ | |
6314 | http://svn.libburnia-project.org/libburn/libburn | |
6315 | ||
6316 | 7 Jan 2009 [2375] | |
6317 | svn copy -m "Branching for libburn bugfix release 0.6.0.pl01" \ | |
6318 | http://svn.libburnia-project.org/libburn/tags/ZeroSixZero \ | |
6319 | http://svn.libburnia-project.org/libburn/branches/ZeroSixZeroPl01 | |
6320 | ||
6321 | 2009.01.07.140001 [branch 2376] | |
6322 | README | |
6323 | cdrskin/README | |
6324 | cdrskin/cdrskin_eng.html | |
6325 | cdrskin/cdrskin_timestamp.h | |
6326 | Mentioned bug fix and pl01 | |
6327 | ||
6328 | 2009.01.07.140001 [branch 2377] | |
6329 | libburn/write.c | |
6330 | Bug fix: BD-R were not correctly finalized | |
6331 | ||
6332 | 7 Jan 2009 [2378] | |
6333 | svn move -m 'libburn bugfix release 0.6.0.pl01 is ready' \ | |
6334 | http://svn.libburnia-project.org/libburn/branches/ZeroSixZeroPl01 \ | |
6335 | http://svn.libburnia-project.org/libburn/tags/ZeroSixZeroPl01 | |
6336 | ||
6337 | ------------------------------------ cycle - cdrskin-0.6.1 - 2009.01.07.154414 | |
6338 | ||
6339 | 2009.01.09.095943 [2381] | |
6340 | libburn/transport.h | |
6341 | libburn/write.c | |
6342 | libburn/mmc.c | |
6343 | libburn/libdax_msgs.h | |
6344 | Recognizing BD-R media spoiled by the close bug and handling them as appendable | |
6345 | ||
6346 | ------------------------------------ cycle - cdrskin-0.6.1 - 2009.01.09.100210 | |
6347 | ||
6348 | 2009.01.09.161704 [2383] | |
6349 | libburn/write.c | |
6350 | Preventing a possible bug with a burn run of more than one session at once | |
6351 | ||
6352 | 2009.01.11.102711 [2390] | |
6353 | libburn/write.c | |
6354 | libburn/libdax_msgs.h | |
6355 | Prepared eventual closing of spoiled BD-R media by a pseudo write run | |
6356 | ||
6357 | 11 Jan 2009 [2391] | |
6358 | doc/cookbook.txt | |
6359 | Updated cookbook about BD-R media | |
6360 | ||
6361 | 27 Jan 2009 [2431] | |
6362 | README | |
6363 | libburn/libburn.h | |
6364 | Mentioned the need for 64 bit file i/o | |
6365 | ||
6366 | 2009.02.04.102822 [2447] | |
6367 | Makefile.am | |
6368 | Linking with $LIBBURN_ARCH_LIBS to get -lcam on FreeBSD | |
6369 | ||
6370 | 4 Feb 2009 [2448] | |
6371 | README | |
6372 | cdrskin/README | |
6373 | Mentioned hald as possibly conflicting service | |
6374 | ||
6375 | 2009.02.19.192801 [2479] | |
6376 | libburn/spc.c | |
6377 | Human readable error messages with asynchronous SCSI errors | |
6378 | ||
6379 | 20 Feb 2009 [2482] | |
6380 | svn copy http://svn.libburnia-project.org/libburn/trunk | |
6381 | http://svn.libburnia-project.org/libburn/branches/ZeroSixZero | |
6382 | Preparing for libburn-0.6.0 | |
6383 | ||
6384 | 2009.02.20.090001 [2483] | |
6385 | Makefile.am | |
6386 | configure.ac | |
6387 | README | |
6388 | libburn/libburn.h | |
6389 | cdrskin/cdrskin.c | |
6390 | cdrskin/README | |
6391 | cdrskin/compile_cdrskin.sh | |
6392 | cdrskin/cdrskin_timestamp.h | |
6393 | cdrskin/cdrskin_eng.html | |
6394 | Made number transition to 0.6.2 | |
6395 | ||
6396 | 20 Feb 2009 [2484] | |
6397 | - cdrskin/add_ts_changes_to_libburn_0_6_0 | |
6398 | - cdrskin/add_ts_changes_to_libburn_0_6_1 | |
6399 | + cdrskin/add_ts_changes_to_libburn_0_6_2 | |
6400 | + cdrskin/add_ts_changes_to_libburn_0_6_3 | |
6401 | Updated cdrskin tarball generator | |
6402 | ||
6403 | ------------------------------ release - cdrskin-0.6.2.pl00 - 2009.02.20.090001 | |
6404 | * Improvements with build system for FreeBSD | |
6405 | ||
6406 | 2009.02.20.124909 [2485] | |
6407 | Makefile.am | |
6408 | configure.ac | |
6409 | README | |
6410 | libburn/libburn.h | |
6411 | cdrskin/cdrskin.c | |
6412 | cdrskin/README | |
6413 | cdrskin/compile_cdrskin.sh | |
6414 | cdrskin/cdrskin_timestamp.h | |
6415 | cdrskin/cdrskin_eng.html | |
6416 | Made number transition to 0.6.3 | |
6417 | ||
6418 | 20 Feb 2009 [2486] | |
6419 | - cdrskin/add_ts_changes_to_libburn_0_6_0 | |
6420 | - cdrskin/add_ts_changes_to_libburn_0_6_1 | |
6421 | + cdrskin/add_ts_changes_to_libburn_0_6_2 | |
6422 | + cdrskin/add_ts_changes_to_libburn_0_6_3 | |
6423 | Updated cdrskin tarball generator | |
6424 | ||
6425 | ------------------------------------ cycle - cdrskin-0.6.3 - 2009.02.20.132535 | |
6426 | ||
6427 | 20 Feb 2009 [2489] | |
6428 | svn move -m libburn release 0.6.2 is ready | |
6429 | http://svn.libburnia-project.org/libburn/branches/ZeroSixTwo | |
6430 | http://svn.libburnia-project.org/libburn/tags/ZeroSixTwo | |
6431 | ||
6432 | 2009.02.27.143100 [2500] | |
6433 | libburn/libburn.h | |
6434 | libburn/transport.h | |
6435 | libburn/drive.c | |
6436 | libburn/options.c | |
6437 | libburn/write.c | |
6438 | libburn/mmc.c | |
6439 | New API function burn_drive_set_stream_recording() | |
6440 | ||
6441 | 2009.02.27.211707 [2501] | |
6442 | cdrskin/cdrskin.c | |
6443 | cdrskin/cdrskin.1 | |
6444 | New stream_recording mode with start number | |
6445 | ||
6446 | 2009.03.02.170126 [2513] | |
6447 | libburn/os.h | |
6448 | libburn/libdax_msgs.h | |
6449 | libburn/sg.c | |
6450 | + libburn/os-dummy.h | |
6451 | + libburn/sg-dummy.c | |
6452 | New operating system adapter "dummy" for stdio on POSIX-like systems | |
6453 | ||
6454 | 2009.03.02.193353 [2514] | |
6455 | libburn/drive.c | |
6456 | Fixed a race condition on abort with stdio writing which could cause SIGSEGV | |
6457 | ||
6458 | 2009.03.02.200132 [2515] | |
6459 | libburn/sg.c | |
6460 | Added a dummy function with loud compiler warning to sg.c dummy case | |
6461 | ||
6462 | 2009.03.03.092057 [2516] | |
6463 | configure.ac | |
6464 | libburn/sg-dummy.c | |
6465 | Making optional use of statvfs() in sg-dummy | |
6466 | ||
6467 | ------------------------------------ cycle - cdrskin-0.6.3 - 2009.03.03.092057 | |
6468 | * New API function burn_drive_set_stream_recording() | |
6469 | * New stream recording mode with start number | |
6470 | ||
6471 | ||
6472 | 2009.03.05.145309 [2520] | |
6473 | acinclude.m4 | |
6474 | Lifted the ban on operating systems other than Linux and FreeBSD | |
6475 | ||
6476 | ------------------------------------ cycle - cdrskin-0.6.3 - 2009.03.05.145309 | |
6477 | * New operating system adapter "dummy" for stdio on POSIX-like systems | |
6478 | ||
6479 | ||
6480 | 2009.03.08.140120 [2522] | |
6481 | libburn/cleanup.c | |
6482 | Reacted on compiler warnings of SchilliX-0.6.7 (based on Solaris 5.11) | |
6483 | ||
6484 | 13 Mar 2009 [2529] | |
6485 | svn copy -m "Branching for libburn release 0.6.4" \ | |
6486 | http://svn.libburnia-project.org/libburn/trunk \ | |
6487 | http://svn.libburnia-project.org/libburn/branches/ZeroSixFour | |
6488 | ||
6489 | 2009.03.13.080001 [2530] | |
6490 | Makefile.am | |
6491 | configure.ac | |
6492 | README | |
6493 | libburn/libburn.h | |
6494 | cdrskin/cdrskin.c | |
6495 | cdrskin/README | |
6496 | cdrskin/compile_cdrskin.sh | |
6497 | cdrskin/cdrskin_timestamp.h | |
6498 | cdrskin/cdrskin_eng.html | |
6499 | Made libburn number transition to 0.6.4 | |
6500 | ||
6501 | 13 Mar 2009 [2531] | |
6502 | - cdrskin/add_ts_changes_to_libburn_0_6_2 | |
6503 | - cdrskin/add_ts_changes_to_libburn_0_6_3 | |
6504 | + cdrskin/add_ts_changes_to_libburn_0_6_4 | |
6505 | + cdrskin/add_ts_changes_to_libburn_0_6_5 | |
6506 | Updated cdrskin tarball generator | |
6507 | ||
6508 | 13 Mar 2009 [2534] | |
6509 | cdrskin/changelog.txt | |
6510 | Documented changes and release timestamp | |
6511 | ||
6512 | ------------------------------ release - cdrskin-0.6.4.pl00 - 2009.03.13.080001 | |
6513 | * New operating system adapter "dummy" for stdio on general X/Open systems | |
6514 | * New API function burn_drive_set_stream_recording() | |
6515 | * New stream recording mode with start address | |
6516 | ||
6517 | ||
6518 | 2009.03.13.135818 [2532] | |
6519 | Makefile.am | |
6520 | configure.ac | |
6521 | README | |
6522 | libburn/libburn.h | |
6523 | cdrskin/cdrskin.c | |
6524 | cdrskin/README | |
6525 | cdrskin/compile_cdrskin.sh | |
6526 | cdrskin/cdrskin_timestamp.h | |
6527 | cdrskin/cdrskin_eng.html | |
6528 | Made libburn number transition to 0.6.5 | |
6529 | ||
6530 | 13 Mar 2009 [2533] | |
6531 | - cdrskin/add_ts_changes_to_libburn_0_6_2 | |
6532 | - cdrskin/add_ts_changes_to_libburn_0_6_3 | |
6533 | + cdrskin/add_ts_changes_to_libburn_0_6_4 | |
6534 | + cdrskin/add_ts_changes_to_libburn_0_6_5 | |
6535 | Updated cdrskin tarball generator | |
6536 | ||
6537 | 13 Mar 2009 [2535] | |
6538 | cdrskin/changelog.txt | |
6539 | Documented changes and release timestamp | |
6540 | ||
6541 | ------------------------------------ cycle - cdrskin-0.6.5 - 2009.03.13.162355 | |
6542 | ||
6543 | 13 Mar 2009 [2538] | |
6544 | svn move -m "libburn release 0.6.4 is ready" \ | |
6545 | http://svn.libburnia-project.org/libburn/branches/ZeroSixFour \ | |
6546 | http://svn.libburnia-project.org/libburn/tags/ZeroSixFour | |
6547 | ||
6548 | 2009.03.16.190745 [2547] | |
6549 | configure.ac | |
6550 | acinclude.m4 | |
6551 | Makefile.am | |
6552 | Get on FreeBSD pkgconfigdir=.../libdata , on Linux and others: .../lib | |
6553 | ||
6554 | 2009.03.18.124558 [2553] | |
6555 | libburn/spc.c | |
6556 | Human readable error messages for asc=08 "Logical unit communication failure" | |
6557 | ||
6558 | 2009.03.18.172512 [2554] | |
6559 | libburn/drive.c | |
6560 | Bug fix: burn_abort() did not work with broken output pipe (since rev 2514) | |
6561 | ||
6562 | 2009.04.30.065653 [2623] | |
6563 | libburn/write.c | |
6564 | Marked alleged use of uninitialized memory reported by valgrind | |
6565 | ||
6566 | 2009.04.30.065918 [2624] | |
6567 | libburn/write.c | |
6568 | Replaced 8 blanks by a tab | |
6569 | ||
6570 | 2009.04.30.070813 [2625] | |
6571 | libburn/sg-freebsd.c | |
6572 | Bug fix: Device scan stalled on FreeBSD. Ticket 148 jwehle | |
6573 | ||
6574 | ------------------------------------ cycle - cdrskin-0.6.5 - 2009.04.30.070813 | |
6575 | Bug fix: burn_abort() did not work with broken output pipe (since rev 2514) | |
6576 | Bug fix: Device scan stalled on FreeBSD. Ticket 148 jwehle | |
6577 | ||
6578 | 7 May 2009 [2628] | |
6579 | svn copy -m "Branching for libburn release 0.6.6" | |
6580 | http://svn.libburnia-project.org/libburn/trunk | |
6581 | http://svn.libburnia-project.org/libburn/branches/ZeroSixSix | |
6582 | ||
6583 | 7 May 2009 [2629] | |
6584 | cdrskin/cdrskin.1 | |
6585 | Mentioned BD were it was missing | |
6586 | ||
6587 | 2009.05.07.100001 [2630] | |
6588 | Makefile.am | |
6589 | configure.ac | |
6590 | README | |
6591 | libburn/libburn.h | |
6592 | cdrskin/cdrskin.c | |
6593 | cdrskin/README | |
6594 | cdrskin/compile_cdrskin.sh | |
6595 | cdrskin/cdrskin_timestamp.h | |
6596 | cdrskin/cdrskin_eng.html | |
6597 | Made number transition and activated development documentation | |
6598 | ||
6599 | 7 May 2009 [2631] | |
6600 | - cdrskin/add_ts_changes_to_libburn_0_6_4 | |
6601 | - cdrskin/add_ts_changes_to_libburn_0_6_5 | |
6602 | + cdrskin/add_ts_changes_to_libburn_0_6_6 | |
6603 | + cdrskin/add_ts_changes_to_libburn_0_6_7 | |
6604 | Updated cdrskin tarball generator | |
6605 | ||
6606 | 7 May 2009 [2632] | |
6607 | cdrskin/changelog.txt | |
6608 | Documented changes and release timestamp | |
6609 | ||
6610 | ------------------------------ release - cdrskin-0.6.6.pl00 - 2009.05.07.100001 | |
6611 | Bug fix: burn_abort() did not work with broken output pipe (since rev 2514) | |
6612 | Bug fix: Device scan stalled on FreeBSD. Ticket 148 jwehle | |
6613 | ||
6614 | ||
6615 | 7 May 2009 [2633] | |
6616 | cdrskin/cdrskin.1 | |
6617 | Mentioned BD were it was missing | |
6618 | ||
6619 | 2009.05.07.181034 [2634] | |
6620 | Makefile.am | |
6621 | configure.ac | |
6622 | README | |
6623 | libburn/libburn.h | |
6624 | cdrskin/cdrskin.c | |
6625 | cdrskin/README | |
6626 | cdrskin/compile_cdrskin.sh | |
6627 | cdrskin/cdrskin_timestamp.h | |
6628 | cdrskin/cdrskin_eng.html | |
6629 | Made number transition and activated development documentation | |
6630 | ||
6631 | 7 May 2009 [2635] | |
6632 | - cdrskin/add_ts_changes_to_libburn_0_6_4 | |
6633 | - cdrskin/add_ts_changes_to_libburn_0_6_5 | |
6634 | + cdrskin/add_ts_changes_to_libburn_0_6_6 | |
6635 | + cdrskin/add_ts_changes_to_libburn_0_6_7 | |
6636 | Updated cdrskin tarball generator | |
6637 | ||
6638 | 7 May 2009 [2636] | |
6639 | cdrskin/changelog.txt | |
6640 | Documented changes and release timestamp | |
6641 | ||
6642 | ------------------------------------ cycle - cdrskin-0.6.7 - 2009.05.07.181034 | |
6643 | ||
6644 | 8 May 2009 [2637] | |
6645 | svn move -m libburn release 0.6.6 is ready | |
6646 | http://svn.libburnia-project.org/libburn/branches/ZeroSixSix | |
6647 | http://svn.libburnia-project.org/libburn/tags/ZeroSixSix | |
6648 | ||
6649 | 2009.05.17.144304 [2645] | |
6650 | cdrskin/cdrskin.c | |
6651 | Made -scanbus work with SCSI bus numbers like 85 (USB, kernel 2.6.18.2) | |
6652 | ||
6653 | 2009.06.02.162841 [2655] | |
6654 | libburn/drive.c | |
6655 | libburn/async.c | |
6656 | libburn/options.c | |
6657 | libburn/spc.c | |
6658 | libburn/libdax_msgs.h | |
6659 | Rectified use of burn_drive.mdata->valid | |
6660 | ||
6661 | 2 Jun 2009 [2656] | |
6662 | test/libburner.c | |
6663 | Avoided SIGSEGV if no drives were found by scan | |
6664 | ||
6665 | 2009.06.02.172201 [2657] | |
6666 | libburn/drive.c | |
6667 | Avoided to enumerate faulty drive objects | |
6668 | ||
6669 | 2009.06.03.085637 [2658] | |
6670 | libburn/spc.c | |
6671 | Bug fix: Old MMC-1 drives were rejected because of mode page 2Ah length | |
6672 | ||
6673 | 2009.06.03.185118 [2659] | |
6674 | libburn/transport.h | |
6675 | libburn/drive.c | |
6676 | libburn/spc.c | |
6677 | libburn/mmc.c | |
6678 | Bug fix: No usable media was detected with old MMC-1 drives | |
6679 | ||
6680 | 2009.06.14.095004 [2669] | |
6681 | libburn/sg-linux.c | |
6682 | Retrying 3 times on EBUSY drives with generous usleep intervals | |
6683 | ||
6684 | ------------------------------------ cycle - cdrskin-0.6.7 - 2009.06.14.095833 | |
6685 | Made -scanbus work with high SCSI bus numbers | |
6686 | Bug fix: Old MMC-1 drives were rejected because of mode page 2Ah length | |
6687 | Bug fix: No usable media was detected with old MMC-1 drives | |
6688 | ||
6689 | ||
6690 | 7 Jul 2009 [2691] | |
6691 | acinclude.m4 | |
6692 | configure.ac | |
6693 | configure options --enable-libdir-pkgconfig and --enable-pkgconfig-path=DIR | |
6694 | ||
6695 | 2009.07.07.191134 [2692] | |
6696 | Timestamp for revision 2691 | |
6697 | ||
6698 | 14 Jul 2009 [2894] | |
6699 | svn copy -m "Branching for libburn release 0.6.8" | |
6700 | http://svn.libburnia-project.org/libburn/trunk | |
6701 | http://svn.libburnia-project.org/libburn/branches/ZeroSixEight | |
6702 | ||
6703 | 2009.07.14.100001 [2695] | |
6704 | Makefile.am | |
6705 | configure.ac | |
6706 | README | |
6707 | libburn/libburn.h | |
6708 | cdrskin/cdrskin.c | |
6709 | cdrskin/README | |
6710 | cdrskin/compile_cdrskin.sh | |
6711 | cdrskin/cdrskin_timestamp.h | |
6712 | cdrskin/cdrskin_eng.html | |
6713 | Made number transition and activated development documentation | |
6714 | ||
6715 | 14 Jul 2009 [2696] | |
6716 | - cdrskin/add_ts_changes_to_libburn_0_6_6 | |
6717 | - cdrskin/add_ts_changes_to_libburn_0_6_7 | |
6718 | + cdrskin/add_ts_changes_to_libburn_0_6_8 | |
6719 | + cdrskin/add_ts_changes_to_libburn_0_6_9 | |
6720 | Updated cdrskin tarball generator | |
6721 | ||
6722 | 14 Jul 2009 [2697] | |
6723 | cdrskin/changelog.txt | |
6724 | Documented changes and release timestamp | |
6725 | ||
6726 | ------------------------------ release - cdrskin-0.6.8.pl00 - 2009.07.14.100001 | |
6727 | Made -scanbus work with high SCSI bus numbers | |
6728 | Bug fix: Old MMC-1 drives were rejected because of mode page 2Ah length | |
6729 | Bug fix: No usable media was detected with old MMC-1 drives | |
6730 | ||
6731 | ||
6732 | 2009.07.14.133159 [2698] | |
6733 | Makefile.am | |
6734 | configure.ac | |
6735 | README | |
6736 | libburn/libburn.h | |
6737 | cdrskin/cdrskin.c | |
6738 | cdrskin/README | |
6739 | cdrskin/compile_cdrskin.sh | |
6740 | cdrskin/cdrskin_timestamp.h | |
6741 | cdrskin/cdrskin_eng.html | |
6742 | Made number transition and activated development documentation | |
6743 | ||
6744 | 14 Jul 2009 [2699] | |
6745 | - cdrskin/add_ts_changes_to_libburn_0_6_6 | |
6746 | - cdrskin/add_ts_changes_to_libburn_0_6_7 | |
6747 | + cdrskin/add_ts_changes_to_libburn_0_6_8 | |
6748 | + cdrskin/add_ts_changes_to_libburn_0_6_9 | |
6749 | Updated cdrskin tarball generator | |
6750 | ||
6751 | 14 Jul 2009 [] | |
6752 | cdrskin/changelog.txt | |
6753 | Documented changes and release timestamp | |
6754 | ||
6755 | ------------------------------------ cycle - cdrskin-0.6.9 - 2009.07.14.133159 | |
6756 | ||
6757 | ||
6758 | ------------------------------------ cycle - cdrskin-0.6.9 - | |
6759 | ------------------------------------ cycle - cdrskin-0.6.9 - | |
6285 | 6760 | |
6286 | 6761 | =============================================================================== |
6287 | 6762 | TODO |
6290 | 6765 | |
6291 | 6766 | --------------------------------- bugs ------------------------------------- |
6292 | 6767 | |
6293 | - Needed is a system dependend facility: dev_t <-> major, minor | |
6294 | 6768 | |
6295 | 6769 | - Do something about drive->buffer asynchronous race conditions |
6296 | 6770 | and dangerous use of local heap memory. |
6328 | 6802 | |
6329 | 6803 | What about cdrskin rc files ? Forward with fallback runs ? |
6330 | 6804 | |
6331 | cdrskin/README | |
6332 | Thin out | |
6333 | ||
6334 | 6805 | |
6335 | 6806 | [] |
6336 | 6807 | Emulate -dummy on overwriteables ? |
0 | 0 | #!/bin/sh |
1 | 1 | |
2 | 2 | # compile_cdrskin.sh |
3 | # Copyright 2005 - 2008 Thomas Schmitt, scdbackup@gmx.net, GPL version 2 | |
3 | # Copyright 2005 - 2009 Thomas Schmitt, scdbackup@gmx.net, GPL version 2 | |
4 | 4 | # to be executed within ./libburn-* resp ./cdrskin-* |
5 | 5 | |
6 | 6 | debug_opts="-O2" |
7 | 7 | def_opts= |
8 | 8 | largefile_opts="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1" |
9 | libvers="-DCdrskin_libburn_0_6_4" | |
9 | libvers="-DCdrskin_libburn_0_7_0" | |
10 | 10 | cleanup_src_or_obj="libburn/cleanup.o" |
11 | 11 | libdax_msgs_o="libburn/libdax_msgs.o" |
12 | 12 | libdax_audioxtr_o="libburn/libdax_audioxtr.o" |
32 | 32 | libdax_audioxtr_o= |
33 | 33 | libdax_msgs_o="libburn/message.o" |
34 | 34 | cleanup_src_or_obj="-DCleanup_has_no_libburn_os_H cdrskin/cleanup.c" |
35 | elif test "$i" = "-libburn_0_6_4" | |
36 | then | |
37 | libvers="-DCdrskin_libburn_0_6_4" | |
35 | elif test "$i" = "-libburn_0_7_0" | |
36 | then | |
37 | libvers="-DCdrskin_libburn_0_7_0" | |
38 | 38 | libdax_audioxtr_o="libburn/libdax_audioxtr.o" |
39 | 39 | libdax_msgs_o="libburn/libdax_msgs.o" |
40 | 40 | cleanup_src_or_obj="libburn/cleanup.o" |
41 | 41 | elif test "$i" = "-libburn_svn" |
42 | 42 | then |
43 | libvers="-DCdrskin_libburn_0_6_5" | |
43 | libvers="-DCdrskin_libburn_0_7_1" | |
44 | 44 | libdax_audioxtr_o="libburn/libdax_audioxtr.o" |
45 | 45 | libdax_msgs_o="libburn/libdax_msgs.o" |
46 | 46 | cleanup_src_or_obj="libburn/cleanup.o" |
74 | 74 | echo "Options:" |
75 | 75 | echo " -compile_cdrfifo compile program cdrskin/cdrfifo." |
76 | 76 | echo " -compile_dewav compile program test/dewav without libburn." |
77 | echo " -libburn_0_6_4 set macro to match libburn-0.6.4" | |
77 | echo " -libburn_0_7_0 set macro to match libburn-0.7.0" | |
78 | 78 | echo " -libburn_svn set macro to match current libburn-SVN." |
79 | 79 | echo " -do_not_compile_cdrskin omit compilation of cdrskin/cdrskin." |
80 | 80 | echo " -experimental use newly introduced libburn features." |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.60 for libburn 0.6.4. | |
2 | # Generated by GNU Autoconf 2.60 for libburn 0.7.0. | |
3 | 3 | # |
4 | 4 | # Report bugs to <http://libburnia-project.org>. |
5 | 5 | # |
712 | 712 | # Identity of this package. |
713 | 713 | PACKAGE_NAME='libburn' |
714 | 714 | PACKAGE_TARNAME='libburn' |
715 | PACKAGE_VERSION='0.6.4' | |
716 | PACKAGE_STRING='libburn 0.6.4' | |
715 | PACKAGE_VERSION='0.7.0' | |
716 | PACKAGE_STRING='libburn 0.7.0' | |
717 | 717 | PACKAGE_BUGREPORT='http://libburnia-project.org' |
718 | 718 | |
719 | 719 | ac_default_prefix=/usr/local |
874 | 874 | LIBTOOL_DEPS |
875 | 875 | THREAD_LIBS |
876 | 876 | ARCH |
877 | LIBBURNIA_PKGCONFDIR | |
877 | 878 | LIBBURN_ARCH_LIBS |
878 | 879 | LIBOBJS |
879 | 880 | LTLIBOBJS' |
1394 | 1395 | # Omit some internal or obsolete options to make the list less imposing. |
1395 | 1396 | # This message is too long to be a string in the A/UX 3.1 sh. |
1396 | 1397 | cat <<_ACEOF |
1397 | \`configure' configures libburn 0.6.4 to adapt to many kinds of systems. | |
1398 | \`configure' configures libburn 0.7.0 to adapt to many kinds of systems. | |
1398 | 1399 | |
1399 | 1400 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1400 | 1401 | |
1465 | 1466 | |
1466 | 1467 | if test -n "$ac_init_help"; then |
1467 | 1468 | case $ac_init_help in |
1468 | short | recursive ) echo "Configuration of libburn 0.6.4:";; | |
1469 | short | recursive ) echo "Configuration of libburn 0.7.0:";; | |
1469 | 1470 | esac |
1470 | 1471 | cat <<\_ACEOF |
1471 | 1472 | |
1483 | 1484 | optimize for fast installation [default=yes] |
1484 | 1485 | --disable-libtool-lock avoid locking (might break parallel builds) |
1485 | 1486 | --enable-debug Disable aggressive optimizations default=yes |
1487 | --enable-libdir-pkgconfig Install to $libdir/pkgconfig on any OS, default=no | |
1488 | --enable-pkgconfig-path=DIR Absolute path of directory for libisofs-*.pc | |
1486 | 1489 | |
1487 | 1490 | Optional Packages: |
1488 | 1491 | --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] |
1570 | 1573 | test -n "$ac_init_help" && exit $ac_status |
1571 | 1574 | if $ac_init_version; then |
1572 | 1575 | cat <<\_ACEOF |
1573 | libburn configure 0.6.4 | |
1576 | libburn configure 0.7.0 | |
1574 | 1577 | generated by GNU Autoconf 2.60 |
1575 | 1578 | |
1576 | 1579 | Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, |
1584 | 1587 | This file contains any messages produced by compilers while |
1585 | 1588 | running configure, to aid debugging if configure makes a mistake. |
1586 | 1589 | |
1587 | It was created by libburn $as_me 0.6.4, which was | |
1590 | It was created by libburn $as_me 0.7.0, which was | |
1588 | 1591 | generated by GNU Autoconf 2.60. Invocation command line was |
1589 | 1592 | |
1590 | 1593 | $ $0 $@ |
2383 | 2386 | |
2384 | 2387 | # Define the identity of the package. |
2385 | 2388 | PACKAGE='libburn' |
2386 | VERSION='0.6.4' | |
2389 | VERSION='0.7.0' | |
2387 | 2390 | |
2388 | 2391 | |
2389 | 2392 | cat >>confdefs.h <<_ACEOF |
2531 | 2534 | |
2532 | 2535 | |
2533 | 2536 | BURN_MAJOR_VERSION=0 |
2534 | BURN_MINOR_VERSION=6 | |
2535 | BURN_MICRO_VERSION=4 | |
2537 | BURN_MINOR_VERSION=7 | |
2538 | BURN_MICRO_VERSION=0 | |
2536 | 2539 | BURN_VERSION=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION |
2537 | 2540 | |
2538 | 2541 | |
2541 | 2544 | |
2542 | 2545 | |
2543 | 2546 | LT_RELEASE=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION |
2544 | LT_CURRENT=33 | |
2545 | LT_AGE=29 | |
2547 | LT_CURRENT=39 | |
2548 | LT_AGE=35 | |
2546 | 2549 | LT_REVISION=0 |
2547 | 2550 | LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE` |
2548 | 2551 | |
6397 | 6400 | ;; |
6398 | 6401 | *-*-irix6*) |
6399 | 6402 | # Find out which ABI we are using. |
6400 | echo '#line 6401 "configure"' > conftest.$ac_ext | |
6403 | echo '#line 6404 "configure"' > conftest.$ac_ext | |
6401 | 6404 | if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 |
6402 | 6405 | (eval $ac_compile) 2>&5 |
6403 | 6406 | ac_status=$? |
8825 | 8828 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
8826 | 8829 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
8827 | 8830 | -e 's:$: $lt_compiler_flag:'` |
8828 | (eval echo "\"\$as_me:8829: $lt_compile\"" >&5) | |
8831 | (eval echo "\"\$as_me:8832: $lt_compile\"" >&5) | |
8829 | 8832 | (eval "$lt_compile" 2>conftest.err) |
8830 | 8833 | ac_status=$? |
8831 | 8834 | cat conftest.err >&5 |
8832 | echo "$as_me:8833: \$? = $ac_status" >&5 | |
8835 | echo "$as_me:8836: \$? = $ac_status" >&5 | |
8833 | 8836 | if (exit $ac_status) && test -s "$ac_outfile"; then |
8834 | 8837 | # The compiler can only warn and ignore the option if not recognized |
8835 | 8838 | # So say no if there are warnings other than the usual output. |
9093 | 9096 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
9094 | 9097 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
9095 | 9098 | -e 's:$: $lt_compiler_flag:'` |
9096 | (eval echo "\"\$as_me:9097: $lt_compile\"" >&5) | |
9099 | (eval echo "\"\$as_me:9100: $lt_compile\"" >&5) | |
9097 | 9100 | (eval "$lt_compile" 2>conftest.err) |
9098 | 9101 | ac_status=$? |
9099 | 9102 | cat conftest.err >&5 |
9100 | echo "$as_me:9101: \$? = $ac_status" >&5 | |
9103 | echo "$as_me:9104: \$? = $ac_status" >&5 | |
9101 | 9104 | if (exit $ac_status) && test -s "$ac_outfile"; then |
9102 | 9105 | # The compiler can only warn and ignore the option if not recognized |
9103 | 9106 | # So say no if there are warnings other than the usual output. |
9197 | 9200 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
9198 | 9201 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
9199 | 9202 | -e 's:$: $lt_compiler_flag:'` |
9200 | (eval echo "\"\$as_me:9201: $lt_compile\"" >&5) | |
9203 | (eval echo "\"\$as_me:9204: $lt_compile\"" >&5) | |
9201 | 9204 | (eval "$lt_compile" 2>out/conftest.err) |
9202 | 9205 | ac_status=$? |
9203 | 9206 | cat out/conftest.err >&5 |
9204 | echo "$as_me:9205: \$? = $ac_status" >&5 | |
9207 | echo "$as_me:9208: \$? = $ac_status" >&5 | |
9205 | 9208 | if (exit $ac_status) && test -s out/conftest2.$ac_objext |
9206 | 9209 | then |
9207 | 9210 | # The compiler can only warn and ignore the option if not recognized |
11649 | 11652 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 |
11650 | 11653 | lt_status=$lt_dlunknown |
11651 | 11654 | cat > conftest.$ac_ext <<EOF |
11652 | #line 11653 "configure" | |
11655 | #line 11656 "configure" | |
11653 | 11656 | #include "confdefs.h" |
11654 | 11657 | |
11655 | 11658 | #if HAVE_DLFCN_H |
11749 | 11752 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 |
11750 | 11753 | lt_status=$lt_dlunknown |
11751 | 11754 | cat > conftest.$ac_ext <<EOF |
11752 | #line 11753 "configure" | |
11755 | #line 11756 "configure" | |
11753 | 11756 | #include "confdefs.h" |
11754 | 11757 | |
11755 | 11758 | #if HAVE_DLFCN_H |
14117 | 14120 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
14118 | 14121 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
14119 | 14122 | -e 's:$: $lt_compiler_flag:'` |
14120 | (eval echo "\"\$as_me:14121: $lt_compile\"" >&5) | |
14123 | (eval echo "\"\$as_me:14124: $lt_compile\"" >&5) | |
14121 | 14124 | (eval "$lt_compile" 2>conftest.err) |
14122 | 14125 | ac_status=$? |
14123 | 14126 | cat conftest.err >&5 |
14124 | echo "$as_me:14125: \$? = $ac_status" >&5 | |
14127 | echo "$as_me:14128: \$? = $ac_status" >&5 | |
14125 | 14128 | if (exit $ac_status) && test -s "$ac_outfile"; then |
14126 | 14129 | # The compiler can only warn and ignore the option if not recognized |
14127 | 14130 | # So say no if there are warnings other than the usual output. |
14221 | 14224 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
14222 | 14225 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
14223 | 14226 | -e 's:$: $lt_compiler_flag:'` |
14224 | (eval echo "\"\$as_me:14225: $lt_compile\"" >&5) | |
14227 | (eval echo "\"\$as_me:14228: $lt_compile\"" >&5) | |
14225 | 14228 | (eval "$lt_compile" 2>out/conftest.err) |
14226 | 14229 | ac_status=$? |
14227 | 14230 | cat out/conftest.err >&5 |
14228 | echo "$as_me:14229: \$? = $ac_status" >&5 | |
14231 | echo "$as_me:14232: \$? = $ac_status" >&5 | |
14229 | 14232 | if (exit $ac_status) && test -s out/conftest2.$ac_objext |
14230 | 14233 | then |
14231 | 14234 | # The compiler can only warn and ignore the option if not recognized |
15791 | 15794 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
15792 | 15795 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
15793 | 15796 | -e 's:$: $lt_compiler_flag:'` |
15794 | (eval echo "\"\$as_me:15795: $lt_compile\"" >&5) | |
15797 | (eval echo "\"\$as_me:15798: $lt_compile\"" >&5) | |
15795 | 15798 | (eval "$lt_compile" 2>conftest.err) |
15796 | 15799 | ac_status=$? |
15797 | 15800 | cat conftest.err >&5 |
15798 | echo "$as_me:15799: \$? = $ac_status" >&5 | |
15801 | echo "$as_me:15802: \$? = $ac_status" >&5 | |
15799 | 15802 | if (exit $ac_status) && test -s "$ac_outfile"; then |
15800 | 15803 | # The compiler can only warn and ignore the option if not recognized |
15801 | 15804 | # So say no if there are warnings other than the usual output. |
15895 | 15898 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
15896 | 15899 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
15897 | 15900 | -e 's:$: $lt_compiler_flag:'` |
15898 | (eval echo "\"\$as_me:15899: $lt_compile\"" >&5) | |
15901 | (eval echo "\"\$as_me:15902: $lt_compile\"" >&5) | |
15899 | 15902 | (eval "$lt_compile" 2>out/conftest.err) |
15900 | 15903 | ac_status=$? |
15901 | 15904 | cat out/conftest.err >&5 |
15902 | echo "$as_me:15903: \$? = $ac_status" >&5 | |
15905 | echo "$as_me:15906: \$? = $ac_status" >&5 | |
15903 | 15906 | if (exit $ac_status) && test -s out/conftest2.$ac_objext |
15904 | 15907 | then |
15905 | 15908 | # The compiler can only warn and ignore the option if not recognized |
18125 | 18128 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
18126 | 18129 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
18127 | 18130 | -e 's:$: $lt_compiler_flag:'` |
18128 | (eval echo "\"\$as_me:18129: $lt_compile\"" >&5) | |
18131 | (eval echo "\"\$as_me:18132: $lt_compile\"" >&5) | |
18129 | 18132 | (eval "$lt_compile" 2>conftest.err) |
18130 | 18133 | ac_status=$? |
18131 | 18134 | cat conftest.err >&5 |
18132 | echo "$as_me:18133: \$? = $ac_status" >&5 | |
18135 | echo "$as_me:18136: \$? = $ac_status" >&5 | |
18133 | 18136 | if (exit $ac_status) && test -s "$ac_outfile"; then |
18134 | 18137 | # The compiler can only warn and ignore the option if not recognized |
18135 | 18138 | # So say no if there are warnings other than the usual output. |
18393 | 18396 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
18394 | 18397 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
18395 | 18398 | -e 's:$: $lt_compiler_flag:'` |
18396 | (eval echo "\"\$as_me:18397: $lt_compile\"" >&5) | |
18399 | (eval echo "\"\$as_me:18400: $lt_compile\"" >&5) | |
18397 | 18400 | (eval "$lt_compile" 2>conftest.err) |
18398 | 18401 | ac_status=$? |
18399 | 18402 | cat conftest.err >&5 |
18400 | echo "$as_me:18401: \$? = $ac_status" >&5 | |
18403 | echo "$as_me:18404: \$? = $ac_status" >&5 | |
18401 | 18404 | if (exit $ac_status) && test -s "$ac_outfile"; then |
18402 | 18405 | # The compiler can only warn and ignore the option if not recognized |
18403 | 18406 | # So say no if there are warnings other than the usual output. |
18497 | 18500 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
18498 | 18501 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
18499 | 18502 | -e 's:$: $lt_compiler_flag:'` |
18500 | (eval echo "\"\$as_me:18501: $lt_compile\"" >&5) | |
18503 | (eval echo "\"\$as_me:18504: $lt_compile\"" >&5) | |
18501 | 18504 | (eval "$lt_compile" 2>out/conftest.err) |
18502 | 18505 | ac_status=$? |
18503 | 18506 | cat out/conftest.err >&5 |
18504 | echo "$as_me:18505: \$? = $ac_status" >&5 | |
18507 | echo "$as_me:18508: \$? = $ac_status" >&5 | |
18505 | 18508 | if (exit $ac_status) && test -s out/conftest2.$ac_objext |
18506 | 18509 | then |
18507 | 18510 | # The compiler can only warn and ignore the option if not recognized |
21449 | 21452 | |
21450 | 21453 | |
21451 | 21454 | ARCH="" |
21455 | LIBBURNIA_PKGCONFDIR="$libdir"/pkgconfig | |
21452 | 21456 | |
21453 | 21457 | { echo "$as_me:$LINENO: checking target operating system" >&5 |
21454 | 21458 | echo $ECHO_N "checking target operating system... $ECHO_C" >&6; } |
21459 | ||
21455 | 21460 | |
21456 | 21461 | case $target in |
21457 | 21462 | *-*-linux*) |
21461 | 21466 | *-*-freebsd*) |
21462 | 21467 | ARCH=freebsd |
21463 | 21468 | LIBBURN_ARCH_LIBS=-lcam |
21469 | LIBBURNIA_PKGCONFDIR=$(echo "$libdir" | sed 's/\/lib$/\/libdata/')/pkgconfig | |
21464 | 21470 | ;; |
21465 | 21471 | *) |
21466 | 21472 | ARCH= |
21471 | 21477 | |
21472 | 21478 | { echo "$as_me:$LINENO: result: $ARCH" >&5 |
21473 | 21479 | echo "${ECHO_T}$ARCH" >&6; } |
21480 | ||
21474 | 21481 | |
21475 | 21482 | |
21476 | 21483 | |
21762 | 21769 | fi |
21763 | 21770 | CFLAGS="$CFLAGS -DDEBUG" |
21764 | 21771 | fi |
21772 | ||
21773 | ||
21774 | ||
21775 | ### for testing --enable-libdir-pkgconfig on Linux | |
21776 | ### LIBBURNIA_PKGCONFDIR="$libdir"data/pkgconfig | |
21777 | ||
21778 | if test "x$LIBBURNIA_PKGCONFDIR" = "x$libdir"/pkgconfig | |
21779 | then | |
21780 | dummy=dummy | |
21781 | else | |
21782 | # Check whether --enable-libdir-pkgconfig was given. | |
21783 | if test "${enable_libdir_pkgconfig+set}" = set; then | |
21784 | enableval=$enable_libdir_pkgconfig; | |
21785 | else | |
21786 | enable_libdir_pkgconfig="no" | |
21787 | fi | |
21788 | ||
21789 | { echo "$as_me:$LINENO: checking for --enable-libdir-pkgconfig" >&5 | |
21790 | echo $ECHO_N "checking for --enable-libdir-pkgconfig... $ECHO_C" >&6; } | |
21791 | if test "x$enable_libdir_pkgconfig" = xyes | |
21792 | then | |
21793 | LIBBURNIA_PKGCONFDIR="$libdir"/pkgconfig | |
21794 | fi | |
21795 | { echo "$as_me:$LINENO: result: $enable_libdir_pkgconfig" >&5 | |
21796 | echo "${ECHO_T}$enable_libdir_pkgconfig" >&6; } | |
21797 | fi | |
21798 | ||
21799 | libburnia_pkgconfig_override="no" | |
21800 | # Check whether --enable-pkgconfig-path was given. | |
21801 | if test "${enable_pkgconfig_path+set}" = set; then | |
21802 | enableval=$enable_pkgconfig_path; libburnia_pkgconfig_override="yes" | |
21803 | else | |
21804 | enable_pkgconfig_path="none" | |
21805 | fi | |
21806 | ||
21807 | { echo "$as_me:$LINENO: checking for overridden pkgconfig directory path" >&5 | |
21808 | echo $ECHO_N "checking for overridden pkgconfig directory path... $ECHO_C" >&6; } | |
21809 | if test "x$enable_pkgconfig_path" = xno | |
21810 | then | |
21811 | libburnia_pkgconfig_override="no" | |
21812 | fi | |
21813 | if test "x$enable_pkgconfig_path" = x -o "x$enable_pkgconfig_path" = xyes | |
21814 | then | |
21815 | libburnia_pkgconfig_override="invalid argument" | |
21816 | fi | |
21817 | if test "x$libburnia_pkgconfig_override" = xyes | |
21818 | then | |
21819 | LIBBURNIA_PKGCONFDIR="$enable_pkgconfig_path" | |
21820 | { echo "$as_me:$LINENO: result: $LIBBURNIA_PKGCONFDIR" >&5 | |
21821 | echo "${ECHO_T}$LIBBURNIA_PKGCONFDIR" >&6; } | |
21822 | else | |
21823 | { echo "$as_me:$LINENO: result: $libburnia_pkgconfig_override" >&5 | |
21824 | echo "${ECHO_T}$libburnia_pkgconfig_override" >&6; } | |
21825 | fi | |
21826 | ||
21827 | ||
21828 | ### AC_MSG_RESULT([LIBBURNIA_PKGCONFDIR = $LIBBURNIA_PKGCONFDIR]) | |
21829 | ||
21830 | ||
21831 | ||
21765 | 21832 | |
21766 | 21833 | ac_config_files="$ac_config_files Makefile doc/doxygen.conf version.h libburn-1.pc" |
21767 | 21834 | |
22206 | 22273 | # report actual input values of CONFIG_FILES etc. instead of their |
22207 | 22274 | # values after options handling. |
22208 | 22275 | ac_log=" |
22209 | This file was extended by libburn $as_me 0.6.4, which was | |
22276 | This file was extended by libburn $as_me 0.7.0, which was | |
22210 | 22277 | generated by GNU Autoconf 2.60. Invocation command line was |
22211 | 22278 | |
22212 | 22279 | CONFIG_FILES = $CONFIG_FILES |
22253 | 22320 | _ACEOF |
22254 | 22321 | cat >>$CONFIG_STATUS <<_ACEOF |
22255 | 22322 | ac_cs_version="\\ |
22256 | libburn config.status 0.6.4 | |
22323 | libburn config.status 0.7.0 | |
22257 | 22324 | configured by $0, generated by GNU Autoconf 2.60, |
22258 | 22325 | with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" |
22259 | 22326 | |
22585 | 22652 | LIBTOOL_DEPS!$LIBTOOL_DEPS$ac_delim |
22586 | 22653 | THREAD_LIBS!$THREAD_LIBS$ac_delim |
22587 | 22654 | ARCH!$ARCH$ac_delim |
22655 | LIBBURNIA_PKGCONFDIR!$LIBBURNIA_PKGCONFDIR$ac_delim | |
22588 | 22656 | LIBBURN_ARCH_LIBS!$LIBBURN_ARCH_LIBS$ac_delim |
22589 | 22657 | LIBOBJS!$LIBOBJS$ac_delim |
22590 | 22658 | LTLIBOBJS!$LTLIBOBJS$ac_delim |
22591 | 22659 | _ACEOF |
22592 | 22660 | |
22593 | if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 27; then | |
22661 | if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 28; then | |
22594 | 22662 | break |
22595 | 22663 | elif $ac_last_try; then |
22596 | 22664 | { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 |
0 | AC_INIT([libburn], [0.6.4], [http://libburnia-project.org]) | |
0 | AC_INIT([libburn], [0.7.0], [http://libburnia-project.org]) | |
1 | 1 | AC_PREREQ([2.50]) |
2 | 2 | dnl AC_CONFIG_HEADER([config.h]) |
3 | 3 | |
6 | 6 | |
7 | 7 | AM_INIT_AUTOMAKE([subdir-objects]) |
8 | 8 | |
9 | dnl Notes by ts A71207 - A81111 : | |
9 | dnl Notes by ts A71207 - A90827 : | |
10 | 10 | dnl |
11 | 11 | dnl Regrettably the meaning of the various version types was misunderstood |
12 | 12 | dnl before version 0.4.1. |
70 | 70 | dnl 0.6.0 = libburn.so.4.25.0 |
71 | 71 | dnl 0.6.2 = libburn.so.4.27.0 |
72 | 72 | dnl 0.6.4 = libburn.so.4.29.0 |
73 | dnl 0.6.6 = libburn.so.4.31.0 | |
74 | dnl 0.6.8 = libburn.so.4.33.0 | |
75 | dnl 0.7.0 = libburn.so.4.35.0 | |
73 | 76 | dnl |
74 | 77 | dnl So LT_CURRENT, LT_REVISION and LT_AGE get set directly here. |
75 | 78 | dnl SONAME of the emerging library is LT_CURRENT - LT_AGE. |
94 | 97 | dnl |
95 | 98 | dnl As said: Only copies. Original in libburn/libburn.h : burn_header_version_* |
96 | 99 | BURN_MAJOR_VERSION=0 |
97 | BURN_MINOR_VERSION=6 | |
98 | BURN_MICRO_VERSION=4 | |
100 | BURN_MINOR_VERSION=7 | |
101 | BURN_MICRO_VERSION=0 | |
99 | 102 | BURN_VERSION=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION |
100 | 103 | |
101 | 104 | AC_SUBST(BURN_MAJOR_VERSION) |
106 | 109 | dnl Libtool versioning |
107 | 110 | LT_RELEASE=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION |
108 | 111 | dnl |
109 | dnl ts A90313 | |
110 | dnl This is the release version libburn-0.6.4 = libburn.so.4.29.0 | |
112 | dnl ts A90827 | |
113 | dnl This is the release version libburn-0.7.0 = libburn.so.4.35.0 | |
111 | 114 | dnl ### This is the development version after above release version |
112 | 115 | dnl LT_CURRENT++, LT_AGE++ has not yet happened. |
113 | 116 | dnl ### LT_CURRENT++, LT_AGE++ has happened meanwhile. |
114 | 117 | dnl |
115 | dnl SONAME = 33 - 29 = 4 . Linux library name = libburn.so.4.29.0 | |
116 | LT_CURRENT=33 | |
117 | LT_AGE=29 | |
118 | dnl SONAME = 39 - 35 = 4 . Linux library name = libburn.so.4.35.0 | |
119 | LT_CURRENT=39 | |
120 | LT_AGE=35 | |
118 | 121 | LT_REVISION=0 |
119 | 122 | LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE` |
120 | 123 | |
161 | 164 | |
162 | 165 | TARGET_SHIZZLE |
163 | 166 | AC_SUBST(ARCH) |
167 | AC_SUBST(LIBBURNIA_PKGCONFDIR) | |
164 | 168 | AC_SUBST(LIBBURN_ARCH_LIBS) |
165 | 169 | |
166 | 170 | dnl ts A90303 |
192 | 196 | CFLAGS="$CFLAGS -DDEBUG" |
193 | 197 | fi |
194 | 198 | |
199 | ||
200 | dnl Determine target directory for libburn-*.pc | |
201 | dnl Important: Must be performed _after_ TARGET_SHIZZLE | |
202 | dnl | |
203 | LIBBURNIA_SET_PKGCONFIG | |
204 | ||
205 | ||
195 | 206 | AC_CONFIG_FILES([ |
196 | 207 | Makefile |
197 | 208 | doc/doxygen.conf |
558 | 558 | } |
559 | 559 | |
560 | 560 | /* ts A61007 : obsolete Assert in spc_select_write_params() */ |
561 | if (d->drive_role == 1 && !d->mdata->valid) { | |
561 | if (d->drive_role == 1 && d->mdata->valid <= 0) { | |
562 | 562 | libdax_msgs_submit(libdax_messenger, |
563 | 563 | d->global_index, 0x00020113, |
564 | 564 | LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH, |
39 | 39 | /* A70903 : for burn_scsi_setup_drive() */ |
40 | 40 | #include "spc.h" |
41 | 41 | |
42 | /* A90815 : for mmc_obtain_profile_name() */ | |
43 | #include "mmc.h" | |
44 | ||
42 | 45 | #include "libdax_msgs.h" |
43 | 46 | extern struct libdax_msgs *libdax_messenger; |
44 | 47 | |
231 | 234 | /* ts A61020 : d->status was set to BURN_DISC_BLANK as pure guess */ |
232 | 235 | |
233 | 236 | /* ts A71128 : run read_disc_info() for any recognizeable profile */ |
234 | if (d->current_profile > 0 || | |
237 | if (d->current_profile > 0 || d->current_is_guessed_profile || | |
235 | 238 | d->mdata->cdr_write || d->mdata->cdrw_write || |
236 | 239 | d->mdata->dvdr_write || d->mdata->dvdram_write) { |
237 | 240 | |
417 | 420 | struct burn_drive *burn_drive_finish_enum(struct burn_drive *d) |
418 | 421 | { |
419 | 422 | struct burn_drive *t; |
423 | char msg[BURN_DRIVE_ADR_LEN + 160]; | |
424 | int ret; | |
425 | ||
420 | 426 | /* ts A60821 |
421 | 427 | <<< debug: for tracing calls which might use open drive fds */ |
422 | 428 | int mmc_function_spy(struct burn_drive *d, char * text); |
429 | 435 | mmc_function_spy(NULL, "enumerate_common : -------- doing grab"); |
430 | 436 | |
431 | 437 | /* try to get the drive info */ |
432 | if (t->grab(t)) { | |
438 | ret = t->grab(t); | |
439 | if (ret) { | |
433 | 440 | burn_print(2, "getting drive info\n"); |
434 | 441 | t->getcaps(t); |
435 | 442 | t->unlock(t); |
436 | 443 | t->released = 1; |
437 | 444 | } else { |
438 | burn_print(2, "unable to grab new located drive\n"); | |
445 | /* ts A90602 */ | |
446 | d->mdata->valid = -1; | |
447 | sprintf(msg, "Unable to grab scanned drive %s", d->devname); | |
448 | libdax_msgs_submit(libdax_messenger, d->global_index, | |
449 | 0x0002016f, LIBDAX_MSGS_SEV_DEBUG, | |
450 | LIBDAX_MSGS_PRIO_LOW, msg, 0, 0); | |
439 | 451 | burn_drive_unregister(t); |
440 | 452 | t = NULL; |
441 | 453 | } |
516 | 528 | |
517 | 529 | /* ts A61125 : outsourced model aspects */ |
518 | 530 | burn_drive_mark_unready(d); |
531 | return 1; | |
532 | } | |
533 | ||
534 | ||
535 | /* API */ | |
536 | /* ts A90824 | |
537 | @param flag bit0= wake up (else start snoozing) | |
538 | */ | |
539 | int burn_drive_snooze(struct burn_drive *d, int flag) | |
540 | { | |
541 | if (d->drive_role != 1) | |
542 | return 0; | |
543 | if (flag & 1) | |
544 | d->start_unit(d); | |
545 | else | |
546 | d->stop_unit(d); | |
519 | 547 | return 1; |
520 | 548 | } |
521 | 549 | |
854 | 882 | a ssert(d->mdata); |
855 | 883 | #endif |
856 | 884 | |
857 | if (!d->idata->valid || !d->mdata->valid) | |
885 | if(d->idata->valid <= 0 || d->mdata->valid <= 0) | |
858 | 886 | return 0; |
859 | 887 | |
860 | 888 | id = (struct burn_scsi_inquiry_data *)d->idata; |
920 | 948 | */ |
921 | 949 | unsigned char scanned[32]; |
922 | 950 | unsigned count = 0; |
923 | int i; | |
951 | int i, ret; | |
924 | 952 | |
925 | 953 | /* ts A61007 : moved up to burn_drive_scan() */ |
926 | 954 | /* a ssert(burn_running); */ |
977 | 1005 | if (drive_array[i].global_index < 0) |
978 | 1006 | continue; /* invalid device */ |
979 | 1007 | |
980 | while (!drive_getcaps(&drive_array[i], | |
981 | &(*drives)[*n_drives])) { | |
1008 | /* ts A90602 : This old loop is not plausible. See A70907. | |
1009 | while (!drive_getcaps(&drive_array[i], | |
1010 | &(*drives)[*n_drives])) { | |
982 | 1011 | sleep(1); |
983 | } | |
984 | (*n_drives)++; | |
1012 | } | |
1013 | */ | |
1014 | /* ts A90602 : A single call shall do (rather than a loop) */ | |
1015 | ret = drive_getcaps(&drive_array[i], &(*drives)[*n_drives]); | |
1016 | if (ret > 0) | |
1017 | (*n_drives)++; | |
985 | 1018 | scanned[i / 8] |= 1 << (i % 8); |
1019 | } | |
1020 | if (*drives != NULL && *n_drives == 0) { | |
1021 | free ((char *) *drives); | |
1022 | *drives = NULL; | |
986 | 1023 | } |
987 | 1024 | |
988 | 1025 | return(1); |
1139 | 1176 | |
1140 | 1177 | int burn_drive_get_read_speed(struct burn_drive *d) |
1141 | 1178 | { |
1142 | if(!d->mdata->valid) | |
1179 | if(d->mdata->valid <= 0) | |
1143 | 1180 | return 0; |
1144 | 1181 | return d->mdata->max_read_speed; |
1145 | 1182 | } |
1146 | 1183 | |
1147 | 1184 | int burn_drive_get_write_speed(struct burn_drive *d) |
1148 | 1185 | { |
1149 | if(!d->mdata->valid) | |
1186 | if(d->mdata->valid <= 0) | |
1150 | 1187 | return 0; |
1151 | 1188 | return d->mdata->max_write_speed; |
1152 | 1189 | } |
1154 | 1191 | /* ts A61021 : New API function */ |
1155 | 1192 | int burn_drive_get_min_write_speed(struct burn_drive *d) |
1156 | 1193 | { |
1157 | if(!d->mdata->valid) | |
1194 | if(d->mdata->valid <= 0) | |
1158 | 1195 | return 0; |
1159 | 1196 | return d->mdata->min_write_speed; |
1160 | 1197 | } |
1741 | 1778 | unsigned long wait_grain= 100000; |
1742 | 1779 | time_t start_time, current_time, pacifier_time, end_time; |
1743 | 1780 | |
1781 | #ifndef NIX | |
1782 | time_t stdio_patience = 3; | |
1783 | #endif | |
1784 | ||
1744 | 1785 | current_time = start_time = pacifier_time = time(0); |
1745 | 1786 | end_time = start_time + patience; |
1746 | 1787 | |
1757 | 1798 | if(occup == -2) |
1758 | 1799 | continue; |
1759 | 1800 | |
1801 | if(drive_array[i].drive_role != 1) { | |
1802 | ||
1760 | 1803 | #ifdef NIX |
1761 | /* <<< this causes a race condition with drive usage | |
1762 | and drive disposal | |
1763 | */ | |
1764 | if(drive_array[i].drive_role != 1) { | |
1804 | ||
1805 | /* ts A90302 | |
1806 | <<< this causes a race condition with drive | |
1807 | usage and drive disposal. | |
1808 | */ | |
1765 | 1809 | drive_array[i].busy = BURN_DRIVE_IDLE; |
1766 | 1810 | burn_drive_forget(&(drive_array[i]), 1); |
1767 | } else | |
1768 | #endif /* NIX */ | |
1811 | continue; | |
1812 | ||
1813 | #else /* NIX */ | |
1814 | ||
1815 | /* ts A90318 | |
1816 | >>> but if a pipe breaks then the drive | |
1817 | never gets idle. | |
1818 | So for now with a short patience timespan | |
1819 | and eventually a deliberate memory leak. | |
1820 | */ | |
1821 | if (current_time - start_time > | |
1822 | stdio_patience) { | |
1823 | drive_array[i].global_index = -1; | |
1824 | continue; | |
1825 | } | |
1826 | ||
1827 | #endif /* ! NIX */ | |
1828 | ||
1829 | } | |
1769 | 1830 | |
1770 | 1831 | if(occup <= 10) { |
1771 | 1832 | burn_drive_forget(&(drive_array[i]), 1); |
1846 | 1907 | } |
1847 | 1908 | if(d->drive_role != 1) |
1848 | 1909 | return 0; |
1849 | if (d->current_profile == -1 || d->current_is_cd_profile) { | |
1910 | if ((d->current_profile == -1 || d->current_is_cd_profile) | |
1911 | && (d->mdata->cdrw_write || d->current_profile != 0x08)) { | |
1850 | 1912 | d->read_atip(d); |
1851 | 1913 | /* >>> some control of success would be nice :) */ |
1852 | 1914 | } else { |
1853 | /* mmc5r03c.pdf 6.26.3.6.3 : ATIP is undefined for non-CD */; | |
1915 | /* mmc5r03c.pdf 6.26.3.6.3 : ATIP is undefined for non-CD | |
1916 | (and it seems meaningless for non-burners). | |
1917 | ts A90823: Pseudo-CD U3 memory stick stalls with ATIP. | |
1918 | It is !cdrw_write and profile is 0x08. | |
1919 | */ | |
1854 | 1920 | return 0; |
1855 | 1921 | } |
1856 | 1922 | return 1; |
1955 | 2021 | *pno = d->current_profile; |
1956 | 2022 | strcpy(name,d->current_profile_text); |
1957 | 2023 | return *pno >= 0; |
2024 | } | |
2025 | ||
2026 | ||
2027 | /* ts A90815 : New API function */ | |
2028 | int burn_drive_get_all_profiles(struct burn_drive *d, int *num_profiles, | |
2029 | int profiles[64], char is_current[64]) | |
2030 | { | |
2031 | int i; | |
2032 | ||
2033 | *num_profiles = d->num_profiles; | |
2034 | for (i = 0; i < d->num_profiles; i++) { | |
2035 | profiles[i] = (d->all_profiles[i * 4] << 8) | | |
2036 | d->all_profiles[i * 4 + 1]; | |
2037 | is_current[i] = d->all_profiles[i * 4 + 2] & 1; | |
2038 | } | |
2039 | return 1; | |
2040 | } | |
2041 | ||
2042 | ||
2043 | /* ts A90815 : New API function */ | |
2044 | int burn_obtain_profile_name(int profile_number, char name[80]) | |
2045 | { | |
2046 | strcpy(name, mmc_obtain_profile_name(profile_number)); | |
2047 | return(name[0] != 0); | |
1958 | 2048 | } |
1959 | 2049 | |
1960 | 2050 | |
2057 | 2147 | struct burn_speed_descriptor *sd, *csd = NULL; |
2058 | 2148 | |
2059 | 2149 | (*speed_list) = NULL; |
2060 | if(!d->mdata->valid) | |
2150 | if(d->mdata->valid <= 0) | |
2061 | 2151 | return 0; |
2062 | 2152 | for (sd = d->mdata->speed_descriptors; sd != NULL; sd = sd->next) { |
2063 | 2153 | ret = burn_speed_descriptor_new(&csd, NULL, csd, 0); |
2082 | 2172 | if (speed_goal < 0) |
2083 | 2173 | best_speed = 2000000000; |
2084 | 2174 | *best_descr = NULL; |
2085 | if(!d->mdata->valid) | |
2175 | if(d->mdata->valid <= 0) | |
2086 | 2176 | return 0; |
2087 | 2177 | for (sd = d->mdata->speed_descriptors; sd != NULL; sd = sd->next) { |
2088 | 2178 | if (flag & 1) |
1026 | 1026 | @return 1 if it was possible to grab the drive, else 0 |
1027 | 1027 | */ |
1028 | 1028 | int burn_drive_grab(struct burn_drive *drive, int load); |
1029 | ||
1030 | ||
1031 | /* ts A90824 */ | |
1032 | /** Calm down or alert a drive. Some drives stay alert after reading for | |
1033 | quite some time. This saves time with the startup for the next read | |
1034 | operation but also causes noise and consumes extra energy. It makes | |
1035 | sense to calm down the drive if no read operation is expected for the | |
1036 | next few seconds. The drive will get alert automatically if operations | |
1037 | are required. | |
1038 | @param drive The drive to influence. | |
1039 | @param flag Bitfield for control purposes | |
1040 | bit0= become alert (else start snoozing) | |
1041 | This is not mandatory to allow further drive operations | |
1042 | @return 1= success , 0= drive role not suitable for calming | |
1043 | @since 0.7.0 | |
1044 | */ | |
1045 | int burn_drive_snooze(struct burn_drive *d, int flag); | |
1029 | 1046 | |
1030 | 1047 | |
1031 | 1048 | /** Release a drive. This should not be done until the drive is no longer |
1997 | 2014 | void burn_read_opts_set_hardware_error_retries(struct burn_read_opts *opts, |
1998 | 2015 | unsigned char hardware_error_retries); |
1999 | 2016 | |
2017 | ||
2018 | /* ts A90815 */ | |
2019 | /** Gets the list of profile codes supported by the drive. | |
2020 | Profiles depict the feature sets which constitute media types. For | |
2021 | known profile codes and names see burn_disc_get_profile(). | |
2022 | @param d is the drive to query | |
2023 | @param num_profiles returns the number of supported profiles | |
2024 | @param profiles returns the profile codes | |
2025 | @param is_current returns the status of the corresponding profile code: | |
2026 | 1= current, i.e. the matching media is loaded | |
2027 | 0= not current, i.e. the matching media is not loaded | |
2028 | @return always 1 for now | |
2029 | @since 0.7.0 | |
2030 | */ | |
2031 | int burn_drive_get_all_profiles(struct burn_drive *d, int *num_profiles, | |
2032 | int profiles[64], char is_current[64]); | |
2033 | ||
2034 | ||
2035 | /* ts A90815 */ | |
2036 | /** Obtains the profile name associated with a profile code. | |
2037 | @param profile_code the profile code to be translated | |
2038 | @param name returns the profile name (e.g. "DVD+RW") | |
2039 | @return 1= known profile code , 0= unknown profile code | |
2040 | @since 0.7.0 | |
2041 | */ | |
2042 | int burn_obtain_profile_name(int profile_code, char name[80]); | |
2043 | ||
2044 | ||
2000 | 2045 | /** Gets the maximum write speed for a drive and eventually loaded media. |
2001 | 2046 | The return value might change by the media type of already loaded media, |
2002 | 2047 | again by call burn_drive_grab() and again by call burn_disc_read_atip(). |
2258 | 2303 | |
2259 | 2304 | */ |
2260 | 2305 | #define burn_header_version_major 0 |
2261 | #define burn_header_version_minor 6 | |
2262 | #define burn_header_version_micro 4 | |
2306 | #define burn_header_version_minor 7 | |
2307 | #define burn_header_version_micro 0 | |
2263 | 2308 | /** Note: |
2264 | 2309 | Above version numbers are also recorded in configure.ac because libtool |
2265 | 2310 | wants them as parameters at build time. |
544 | 544 | 0x0002016a (FAILURE,HIGH) = No MMC transport adapter is present |
545 | 545 | 0x0002016b (WARNING,HIGH) = No MMC transport adapter is present |
546 | 546 | 0x0002016c (DEBUG,HIGH) = No MMC transport adapter is present |
547 | ||
547 | 0x0002016e (DEBUG,HIGH) = MODE SENSE page 2A too short | |
548 | 0x0002016f (DEBUG,HIGH) = Unable to grab scanned drive | |
548 | 549 | 0x00020170 (NOTE,HIGH) = Closing open session before writing new one |
549 | 550 | 0x00020171 (NOTE,HIGH) = Closing BD-R with accidently open session |
550 | 551 |
75 | 75 | actually formatting the media. |
76 | 76 | # define Libburn_do_not_format_dvd_ram_or_bd_rE 1 |
77 | 77 | */ |
78 | ||
79 | ||
80 | /* ts A90603 : Simulate the command restrictions of an old MMC-1 drive | |
81 | # define Libisofs_simulate_old_mmc1_drivE 1 | |
82 | */ | |
83 | ||
78 | 84 | |
79 | 85 | /* DVD/BD progress report: |
80 | 86 | ts A61219 : It seems to work with a used (i.e. thoroughly formatted) DVD+RW. |
229 | 235 | d->cancel = 1; |
230 | 236 | return 0; |
231 | 237 | } |
238 | if (d->is_stopped && strcmp(text, "stop_unit") != 0 && | |
239 | strcmp(text, "start_unit") != 0) { | |
240 | d->start_unit(d); | |
241 | d->is_stopped = 0; | |
242 | } | |
232 | 243 | return 1; |
233 | 244 | } |
234 | 245 | |
1152 | 1163 | struct buffer buf; |
1153 | 1164 | struct command c; |
1154 | 1165 | int dlen; |
1155 | int i, bpl= 12, old_alloc_len, t_idx; | |
1166 | int i, bpl= 12, old_alloc_len, t_idx, ret; | |
1156 | 1167 | unsigned char *tdata; |
1157 | 1168 | char msg[321]; |
1158 | 1169 | |
1178 | 1189 | d->status = BURN_DISC_FULL; |
1179 | 1190 | return 1; |
1180 | 1191 | } |
1192 | ||
1193 | /* ts A90823: | |
1194 | SanDisk Cruzer U3 memory stick stalls on format 2. | |
1195 | Format 0 seems to be more conservative with read-only drives. | |
1196 | */ | |
1197 | if (!(d->mdata->cdrw_write || d->current_profile != 0x08)) { | |
1198 | ret = mmc_read_toc_fmt0(d); | |
1199 | return ret; | |
1200 | } | |
1201 | ||
1181 | 1202 | scsi_init_command(&c, MMC_GET_TOC, sizeof(MMC_GET_TOC)); |
1182 | 1203 | /* |
1183 | 1204 | memcpy(c.opcode, MMC_GET_TOC, sizeof(MMC_GET_TOC)); |
1459 | 1480 | } |
1460 | 1481 | |
1461 | 1482 | |
1462 | static int mmc_read_disc_info_al(struct burn_drive *d, int *alloc_len) | |
1463 | { | |
1464 | struct buffer buf; | |
1465 | unsigned char *data; | |
1466 | struct command c; | |
1467 | char msg[160]; | |
1468 | /* ts A70131 : had to move mmc_read_toc() to end of function */ | |
1469 | int do_read_toc = 0, disc_status, len, old_alloc_len; | |
1470 | int ret, number_of_sessions = -1; | |
1471 | ||
1472 | /* ts A61020 */ | |
1473 | d->start_lba = d->end_lba = -2000000000; | |
1474 | d->erasable = 0; | |
1475 | d->last_track_no = 1; | |
1476 | ||
1477 | /* ts A70212 - A70215 */ | |
1478 | d->media_capacity_remaining = 0; | |
1479 | d->media_lba_limit = 0; | |
1480 | ||
1481 | /* ts A81210 */ | |
1482 | d->media_read_capacity = 0x7fffffff; | |
1483 | ||
1484 | /* ts A61202 */ | |
1485 | d->toc_entries = 0; | |
1486 | if (d->status == BURN_DISC_EMPTY) | |
1487 | return 1; | |
1488 | ||
1489 | mmc_get_configuration(d); | |
1490 | ||
1491 | /* ts A70910 : found this as condition for mmc_function_spy() which went up | |
1492 | if (*alloc_len < 2) | |
1493 | */ | |
1494 | ||
1495 | scsi_init_command(&c, MMC_GET_DISC_INFO, sizeof(MMC_GET_DISC_INFO)); | |
1496 | /* | |
1497 | memcpy(c.opcode, MMC_GET_DISC_INFO, sizeof(MMC_GET_DISC_INFO)); | |
1498 | c.oplen = sizeof(MMC_GET_DISC_INFO); | |
1499 | */ | |
1500 | c.dxfer_len = *alloc_len; | |
1501 | c.opcode[7]= (c.dxfer_len >> 8) & 0xff; | |
1502 | c.opcode[8]= c.dxfer_len & 0xff; | |
1503 | c.retry = 1; | |
1504 | c.page = &buf; | |
1505 | c.page->sectors = 0; | |
1506 | c.page->bytes = 0; | |
1507 | c.dir = FROM_DRIVE; | |
1508 | d->issue_command(d, &c); | |
1509 | ||
1510 | if (c.error) { | |
1511 | d->busy = BURN_DRIVE_IDLE; | |
1512 | return 0; | |
1513 | } | |
1514 | ||
1515 | data = c.page->data; | |
1516 | len = (data[0] << 8) | data[1]; | |
1517 | old_alloc_len = *alloc_len; | |
1518 | *alloc_len = len + 2; | |
1519 | if (old_alloc_len < 34) | |
1520 | return 1; | |
1521 | if (*alloc_len < 24) /* data[23] is the last byte used here */ | |
1522 | return 0; | |
1523 | if (len + 2 > old_alloc_len) | |
1524 | len = old_alloc_len - 2; | |
1525 | ||
1526 | d->erasable = !!(data[2] & 16); | |
1527 | ||
1528 | disc_status = data[2] & 3; | |
1529 | d->state_of_last_session = (data[2] >> 2) & 3; | |
1530 | number_of_sessions = (data[9] << 8) | data[4]; | |
1531 | ||
1532 | if (d->current_profile == 0x10 || d->current_profile == 0x40) { | |
1533 | /* DVD-ROM , BD-ROM */ | |
1534 | disc_status = 2; /* always full and finalized */ | |
1535 | d->erasable = 0; /* never erasable */ | |
1536 | } | |
1537 | ||
1538 | /* ts A80207 : DVD - R DL can normally be read but not be written */ | |
1539 | if(d->current_profile == 0x15 && !burn_support_untested_profiles) { | |
1540 | disc_status = 2; /* always full and finalized */ | |
1541 | d->erasable = 0; /* never erasable */ | |
1542 | } | |
1543 | ||
1544 | #ifdef Libburn_support_bd_r_readonlY | |
1545 | /* <<< For now: declaring BD-R read-only | |
1546 | */ | |
1547 | #ifndef Libburn_support_bd_plus_r_srM | |
1548 | if (d->current_profile == 0x41) { | |
1549 | /* BD-R seq as readonly dummy */ | |
1550 | disc_status = 2; /* always full and finalized */ | |
1551 | d->erasable = 0; /* never erasable */ | |
1552 | } | |
1553 | #endif | |
1554 | if (d->current_profile == 0x42) { | |
1555 | /* BD-R rnd */ | |
1556 | disc_status = 2; /* always full and finalized */ | |
1557 | d->erasable = 0; /* never erasable */ | |
1558 | } | |
1559 | #endif /* Libburn_support_bd_r_readonlY */ | |
1560 | ||
1561 | switch (disc_status) { | |
1562 | case 0: | |
1563 | regard_as_blank:; | |
1564 | d->toc_entries = 0; | |
1565 | d->start_lba = burn_msf_to_lba(data[17], data[18], data[19]); | |
1566 | d->end_lba = burn_msf_to_lba(data[21], data[22], data[23]); | |
1567 | ||
1568 | /* | |
1569 | fprintf(stderr, "libburn_experimental: start_lba = %d (%d %d %d) , end_lba = %d (%d %d %d)\n", | |
1570 | d->start_lba, data[17], data[18], data[19], | |
1571 | d->end_lba, data[21], data[22], data[23]); | |
1572 | */ | |
1573 | ||
1574 | d->status = BURN_DISC_BLANK; | |
1575 | break; | |
1576 | case 1: | |
1577 | d->status = BURN_DISC_APPENDABLE; | |
1578 | ||
1579 | case 2: | |
1580 | if (disc_status == 2) | |
1581 | d->status = BURN_DISC_FULL; | |
1582 | ||
1583 | /* ts A81210 */ | |
1584 | ret = mmc_read_capacity(d); | |
1585 | /* Freshly formatted, unwritten BD-R pretend to be appendable | |
1586 | but in our model they need to be regarded as blank. | |
1587 | Criterion: BD-R seq, read capacity known and 0, | |
1588 | declared appendable, single empty session | |
1589 | */ | |
1590 | if (d->current_profile == 0x41 && | |
1591 | d->status == BURN_DISC_APPENDABLE && | |
1592 | ret > 0 && d->media_read_capacity == 0 && | |
1593 | d->state_of_last_session == 0 && number_of_sessions == 1) | |
1594 | goto regard_as_blank; | |
1595 | ||
1596 | if (d->current_profile == 0x41 && | |
1597 | d->status == BURN_DISC_APPENDABLE && | |
1598 | d->state_of_last_session == 1) { | |
1599 | ||
1600 | /* ??? apply this test to other media types ? */ | |
1601 | ||
1602 | libdax_msgs_submit(libdax_messenger, d->global_index, | |
1603 | 0x00020169, | |
1604 | LIBDAX_MSGS_SEV_WARNING, LIBDAX_MSGS_PRIO_HIGH, | |
1605 | "Last session on media is still open.", 0, 0); | |
1606 | } | |
1607 | ||
1608 | do_read_toc = 1; | |
1609 | break; | |
1610 | } | |
1611 | ||
1612 | if ((d->current_profile != 0 || d->status != BURN_DISC_UNREADY) | |
1613 | && ! d->current_is_supported_profile) { | |
1614 | if (!d->silent_on_scsi_error) { | |
1615 | sprintf(msg, | |
1616 | "Unsuitable media detected. Profile %4.4Xh %s", | |
1617 | d->current_profile, d->current_profile_text); | |
1618 | libdax_msgs_submit(libdax_messenger, d->global_index, | |
1619 | 0x0002011e, | |
1620 | LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH, | |
1621 | msg, 0,0); | |
1622 | } | |
1623 | d->status = BURN_DISC_UNSUITABLE; | |
1624 | return 0; | |
1625 | } | |
1626 | ||
1627 | /* >>> ts A61217 : Note for future | |
1628 | growisofs performs OPC if (data[0]<<8)|data[1]<=32 | |
1629 | which indicates no OPC entries are attached to the | |
1630 | reply from the drive. | |
1631 | */ | |
1632 | ||
1633 | /* ts A61219 : mmc5r03c.pdf 6.22.3.1.13 BG Format Status | |
1634 | 0=blank (not yet started) | |
1635 | 1=started but neither running nor complete | |
1636 | 2=in progress | |
1637 | 3=completed | |
1638 | */ | |
1639 | d->bg_format_status = data[7] & 3; | |
1640 | ||
1641 | /* Preliminarily declare blank: | |
1642 | ts A61219 : DVD+RW (is not bg_format_status==0 "blank") | |
1643 | ts A61229 : same for DVD-RW Restricted overwrite | |
1644 | ts A70112 : same for DVD-RAM | |
1645 | */ | |
1646 | if (d->current_profile == 0x1a || d->current_profile == 0x13 || | |
1647 | d->current_profile == 0x12 || d->current_profile == 0x43) | |
1648 | d->status = BURN_DISC_BLANK; | |
1649 | ||
1650 | if (d->status == BURN_DISC_BLANK) { | |
1651 | d->last_track_no = 1; /* The "incomplete track" */ | |
1652 | d->complete_sessions = 0; | |
1653 | } else { | |
1654 | /* ts A70131 : number of non-empty sessions */ | |
1655 | d->complete_sessions = number_of_sessions; | |
1656 | /* mmc5r03c.pdf 6.22.3.1.3 State of Last Session: 3=complete */ | |
1657 | if (d->state_of_last_session != 3 && d->complete_sessions >= 1) | |
1658 | d->complete_sessions--; | |
1659 | ||
1660 | /* ts A70129 : mmc5r03c.pdf 6.22.3.1.7 | |
1661 | This includes the "incomplete track" if the disk is | |
1662 | appendable. I.e number of complete tracks + 1. */ | |
1663 | d->last_track_no = (data[11] << 8) | data[6]; | |
1664 | } | |
1665 | if (d->current_profile != 0x0a && d->current_profile != 0x13 && | |
1666 | d->current_profile != 0x14 && d->status != BURN_DISC_FULL) | |
1667 | d->erasable = 0; /* stay in sync with burn_disc_erase() */ | |
1668 | ||
1669 | if (do_read_toc) | |
1670 | mmc_read_toc(d); | |
1671 | return 1; | |
1672 | } | |
1673 | ||
1674 | ||
1675 | void mmc_read_disc_info(struct burn_drive *d) | |
1676 | { | |
1677 | int alloc_len = 34, ret; | |
1678 | ||
1679 | if (mmc_function_spy(d, "mmc_read_disc_info") <= 0) | |
1680 | return; | |
1681 | ||
1682 | ret = mmc_read_disc_info_al(d, &alloc_len); | |
1683 | /* | |
1684 | fprintf(stderr,"LIBBURN_DEBUG: 51h alloc_len = %d , ret = %d\n", | |
1685 | alloc_len, ret); | |
1686 | */ | |
1687 | /* for now there is no need to inquire the variable lenght part */ | |
1688 | } | |
1689 | ||
1690 | ||
1691 | void mmc_read_atip(struct burn_drive *d) | |
1692 | { | |
1693 | struct buffer buf; | |
1694 | struct command c; | |
1695 | int alloc_len = 28; | |
1696 | ||
1697 | /* ts A61021 */ | |
1698 | unsigned char *data; | |
1699 | /* Speed values from A1: | |
1700 | With 4 cdrecord tells "10" or "8" where MMC-1 says "8". | |
1701 | cdrecord "8" appear on 4xCD-RW and thus seem to be quite invalid. | |
1702 | My CD-R (>=24 speed) tell no A1. | |
1703 | The higher non-MMC-1 values are hearsay. | |
1704 | */ | |
1705 | /* 0, 2, 4, 6, 10, -, 16, -, */ | |
1706 | static int speed_value[16]= { 0, 353, 706, 1059, 1764, -5, 2824, -7, | |
1707 | 4234, 5646, 7056, 8468, -12, -13, -14, -15}; | |
1708 | /* 24, 32, 40, 48, -, -, -, - */ | |
1709 | ||
1710 | if (mmc_function_spy(d, "mmc_read_atip") <= 0) | |
1711 | return; | |
1712 | ||
1713 | scsi_init_command(&c, MMC_GET_ATIP, sizeof(MMC_GET_ATIP)); | |
1714 | /* | |
1715 | memcpy(c.opcode, MMC_GET_ATIP, sizeof(MMC_GET_ATIP)); | |
1716 | c.oplen = sizeof(MMC_GET_ATIP); | |
1717 | */ | |
1718 | c.dxfer_len = alloc_len; | |
1719 | c.opcode[7]= (c.dxfer_len >> 8) & 0xff; | |
1720 | c.opcode[8]= c.dxfer_len & 0xff; | |
1721 | c.retry = 1; | |
1722 | c.page = &buf; | |
1723 | c.page->bytes = 0; | |
1724 | c.page->sectors = 0; | |
1725 | ||
1726 | c.dir = FROM_DRIVE; | |
1727 | d->issue_command(d, &c); | |
1728 | burn_print(1, "atip shit for you\n"); | |
1729 | ||
1730 | ||
1731 | /* ts A61021 */ | |
1732 | data = c.page->data; | |
1733 | d->erasable= !!(data[6]&64); | |
1734 | d->start_lba= burn_msf_to_lba(data[8],data[9],data[10]); | |
1735 | d->end_lba= burn_msf_to_lba(data[12],data[13],data[14]); | |
1736 | if (data[6]&4) { | |
1737 | if (speed_value[(data[16]>>4)&7] > 0) { | |
1738 | d->mdata->min_write_speed = | |
1739 | speed_value[(data[16]>>4)&7]; | |
1740 | if (speed_value[(data[16])&15] <= 0) | |
1741 | d->mdata->max_write_speed = | |
1742 | speed_value[(data[16]>>4)&7]; | |
1743 | } | |
1744 | if (speed_value[(data[16])&15] > 0) { | |
1745 | d->mdata->max_write_speed = | |
1746 | speed_value[(data[16])&15]; | |
1747 | if (speed_value[(data[16]>>4)&7] <= 0) | |
1748 | d->mdata->min_write_speed = | |
1749 | speed_value[(data[16])&15]; | |
1750 | } | |
1751 | } | |
1752 | ||
1753 | #ifdef Burn_mmc_be_verbous_about_atiP | |
1754 | { int i; | |
1755 | fprintf(stderr,"libburn_experimental: Returned ATIP Data\n"); | |
1756 | for(i= 0; i<28; i++) | |
1757 | fprintf(stderr,"%3.3d (0x%2.2x)%s", | |
1758 | data[i],data[i],((i+1)%5 ? " ":"\n")); | |
1759 | fprintf(stderr,"\n"); | |
1760 | ||
1761 | fprintf(stderr, | |
1762 | "libburn_experimental: Indicative Target Writing Power= %d\n", | |
1763 | (data[4]>>4)&7); | |
1764 | fprintf(stderr, | |
1765 | "libburn_experimental: Reference speed= %d ->%d\n", | |
1766 | data[4]&7, speed_value[data[4]&7]); | |
1767 | fprintf(stderr, | |
1768 | "libburn_experimental: Is %sunrestricted\n", | |
1769 | (data[5]&64?"":"not ")); | |
1770 | fprintf(stderr, | |
1771 | "libburn_experimental: Is %serasable, sub-type %d\n", | |
1772 | (data[6]&64?"":"not "),(data[6]>>3)&3); | |
1773 | fprintf(stderr, | |
1774 | "libburn_experimental: lead in: %d (%-2.2d:%-2.2d/%-2.2d)\n", | |
1775 | burn_msf_to_lba(data[8],data[9],data[10]), | |
1776 | data[8],data[9],data[10]); | |
1777 | fprintf(stderr, | |
1778 | "libburn_experimental: lead out: %d (%-2.2d:%-2.2d/%-2.2d)\n", | |
1779 | burn_msf_to_lba(data[12],data[13],data[14]), | |
1780 | data[12],data[13],data[14]); | |
1781 | if(data[6]&4) | |
1782 | fprintf(stderr, | |
1783 | "libburn_experimental: A1 speed low %d speed high %d\n", | |
1784 | speed_value[(data[16]>>4)&7], speed_value[(data[16])&7]); | |
1785 | if(data[6]&2) | |
1786 | fprintf(stderr, | |
1787 | "libburn_experimental: A2 speed low %d speed high %d\n", | |
1788 | speed_value[(data[20]>>4)&7], speed_value[(data[20])&7]); | |
1789 | if(data[6]&1) | |
1790 | fprintf(stderr, | |
1791 | "libburn_experimental: A3 speed low %d speed high %d\n", | |
1792 | speed_value[(data[24]>>4)&7], speed_value[(data[24])&7]); | |
1793 | } | |
1794 | ||
1795 | #endif /* Burn_mmc_be_verbous_about_atiP */ | |
1796 | ||
1797 | /* ts A61020 | |
1798 | http://www.t10.org/ftp/t10/drafts/mmc/mmc-r10a.pdf , table 77 : | |
1799 | ||
1800 | 0 ATIP Data Length MSB | |
1801 | 1 ATIP Data Length LSB | |
1802 | 2 Reserved | |
1803 | 3 Reserved | |
1804 | 4 bit7=1, bit4-6="Indicative Target Writing Power", bit3=reserved , | |
1805 | bit0-2="Reference speed" | |
1806 | 5 bit7=0, bit6="URU" , bit0-5=reserved | |
1807 | 6 bit7=1, bit6="Disc Type", bit3-4="Disc Sub-Type", | |
1808 | bit2="A1", bit1="A2", bit0="A3" | |
1809 | 7 reserved | |
1810 | 8 ATIP Start Time of lead-in (Min) | |
1811 | 9 ATIP Start Time of lead-in (Sec) | |
1812 | 10 ATIP Start Time of lead-in (Frame) | |
1813 | 11 reserved | |
1814 | 12 ATIP Last Possible Start Time of lead-out (Min) | |
1815 | 13 ATIP Last Possible Start Time of lead-out (Sec) | |
1816 | 14 ATIP Last Possible Start Time of lead-out (Frame) | |
1817 | 15 reserved | |
1818 | 16 bit7=0, bit4-6="Lowest Usable CLV Recording speed" | |
1819 | bit0-3="Highest Usable CLV Recording speed" | |
1820 | 17 bit7=0, bit4-6="Power Multiplication Factor p", | |
1821 | bit1-3="Target y value of the Modulation/Power function", bit0=reserved | |
1822 | 18 bit7=1, bit4-6="Recommended Erase/Write Power Ratio (P(inf)/W(inf))" | |
1823 | bit0-3=reserved | |
1824 | 19 reserved | |
1825 | 20-22 A2 Values | |
1826 | 23 reserved | |
1827 | 24-26 A3 Values | |
1828 | 27 reserved | |
1829 | ||
1830 | Disc Type - zero indicates CD-R media; one indicates CD-RW media. | |
1831 | ||
1832 | Disc Sub-Type - shall be set to zero. | |
1833 | ||
1834 | A1 - when set to one, indicates that bytes 16-18 are valid. | |
1835 | ||
1836 | Lowest Usable CLV Recording Speed | |
1837 | 000b Reserved | |
1838 | 001b 2X | |
1839 | 010b - 111b Reserved | |
1840 | ||
1841 | Highest CLV Recording Speeds | |
1842 | 000b Reserved | |
1843 | 001b 2X | |
1844 | 010b 4X | |
1845 | 011b 6X | |
1846 | 100b 8X | |
1847 | 101b - 111b Reserved | |
1848 | ||
1849 | MMC-3 seems to recommend MODE SENSE (5Ah) page 2Ah rather than A1, A2, A3. | |
1850 | This page is loaded in libburn function spc_sense_caps() . | |
1851 | Speed is given in kbytes/sec there. But i suspect this to be independent | |
1852 | of media. So one would habe to associate the speed descriptor blocks with | |
1853 | the ATIP media characteristics ? How ? | |
1854 | ||
1855 | */ | |
1856 | } | |
1857 | ||
1858 | void mmc_read_sectors(struct burn_drive *d, | |
1859 | int start, | |
1860 | int len, | |
1861 | const struct burn_read_opts *o, struct buffer *buf) | |
1862 | { | |
1863 | int temp; | |
1864 | int errorblock, req; | |
1865 | struct command c; | |
1866 | ||
1867 | if (mmc_function_spy(d, "mmc_read_sectors") <= 0) | |
1868 | return; | |
1869 | ||
1870 | /* ts A61009 : to be ensured by callers */ | |
1871 | /* a ssert(len >= 0); */ | |
1872 | ||
1873 | /* if the drive isn't busy, why the hell are we here? */ | |
1874 | /* ts A61006 : i second that question */ | |
1875 | /* a ssert(d->busy); */ | |
1876 | ||
1877 | burn_print(12, "reading %d from %d\n", len, start); | |
1878 | ||
1879 | scsi_init_command(&c, MMC_READ_CD, sizeof(MMC_READ_CD)); | |
1880 | /* | |
1881 | memcpy(c.opcode, MMC_READ_CD, sizeof(MMC_READ_CD)); | |
1882 | c.oplen = sizeof(MMC_READ_CD); | |
1883 | */ | |
1884 | c.retry = 1; | |
1885 | temp = start; | |
1886 | c.opcode[5] = temp & 0xFF; | |
1887 | temp >>= 8; | |
1888 | c.opcode[4] = temp & 0xFF; | |
1889 | temp >>= 8; | |
1890 | c.opcode[3] = temp & 0xFF; | |
1891 | temp >>= 8; | |
1892 | c.opcode[2] = temp & 0xFF; | |
1893 | c.opcode[8] = len & 0xFF; | |
1894 | len >>= 8; | |
1895 | c.opcode[7] = len & 0xFF; | |
1896 | len >>= 8; | |
1897 | c.opcode[6] = len & 0xFF; | |
1898 | req = 0xF8; | |
1899 | ||
1900 | /* ts A61106 : LG GSA-4082B dislikes this. key=5h asc=24h ascq=00h | |
1901 | ||
1902 | if (d->busy == BURN_DRIVE_GRABBING || o->report_recovered_errors) | |
1903 | req |= 2; | |
1904 | */ | |
1905 | ||
1906 | c.opcode[10] = 0; | |
1907 | /* always read the subcode, throw it away later, since we don't know | |
1908 | what we're really reading | |
1909 | */ | |
1910 | if (d->busy == BURN_DRIVE_GRABBING || (o->subcodes_audio) | |
1911 | || (o->subcodes_data)) | |
1912 | c.opcode[10] = 1; | |
1913 | ||
1914 | c.opcode[9] = req; | |
1915 | c.page = buf; | |
1916 | c.dir = FROM_DRIVE; | |
1917 | d->issue_command(d, &c); | |
1918 | ||
1919 | if (c.error) { | |
1920 | burn_print(12, "got an error over here\n"); | |
1921 | burn_print(12, "%d, %d, %d, %d\n", c.sense[3], c.sense[4], | |
1922 | c.sense[5], c.sense[6]); | |
1923 | errorblock = | |
1924 | (c.sense[3] << 24) + (c.sense[4] << 16) + | |
1925 | (c.sense[5] << 8) + c.sense[6]; | |
1926 | c.page->sectors = errorblock - start + 1; | |
1927 | burn_print(1, "error on block %d\n", errorblock); | |
1928 | burn_print(12, "error on block %d\n", errorblock); | |
1929 | burn_print(12, "returning %d sectors\n", c.page->sectors); | |
1930 | } | |
1931 | } | |
1932 | ||
1933 | void mmc_erase(struct burn_drive *d, int fast) | |
1934 | { | |
1935 | struct command c; | |
1936 | ||
1937 | if (mmc_function_spy(d, "mmc_erase") <= 0) | |
1938 | return; | |
1939 | ||
1940 | scsi_init_command(&c, MMC_BLANK, sizeof(MMC_BLANK)); | |
1941 | /* | |
1942 | memcpy(c.opcode, MMC_BLANK, sizeof(MMC_BLANK)); | |
1943 | c.oplen = sizeof(MMC_BLANK); | |
1944 | */ | |
1945 | c.opcode[1] = 16; /* IMMED set to 1 */ | |
1946 | c.opcode[1] |= !!fast; | |
1947 | c.retry = 1; | |
1948 | c.page = NULL; | |
1949 | c.dir = NO_TRANSFER; | |
1950 | d->issue_command(d, &c); | |
1951 | } | |
1952 | ||
1953 | void mmc_read_lead_in(struct burn_drive *d, struct buffer *buf) | |
1954 | { | |
1955 | int len; | |
1956 | struct command c; | |
1957 | ||
1958 | if (mmc_function_spy(d, "mmc_read_lead_in") <= 0) | |
1959 | return; | |
1960 | ||
1961 | len = buf->sectors; | |
1962 | scsi_init_command(&c, MMC_READ_CD, sizeof(MMC_READ_CD)); | |
1963 | /* | |
1964 | memcpy(c.opcode, MMC_READ_CD, sizeof(MMC_READ_CD)); | |
1965 | c.oplen = sizeof(MMC_READ_CD); | |
1966 | */ | |
1967 | c.retry = 1; | |
1968 | c.opcode[5] = 0; | |
1969 | c.opcode[4] = 0; | |
1970 | c.opcode[3] = 0; | |
1971 | c.opcode[2] = 0xF0; | |
1972 | c.opcode[8] = 1; | |
1973 | c.opcode[7] = 0; | |
1974 | c.opcode[6] = 0; | |
1975 | c.opcode[9] = 0; | |
1976 | c.opcode[10] = 2; | |
1977 | c.page = buf; | |
1978 | c.dir = FROM_DRIVE; | |
1979 | d->issue_command(d, &c); | |
1980 | } | |
1981 | ||
1982 | void mmc_perform_opc(struct burn_drive *d) | |
1983 | { | |
1984 | struct command c; | |
1985 | ||
1986 | if (mmc_function_spy(d, "mmc_perform_opc") <= 0) | |
1987 | return; | |
1988 | ||
1989 | scsi_init_command(&c, MMC_SEND_OPC, sizeof(MMC_SEND_OPC)); | |
1990 | /* | |
1991 | memcpy(c.opcode, MMC_SEND_OPC, sizeof(MMC_SEND_OPC)); | |
1992 | c.oplen = sizeof(MMC_SEND_OPC); | |
1993 | */ | |
1994 | c.retry = 1; | |
1995 | c.opcode[1] = 1; | |
1996 | c.page = NULL; | |
1997 | c.dir = NO_TRANSFER; | |
1998 | d->issue_command(d, &c); | |
1999 | } | |
2000 | ||
2001 | ||
2002 | /* ts A61221 : Learned much from dvd+rw-tools-7.0 set_speed_B6h() but then | |
2003 | made own experiments on base of mmc5r03c.pdf 6.8.3 and 6.39 in the hope | |
2004 | to achieve a leaner solution | |
2005 | ts A70712 : That leaner solution does not suffice for my LG GSA-4082B. | |
2006 | Meanwhile there is a speed descriptor list anyway. | |
2007 | */ | |
2008 | int mmc_set_streaming(struct burn_drive *d, | |
2009 | int r_speed, int w_speed, int end_lba) | |
2010 | { | |
2011 | struct buffer buf; | |
2012 | struct command c; | |
2013 | int b, eff_end_lba; | |
2014 | char msg[256]; | |
2015 | unsigned char *pd; | |
2016 | int key, asc, ascq; | |
2017 | ||
2018 | if (mmc_function_spy(d, "mmc_set_streaming") <= 0) | |
2019 | return 0; | |
2020 | ||
2021 | scsi_init_command(&c, MMC_SET_STREAMING, sizeof(MMC_SET_STREAMING)); | |
2022 | /* | |
2023 | c.oplen = sizeof(MMC_SET_STREAMING); | |
2024 | memcpy(c.opcode, MMC_SET_STREAMING, sizeof(MMC_SET_STREAMING)); | |
2025 | */ | |
2026 | c.retry = 1; | |
2027 | c.page = &buf; | |
2028 | c.page->bytes = 28; | |
2029 | c.opcode[9] = (c.page->bytes >> 8) & 0xff; | |
2030 | c.opcode[10] = c.page->bytes & 0xff; | |
2031 | c.page->sectors = 0; | |
2032 | c.dir = TO_DRIVE; | |
2033 | memset(c.page->data, 0, c.page->bytes); | |
2034 | pd = c.page->data; | |
2035 | ||
2036 | pd[0] = 0; /* WRC=0 (Default Rotation Control), RDD=Exact=RA=0 */ | |
2037 | ||
2038 | if (w_speed == 0) | |
2039 | w_speed = 0x10000000; /* ~ 2 TB/s */ | |
2040 | else if (w_speed < 0) | |
2041 | w_speed = 177; /* 1x CD */ | |
2042 | if (r_speed == 0) | |
2043 | r_speed = 0x10000000; /* ~ 2 TB/s */ | |
2044 | else if (r_speed < 0) | |
2045 | r_speed = 177; /* 1x CD */ | |
2046 | if (end_lba == 0) { | |
2047 | /* Default computed from 4.7e9 */ | |
2048 | eff_end_lba = 2294921 - 1; | |
2049 | if (d->mdata->max_end_lba > 0) | |
2050 | eff_end_lba = d->mdata->max_end_lba - 1; | |
2051 | } else | |
2052 | eff_end_lba = end_lba; | |
2053 | ||
2054 | sprintf(msg, "mmc_set_streaming: end_lba=%d , r=%d , w=%d", | |
2055 | end_lba, r_speed, w_speed); | |
2056 | libdax_msgs_submit(libdax_messenger, d->global_index, 0x00000002, | |
2057 | LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO, | |
2058 | msg, 0, 0); | |
2059 | ||
2060 | /* start_lba is 0 , 1000 = 1 second as base time for data rate */ | |
2061 | for (b = 0; b < 4 ; b++) { | |
2062 | pd[8+b] = (end_lba >> (24 - 8 * b)) & 0xff; | |
2063 | pd[12+b] = (r_speed >> (24 - 8 * b)) & 0xff; | |
2064 | pd[16+b] = (1000 >> (24 - 8 * b)) & 0xff; | |
2065 | pd[20+b] = (w_speed >> (24 - 8 * b)) & 0xff; | |
2066 | pd[24+b] = (1000 >> (24 - 8 * b)) & 0xff; | |
2067 | } | |
2068 | ||
2069 | /* <<< | |
2070 | fprintf(stderr,"LIBBURN_EXPERIMENTAL : B6h Performance descriptor:\n"); | |
2071 | for (b = 0; b < 28 ; b++) | |
2072 | fprintf(stderr, "%2.2X%c", pd[b], ((b+1)%4 ? ' ' : '\n')); | |
2073 | */ | |
2074 | ||
2075 | ||
2076 | d->issue_command(d, &c); | |
2077 | if (c.error) { | |
2078 | if (c.sense[2]!=0 && !d->silent_on_scsi_error) { | |
2079 | ||
2080 | #ifdef NIX | |
2081 | sprintf(msg, | |
2082 | "SCSI error on set_streaming(%d): key=%X asc=%2.2Xh ascq=%2.2Xh", | |
2083 | w_speed, | |
2084 | c.sense[2],c.sense[12],c.sense[13]); | |
2085 | libdax_msgs_submit(libdax_messenger, | |
2086 | d->global_index, | |
2087 | 0x00020124, | |
2088 | LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH, | |
2089 | msg, 0, 0); | |
2090 | #else /* NIX */ | |
2091 | ||
2092 | sprintf(msg, | |
2093 | "SCSI error on set_streaming(%d): ", w_speed); | |
2094 | scsi_error_msg(d, c.sense, 14, msg + strlen(msg), | |
2095 | &key, &asc, &ascq); | |
2096 | ||
2097 | #endif /* !NIX */ | |
2098 | ||
2099 | } | |
2100 | return 0; | |
2101 | } | |
2102 | return 1; | |
2103 | } | |
2104 | ||
2105 | ||
2106 | void mmc_set_speed(struct burn_drive *d, int r, int w) | |
2107 | { | |
2108 | struct command c; | |
2109 | int ret, end_lba = 0; | |
2110 | struct burn_speed_descriptor *best_sd = NULL; | |
2111 | ||
2112 | if (mmc_function_spy(d, "mmc_set_speed") <= 0) | |
2113 | return; | |
2114 | ||
2115 | if (r <= 0 || w <= 0) { | |
2116 | /* ts A70712 : now searching for best speed descriptor */ | |
2117 | if (w > 0 && r <= 0) | |
2118 | burn_drive_get_best_speed(d, r, &best_sd, 1); | |
2119 | else | |
2120 | burn_drive_get_best_speed(d, w, &best_sd, 0); | |
2121 | if (best_sd != NULL) { | |
2122 | w = best_sd->write_speed; | |
2123 | d->nominal_write_speed = w; | |
2124 | r = best_sd->read_speed; | |
2125 | end_lba = best_sd->end_lba; | |
2126 | } | |
2127 | } | |
2128 | ||
2129 | /* A70711 */ | |
2130 | d->nominal_write_speed = w; | |
2131 | ||
2132 | /* ts A61221 : try to set DVD speed via command B6h */ | |
2133 | if (strstr(d->current_profile_text, "DVD") == d->current_profile_text){ | |
2134 | ret = mmc_set_streaming(d, r, w, end_lba); | |
2135 | if (ret != 0) | |
2136 | return; /* success or really fatal failure */ | |
2137 | } | |
2138 | ||
2139 | /* ts A61112 : MMC standards prescribe FFFFh as max speed. | |
2140 | But libburn.h prescribes 0. | |
2141 | ts A70715 : <0 now means minimum speed */ | |
2142 | if (r == 0 || r > 0xffff) | |
2143 | r = 0xffff; | |
2144 | else if (r < 0) | |
2145 | r = 177; /* 1x CD */ | |
2146 | if (w == 0 || w > 0xffff) | |
2147 | w = 0xffff; | |
2148 | else if (w < 0) | |
2149 | w = 177; /* 1x CD */ | |
2150 | ||
2151 | scsi_init_command(&c, MMC_SET_SPEED, sizeof(MMC_SET_SPEED)); | |
2152 | /* | |
2153 | memcpy(c.opcode, MMC_SET_SPEED, sizeof(MMC_SET_SPEED)); | |
2154 | c.oplen = sizeof(MMC_SET_SPEED); | |
2155 | */ | |
2156 | c.retry = 1; | |
2157 | c.opcode[2] = r >> 8; | |
2158 | c.opcode[3] = r & 0xFF; | |
2159 | c.opcode[4] = w >> 8; | |
2160 | c.opcode[5] = w & 0xFF; | |
2161 | c.page = NULL; | |
2162 | c.dir = NO_TRANSFER; | |
2163 | d->issue_command(d, &c); | |
2164 | } | |
2165 | ||
2166 | ||
2167 | 1483 | /* ts A61201 */ |
2168 | static char *mmc_obtain_profile_name(int profile_number) | |
1484 | char *mmc_obtain_profile_name(int profile_number) | |
2169 | 1485 | { |
2170 | 1486 | static char *texts[0x53] = {NULL}; |
2171 | 1487 | int i, max_pno = 0x53; |
2207 | 1523 | } |
2208 | 1524 | |
2209 | 1525 | |
1526 | /* ts A90603 : to be used if the drive knows no GET CONFIGURATION | |
1527 | */ | |
1528 | static int mmc_guess_profile(struct burn_drive *d, int flag) | |
1529 | { | |
1530 | int cp; | |
1531 | ||
1532 | cp = 0; | |
1533 | if (d->status == BURN_DISC_BLANK || | |
1534 | d->status == BURN_DISC_APPENDABLE) { | |
1535 | cp = 0x09; | |
1536 | } else if (d->status == BURN_DISC_FULL) { | |
1537 | cp = 0x08; | |
1538 | } | |
1539 | if (cp) | |
1540 | if (d->erasable) | |
1541 | cp = 0x0a; | |
1542 | d->current_profile = cp; | |
1543 | if (cp == 0) | |
1544 | return 0; | |
1545 | d->current_is_cd_profile = 1; | |
1546 | d->current_is_supported_profile = 1; | |
1547 | strcpy(d->current_profile_text, mmc_obtain_profile_name(cp)); | |
1548 | return 1; | |
1549 | } | |
1550 | ||
1551 | ||
1552 | static int mmc_read_disc_info_al(struct burn_drive *d, int *alloc_len) | |
1553 | { | |
1554 | struct buffer buf; | |
1555 | unsigned char *data; | |
1556 | struct command c; | |
1557 | char msg[160]; | |
1558 | /* ts A70131 : had to move mmc_read_toc() to end of function */ | |
1559 | int do_read_toc = 0, disc_status, len, old_alloc_len; | |
1560 | int ret, number_of_sessions = -1; | |
1561 | ||
1562 | /* ts A61020 */ | |
1563 | d->start_lba = d->end_lba = -2000000000; | |
1564 | d->erasable = 0; | |
1565 | d->last_track_no = 1; | |
1566 | ||
1567 | /* ts A70212 - A70215 */ | |
1568 | d->media_capacity_remaining = 0; | |
1569 | d->media_lba_limit = 0; | |
1570 | ||
1571 | /* ts A81210 */ | |
1572 | d->media_read_capacity = 0x7fffffff; | |
1573 | ||
1574 | /* ts A61202 */ | |
1575 | d->toc_entries = 0; | |
1576 | if (d->status == BURN_DISC_EMPTY) | |
1577 | return 1; | |
1578 | ||
1579 | mmc_get_configuration(d); | |
1580 | ||
1581 | /* ts A70910 : found this as condition for mmc_function_spy() which went up | |
1582 | if (*alloc_len < 2) | |
1583 | */ | |
1584 | ||
1585 | scsi_init_command(&c, MMC_GET_DISC_INFO, sizeof(MMC_GET_DISC_INFO)); | |
1586 | /* | |
1587 | memcpy(c.opcode, MMC_GET_DISC_INFO, sizeof(MMC_GET_DISC_INFO)); | |
1588 | c.oplen = sizeof(MMC_GET_DISC_INFO); | |
1589 | */ | |
1590 | c.dxfer_len = *alloc_len; | |
1591 | c.opcode[7]= (c.dxfer_len >> 8) & 0xff; | |
1592 | c.opcode[8]= c.dxfer_len & 0xff; | |
1593 | c.retry = 1; | |
1594 | c.page = &buf; | |
1595 | c.page->sectors = 0; | |
1596 | c.page->bytes = 0; | |
1597 | c.dir = FROM_DRIVE; | |
1598 | d->issue_command(d, &c); | |
1599 | ||
1600 | if (c.error) { | |
1601 | d->busy = BURN_DRIVE_IDLE; | |
1602 | return 0; | |
1603 | } | |
1604 | ||
1605 | data = c.page->data; | |
1606 | len = (data[0] << 8) | data[1]; | |
1607 | old_alloc_len = *alloc_len; | |
1608 | *alloc_len = len + 2; | |
1609 | if (old_alloc_len < 34) | |
1610 | return 1; | |
1611 | if (*alloc_len < 24) /* data[23] is the last byte used here */ | |
1612 | return 0; | |
1613 | if (len + 2 > old_alloc_len) | |
1614 | len = old_alloc_len - 2; | |
1615 | ||
1616 | d->erasable = !!(data[2] & 16); | |
1617 | ||
1618 | disc_status = data[2] & 3; | |
1619 | d->state_of_last_session = (data[2] >> 2) & 3; | |
1620 | number_of_sessions = (data[9] << 8) | data[4]; | |
1621 | ||
1622 | if (d->current_profile == 0x10 || d->current_profile == 0x40) { | |
1623 | /* DVD-ROM , BD-ROM */ | |
1624 | disc_status = 2; /* always full and finalized */ | |
1625 | d->erasable = 0; /* never erasable */ | |
1626 | } | |
1627 | ||
1628 | /* ts A80207 : DVD - R DL can normally be read but not be written */ | |
1629 | if(d->current_profile == 0x15 && !burn_support_untested_profiles) { | |
1630 | disc_status = 2; /* always full and finalized */ | |
1631 | d->erasable = 0; /* never erasable */ | |
1632 | } | |
1633 | ||
1634 | #ifdef Libburn_support_bd_r_readonlY | |
1635 | /* <<< For now: declaring BD-R read-only | |
1636 | */ | |
1637 | #ifndef Libburn_support_bd_plus_r_srM | |
1638 | if (d->current_profile == 0x41) { | |
1639 | /* BD-R seq as readonly dummy */ | |
1640 | disc_status = 2; /* always full and finalized */ | |
1641 | d->erasable = 0; /* never erasable */ | |
1642 | } | |
1643 | #endif | |
1644 | if (d->current_profile == 0x42) { | |
1645 | /* BD-R rnd */ | |
1646 | disc_status = 2; /* always full and finalized */ | |
1647 | d->erasable = 0; /* never erasable */ | |
1648 | } | |
1649 | #endif /* Libburn_support_bd_r_readonlY */ | |
1650 | ||
1651 | switch (disc_status) { | |
1652 | case 0: | |
1653 | regard_as_blank:; | |
1654 | d->toc_entries = 0; | |
1655 | d->start_lba = burn_msf_to_lba(data[17], data[18], data[19]); | |
1656 | d->end_lba = burn_msf_to_lba(data[21], data[22], data[23]); | |
1657 | ||
1658 | /* | |
1659 | fprintf(stderr, "libburn_experimental: start_lba = %d (%d %d %d) , end_lba = %d (%d %d %d)\n", | |
1660 | d->start_lba, data[17], data[18], data[19], | |
1661 | d->end_lba, data[21], data[22], data[23]); | |
1662 | */ | |
1663 | ||
1664 | d->status = BURN_DISC_BLANK; | |
1665 | break; | |
1666 | case 1: | |
1667 | d->status = BURN_DISC_APPENDABLE; | |
1668 | ||
1669 | case 2: | |
1670 | if (disc_status == 2) | |
1671 | d->status = BURN_DISC_FULL; | |
1672 | ||
1673 | /* ts A81210 */ | |
1674 | ret = mmc_read_capacity(d); | |
1675 | /* Freshly formatted, unwritten BD-R pretend to be appendable | |
1676 | but in our model they need to be regarded as blank. | |
1677 | Criterion: BD-R seq, read capacity known and 0, | |
1678 | declared appendable, single empty session | |
1679 | */ | |
1680 | if (d->current_profile == 0x41 && | |
1681 | d->status == BURN_DISC_APPENDABLE && | |
1682 | ret > 0 && d->media_read_capacity == 0 && | |
1683 | d->state_of_last_session == 0 && number_of_sessions == 1) | |
1684 | goto regard_as_blank; | |
1685 | ||
1686 | if (d->current_profile == 0x41 && | |
1687 | d->status == BURN_DISC_APPENDABLE && | |
1688 | d->state_of_last_session == 1) { | |
1689 | ||
1690 | /* ??? apply this test to other media types ? */ | |
1691 | ||
1692 | libdax_msgs_submit(libdax_messenger, d->global_index, | |
1693 | 0x00020169, | |
1694 | LIBDAX_MSGS_SEV_WARNING, LIBDAX_MSGS_PRIO_HIGH, | |
1695 | "Last session on media is still open.", 0, 0); | |
1696 | } | |
1697 | ||
1698 | do_read_toc = 1; | |
1699 | break; | |
1700 | } | |
1701 | ||
1702 | /* ts A90603 : An MMC-1 drive might not know the media type yet */ | |
1703 | if (d->current_is_guessed_profile && d->current_profile == 0) | |
1704 | mmc_guess_profile(d, 0); | |
1705 | ||
1706 | if ((d->current_profile != 0 || d->status != BURN_DISC_UNREADY) | |
1707 | && ! d->current_is_supported_profile) { | |
1708 | if (!d->silent_on_scsi_error) { | |
1709 | sprintf(msg, | |
1710 | "Unsuitable media detected. Profile %4.4Xh %s", | |
1711 | d->current_profile, d->current_profile_text); | |
1712 | libdax_msgs_submit(libdax_messenger, d->global_index, | |
1713 | 0x0002011e, | |
1714 | LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH, | |
1715 | msg, 0,0); | |
1716 | } | |
1717 | d->status = BURN_DISC_UNSUITABLE; | |
1718 | return 0; | |
1719 | } | |
1720 | ||
1721 | /* ts A61217 : Note for future | |
1722 | growisofs performs OPC if (data[0]<<8)|data[1]<=32 | |
1723 | which indicates no OPC entries are attached to the | |
1724 | reply from the drive. | |
1725 | */ | |
1726 | ||
1727 | /* ts A61219 : mmc5r03c.pdf 6.22.3.1.13 BG Format Status | |
1728 | 0=blank (not yet started) | |
1729 | 1=started but neither running nor complete | |
1730 | 2=in progress | |
1731 | 3=completed | |
1732 | */ | |
1733 | d->bg_format_status = data[7] & 3; | |
1734 | ||
1735 | /* Preliminarily declare blank: | |
1736 | ts A61219 : DVD+RW (is not bg_format_status==0 "blank") | |
1737 | ts A61229 : same for DVD-RW Restricted overwrite | |
1738 | ts A70112 : same for DVD-RAM | |
1739 | */ | |
1740 | if (d->current_profile == 0x1a || d->current_profile == 0x13 || | |
1741 | d->current_profile == 0x12 || d->current_profile == 0x43) | |
1742 | d->status = BURN_DISC_BLANK; | |
1743 | ||
1744 | if (d->status == BURN_DISC_BLANK) { | |
1745 | d->last_track_no = 1; /* The "incomplete track" */ | |
1746 | d->complete_sessions = 0; | |
1747 | } else { | |
1748 | /* ts A70131 : number of non-empty sessions */ | |
1749 | d->complete_sessions = number_of_sessions; | |
1750 | /* mmc5r03c.pdf 6.22.3.1.3 State of Last Session: 3=complete */ | |
1751 | if (d->state_of_last_session != 3 && d->complete_sessions >= 1) | |
1752 | d->complete_sessions--; | |
1753 | ||
1754 | /* ts A70129 : mmc5r03c.pdf 6.22.3.1.7 | |
1755 | This includes the "incomplete track" if the disk is | |
1756 | appendable. I.e number of complete tracks + 1. */ | |
1757 | d->last_track_no = (data[11] << 8) | data[6]; | |
1758 | } | |
1759 | if (d->current_profile != 0x0a && d->current_profile != 0x13 && | |
1760 | d->current_profile != 0x14 && d->status != BURN_DISC_FULL) | |
1761 | d->erasable = 0; /* stay in sync with burn_disc_erase() */ | |
1762 | ||
1763 | if (do_read_toc) | |
1764 | mmc_read_toc(d); | |
1765 | return 1; | |
1766 | } | |
1767 | ||
1768 | ||
1769 | void mmc_read_disc_info(struct burn_drive *d) | |
1770 | { | |
1771 | int alloc_len = 34, ret; | |
1772 | ||
1773 | if (mmc_function_spy(d, "mmc_read_disc_info") <= 0) | |
1774 | return; | |
1775 | ||
1776 | ret = mmc_read_disc_info_al(d, &alloc_len); | |
1777 | /* | |
1778 | fprintf(stderr,"LIBBURN_DEBUG: 51h alloc_len = %d , ret = %d\n", | |
1779 | alloc_len, ret); | |
1780 | */ | |
1781 | /* for now there is no need to inquire the variable lenght part */ | |
1782 | } | |
1783 | ||
1784 | ||
1785 | void mmc_read_atip(struct burn_drive *d) | |
1786 | { | |
1787 | struct buffer buf; | |
1788 | struct command c; | |
1789 | int alloc_len = 28; | |
1790 | ||
1791 | /* ts A61021 */ | |
1792 | unsigned char *data; | |
1793 | /* Speed values from A1: | |
1794 | With 4 cdrecord tells "10" or "8" where MMC-1 says "8". | |
1795 | cdrecord "8" appear on 4xCD-RW and thus seem to be quite invalid. | |
1796 | My CD-R (>=24 speed) tell no A1. | |
1797 | The higher non-MMC-1 values are hearsay. | |
1798 | */ | |
1799 | /* 0, 2, 4, 6, 10, -, 16, -, */ | |
1800 | static int speed_value[16]= { 0, 353, 706, 1059, 1764, -5, 2824, -7, | |
1801 | 4234, 5646, 7056, 8468, -12, -13, -14, -15}; | |
1802 | /* 24, 32, 40, 48, -, -, -, - */ | |
1803 | ||
1804 | if (mmc_function_spy(d, "mmc_read_atip") <= 0) | |
1805 | return; | |
1806 | ||
1807 | scsi_init_command(&c, MMC_GET_ATIP, sizeof(MMC_GET_ATIP)); | |
1808 | /* | |
1809 | memcpy(c.opcode, MMC_GET_ATIP, sizeof(MMC_GET_ATIP)); | |
1810 | c.oplen = sizeof(MMC_GET_ATIP); | |
1811 | */ | |
1812 | c.dxfer_len = alloc_len; | |
1813 | c.opcode[7]= (c.dxfer_len >> 8) & 0xff; | |
1814 | c.opcode[8]= c.dxfer_len & 0xff; | |
1815 | c.retry = 1; | |
1816 | c.page = &buf; | |
1817 | c.page->bytes = 0; | |
1818 | c.page->sectors = 0; | |
1819 | ||
1820 | c.dir = FROM_DRIVE; | |
1821 | d->issue_command(d, &c); | |
1822 | burn_print(1, "atip shit for you\n"); | |
1823 | ||
1824 | ||
1825 | /* ts A61021 */ | |
1826 | data = c.page->data; | |
1827 | d->erasable= !!(data[6]&64); | |
1828 | d->start_lba= burn_msf_to_lba(data[8],data[9],data[10]); | |
1829 | d->end_lba= burn_msf_to_lba(data[12],data[13],data[14]); | |
1830 | if (data[6]&4) { | |
1831 | if (speed_value[(data[16]>>4)&7] > 0) { | |
1832 | d->mdata->min_write_speed = | |
1833 | speed_value[(data[16]>>4)&7]; | |
1834 | if (speed_value[(data[16])&15] <= 0) | |
1835 | d->mdata->max_write_speed = | |
1836 | speed_value[(data[16]>>4)&7]; | |
1837 | } | |
1838 | if (speed_value[(data[16])&15] > 0) { | |
1839 | d->mdata->max_write_speed = | |
1840 | speed_value[(data[16])&15]; | |
1841 | if (speed_value[(data[16]>>4)&7] <= 0) | |
1842 | d->mdata->min_write_speed = | |
1843 | speed_value[(data[16])&15]; | |
1844 | } | |
1845 | } | |
1846 | ||
1847 | #ifdef Burn_mmc_be_verbous_about_atiP | |
1848 | { int i; | |
1849 | fprintf(stderr,"libburn_experimental: Returned ATIP Data\n"); | |
1850 | for(i= 0; i<28; i++) | |
1851 | fprintf(stderr,"%3.3d (0x%2.2x)%s", | |
1852 | data[i],data[i],((i+1)%5 ? " ":"\n")); | |
1853 | fprintf(stderr,"\n"); | |
1854 | ||
1855 | fprintf(stderr, | |
1856 | "libburn_experimental: Indicative Target Writing Power= %d\n", | |
1857 | (data[4]>>4)&7); | |
1858 | fprintf(stderr, | |
1859 | "libburn_experimental: Reference speed= %d ->%d\n", | |
1860 | data[4]&7, speed_value[data[4]&7]); | |
1861 | fprintf(stderr, | |
1862 | "libburn_experimental: Is %sunrestricted\n", | |
1863 | (data[5]&64?"":"not ")); | |
1864 | fprintf(stderr, | |
1865 | "libburn_experimental: Is %serasable, sub-type %d\n", | |
1866 | (data[6]&64?"":"not "),(data[6]>>3)&3); | |
1867 | fprintf(stderr, | |
1868 | "libburn_experimental: lead in: %d (%-2.2d:%-2.2d/%-2.2d)\n", | |
1869 | burn_msf_to_lba(data[8],data[9],data[10]), | |
1870 | data[8],data[9],data[10]); | |
1871 | fprintf(stderr, | |
1872 | "libburn_experimental: lead out: %d (%-2.2d:%-2.2d/%-2.2d)\n", | |
1873 | burn_msf_to_lba(data[12],data[13],data[14]), | |
1874 | data[12],data[13],data[14]); | |
1875 | if(data[6]&4) | |
1876 | fprintf(stderr, | |
1877 | "libburn_experimental: A1 speed low %d speed high %d\n", | |
1878 | speed_value[(data[16]>>4)&7], speed_value[(data[16])&7]); | |
1879 | if(data[6]&2) | |
1880 | fprintf(stderr, | |
1881 | "libburn_experimental: A2 speed low %d speed high %d\n", | |
1882 | speed_value[(data[20]>>4)&7], speed_value[(data[20])&7]); | |
1883 | if(data[6]&1) | |
1884 | fprintf(stderr, | |
1885 | "libburn_experimental: A3 speed low %d speed high %d\n", | |
1886 | speed_value[(data[24]>>4)&7], speed_value[(data[24])&7]); | |
1887 | } | |
1888 | ||
1889 | #endif /* Burn_mmc_be_verbous_about_atiP */ | |
1890 | ||
1891 | /* ts A61020 | |
1892 | http://www.t10.org/ftp/t10/drafts/mmc/mmc-r10a.pdf , table 77 : | |
1893 | ||
1894 | 0 ATIP Data Length MSB | |
1895 | 1 ATIP Data Length LSB | |
1896 | 2 Reserved | |
1897 | 3 Reserved | |
1898 | 4 bit7=1, bit4-6="Indicative Target Writing Power", bit3=reserved , | |
1899 | bit0-2="Reference speed" | |
1900 | 5 bit7=0, bit6="URU" , bit0-5=reserved | |
1901 | 6 bit7=1, bit6="Disc Type", bit3-4="Disc Sub-Type", | |
1902 | bit2="A1", bit1="A2", bit0="A3" | |
1903 | 7 reserved | |
1904 | 8 ATIP Start Time of lead-in (Min) | |
1905 | 9 ATIP Start Time of lead-in (Sec) | |
1906 | 10 ATIP Start Time of lead-in (Frame) | |
1907 | 11 reserved | |
1908 | 12 ATIP Last Possible Start Time of lead-out (Min) | |
1909 | 13 ATIP Last Possible Start Time of lead-out (Sec) | |
1910 | 14 ATIP Last Possible Start Time of lead-out (Frame) | |
1911 | 15 reserved | |
1912 | 16 bit7=0, bit4-6="Lowest Usable CLV Recording speed" | |
1913 | bit0-3="Highest Usable CLV Recording speed" | |
1914 | 17 bit7=0, bit4-6="Power Multiplication Factor p", | |
1915 | bit1-3="Target y value of the Modulation/Power function", bit0=reserved | |
1916 | 18 bit7=1, bit4-6="Recommended Erase/Write Power Ratio (P(inf)/W(inf))" | |
1917 | bit0-3=reserved | |
1918 | 19 reserved | |
1919 | 20-22 A2 Values | |
1920 | 23 reserved | |
1921 | 24-26 A3 Values | |
1922 | 27 reserved | |
1923 | ||
1924 | Disc Type - zero indicates CD-R media; one indicates CD-RW media. | |
1925 | ||
1926 | Disc Sub-Type - shall be set to zero. | |
1927 | ||
1928 | A1 - when set to one, indicates that bytes 16-18 are valid. | |
1929 | ||
1930 | Lowest Usable CLV Recording Speed | |
1931 | 000b Reserved | |
1932 | 001b 2X | |
1933 | 010b - 111b Reserved | |
1934 | ||
1935 | Highest CLV Recording Speeds | |
1936 | 000b Reserved | |
1937 | 001b 2X | |
1938 | 010b 4X | |
1939 | 011b 6X | |
1940 | 100b 8X | |
1941 | 101b - 111b Reserved | |
1942 | ||
1943 | MMC-3 seems to recommend MODE SENSE (5Ah) page 2Ah rather than A1, A2, A3. | |
1944 | This page is loaded in libburn function spc_sense_caps() . | |
1945 | Speed is given in kbytes/sec there. But i suspect this to be independent | |
1946 | of media. So one would habe to associate the speed descriptor blocks with | |
1947 | the ATIP media characteristics ? How ? | |
1948 | ||
1949 | */ | |
1950 | } | |
1951 | ||
1952 | void mmc_read_sectors(struct burn_drive *d, | |
1953 | int start, | |
1954 | int len, | |
1955 | const struct burn_read_opts *o, struct buffer *buf) | |
1956 | { | |
1957 | int temp; | |
1958 | int errorblock, req; | |
1959 | struct command c; | |
1960 | ||
1961 | if (mmc_function_spy(d, "mmc_read_sectors") <= 0) | |
1962 | return; | |
1963 | ||
1964 | /* ts A61009 : to be ensured by callers */ | |
1965 | /* a ssert(len >= 0); */ | |
1966 | ||
1967 | /* if the drive isn't busy, why the hell are we here? */ | |
1968 | /* ts A61006 : i second that question */ | |
1969 | /* a ssert(d->busy); */ | |
1970 | ||
1971 | burn_print(12, "reading %d from %d\n", len, start); | |
1972 | ||
1973 | scsi_init_command(&c, MMC_READ_CD, sizeof(MMC_READ_CD)); | |
1974 | /* | |
1975 | memcpy(c.opcode, MMC_READ_CD, sizeof(MMC_READ_CD)); | |
1976 | c.oplen = sizeof(MMC_READ_CD); | |
1977 | */ | |
1978 | c.retry = 1; | |
1979 | temp = start; | |
1980 | c.opcode[5] = temp & 0xFF; | |
1981 | temp >>= 8; | |
1982 | c.opcode[4] = temp & 0xFF; | |
1983 | temp >>= 8; | |
1984 | c.opcode[3] = temp & 0xFF; | |
1985 | temp >>= 8; | |
1986 | c.opcode[2] = temp & 0xFF; | |
1987 | c.opcode[8] = len & 0xFF; | |
1988 | len >>= 8; | |
1989 | c.opcode[7] = len & 0xFF; | |
1990 | len >>= 8; | |
1991 | c.opcode[6] = len & 0xFF; | |
1992 | req = 0xF8; | |
1993 | ||
1994 | /* ts A61106 : LG GSA-4082B dislikes this. key=5h asc=24h ascq=00h | |
1995 | ||
1996 | if (d->busy == BURN_DRIVE_GRABBING || o->report_recovered_errors) | |
1997 | req |= 2; | |
1998 | */ | |
1999 | ||
2000 | c.opcode[10] = 0; | |
2001 | /* always read the subcode, throw it away later, since we don't know | |
2002 | what we're really reading | |
2003 | */ | |
2004 | if (d->busy == BURN_DRIVE_GRABBING || (o->subcodes_audio) | |
2005 | || (o->subcodes_data)) | |
2006 | c.opcode[10] = 1; | |
2007 | ||
2008 | c.opcode[9] = req; | |
2009 | c.page = buf; | |
2010 | c.dir = FROM_DRIVE; | |
2011 | d->issue_command(d, &c); | |
2012 | ||
2013 | if (c.error) { | |
2014 | burn_print(12, "got an error over here\n"); | |
2015 | burn_print(12, "%d, %d, %d, %d\n", c.sense[3], c.sense[4], | |
2016 | c.sense[5], c.sense[6]); | |
2017 | errorblock = | |
2018 | (c.sense[3] << 24) + (c.sense[4] << 16) + | |
2019 | (c.sense[5] << 8) + c.sense[6]; | |
2020 | c.page->sectors = errorblock - start + 1; | |
2021 | burn_print(1, "error on block %d\n", errorblock); | |
2022 | burn_print(12, "error on block %d\n", errorblock); | |
2023 | burn_print(12, "returning %d sectors\n", c.page->sectors); | |
2024 | } | |
2025 | } | |
2026 | ||
2027 | void mmc_erase(struct burn_drive *d, int fast) | |
2028 | { | |
2029 | struct command c; | |
2030 | ||
2031 | if (mmc_function_spy(d, "mmc_erase") <= 0) | |
2032 | return; | |
2033 | ||
2034 | scsi_init_command(&c, MMC_BLANK, sizeof(MMC_BLANK)); | |
2035 | /* | |
2036 | memcpy(c.opcode, MMC_BLANK, sizeof(MMC_BLANK)); | |
2037 | c.oplen = sizeof(MMC_BLANK); | |
2038 | */ | |
2039 | c.opcode[1] = 16; /* IMMED set to 1 */ | |
2040 | c.opcode[1] |= !!fast; | |
2041 | c.retry = 1; | |
2042 | c.page = NULL; | |
2043 | c.dir = NO_TRANSFER; | |
2044 | d->issue_command(d, &c); | |
2045 | } | |
2046 | ||
2047 | void mmc_read_lead_in(struct burn_drive *d, struct buffer *buf) | |
2048 | { | |
2049 | int len; | |
2050 | struct command c; | |
2051 | ||
2052 | if (mmc_function_spy(d, "mmc_read_lead_in") <= 0) | |
2053 | return; | |
2054 | ||
2055 | len = buf->sectors; | |
2056 | scsi_init_command(&c, MMC_READ_CD, sizeof(MMC_READ_CD)); | |
2057 | /* | |
2058 | memcpy(c.opcode, MMC_READ_CD, sizeof(MMC_READ_CD)); | |
2059 | c.oplen = sizeof(MMC_READ_CD); | |
2060 | */ | |
2061 | c.retry = 1; | |
2062 | c.opcode[5] = 0; | |
2063 | c.opcode[4] = 0; | |
2064 | c.opcode[3] = 0; | |
2065 | c.opcode[2] = 0xF0; | |
2066 | c.opcode[8] = 1; | |
2067 | c.opcode[7] = 0; | |
2068 | c.opcode[6] = 0; | |
2069 | c.opcode[9] = 0; | |
2070 | c.opcode[10] = 2; | |
2071 | c.page = buf; | |
2072 | c.dir = FROM_DRIVE; | |
2073 | d->issue_command(d, &c); | |
2074 | } | |
2075 | ||
2076 | void mmc_perform_opc(struct burn_drive *d) | |
2077 | { | |
2078 | struct command c; | |
2079 | ||
2080 | if (mmc_function_spy(d, "mmc_perform_opc") <= 0) | |
2081 | return; | |
2082 | ||
2083 | scsi_init_command(&c, MMC_SEND_OPC, sizeof(MMC_SEND_OPC)); | |
2084 | /* | |
2085 | memcpy(c.opcode, MMC_SEND_OPC, sizeof(MMC_SEND_OPC)); | |
2086 | c.oplen = sizeof(MMC_SEND_OPC); | |
2087 | */ | |
2088 | c.retry = 1; | |
2089 | c.opcode[1] = 1; | |
2090 | c.page = NULL; | |
2091 | c.dir = NO_TRANSFER; | |
2092 | d->issue_command(d, &c); | |
2093 | } | |
2094 | ||
2095 | ||
2096 | /* ts A61221 : Learned much from dvd+rw-tools-7.0 set_speed_B6h() but then | |
2097 | made own experiments on base of mmc5r03c.pdf 6.8.3 and 6.39 in the hope | |
2098 | to achieve a leaner solution | |
2099 | ts A70712 : That leaner solution does not suffice for my LG GSA-4082B. | |
2100 | Meanwhile there is a speed descriptor list anyway. | |
2101 | */ | |
2102 | int mmc_set_streaming(struct burn_drive *d, | |
2103 | int r_speed, int w_speed, int end_lba) | |
2104 | { | |
2105 | struct buffer buf; | |
2106 | struct command c; | |
2107 | int b, eff_end_lba; | |
2108 | char msg[256]; | |
2109 | unsigned char *pd; | |
2110 | int key, asc, ascq; | |
2111 | ||
2112 | if (mmc_function_spy(d, "mmc_set_streaming") <= 0) | |
2113 | return 0; | |
2114 | ||
2115 | scsi_init_command(&c, MMC_SET_STREAMING, sizeof(MMC_SET_STREAMING)); | |
2116 | /* | |
2117 | c.oplen = sizeof(MMC_SET_STREAMING); | |
2118 | memcpy(c.opcode, MMC_SET_STREAMING, sizeof(MMC_SET_STREAMING)); | |
2119 | */ | |
2120 | c.retry = 1; | |
2121 | c.page = &buf; | |
2122 | c.page->bytes = 28; | |
2123 | c.opcode[9] = (c.page->bytes >> 8) & 0xff; | |
2124 | c.opcode[10] = c.page->bytes & 0xff; | |
2125 | c.page->sectors = 0; | |
2126 | c.dir = TO_DRIVE; | |
2127 | memset(c.page->data, 0, c.page->bytes); | |
2128 | pd = c.page->data; | |
2129 | ||
2130 | pd[0] = 0; /* WRC=0 (Default Rotation Control), RDD=Exact=RA=0 */ | |
2131 | ||
2132 | if (w_speed == 0) | |
2133 | w_speed = 0x10000000; /* ~ 2 TB/s */ | |
2134 | else if (w_speed < 0) | |
2135 | w_speed = 177; /* 1x CD */ | |
2136 | if (r_speed == 0) | |
2137 | r_speed = 0x10000000; /* ~ 2 TB/s */ | |
2138 | else if (r_speed < 0) | |
2139 | r_speed = 177; /* 1x CD */ | |
2140 | if (end_lba == 0) { | |
2141 | /* Default computed from 4.7e9 */ | |
2142 | eff_end_lba = 2294921 - 1; | |
2143 | if (d->mdata->max_end_lba > 0) | |
2144 | eff_end_lba = d->mdata->max_end_lba - 1; | |
2145 | } else | |
2146 | eff_end_lba = end_lba; | |
2147 | ||
2148 | sprintf(msg, "mmc_set_streaming: end_lba=%d , r=%d , w=%d", | |
2149 | end_lba, r_speed, w_speed); | |
2150 | libdax_msgs_submit(libdax_messenger, d->global_index, 0x00000002, | |
2151 | LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO, | |
2152 | msg, 0, 0); | |
2153 | ||
2154 | /* start_lba is 0 , 1000 = 1 second as base time for data rate */ | |
2155 | for (b = 0; b < 4 ; b++) { | |
2156 | pd[8+b] = (end_lba >> (24 - 8 * b)) & 0xff; | |
2157 | pd[12+b] = (r_speed >> (24 - 8 * b)) & 0xff; | |
2158 | pd[16+b] = (1000 >> (24 - 8 * b)) & 0xff; | |
2159 | pd[20+b] = (w_speed >> (24 - 8 * b)) & 0xff; | |
2160 | pd[24+b] = (1000 >> (24 - 8 * b)) & 0xff; | |
2161 | } | |
2162 | ||
2163 | /* <<< | |
2164 | fprintf(stderr,"LIBBURN_EXPERIMENTAL : B6h Performance descriptor:\n"); | |
2165 | for (b = 0; b < 28 ; b++) | |
2166 | fprintf(stderr, "%2.2X%c", pd[b], ((b+1)%4 ? ' ' : '\n')); | |
2167 | */ | |
2168 | ||
2169 | ||
2170 | d->issue_command(d, &c); | |
2171 | if (c.error) { | |
2172 | if (c.sense[2]!=0 && !d->silent_on_scsi_error) { | |
2173 | ||
2174 | #ifdef NIX | |
2175 | sprintf(msg, | |
2176 | "SCSI error on set_streaming(%d): key=%X asc=%2.2Xh ascq=%2.2Xh", | |
2177 | w_speed, | |
2178 | c.sense[2],c.sense[12],c.sense[13]); | |
2179 | libdax_msgs_submit(libdax_messenger, | |
2180 | d->global_index, | |
2181 | 0x00020124, | |
2182 | LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH, | |
2183 | msg, 0, 0); | |
2184 | #else /* NIX */ | |
2185 | ||
2186 | sprintf(msg, | |
2187 | "SCSI error on set_streaming(%d): ", w_speed); | |
2188 | scsi_error_msg(d, c.sense, 14, msg + strlen(msg), | |
2189 | &key, &asc, &ascq); | |
2190 | ||
2191 | #endif /* !NIX */ | |
2192 | ||
2193 | } | |
2194 | return 0; | |
2195 | } | |
2196 | return 1; | |
2197 | } | |
2198 | ||
2199 | ||
2200 | void mmc_set_speed(struct burn_drive *d, int r, int w) | |
2201 | { | |
2202 | struct command c; | |
2203 | int ret, end_lba = 0; | |
2204 | struct burn_speed_descriptor *best_sd = NULL; | |
2205 | ||
2206 | if (mmc_function_spy(d, "mmc_set_speed") <= 0) | |
2207 | return; | |
2208 | ||
2209 | if (r <= 0 || w <= 0) { | |
2210 | /* ts A70712 : now searching for best speed descriptor */ | |
2211 | if (w > 0 && r <= 0) | |
2212 | burn_drive_get_best_speed(d, r, &best_sd, 1); | |
2213 | else | |
2214 | burn_drive_get_best_speed(d, w, &best_sd, 0); | |
2215 | if (best_sd != NULL) { | |
2216 | w = best_sd->write_speed; | |
2217 | d->nominal_write_speed = w; | |
2218 | r = best_sd->read_speed; | |
2219 | end_lba = best_sd->end_lba; | |
2220 | } | |
2221 | } | |
2222 | ||
2223 | /* A70711 */ | |
2224 | d->nominal_write_speed = w; | |
2225 | ||
2226 | /* ts A61221 : try to set DVD speed via command B6h */ | |
2227 | if (strstr(d->current_profile_text, "DVD") == d->current_profile_text){ | |
2228 | ret = mmc_set_streaming(d, r, w, end_lba); | |
2229 | if (ret != 0) | |
2230 | return; /* success or really fatal failure */ | |
2231 | } | |
2232 | ||
2233 | /* ts A61112 : MMC standards prescribe FFFFh as max speed. | |
2234 | But libburn.h prescribes 0. | |
2235 | ts A70715 : <0 now means minimum speed */ | |
2236 | if (r == 0 || r > 0xffff) | |
2237 | r = 0xffff; | |
2238 | else if (r < 0) | |
2239 | r = 177; /* 1x CD */ | |
2240 | if (w == 0 || w > 0xffff) | |
2241 | w = 0xffff; | |
2242 | else if (w < 0) | |
2243 | w = 177; /* 1x CD */ | |
2244 | ||
2245 | scsi_init_command(&c, MMC_SET_SPEED, sizeof(MMC_SET_SPEED)); | |
2246 | /* | |
2247 | memcpy(c.opcode, MMC_SET_SPEED, sizeof(MMC_SET_SPEED)); | |
2248 | c.oplen = sizeof(MMC_SET_SPEED); | |
2249 | */ | |
2250 | c.retry = 1; | |
2251 | c.opcode[2] = r >> 8; | |
2252 | c.opcode[3] = r & 0xFF; | |
2253 | c.opcode[4] = w >> 8; | |
2254 | c.opcode[5] = w & 0xFF; | |
2255 | c.page = NULL; | |
2256 | c.dir = NO_TRANSFER; | |
2257 | d->issue_command(d, &c); | |
2258 | } | |
2259 | ||
2260 | ||
2210 | 2261 | /* ts A61201 : found in unfunctional state |
2211 | 2262 | */ |
2212 | 2263 | static int mmc_get_configuration_al(struct burn_drive *d, int *alloc_len) |
2213 | 2264 | { |
2214 | 2265 | struct buffer buf; |
2215 | 2266 | int len, cp, descr_len = 0, feature_code, prf_number, only_current = 1; |
2216 | int old_alloc_len; | |
2267 | int old_alloc_len, only_current_profile = 0; | |
2217 | 2268 | unsigned char *descr, *prf, *up_to, *prf_end; |
2218 | 2269 | struct command c; |
2219 | 2270 | int phys_if_std = 0; |
2226 | 2277 | d->current_profile_text[0] = 0; |
2227 | 2278 | d->current_is_cd_profile = 0; |
2228 | 2279 | d->current_is_supported_profile = 0; |
2280 | d->current_is_guessed_profile = 0; | |
2281 | d->num_profiles = 0; | |
2229 | 2282 | d->current_has_feat21h = 0; |
2230 | 2283 | d->current_feat21h_link_size = -1; |
2231 | 2284 | d->current_feat23h_byte4 = 0; |
2234 | 2287 | |
2235 | 2288 | scsi_init_command(&c, MMC_GET_CONFIGURATION, |
2236 | 2289 | sizeof(MMC_GET_CONFIGURATION)); |
2237 | /* | |
2238 | memcpy(c.opcode, MMC_GET_CONFIGURATION, sizeof(MMC_GET_CONFIGURATION)); | |
2239 | c.oplen = sizeof(MMC_GET_CONFIGURATION); | |
2240 | */ | |
2241 | 2290 | c.dxfer_len= *alloc_len; |
2242 | 2291 | c.retry = 1; |
2243 | 2292 | c.opcode[7] = (c.dxfer_len >> 8) & 0xff; |
2248 | 2297 | c.dir = FROM_DRIVE; |
2249 | 2298 | d->issue_command(d, &c); |
2250 | 2299 | |
2251 | if (c.error) | |
2252 | return 0; | |
2300 | #ifdef Libisofs_simulate_old_mmc1_drivE | |
2301 | c.error = 1; | |
2302 | c.sense[2] = 0x5; | |
2303 | c.sense[12] = 0x20; | |
2304 | c.sense[13] = 0x0; | |
2305 | #endif /* Libisofs_simulate_old_mmc1_drivE */ | |
2306 | ||
2307 | if (c.error) { | |
2308 | /* ts A90603 : MMC-1 drive do not know 46h GET CONFIGURATION */ | |
2309 | if (c.sense[2] == 0x5 && c.sense[12] == 0x20 && | |
2310 | c.sense[13] == 0x0) { | |
2311 | d->current_is_guessed_profile = 1; | |
2312 | /* Will yield a non-zero profile only after | |
2313 | mmc_read_disc_info_al() was called */ | |
2314 | mmc_guess_profile(d, 0); | |
2315 | } | |
2316 | return 0; | |
2317 | } | |
2253 | 2318 | old_alloc_len = *alloc_len; |
2254 | 2319 | *alloc_len = len = mmc_four_char_to_int(c.page->data); |
2255 | 2320 | if (len > old_alloc_len) |
2327 | 2392 | #endif |
2328 | 2393 | |
2329 | 2394 | /* Enable this to get loud and repeated reports about the feature set : |
2330 | #define Libburn_print_feature_descriptorS 1 | |
2395 | #define Libburn_print_feature_descriptorS 1 | |
2331 | 2396 | */ |
2332 | 2397 | /* ts A70127 : Interpret list of profile and feature descriptors. |
2333 | 2398 | see mmc5r03c.pdf 5.2 |
2341 | 2406 | "-----------------------------------------------------------------\n"); |
2342 | 2407 | fprintf(stderr, |
2343 | 2408 | "LIBBURN_EXPERIMENTAL : feature list length = %d , shown = %d\n", |
2344 | len, up_to - c.page->data); | |
2409 | len, (int) (up_to - c.page->data)); | |
2345 | 2410 | #endif /* Libburn_print_feature_descriptorS */ |
2346 | 2411 | |
2347 | 2412 | for (descr = c.page->data + 8; descr + 3 < up_to; descr += descr_len) { |
2359 | 2424 | |
2360 | 2425 | if (feature_code == 0x0) { |
2361 | 2426 | prf_end = descr + 4 + descr[3]; |
2427 | d->num_profiles = descr[3] / 4; | |
2428 | if (d->num_profiles > 64) | |
2429 | d->num_profiles = 64; | |
2430 | if (d->num_profiles > 0) | |
2431 | memcpy(d->all_profiles, descr + 4, | |
2432 | d->num_profiles * 4); | |
2362 | 2433 | for (prf = descr + 4; prf + 2 < prf_end; prf += 4) { |
2363 | if (only_current && !(prf[2] & 1)) | |
2434 | if (only_current_profile && !(prf[2] & 1)) | |
2364 | 2435 | continue; |
2365 | 2436 | prf_number = (prf[0] << 8) | prf[1]; |
2366 | 2437 | |
3474 | 3545 | c.page->bytes = 0; |
3475 | 3546 | c.dir = FROM_DRIVE; |
3476 | 3547 | d->issue_command(d, &c); |
3548 | ||
3549 | #ifdef Libisofs_simulate_old_mmc1_drivE | |
3550 | c.error = 1; | |
3551 | c.sense[2] = 0x5; | |
3552 | c.sense[12] = 0x20; | |
3553 | c.sense[13] = 0x0; | |
3554 | #endif /* Libisofs_simulate_old_mmc1_drivE */ | |
3555 | ||
3477 | 3556 | if (c.error) |
3478 | 3557 | return 0; |
3479 | 3558 | len = mmc_four_char_to_int(c.page->data); |
3803 | 3882 | d->start_lba = -2000000000; |
3804 | 3883 | d->end_lba = -2000000000; |
3805 | 3884 | |
3806 | /* ts A61201 - A70223*/ | |
3885 | /* ts A61201 - A90815*/ | |
3807 | 3886 | d->erasable = 0; |
3808 | 3887 | d->current_profile = -1; |
3809 | 3888 | d->current_profile_text[0] = 0; |
3810 | 3889 | d->current_is_cd_profile = 0; |
3811 | 3890 | d->current_is_supported_profile = 0; |
3891 | d->current_is_guessed_profile = 0; | |
3892 | memset(d->all_profiles, 0, 256); | |
3893 | d->num_profiles = 0; | |
3812 | 3894 | d->current_has_feat21h = 0; |
3813 | 3895 | d->current_feat21h_link_size = -1; |
3814 | 3896 | d->current_feat23h_byte4 = 0; |
74 | 74 | /* ts A81210 : Determine the upper limit of readable data size */ |
75 | 75 | int mmc_read_capacity(struct burn_drive *d); |
76 | 76 | |
77 | /* ts A61201 */ | |
78 | char *mmc_obtain_profile_name(int profile_number); | |
79 | ||
77 | 80 | |
78 | 81 | /* mmc5r03c.pdf 4.3.4.4.1 d) "The maximum number of RZones is 2 302." */ |
79 | 82 | #define BURN_MMC_FAKE_TOC_MAX_SIZE 2302 |
142 | 142 | int burn_write_opts_set_underrun_proof(struct burn_write_opts *opts, |
143 | 143 | int underrun_proof) |
144 | 144 | { |
145 | if (!opts->drive->mdata->valid) | |
145 | if (opts->drive->mdata->valid <= 0) | |
146 | 146 | return 0; |
147 | 147 | if (opts->drive->mdata->underrun_proof) { |
148 | 148 | opts->underrun_proof = underrun_proof; |
20 | 20 | static unsigned char SBC_LOAD[] = { 0x1b, 0, 0, 0, 3, 0 }; |
21 | 21 | static unsigned char SBC_UNLOAD[] = { 0x1b, 0, 0, 0, 2, 0 }; |
22 | 22 | static unsigned char SBC_START_UNIT[] = { 0x1b, 0, 0, 0, 1, 0 }; |
23 | static unsigned char SBC_STOP_UNIT[] = { 0x1b, 0, 0, 0, 0, 0 }; | |
23 | 24 | |
24 | 25 | void sbc_load(struct burn_drive *d) |
25 | 26 | { |
78 | 79 | int sbc_start_unit(struct burn_drive *d) |
79 | 80 | { |
80 | 81 | struct command c; |
82 | int ret; | |
81 | 83 | |
82 | 84 | if (mmc_function_spy(d, "start_unit") <= 0) |
83 | 85 | return 0; |
84 | 86 | |
85 | 87 | scsi_init_command(&c, SBC_START_UNIT, sizeof(SBC_START_UNIT)); |
86 | /* | |
87 | memcpy(c.opcode, SBC_START_UNIT, sizeof(SBC_START_UNIT)); | |
88 | c.oplen = sizeof(SBC_START_UNIT); | |
89 | c.page = NULL; | |
90 | */ | |
91 | 88 | c.retry = 1; |
92 | ||
93 | 89 | c.opcode[1] |= 1; /* ts A70918 : Immed */ |
94 | ||
95 | 90 | c.dir = NO_TRANSFER; |
96 | 91 | d->issue_command(d, &c); |
97 | 92 | if (c.error) |
98 | 93 | return 0; |
99 | 94 | /* ts A70918 : now asynchronous */ |
100 | return spc_wait_unit_attention(d, 1800, "START UNIT", 0); | |
95 | d->is_stopped = 0; | |
96 | ret = spc_wait_unit_attention(d, 1800, "START UNIT", 0); | |
97 | return ret; | |
101 | 98 | } |
99 | ||
100 | /* ts A90824 : Trying to reduce drive noise */ | |
101 | int sbc_stop_unit(struct burn_drive *d) | |
102 | { | |
103 | struct command c; | |
104 | int ret; | |
105 | ||
106 | if (mmc_function_spy(d, "stop_unit") <= 0) | |
107 | return 0; | |
108 | ||
109 | scsi_init_command(&c, SBC_STOP_UNIT, sizeof(SBC_STOP_UNIT)); | |
110 | c.retry = 1; | |
111 | c.opcode[1] |= 1; /* Immed */ | |
112 | c.dir = NO_TRANSFER; | |
113 | d->issue_command(d, &c); | |
114 | if (c.error) | |
115 | return 0; | |
116 | ret = spc_wait_unit_attention(d, 1800, "STOP UNIT", 0); | |
117 | d->is_stopped = 1; | |
118 | return ret; | |
119 | } | |
120 | ||
102 | 121 | |
103 | 122 | |
104 | 123 | /* ts A61021 : the sbc specific part of sg.c:enumerate_common() |
108 | 127 | d->eject = sbc_eject; |
109 | 128 | d->load = sbc_load; |
110 | 129 | d->start_unit = sbc_start_unit; |
130 | d->stop_unit = sbc_stop_unit; | |
131 | d->is_stopped = 0; | |
111 | 132 | return 1; |
112 | 133 | } |
113 | 134 |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | 1 | |
2 | #include <assert.h> | |
3 | 2 | #include <errno.h> |
4 | 3 | #include <unistd.h> |
5 | 4 | #include <stdio.h> |
552 | 551 | if (c->page) { |
553 | 552 | ccb->csio.data_ptr = c->page->data; |
554 | 553 | if (c->dir == FROM_DRIVE) { |
555 | ccb->csio.dxfer_len = BUFFER_SIZE; | |
554 | ||
555 | /* ts A90430 : Ticket 148 , by jwehle : | |
556 | "On ... FreeBSD 6.4 which has a usb memory reader in | |
557 | addition to a ATAPI DVD burner sg_issue_command | |
558 | will hang while the SCSI bus is being scanned" | |
559 | */ | |
560 | if (c->dxfer_len >= 0) | |
561 | ccb->csio.dxfer_len = c->dxfer_len; | |
562 | else | |
563 | ccb->csio.dxfer_len = BUFFER_SIZE; | |
564 | ||
556 | 565 | /* touch page so we can use valgrind */ |
557 | 566 | memset(c->page->data, 0, BUFFER_SIZE); |
558 | 567 | } else { |
559 | assert(c->page->bytes > 0); | |
568 | /* ts A90430 */ | |
569 | /* a ssert(c->page->bytes > 0); */ | |
570 | if (c->page->bytes <= 0) { | |
571 | c->error = 1; | |
572 | return 0; | |
573 | } | |
560 | 574 | ccb->csio.dxfer_len = c->page->bytes; |
561 | 575 | } |
562 | 576 | } else { |
469 | 469 | /* ts A60926 */ |
470 | 470 | static int sg_open_drive_fd(char *fname, int scan_mode) |
471 | 471 | { |
472 | int open_mode = O_RDWR, fd; | |
472 | int open_mode = O_RDWR, fd, tries= 0; | |
473 | 473 | char msg[81]; |
474 | 474 | |
475 | 475 | /* ts A70409 : DDLP-B */ |
501 | 501 | "libburn: experimental: O_EXCL= %d , O_NDELAY= %d\n", |
502 | 502 | !!(open_mode&O_EXCL),!!(open_mode&O_NDELAY)); |
503 | 503 | */ |
504 | ||
504 | ||
505 | try_open:; | |
505 | 506 | fd = open(fname, open_mode); |
506 | 507 | if (fd == -1) { |
507 | 508 | /* <<< debugging |
510 | 511 | fname,errno); |
511 | 512 | */ |
512 | 513 | if (errno == EBUSY) { |
514 | tries++; | |
515 | ||
516 | /* <<< debugging | |
517 | fprintf(stderr, | |
518 | "\nlibburn_DEBUG: EBUSY , tries= %d\n", tries); | |
519 | */ | |
520 | ||
521 | if (tries < 4) { | |
522 | usleep(2000000); | |
523 | goto try_open; | |
524 | } | |
513 | 525 | sg_handle_busy_device(fname, errno); |
514 | 526 | return -1; |
515 | 527 | |
792 | 804 | if (ret<=0) { |
793 | 805 | if (linux_sg_enumerate_debug) |
794 | 806 | fprintf(stderr, "cannot lock siblings\n"); |
795 | sg_handle_busy_device(fname, 0); | |
807 | sg_handle_busy_device(fname, 0); | |
796 | 808 | return 0; |
797 | 809 | } |
798 | 810 | /* the final occupation will be done in sg_grab() */ |
290 | 290 | } |
291 | 291 | |
292 | 292 | /* |
293 | ts A70518 : Do not call with *alloc_len < 8 | |
293 | ts A70518 - A90603 : Do not call with *alloc_len < 10 | |
294 | 294 | */ |
295 | 295 | /** flag&1= do only inquire alloc_len */ |
296 | 296 | static int spc_sense_caps_al(struct burn_drive *d, int *alloc_len, int flag) |
302 | 302 | unsigned char *page; |
303 | 303 | struct command c; |
304 | 304 | struct burn_speed_descriptor *sd; |
305 | char msg[BURN_DRIVE_ADR_LEN + 160]; | |
305 | 306 | |
306 | 307 | /* ts A61225 : 1 = report about post-MMC-1 speed descriptors */ |
307 | 308 | static int speed_debug = 0; |
308 | 309 | |
309 | if (*alloc_len < 8) | |
310 | if (*alloc_len < 10) | |
310 | 311 | return 0; |
312 | ||
313 | /* ts A90602 : Clearing mdata before command execution */ | |
314 | m = d->mdata; | |
315 | m->valid = 0; | |
316 | burn_mdata_free_subs(m); | |
311 | 317 | |
312 | 318 | memset(&buf, 0, sizeof(buf)); |
313 | 319 | scsi_init_command(&c, SPC_MODE_SENSE, sizeof(SPC_MODE_SENSE)); |
327 | 333 | d->issue_command(d, &c); |
328 | 334 | if (c.error) { |
329 | 335 | memset(&buf, 0, sizeof(buf)); |
330 | d->mdata->valid = -1; | |
336 | m->valid = -1; | |
331 | 337 | was_error = 1; |
332 | 338 | } |
333 | 339 | |
334 | 340 | size = c.page->data[0] * 256 + c.page->data[1]; |
335 | m = d->mdata; | |
336 | 341 | page = c.page->data + 8; |
337 | 342 | |
338 | 343 | /* ts A61225 : |
341 | 346 | in MMC-3 6.3.11 there are at least 28 bytes plus a variable length |
342 | 347 | set of speed descriptors. In MMC-5 E.11 it is declared "legacy". |
343 | 348 | */ |
349 | /* ts A90603 : | |
350 | SPC-1 8.3.3 enumerates mode page format bytes from 0 to n and | |
351 | defines Page Length as (n-1). | |
352 | */ | |
344 | 353 | page_length = page[1]; |
345 | 354 | old_alloc_len = *alloc_len; |
346 | *alloc_len = page_length + 8; | |
355 | *alloc_len = page_length + 10; | |
347 | 356 | if (flag & 1) |
348 | 357 | return !was_error; |
349 | if (page_length + 8 > old_alloc_len) | |
350 | page_length = old_alloc_len - 8; | |
351 | if (page_length < 22) | |
358 | if (page_length + 10 > old_alloc_len) | |
359 | page_length = old_alloc_len - 10; | |
360 | ||
361 | /* ts A90602 : 20 asserts page[21]. (see SPC-1 8.3.3) */ | |
362 | if (page_length < 20) { | |
363 | m->valid = -1; | |
364 | sprintf(msg, "MODE SENSE page 2A too short: %s : %d", | |
365 | d->devname, page_length); | |
366 | libdax_msgs_submit(libdax_messenger, d->global_index, | |
367 | 0x0002016e, LIBDAX_MSGS_SEV_DEBUG, | |
368 | LIBDAX_MSGS_PRIO_LOW, msg, 0, 0); | |
352 | 369 | return 0; |
353 | ||
354 | m->valid = 0; | |
355 | burn_mdata_free_subs(m); | |
370 | } | |
356 | 371 | |
357 | 372 | m->buffer_size = page[12] * 256 + page[13]; |
358 | 373 | m->dvdram_read = page[2] & 32; |
383 | 398 | m->min_end_lba = 0x7fffffff; |
384 | 399 | m->max_end_lba = 0; |
385 | 400 | |
386 | m->valid = 1; | |
401 | if (!was_error) | |
402 | m->valid = 1; | |
387 | 403 | |
388 | 404 | mmc_get_configuration(d); |
389 | 405 | |
390 | 406 | /* ts A61225 : end of MMC-1 , begin of MMC-3 */ |
391 | if (page_length < 32) /* no write speed descriptors ? */ | |
407 | if (page_length < 30) /* no write speed descriptors ? */ | |
392 | 408 | goto try_mmc_get_performance; |
393 | 409 | |
394 | 410 | m->cur_write_speed = page[28] * 256 + page[29]; |
412 | 428 | } |
413 | 429 | |
414 | 430 | for (i = 0; i < num_write_speeds; i++) { |
415 | speed = page[32 + 4*i + 2] * 256 + page[32 + 4*i + 3]; | |
431 | speed = page[32 + 4 * i + 2] * 256 + page[32 + 4 * i + 3]; | |
416 | 432 | |
417 | 433 | if (speed_debug) |
418 | 434 | fprintf(stderr, |
419 | 435 | "LIBBURN_DEBUG: write speed #%d = %d kB/s (rc %d)\n", |
420 | i, speed, page[32 + 4*i +1] & 7); | |
436 | i, speed, page[32 + 4 * i + 1] & 7); | |
421 | 437 | |
422 | 438 | /* ts A61226 */ |
423 | 439 | ret = burn_speed_descriptor_new(&(d->mdata->speed_descriptors), |
430 | 446 | strcpy(sd->profile_name, |
431 | 447 | d->current_profile_text); |
432 | 448 | } |
433 | sd->wrc = (( page[32 + 4*i +1] & 7 ) == 1 ); | |
449 | sd->wrc = (( page[32 + 4 * i + 1] & 7 ) == 1 ); | |
434 | 450 | sd->write_speed = speed; |
435 | 451 | } |
436 | 452 | |
446 | 462 | m->min_write_speed, m->max_write_speed); |
447 | 463 | |
448 | 464 | try_mmc_get_performance:; |
449 | ret = mmc_get_write_performance(d); | |
450 | ||
451 | if (ret > 0 && speed_debug) | |
452 | fprintf(stderr, | |
465 | if (m->cdrw_write || page_length >= 32) { | |
466 | /* ts A90823: | |
467 | One has to avoid U3 enhanced memory sticks here. On my | |
468 | SuSE 10.2 a SanDisk Cruzer 4GB stalls at the second occasion | |
469 | of ACh GET PERFORMANCE. (The first one is obviously called | |
470 | by the OS at plug time.) | |
471 | This pseudo drive returns no write capabilities and a page | |
472 | length of 28. MMC-3 describes page length 32. Regrettably | |
473 | MMC-2 prescribes a page length of 26. Here i have to trust | |
474 | m->cdrw_write to reliably indicate any MMC-2 burner. | |
475 | */ | |
476 | ret = mmc_get_write_performance(d); | |
477 | if (ret > 0 && speed_debug) | |
478 | fprintf(stderr, | |
453 | 479 | "LIBBURN_DEBUG: ACh min_write_speed = %d , max_write_speed = %d\n", |
454 | m->min_write_speed, m->max_write_speed); | |
480 | m->min_write_speed, m->max_write_speed); | |
481 | } | |
482 | ||
455 | 483 | return !was_error; |
456 | 484 | } |
457 | 485 | |
458 | 486 | |
459 | 487 | void spc_sense_caps(struct burn_drive *d) |
460 | 488 | { |
461 | int alloc_len, start_len = 22, ret; | |
489 | int alloc_len, start_len = 30, ret; | |
462 | 490 | |
463 | 491 | if (mmc_function_spy(d, "sense_caps") <= 0) |
464 | 492 | return; |
918 | 946 | case 0x04: |
919 | 947 | sprintf(msg, |
920 | 948 | "Logical unit is in the process of becoming ready"); |
949 | return RETRY; | |
950 | case 0x08: | |
951 | if (*key != 4) | |
952 | break; | |
953 | if (*ascq == 0) | |
954 | sprintf(msg, "Logical unit communication failure"); | |
955 | else if (*ascq == 1) | |
956 | sprintf(msg, "Logical unit communication timeout"); | |
957 | else if (*ascq == 2) | |
958 | sprintf(msg, "Logical unit communication parity error"); | |
959 | else if (*ascq == 3) | |
960 | sprintf(msg, "Logical unit communication crc error"); | |
921 | 961 | return RETRY; |
922 | 962 | case 0x09: |
923 | 963 | if (*key != 4) |
160 | 160 | char current_profile_text[80]; |
161 | 161 | int current_is_cd_profile; |
162 | 162 | int current_is_supported_profile; |
163 | /* ts A90603 */ | |
164 | int current_is_guessed_profile; | |
165 | /* ts A90815 */ | |
166 | unsigned char all_profiles[256]; | |
167 | int num_profiles; | |
163 | 168 | |
164 | 169 | /* ts A70128 : MMC-to-MMC feature info from 46h for DVD-RW. |
165 | 170 | Quite internal. Regard as opaque :) |
311 | 316 | void (*eject) (struct burn_drive *); |
312 | 317 | void (*load) (struct burn_drive *); |
313 | 318 | int (*start_unit) (struct burn_drive *); |
319 | ||
320 | /* ts A90824 : Calming down noisy drives */ | |
321 | int (*stop_unit) (struct burn_drive *); | |
322 | int is_stopped; | |
323 | ||
314 | 324 | void (*read_disc_info) (struct burn_drive *); |
315 | 325 | void (*read_sectors) (struct burn_drive *, |
316 | 326 | int start, |
1735 | 1735 | o->obs_pad = 1; /* fill-up track's last 32k buffer */ |
1736 | 1736 | } |
1737 | 1737 | |
1738 | ||
1739 | /* <<< test only : Does this increase effective speed with USB ? | |
1740 | ts A90801 : 64kB: speed with 16x DVD-R is 12 rather than 8 | |
1741 | >>> next try is 128 kB | |
1742 | o->obs = 128 * 1024; | |
1743 | */ | |
1744 | ||
1745 | ||
1738 | 1746 | sprintf(msg, "dvd/bd Profile= %2.2Xh , obs= %d , obs_pad= %d", |
1739 | 1747 | d->current_profile, o->obs, o->obs_pad); |
1740 | 1748 | libdax_msgs_submit(libdax_messenger, d->global_index, 0x00000002, |
1844 | 1852 | int burn_stdio_write(int fd, char *buf, int count, struct burn_drive *d, |
1845 | 1853 | int flag) |
1846 | 1854 | { |
1855 | if (d->cancel) | |
1856 | return 0; | |
1857 | /* | |
1858 | fprintf(stderr, "libburn_DEBUG: write(%d, %lX, %d)\n", | |
1859 | fd, (unsigned long) buf, count); | |
1860 | */ | |
1861 | ||
1847 | 1862 | if (write(fd, buf, count) != count) { |
1848 | 1863 | libdax_msgs_submit(libdax_messenger, d->global_index, |
1849 | 1864 | 0x00020148, |
2092 | 2107 | { |
2093 | 2108 | struct cue_sheet *sheet; |
2094 | 2109 | struct burn_drive *d = o->drive; |
2095 | struct buffer buf, *buffer_mem = o->drive->buffer; | |
2110 | struct buffer *buffer_mem = o->drive->buffer; | |
2096 | 2111 | struct burn_track *lt, *t; |
2097 | 2112 | int first = 1, i, ret, lba, nwa = 0, multi_mem; |
2098 | 2113 | off_t default_size; |
2112 | 2127 | else |
2113 | 2128 | d->stream_recording_start = 0; |
2114 | 2129 | |
2115 | d->buffer = &buf; | |
2130 | d->buffer = calloc(sizeof(struct buffer), 1); | |
2131 | if (d->buffer == NULL) | |
2132 | goto fail_wo_sync; | |
2133 | ||
2134 | ||
2135 | /* >>> ts A90321 | |
2136 | ||
2116 | 2137 | memset(d->buffer, 0, sizeof(struct buffer)); |
2138 | ||
2139 | fprintf(stderr, "libburn_DEBUG: d->buffer = %lX , size = %d\n", | |
2140 | (unsigned long) d->buffer, (int) sizeof(struct buffer)); | |
2141 | ||
2142 | calloc() seems not to have the desired effect. valgrind warns: | |
2143 | ==18251== Syscall param write(buf) points to uninitialised byte(s) | |
2144 | ==18251== at 0x5071DEB: (within /lib64/libpthread-2.5.so) | |
2145 | ==18251== by 0x4723FA: burn_stdio_write (write.c:1850) | |
2146 | ==18251== by 0x4725DC: burn_stdio_mmc_write (write.c:1894) | |
2147 | ==18251== by 0x483B7A: get_sector (sector.c:229) | |
2148 | ==18251== by 0x484F11: sector_data (sector.c:639) | |
2149 | ==18251== by 0x4729FE: burn_stdio_write_track (write.c:2012) | |
2150 | ==18251== by 0x472CF4: burn_stdio_write_sync (write.c:2072) | |
2151 | ==18251== by 0x472E8D: burn_disc_write_sync (write.c:2125) <<< we are here | |
2152 | ==18251== by 0x460254: write_disc_worker_func (async.c:514) | |
2153 | ==18251== by 0x506B09D: start_thread (in /lib64/libpthread-2.5.so) | |
2154 | ==18251== by 0x55484CC: clone (in /lib64/libc-2.5.so) | |
2155 | */ | |
2156 | ||
2117 | 2157 | d->rlba = -150; |
2118 | 2158 | d->toc_temp = 9; |
2119 | 2159 | |
2311 | 2351 | d->busy = BURN_DRIVE_IDLE; |
2312 | 2352 | ex:; |
2313 | 2353 | d->do_stream_recording = 0; |
2354 | if (d->buffer != NULL) | |
2355 | free((char *) d->buffer); | |
2314 | 2356 | d->buffer = buffer_mem; |
2315 | 2357 | return; |
2316 | 2358 | } |