Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Sep 2001 11:25:14 +0200 (CEST)
From:      Søren Schmidt <sos@freebsd.dk>
To:        glenn gombert <glenngombert@zdnetonebox.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: FreeBSD CW-Writer Problem
Message-ID:  <200109150925.f8F9PFR88190@freebsd.dk>
In-Reply-To: <20010915000947.BYTU7831.mta04.onebox.com@onebox.com> "from glenn gombert at Sep 14, 2001 05:09:47 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
It seems glenn gombert wrote:
> Hello,
> 
>   I am running FreeBSD Current and having a problem with my Memorx CRW-1662
> CD-Writer and trying to use it with 'burncd'. I tried to write a small
> test 'iso' Image that I made using mkisofa and got the following error
> message "MODE_SELECT_BIG - Illegal Request'...when trying to write to
> the CRW-1662....
> 
>   As another test I used 'burncd' to erase a CR-R/W with the 'burncd
> erase' command and it seemed to work just fine....
> 
>  Can anyone tell me what the above error is about and how I might get
> the Memorex CRW-1662 with my FreeBSD Current System??

This is probably due to the new DAO mode code, try the below patch
and see if that helps in normal burning mode, if your burner has
problems with DAO mode (-d option) that will most likely still fail.

Index: sys/dev/ata/atapi-cd.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/atapi-cd.c,v
retrieving revision 1.100
diff -u -r1.100 atapi-cd.c
--- sys/dev/ata/atapi-cd.c	10 Sep 2001 11:43:20 -0000	1.100
+++ sys/dev/ata/atapi-cd.c	15 Sep 2001 08:25:55 -0000
@@ -1407,9 +1407,7 @@
 static int
 acd_init_writer(struct acd_softc *cdp, int test_write)
 {
-    struct write_param param;
     int8_t ccb[16];
-    int error;
 
     bzero(ccb, sizeof(ccb));
     ccb[0] = ATAPI_REZERO;
@@ -1417,23 +1415,7 @@
     ccb[0] = ATAPI_SEND_OPC_INFO;
     ccb[1] = 0x01;
     atapi_queue_cmd(cdp->atp, ccb, NULL, 0, ATPR_F_QUIET, 30, NULL, NULL);
-
-    if ((error = acd_mode_sense(cdp, ATAPI_CDROM_WRITE_PARAMETERS_PAGE,
-				(caddr_t)&param, sizeof(param))))
-	return error;
-    param.data_length = 0;
-    param.page_code = ATAPI_CDROM_WRITE_PARAMETERS_PAGE;
-    param.page_length = 0x32;
-    param.test_write = test_write ? 1 : 0;
-    param.write_type = CDR_WTYPE_SESSION;
-    param.session_type = CDR_SESS_NONE;
-    param.fp = 0;
-    param.packet_size = 0;
-    param.track_mode = CDR_TMODE_AUDIO;
-    param.datablock_type = CDR_DB_RAW;
-    param.session_format = CDR_SESS_CDROM;
-
-    return acd_mode_select(cdp, (caddr_t)&param, param.page_length + 10);
+    return 0;
 }
 
 static int
@@ -1613,6 +1595,7 @@
 static int
 acd_send_cue(struct acd_softc *cdp, struct cdr_cuesheet *cuesheet)
 {
+    struct write_param param;
     int8_t ccb[16] = { ATAPI_SEND_CUE_SHEET, 0, 0, 0, 0, 0, 
 		       cuesheet->len>>16, cuesheet->len>>8, cuesheet->len,
 		       0, 0, 0, 0, 0, 0, 0 };
@@ -1621,6 +1604,24 @@
 #ifdef ACD_DEBUG
     int i;
 #endif
+
+    if ((error = acd_mode_sense(cdp, ATAPI_CDROM_WRITE_PARAMETERS_PAGE,
+				(caddr_t)&param, sizeof(param))))
+	return error;
+    param.data_length = 0;
+    param.page_code = ATAPI_CDROM_WRITE_PARAMETERS_PAGE;
+    param.page_length = 0x32;
+    param.test_write = cuesheet->test_write ? 1 : 0;
+    param.write_type = CDR_WTYPE_SESSION;
+    param.session_type = CDR_SESS_NONE;
+    param.fp = 0;
+    param.packet_size = 0;
+    param.track_mode = CDR_TMODE_AUDIO;
+    param.datablock_type = CDR_DB_RAW;
+    param.session_format = CDR_SESS_CDROM;
+    if ((error = acd_mode_select(cdp, (caddr_t)&param, param.page_length + 10)))
+	return error;
+
     buffer = malloc(cuesheet->len, M_ACD, M_NOWAIT);
     if (!buffer)
 	return ENOMEM;
Index: sys/sys/cdrio.h
===================================================================
RCS file: /home/ncvs/src/sys/sys/cdrio.h,v
retrieving revision 1.4
diff -u -r1.4 cdrio.h
--- sys/sys/cdrio.h	10 Sep 2001 11:42:27 -0000	1.4
+++ sys/sys/cdrio.h	15 Sep 2001 08:19:38 -0000
@@ -71,6 +71,7 @@
 struct cdr_cuesheet {
     	int32_t len;
 	struct cdr_cue_entry *entries;
+	int test_write;
 };
 
 #define CDRIOCBLANK		_IOW('c', 100, int)
Index: usr.sbin/burncd/burncd.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/burncd/burncd.c,v
retrieving revision 1.16
diff -u -r1.16 burncd.c
--- usr.sbin/burncd/burncd.c	11 Sep 2001 12:14:20 -0000	1.16
+++ usr.sbin/burncd/burncd.c	15 Sep 2001 08:19:07 -0000
@@ -58,7 +58,7 @@
 static int fd, quiet, verbose, saved_block_size, notracks;
 
 void add_track(char *, int, int);
-void do_DAO(void);
+void do_DAO(int);
 void do_TAO(int, int);
 int write_file(struct track_info *);
 int roundup_blocks(struct track_info *);
@@ -245,7 +245,7 @@
 			cdopen = 1;
 		}
 		if (dao) 
-			do_DAO();
+			do_DAO(test_write);
 		else
 			do_TAO(test_write, preemp);
 	}
@@ -308,7 +308,7 @@
 }
 
 void
-do_DAO(void)
+do_DAO(int test_write)
 {
 	struct cdr_cuesheet sheet;
 	struct cdr_cue_entry cue[100];
@@ -390,6 +390,7 @@
 
 	sheet.len = j * 8;
 	sheet.entries = cue;
+	sheet.test_write = test_write;
 	if (verbose) {
 		u_int8_t *ptr = (u_int8_t *)sheet.entries;
 		
@@ -404,9 +405,10 @@
 	
 	if (ioctl(fd, CDRIOCSENDCUE, &sheet) < 0)
 		err(EX_IOERR, "ioctl(CDRIOCSENDCUE)");
-
+#if 0
 	if (ioctl(fd, CDRIOCNEXTWRITEABLEADDR, &addr) < 0) 
 		err(EX_IOERR, "ioctl(CDRIOCNEXTWRITEABLEADDR)");
+#endif
 	for (i = 0; i < notracks; i++) {
 		if (write_file(&tracks[i]))
 			err(EX_IOERR, "write_file");
-Søren

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109150925.f8F9PFR88190>