Subject: Re: Status of CDIOCPLAYTRACKS, CDIOCSETVOL problems outlined in:
To: None <current-users@netbsd.org>
From: Takeshi Nakayama <tn@catvmics.ne.jp>
List: current-users
Date: 10/28/2002 02:02:07
Hi, this is a topic about two month ago.

I got the same problem, as follows:

cd0 at scsibus0 target 1 lun 0: <TOSHIBA, CD-ROM XM-5301TA, 1895> SCSI2 5/cdrom removable

cd0(umass0:0:1:0):  Check Condition on CDB: 0x15 10 00 00 1c 00
    SENSE KEY:  Illegal Request
     ASC/ASCQ:  Invalid Field In Parameter List
         SKSV:  Error in Parameters, Offset 0, bit 4


And the following patch seems to solve this problem.

Index: cd_scsi.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/scsipi/cd_scsi.c,v
retrieving revision 1.26
diff -u -d -r1.26 cd_scsi.c
--- cd_scsi.c	2002/10/02 16:52:49	1.26
+++ cd_scsi.c	2002/10/27 15:48:45
@@ -171,6 +171,7 @@
 		return (error);
 	data.page.audio.flags &= ~CD_PA_SOTC;
 	data.page.audio.flags |= CD_PA_IMMED;
+	data.header.data_length = 0;
 	return (scsipi_mode_select(cd->sc_periph, SMS_PF,
 	    &data.header, AUDIOPAGESIZE,
 	    flags | XS_CTL_DATA_ONSTACK, CDRETRIES, 20000));
@@ -193,6 +194,7 @@
 	data.page.audio.port[RIGHT_PORT].channels = p1;
 	data.page.audio.port[2].channels = p2;
 	data.page.audio.port[3].channels = p3;
+	data.header.data_length = 0;
 	return (scsipi_mode_select(cd->sc_periph, SMS_PF,
 	    &data.header, AUDIOPAGESIZE,
 	    flags | XS_CTL_DATA_ONSTACK, CDRETRIES, 20000));
@@ -238,6 +240,7 @@
 	data.page.audio.port[RIGHT_PORT].volume = arg->vol[RIGHT_PORT];
 	data.page.audio.port[2].volume = arg->vol[2];
 	data.page.audio.port[3].volume = arg->vol[3];
+	data.header.data_length = 0;
 	return (scsipi_mode_select(cd->sc_periph, SMS_PF,
 	    &data.header, AUDIOPAGESIZE,
 	    flags | XS_CTL_DATA_ONSTACK, CDRETRIES, 20000));


In my analysis, rev 1.19 of cd_scsi.c used cd_scsibus_set_mode()
instead of scsipi_mode_select(). cd_scsibus_set_mode() had the code
which clear a data.header.data_length, but scsipi_mode_select()
does not have. So we need `data.header.data_length = 0;' before
calling scsipi_mode_select().

-- Takeshi Nakayama