Subject: kern/7438: patch to support quirky Toshiba XM-3401TA SCSI CD-ROM
To: None <gnats-bugs@gnats.netbsd.org>
From: None <fredette@mit.edu>
List: netbsd-bugs
Date: 04/21/1999 18:21:54
>Number:         7438
>Category:       kern
>Synopsis:       patch to support quirky Toshiba XM-3401TA SCSI CD-ROM
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 21 18:05:00 1999
>Last-Modified:
>Originator:     Matthew Fredette
>Organization:
	
>Release:        NetBSD 1.3.2
>Environment:
System: NetBSD awaken 1.3.2 NetBSD 1.3.2 (AWAKEN) #4: Tue Apr 20 12:27:27 EDT 1999 fredette@awaken:/u2/src/sys/arch/sun3/compile/AWAKEN sun3


>Description:
The Toshiba XM-3401TA SCSI CD-ROM does not identify itself
as a "CD-ROM removable" SCSI device.  It claims to be a 
"fixed direct" SCSI device.  As a result it gets attached
as an sd? instead of a cd?.
>How-To-Repeat:
Connect a Toshiba XM-3401TA SCSI CD-ROM to a system,
reboot, note result of device probe.
>Fix:
Apply the following patch (derived from the stock NetBSD 
1.3.2 dev/scsipi/scsiconf.c):
[snip]
*** scsiconf.c.orig	Tue May  5 04:21:55 1998
--- scsiconf.c	Tue Apr 20 12:25:11 1999
***************
*** 439,444 ****
--- 439,447 ----
  	 "MICROP  ", "1588-15MBSUN0669", ""},     SDEV_AUTOSAVE},
  	{{T_OPTICAL, T_REMOV,
  	 "EPSON   ", "OMD-5010        ", "3.08"}, SDEV_NOLUNS},
+ 	/* reports itself as direct/fixed */
+ 	{{T_DIRECT, T_FIXED,
+ 	 "TOSHIBA ", "CD-ROM XM-3401TA", "0283"}, ADEV_CDROM|SDEV_NOLUNS},
  
  	{{T_DIRECT, T_FIXED,
  	 "DEC     ", "RZ55     (C) DEC", ""},     SDEV_AUTOSAVE},
***************
*** 647,652 ****
--- 650,661 ----
  
  	if ((sc_link->quirks & SDEV_NOLUNS) == 0)
  		scsi->moreluns |= (1 << target);
+ 	if (sc_link->quirks & ADEV_CDROM) {
+ 		sc_link->quirks ^= ADEV_CDROM;
+ 		inqbuf.dev_qual2 |= SID_REMOVABLE;
+ 		sa.sa_inqbuf.type = inqbuf.device = ((inqbuf.device & (~SID_TYPE)) | T_CDROM);
+ 		sa.sa_inqbuf.removable = T_REMOV;
+ 	}
  
  	/*
  	 * note what BASIC type of device it is
[snip]
>Audit-Trail:
>Unformatted: