From seggers@semyam.dinoco.de  Sun Sep 20 06:58:29 1998
Received: from tim.xenologics.com (tim.xenologics.com [194.77.5.24])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA28306
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 20 Sep 1998 06:58:26 -0700 (PDT)
          (envelope-from seggers@semyam.dinoco.de)
Received: (from uucp@localhost)
	by tim.xenologics.com (8.8.5/8.8.8) with UUCP id PAA23468
	for FreeBSD-gnats-submit@freebsd.org; Sun, 20 Sep 1998 15:56:06 +0200 (MET DST)
Received: (from seggers@localhost)
	by semyam.dinoco.de (8.9.1/8.8.8) id PAA01028;
	Sun, 20 Sep 1998 15:51:59 +0200 (CEST)
	(envelope-from seggers)
Message-Id: <199809201351.PAA01028@semyam.dinoco.de>
Date: Sun, 20 Sep 1998 15:51:59 +0200 (CEST)
From: Stefan Eggers <seggers@semyam.dinoco.de>
Reply-To: seggers@semyam.dinoco.de
To: FreeBSD-gnats-submit@freebsd.org
Cc: seggers@semyam.dinoco.de
Subject: CAM (in -current) for 53c875 fails to play audio CDs
X-Send-Pr-Version: 3.2

>Number:         7996
>Category:       kern
>Synopsis:       CAM (in -current) for 53c875 fails to play audio CDs
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    ken
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 20 07:00:01 PDT 1998
>Closed-Date:    Mon Sep 21 07:27:02 PDT 1998
>Last-Modified:  Mon Sep 21 07:28:01 PDT 1998
>Originator:     Stefan Eggers
>Release:        FreeBSD 3.0-BETA i386
>Organization:
none
>Environment:

	-current from Thursday, retried it with a kernel cvsuped
today with same result.

>Description:

	Trying to play back audio CDs with a program like cdcontrol
(which is included in the base system) results in a message about
extraneous data from the ncr driver.  The drive doesn't start playing.

	The messages from the driver are:

Sep 20 15:40:21 semyam /kernel: (cd0:ncr0:0:1:0): extraneous data discarded.
Sep 20 15:40:21 semyam /kernel: (cd0:ncr0:0:1:0): COMMAND FAILED (9 0) @f0714800.

	Dmesg shows the following lines for cd and ncr:

ncr0: <ncr 53c875 fast20 wide scsi> rev 0x03 int a irq 11 on pci0.12.0
ncr0: minsync=12, maxsync=137, maxoffs=16, 128 dwords burst, large dma fifo
ncr0: single-ended, open drain IRQ driver, using on-chip SRAM
ncr0: restart (scsi reset).
(probe0:ncr0:0:0:0): INQUIRY. CDB: 12 1 80 0 ff 0 
(probe0:ncr0:0:0:0): ILLEGAL REQUEST asc:24,0
(probe0:ncr0:0:0:0): Invalid field in CDB
(probe1:ncr0:0:1:0): INQUIRY. CDB: 12 1 80 0 ff 0 
(probe1:ncr0:0:1:0): ILLEGAL REQUEST asc:24,0
(probe1:ncr0:0:1:0): Invalid field in CDB
pass0 at ncr0 bus 0 target 0 lun 0
pass1 at ncr0 bus 0 target 1 lun 0
(cd0:ncr0:0:1:0): READ CD RECORDED CAPACITY. CDB: 25 0 0 0 0 0 0 0 0 0 
(cd0:ncr0:0:1:0): NOT READY asc:3a,0
(cd0:ncr0:0:1:0): Medium not present
cd0 at ncr0 bus 0 target 1 lun 0
cd0: <PIONEER CD-ROM DR-U12X 1.06> Removable CD-ROM SCSI2 device 
cd0: 10.0MB/s transfers (10.0MHz, offset 15)
cd0: Attempt to query device size failed: NOT READY, Medium not present
(da0:ncr0:0:0:0): READ CAPACITY. CDB: 25 0 0 0 0 0 0 0 0 0 
(da0:ncr0:0:0:0): NOT READY asc:3a,0
(da0:ncr0:0:0:0): Medium not present
da0 at ncr0 bus 0 target 0 lun 0
(cd0:ncr0:0:1:0): extraneous data discarded.
(cd0:ncr0:0:1:0): COMMAND FAILED (9 0) @f0714800.
(cd0:ncr0:0:1:0): extraneous data discarded.
(cd0:ncr0:0:1:0): COMMAND FAILED (9 0) @f0714800.
(cd0:ncr0:0:1:0): extraneous data discarded.
(cd0:ncr0:0:1:0): COMMAND FAILED (9 0) @f0714800.
(cd0:ncr0:0:1:0): extraneous data discarded.
(cd0:ncr0:0:1:0): COMMAND FAILED (9 0) @f0714800.

	The error messages at the end are the result of trying to do
