aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/cdrecord/files/patch-ai
blob: 6106947467d8e1c76c86dacaf1908f900eb225d6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
--- cdrecord/drv_philips.c.orig	Fri Feb  2 15:14:16 2001
+++ cdrecord/drv_philips.c	Fri Feb  2 16:00:48 2001
@@ -62,6 +62,7 @@
 LOCAL	int	write_track_info_philips	__PR((SCSI *scgp, int));
 LOCAL	int	write_track_philips		__PR((SCSI *scgp, long, int));
 LOCAL	int	open_track_philips		__PR((SCSI *scgp, cdr_t *dp, int track, track_t *track_info));
+LOCAL	int	open_track_plasmon		__PR((SCSI *scgp, cdr_t *dp, int track, track_t *track_info));
 LOCAL	int	open_track_oldphilips		__PR((SCSI *scgp, cdr_t *dp, int track, track_t *track_info));
 LOCAL	int	open_track_yamaha		__PR((SCSI *scgp, cdr_t *dp, int track, track_t *track_info));
 LOCAL	int	close_track_philips		__PR((SCSI *scgp, int track, track_t *trackp));
@@ -71,6 +72,7 @@
 LOCAL	int	plasmon_attach			__PR((SCSI *scgp, cdr_t *));
 LOCAL	int	ricoh_attach			__PR((SCSI *scgp, cdr_t *));
 LOCAL	int	philips_getlilo			__PR((SCSI *scgp, long *lilenp, long *lolenp));
+LOCAL	int	plasmon_buf			__PR((SCSI *, long *, long *));
 
 
 struct cdd_52x_mode_page_21 {	/* write track information */
@@ -284,7 +286,7 @@
 	philips_getdisktype,
 	philips_load,
 	philips_unload,
-	buf_dummy,
+	plasmon_buf,
 	recovery_needed,
 	recover_philips,
 	speed_select_philips,
@@ -293,7 +295,7 @@
 	reserve_track_philips,
 	scsi_cdr_write_philips,
 	no_sendcue,
-	open_track_philips,
+	open_track_plasmon,
 	close_track_philips,
 	(int(*)__PR((SCSI *, cdr_t *, int, track_t *, int, int)))cmd_dummy,
 	cmd_dummy,
@@ -922,6 +924,22 @@
 }
 
 LOCAL int
+open_track_plasmon(scgp, dp, track, track_info)
+	SCSI	*scgp;
+	cdr_t	*dp;
+	int	track;
+	track_t *track_info;
+{
+	if (select_secsize(scgp, track_info->secsize) < 0)
+		return (-1);
+
+	if (write_track_info_philips(scgp, track_info->sectype) < 0)
+		return (-1);
+
+	return (0);
+}
+
+LOCAL int
 open_track_oldphilips(scgp, dp, track, track_info)
 	SCSI	*scgp;
 	cdr_t	*dp;
@@ -1211,4 +1229,27 @@
 		*lolenp = lo;
 
 	return (0);
+}
+
+LOCAL int
+plasmon_buf(scgp, sp, fp)
+	SCSI	*scgp;
+	long	*sp;	/* Size pointer */
+	long	*fp;	/* Free space pointer */
+{
+	/*
+	 * There's no way to obtain these values from the
+	 * Plasmon RF41xx devices.  This function stub is only
+	 * present to prevent cdrecord.c from calling a pointless
+	 * READ BUFFER SCSI cmd which is meant to be used for
+	 * something totally else, and which would only jam the
+	 * Plasmon due to the incorrect parameters used.
+	 */
+
+	if (sp)
+		*sp = 2 * 1024 * 1024; /* assume 2 MB */
+	if (fp)
+		*fp = 2 * 1024 * 1024; /* assume 2 MB */
+
+	return 100;
 }