an audio play.  The newest kernel versions I tested contained
sys/cam/scsi/scsi_cd.c version 1.1 and sys/pci/ncr.c version 1.130.

>How-To-Repeat:

	Use the above configuration, insert an audio CD and then try
to start playing with "cdcontrol play".  Now consult /var/log/messages
to see the errors ncr spit out.

>Fix:
	
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: ken 
State-Changed-When: Sun Sep 20 15:55:28 PDT 1998 
State-Changed-Why:  
I have sent the author patches that I think may fix this problem, and 
I have also checked the same patches into the tree. (version 1.3 of scsi_cd.c 
and version 1.2 of scsi_cd.h) 



Responsible-Changed-From-To: freebsd-bugs->ken 
Responsible-Changed-By: ken 
Responsible-Changed-When: Sun Sep 20 15:55:28 PDT 1998 
Responsible-Changed-Why:  
I believe this is a CD driver problem, not a problem with the NCR driver. 
So, since I wrote the CD driver, I'm responsible. 

From: "Kenneth D. Merry" <ken@plutotech.com>
To: seggers@semyam.dinoco.de
Cc: FreeBSD-gnats-submit@FreeBSD.ORG, seggers@semyam.dinoco.de
Subject: Re: kern/7996: CAM (in -current) for 53c875 fails to play audio CDs
Date: Sun, 20 Sep 1998 16:50:57 -0600 (MDT)

 --ELM906331857-3715-0_
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: 7bit
 
 Stefan Eggers wrote...
 
 [ .... ]
 
 > >Number:         7996
 > da0 at ncr0 bus 0 target 0 lun 0
 > (cd0:ncr0:0:1:0): extraneous data discarded.
 > (cd0:ncr0:0:1:0): COMMAND FAILED (9 0) @f0714800.
 > (cd0:ncr0:0:1:0): extraneous data discarded.
 > (cd0:ncr0:0:1:0): COMMAND FAILED (9 0) @f0714800.
 > (cd0:ncr0:0:1:0): extraneous data discarded.
 > (cd0:ncr0:0:1:0): COMMAND FAILED (9 0) @f0714800.
 > (cd0:ncr0:0:1:0): extraneous data discarded.
 > (cd0:ncr0:0:1:0): COMMAND FAILED (9 0) @f0714800.
 > 
 > 	The error messages at the end are the result of trying to do
 > an audio play.  The newest kernel versions I tested contained
 > sys/cam/scsi/scsi_cd.c version 1.1 and sys/pci/ncr.c version 1.130.
 > 
 > >How-To-Repeat:
 > 
 > 	Use the above configuration, insert an audio CD and then try
 > to start playing with "cdcontrol play".  Now consult /var/log/messages
 > to see the errors ncr spit out.
 
 This may be fixed by version 1.3 of scsi_cd.c and version 1.2 of scsi_cd.h.
 Can you please try those out, or try the attached patch, and let me know
 whether this fixes your problem?
 
 Ken
 -- 
 Kenneth Merry
 ken@plutotech.com
 
 --ELM906331857-3715-0_
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Disposition: attachment; filename=scsi_cd.patch.092098
 Content-Description: scsi_cd.patch.092098
 Content-Transfer-Encoding: 7bit
 
 ==== //depot/cam/sys/cam/scsi/scsi_cd.c#82 - /usr/home/ken/perforce/cam/sys/cam/scsi/scsi_cd.c ====
 *** /tmp/tmp.2017.0	Sun Sep 20 16:38:45 1998
 --- /usr/home/ken/perforce/cam/sys/cam/scsi/scsi_cd.c	Sun Sep 20 16:33:40 1998
 ***************
 *** 2759,2765 ****
   	cam_fill_csio(csio, 
   		      /* retries */ 1, 
   		      /* cbfcnp */ cddone, 
 ! 		      /* flags */ CAM_DIR_IN,
   		      /* tag_action */ MSG_SIMPLE_Q_TAG,
   		      /* data_ptr */ (u_int8_t *)data,
   		      /* dxfer_len */ sizeof(*data),
 --- 2759,2765 ----
   	cam_fill_csio(csio, 
   		      /* retries */ 1, 
   		      /* cbfcnp */ cddone, 
 ! 		      /* flags */ CAM_DIR_OUT,
   		      /* tag_action */ MSG_SIMPLE_Q_TAG,
   		      /* data_ptr */ (u_int8_t *)data,
   		      /* dxfer_len */ sizeof(*data),
 ***************
 *** 2793,2834 ****
   static int 
   cdplay(struct cam_periph *periph, u_int32_t blk, u_int32_t len)
   {
 ! 	struct scsi_play *scsi_cmd;
 !         struct ccb_scsiio *csio;
   	union ccb *ccb;
   	int error;
   
   	error = 0;
 - 
   	ccb = cdgetccb(periph, /* priority */ 1);
 - 
   	csio = &ccb->csio;
 ! 
 ! 	cam_fill_csio(csio, 
 ! 		      /* retries */ 1, 
 ! 		      /* cbfcnp */ cddone, 
 ! 		      /* flags */ CAM_DIR_IN,
 ! 		      /* tag_action */ MSG_SIMPLE_Q_TAG,
 ! 		      /* data_ptr */ NULL,
 ! 		      /* dxfer_len */ 0,
 ! 		      /* sense_len */ SSD_FULL_SIZE,
 ! 		      sizeof(struct scsi_play),
 !  		      /* timeout */ 50000);
 ! 
 ! 	scsi_cmd = (struct scsi_play *)&csio->cdb_io.cdb_bytes;
 ! 	bzero (scsi_cmd, sizeof(*scsi_cmd));
 ! 
 ! 	scsi_cmd->op_code = PLAY;
 ! 	scsi_ulto4b(blk, (u_int8_t *)scsi_cmd->blk_addr);
 ! 	scsi_ulto2b(len, (u_int8_t *)scsi_cmd->xfer_len);
   
   	error = cdrunccb(ccb, cderror, /*cam_flags*/0,
 ! 				  /*sense_flags*/SF_RETRY_UA);
   
   	xpt_release_ccb(ccb);
   
   	return(error);
 - 
   }
   
   static int
 --- 2793,2848 ----
   static int 
   cdplay(struct cam_periph *periph, u_int32_t blk, u_int32_t len)
   {
 ! 	struct ccb_scsiio *csio;
   	union ccb *ccb;
   	int error;
 + 	u_int8_t cdb_len;
   
   	error = 0;
   	ccb = cdgetccb(periph, /* priority */ 1);
   	csio = &ccb->csio;
 ! 	/*
 ! 	 * Use the smallest possible command to perform the operation.
 ! 	 */
 ! 	if ((len & 0xffff0000) == 0) {
 ! 		/*
 ! 		 * We can fit in a 10 byte cdb.
 ! 		 */
 ! 		struct scsi_play_10 *scsi_cmd;
 ! 
 ! 		scsi_cmd = (struct scsi_play_10 *)&csio->cdb_io.cdb_bytes;
 ! 		bzero (scsi_cmd, sizeof(*scsi_cmd));
 ! 		scsi_cmd->op_code = PLAY_10;
 ! 		scsi_ulto4b(blk, (u_int8_t *)scsi_cmd->blk_addr);
 ! 		scsi_ulto2b(len, (u_int8_t *)scsi_cmd->xfer_len);
 ! 		cdb_len = sizeof(*scsi_cmd);
 ! 	} else  {
 ! 		struct scsi_play_12 *scsi_cmd;
 ! 
 ! 		scsi_cmd = (struct scsi_play_12 *)&csio->cdb_io.cdb_bytes;
 ! 		bzero (scsi_cmd, sizeof(*scsi_cmd));
 ! 		scsi_cmd->op_code = PLAY_12;
 ! 		scsi_ulto4b(blk, (u_int8_t *)scsi_cmd->blk_addr);
 ! 		scsi_ulto4b(len, (u_int8_t *)scsi_cmd->xfer_len);
 ! 		cdb_len = sizeof(*scsi_cmd);
 ! 	}
 ! 	cam_fill_csio(csio,
 ! 		      /*retries*/2,
 ! 		      cddone,
 ! 		      /*flags*/CAM_DIR_NONE,
 ! 		      MSG_SIMPLE_Q_TAG,
 ! 		      /*dataptr*/NULL,
 ! 		      /*datalen*/0,
 ! 		      /*sense_len*/SSD_FULL_SIZE,
 ! 		      cdb_len,
 ! 		      /*timeout*/50 * 1000);
   
   	error = cdrunccb(ccb, cderror, /*cam_flags*/0,
 ! 			 /*sense_flags*/SF_RETRY_UA);
   
   	xpt_release_ccb(ccb);
   
   	return(error);
   }
   
   static int
 ***************
 *** 2849,2855 ****
   	cam_fill_csio(csio, 
   		      /* retries */ 1, 
   		      /* cbfcnp */ cddone, 
 ! 		      /* flags */ CAM_DIR_IN,
   		      /* tag_action */ MSG_SIMPLE_Q_TAG,
   		      /* data_ptr */ NULL,
   		      /* dxfer_len */ 0,
 --- 2863,2869 ----
   	cam_fill_csio(csio, 
   		      /* retries */ 1, 
   		      /* cbfcnp */ cddone, 
 ! 		      /* flags */ CAM_DIR_NONE,
   		      /* tag_action */ MSG_SIMPLE_Q_TAG,
   		      /* data_ptr */ NULL,
   		      /* dxfer_len */ 0,
 ***************
 *** 2895,2901 ****
   	cam_fill_csio(csio, 
   		      /* retries */ 1, 
   		      /* cbfcnp */ cddone, 
 ! 		      /* flags */ CAM_DIR_IN,
   		      /* tag_action */ MSG_SIMPLE_Q_TAG,
   		      /* data_ptr */ NULL,
   		      /* dxfer_len */ 0,
 --- 2909,2915 ----
   	cam_fill_csio(csio, 
   		      /* retries */ 1, 
   		      /* cbfcnp */ cddone, 
 ! 		      /* flags */ CAM_DIR_NONE,
   		      /* tag_action */ MSG_SIMPLE_Q_TAG,
   		      /* data_ptr */ NULL,
   		      /* dxfer_len */ 0,
 ***************
 *** 2937,2943 ****
   	cam_fill_csio(csio, 
   		      /* retries */ 1, 
   		      /* cbfcnp */ cddone, 
 ! 		      /* flags */ CAM_DIR_IN,
   		      /* tag_action */ MSG_SIMPLE_Q_TAG,
   		      /* data_ptr */ NULL,
   		      /* dxfer_len */ 0,
 --- 2951,2957 ----
   	cam_fill_csio(csio, 
   		      /* retries */ 1, 
   		      /* cbfcnp */ cddone, 
 ! 		      /* flags */ CAM_DIR_NONE,
   		      /* tag_action */ MSG_SIMPLE_Q_TAG,
   		      /* data_ptr */ NULL,
   		      /* dxfer_len */ 0,
 ==== //depot/cam/sys/cam/scsi/scsi_cd.h#8 - /usr/home/ken/perforce/cam/sys/cam/scsi/scsi_cd.h ====
 *** /tmp/tmp.2017.1	Sun Sep 20 16:38:45 1998
 --- /usr/home/ken/perforce/cam/sys/cam/scsi/scsi_cd.h	Sun Sep 20 16:06:55 1998
 ***************
 *** 31,198 ****
   
   struct scsi_pause
   {
 ! 	u_char	op_code;
 ! 	u_char	byte2;
 ! 	u_char	unused[6];
 ! 	u_char	resume;
 ! 	u_char	control;
   };
   #define	PA_PAUSE	1
   #define PA_RESUME	0
   
   struct scsi_play_msf
   {
 ! 	u_char	op_code;
 ! 	u_char	byte2;
 ! 	u_char	unused;
 ! 	u_char	start_m;
 ! 	u_char	start_s;
 ! 	u_char	start_f;
 ! 	u_char	end_m;
 ! 	u_char	end_s;
 ! 	u_char	end_f;
 ! 	u_char	control;
   };
   
   struct scsi_play_track
   {
 ! 	u_char	op_code;
 ! 	u_char	byte2;
 ! 	u_char	unused[2];
 ! 	u_char	start_track;
 ! 	u_char	start_index;
 ! 	u_char	unused1;
 ! 	u_char	end_track;
 ! 	u_char	end_index;
 ! 	u_char	control;
 ! };
 ! 
 ! struct scsi_play
 ! {
 ! 	u_char	op_code;
 ! 	u_char	byte2;
 ! 	u_char	blk_addr[4];
 ! 	u_char	unused;
 ! 	u_char	xfer_len[2];
 ! 	u_char	control;
 ! };
 ! 
 ! struct scsi_play_big
 ! {
 ! 	u_char	op_code;
 ! 	u_char	byte2;	/* same as above */
 ! 	u_char	blk_addr[4];
 ! 	u_char	xfer_len[4];
 ! 	u_char	unused;
 ! 	u_char	control;
 ! };
 ! 
 ! struct scsi_play_rel_big
 ! {
 ! 	u_char	op_code;
 ! 	u_char	byte2;	/* same as above */
 ! 	u_char	blk_addr[4];
 ! 	u_char	xfer_len[4];
 ! 	u_char	track;
 ! 	u_char	control;
   };
   
   struct scsi_read_header
   {
 ! 	u_char	op_code;
 ! 	u_char	byte2;
 ! 	u_char	blk_addr[4];
 ! 	u_char	unused;
 ! 	u_char	data_len[2];
 ! 	u_char	control;
   };
   
   struct scsi_read_subchannel
   {
 ! 	u_char	op_code;
 ! 	u_char	byte1;
 ! 	u_char	byte2;
   #define	SRS_SUBQ	0x40
 ! 	u_char	subchan_format;
 ! 	u_char	unused[2];
 ! 	u_char	track;
 ! 	u_char	data_len[2];
 ! 	u_char	control;
   };
   
   struct scsi_read_toc
   {
 ! 	u_char	op_code;
 ! 	u_char	byte2;
 ! 	u_char	unused[4];
 ! 	u_char	from_track;
 ! 	u_char	data_len[2];
 ! 	u_char	control;
   };
   ;
   
   struct scsi_read_cd_capacity
   {
 ! 	u_char	op_code;
 ! 	u_char	byte2;
 ! 	u_char	addr_3;	/* Most Significant */
 ! 	u_char	addr_2;
 ! 	u_char	addr_1;
 ! 	u_char	addr_0;	/* Least Significant */
 ! 	u_char	unused[3];
 ! 	u_char	control;
   };
   
   /*
    * Opcodes
    */
 - 
   #define READ_CD_CAPACITY	0x25	/* slightly different from disk */
   #define READ_SUBCHANNEL		0x42	/* cdrom read Subchannel */
   #define READ_TOC		0x43	/* cdrom read TOC */
   #define READ_HEADER		0x44	/* cdrom read header */
 ! #define PLAY			0x45	/* cdrom play  'play audio' mode */
   #define PLAY_MSF		0x47	/* cdrom play Min,Sec,Frames mode */
   #define PLAY_TRACK		0x48	/* cdrom play track/index mode */
   #define PLAY_TRACK_REL		0x49	/* cdrom play track/index mode */
   #define PAUSE			0x4b	/* cdrom pause in 'play audio' mode */
 ! #define PLAY_BIG		0xa5	/* cdrom pause in 'play audio' mode */
   #define PLAY_TRACK_REL_BIG	0xa9	/* cdrom play track/index mode */
   
   
   
   struct scsi_read_cd_cap_data
   {
 ! 	u_char	addr_3;	/* Most significant */
 ! 	u_char	addr_2;
 ! 	u_char	addr_1;
 ! 	u_char	addr_0;	/* Least significant */
 ! 	u_char	length_3;	/* Most significant */
 ! 	u_char	length_2;
 ! 	u_char	length_1;
 ! 	u_char	length_0;	/* Least significant */
   };
   
   union	cd_pages
   {
   	struct	audio_page
   	{
 ! 		u_char	page_code;
   #define	CD_PAGE_CODE	0x3F
   #define	AUDIO_PAGE	0x0e
   #define	CD_PAGE_PS	0x80
 ! 		u_char	param_len;
 ! 		u_char	flags;
   #define		CD_PA_SOTC	0x02
   #define		CD_PA_IMMED	0x04
 ! 		u_char	unused[2];
 ! 		u_char	format_lba;
   #define		CD_PA_FORMAT_LBA	0x0F
   #define		CD_PA_APR_VALID	0x80
 ! 		u_char	lb_per_sec[2];
   		struct	port_control
   		{
 ! 			u_char	channels;
   #define	CHANNEL 0x0F
   #define	CHANNEL_0 1
   #define	CHANNEL_1 2
 --- 31,197 ----
   
   struct scsi_pause
   {
 ! 	u_int8_t op_code;
 ! 	u_int8_t byte2;
 ! 	u_int8_t unused[6];
 ! 	u_int8_t resume;
 ! 	u_int8_t control;
   };
   #define	PA_PAUSE	1
   #define PA_RESUME	0
   
   struct scsi_play_msf
   {
 ! 	u_int8_t op_code;
 ! 	u_int8_t byte2;
 ! 	u_int8_t unused;
 ! 	u_int8_t start_m;
 ! 	u_int8_t start_s;
 ! 	u_int8_t start_f;
 ! 	u_int8_t end_m;
 ! 	u_int8_t end_s;
 ! 	u_int8_t end_f;
 ! 	u_int8_t control;
   };
   
   struct scsi_play_track
   {
 ! 	u_int8_t op_code;
 ! 	u_int8_t byte2;
 ! 	u_int8_t unused[2];
 ! 	u_int8_t start_track;
 ! 	u_int8_t start_index;
 ! 	u_int8_t unused1;
 ! 	u_int8_t end_track;
 ! 	u_int8_t end_index;
 ! 	u_int8_t control;
 ! };
 ! 
 ! struct scsi_play_10
 ! {
 ! 	u_int8_t op_code;
 ! 	u_int8_t byte2;
 ! 	u_int8_t blk_addr[4];
 ! 	u_int8_t unused;
 ! 	u_int8_t xfer_len[2];
 ! 	u_int8_t control;
 ! };
 ! 
 ! struct scsi_play_12
 ! {
 ! 	u_int8_t op_code;
 ! 	u_int8_t byte2;	/* same as above */
 ! 	u_int8_t blk_addr[4];
 ! 	u_int8_t xfer_len[4];
 ! 	u_int8_t unused;
 ! 	u_int8_t control;
 ! };
 ! 
 ! struct scsi_play_rel_12
 ! {
 ! 	u_int8_t op_code;
 ! 	u_int8_t byte2;	/* same as above */
 ! 	u_int8_t blk_addr[4];
 ! 	u_int8_t xfer_len[4];
 ! 	u_int8_t track;
 ! 	u_int8_t control;
   };
   
   struct scsi_read_header
   {
 ! 	u_int8_t op_code;
 ! 	u_int8_t byte2;
 ! 	u_int8_t blk_addr[4];
 ! 	u_int8_t unused;
 ! 	u_int8_t data_len[2];
 ! 	u_int8_t control;
   };
   
   struct scsi_read_subchannel
   {
 ! 	u_int8_t op_code;
 ! 	u_int8_t byte1;
 ! 	u_int8_t byte2;
   #define	SRS_SUBQ	0x40
 ! 	u_int8_t subchan_format;
 ! 	u_int8_t unused[2];
 ! 	u_int8_t track;
 ! 	u_int8_t data_len[2];
 ! 	u_int8_t control;
   };
   
   struct scsi_read_toc
   {
 ! 	u_int8_t op_code;
 ! 	u_int8_t byte2;
 ! 	u_int8_t unused[4];
 ! 	u_int8_t from_track;
 ! 	u_int8_t data_len[2];
 ! 	u_int8_t control;
   };
   ;
   
   struct scsi_read_cd_capacity
   {
 ! 	u_int8_t op_code;
 ! 	u_int8_t byte2;
 ! 	u_int8_t addr_3;	/* Most Significant */
 ! 	u_int8_t addr_2;
 ! 	u_int8_t addr_1;
 ! 	u_int8_t addr_0;	/* Least Significant */
 ! 	u_int8_t unused[3];
 ! 	u_int8_t control;
   };
   
   /*
    * Opcodes
    */
   #define READ_CD_CAPACITY	0x25	/* slightly different from disk */
   #define READ_SUBCHANNEL		0x42	/* cdrom read Subchannel */
   #define READ_TOC		0x43	/* cdrom read TOC */
   #define READ_HEADER		0x44	/* cdrom read header */
 ! #define PLAY_10			0x45	/* cdrom play  'play audio' mode */
   #define PLAY_MSF		0x47	/* cdrom play Min,Sec,Frames mode */
   #define PLAY_TRACK		0x48	/* cdrom play track/index mode */
   #define PLAY_TRACK_REL		0x49	/* cdrom play track/index mode */
   #define PAUSE			0x4b	/* cdrom pause in 'play audio' mode */
 ! #define PLAY_12			0xa5	/* cdrom pause in 'play audio' mode */
   #define PLAY_TRACK_REL_BIG	0xa9	/* cdrom play track/index mode */
   
   
   
   struct scsi_read_cd_cap_data
   {
 ! 	u_int8_t addr_3;	/* Most significant */
 ! 	u_int8_t addr_2;
 ! 	u_int8_t addr_1;
 ! 	u_int8_t addr_0;	/* Least significant */
 ! 	u_int8_t length_3;	/* Most significant */
 ! 	u_int8_t length_2;
 ! 	u_int8_t length_1;
 ! 	u_int8_t length_0;	/* Least significant */
   };
   
   union	cd_pages
   {
   	struct	audio_page
   	{
 ! 		u_int8_t page_code;
   #define	CD_PAGE_CODE	0x3F
   #define	AUDIO_PAGE	0x0e
   #define	CD_PAGE_PS	0x80
 ! 		u_int8_t param_len;
 ! 		u_int8_t flags;
   #define		CD_PA_SOTC	0x02
   #define		CD_PA_IMMED	0x04
 ! 		u_int8_t unused[2];
 ! 		u_int8_t format_lba;
   #define		CD_PA_FORMAT_LBA	0x0F
   #define		CD_PA_APR_VALID	0x80
 ! 		u_int8_t lb_per_sec[2];
   		struct	port_control
   		{
 ! 			u_int8_t channels;
   #define	CHANNEL 0x0F
   #define	CHANNEL_0 1
   #define	CHANNEL_1 2
 ***************
 *** 200,206 ****
   #define	CHANNEL_3 8
   #define	LEFT_CHANNEL	CHANNEL_0
   #define	RIGHT_CHANNEL	CHANNEL_1
 ! 			u_char	volume;
   		} port[4];
   #define	LEFT_PORT	0
   #define	RIGHT_PORT	1
 --- 199,205 ----
   #define	CHANNEL_3 8
   #define	LEFT_CHANNEL	CHANNEL_0
   #define	RIGHT_CHANNEL	CHANNEL_1
 ! 			u_int8_t volume;
   		} port[4];
   #define	LEFT_PORT	0
   #define	RIGHT_PORT	1
 
 --ELM906331857-3715-0_--

From: Stefan Eggers <seggers@semyam.dinoco.de>
To: "Kenneth D. Merry" <ken@plutotech.com>
Cc: FreeBSD-gnats-submit@freebsd.org, seggers@semyam.dinoco.de
Subject: Re: kern/7996: CAM (in -current) for 53c875 fails to play audio CDs 
Date: Mon, 21 Sep 1998 08:34:18 +0200

 > Can you please try those out, or try the attached patch, and let me know
 > whether this fixes your problem?
 
 I applied the patch and now it works for me.  Thanks!
 
 Stefan.
State-Changed-From-To: feedback->closed 
State-Changed-By: ken 
State-Changed-When: Mon Sep 21 07:27:02 PDT 1998 
State-Changed-Why:  
PR author reports that the patches fixed his problem.  The patches were 
also applied to -current. 
>Unformatted:
