From owner-freebsd-hardware Thu Feb 26 16:12:57 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA01242 for freebsd-hardware-outgoing; Thu, 26 Feb 1998 16:12:57 -0800 (PST) (envelope-from owner-freebsd-hardware@FreeBSD.ORG) Received: from thunderdome.plutotech.com (root@thunderdome.plutotech.com [206.168.67.122]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA01005 for ; Thu, 26 Feb 1998 16:12:20 -0800 (PST) (envelope-from ken@panzer.plutotech.com) Received: from panzer.plutotech.com (ken@panzer.plutotech.com [206.168.67.125]) by thunderdome.plutotech.com (8.8.7/8.8.5) with ESMTP id RAA01515; Thu, 26 Feb 1998 17:12:18 -0700 (MST) Received: (from ken@localhost) by panzer.plutotech.com (8.8.8/8.8.5) id RAA15790; Thu, 26 Feb 1998 17:12:16 -0700 (MST) From: "Kenneth D. Merry" Message-Id: <199802270012.RAA15790@panzer.plutotech.com> Subject: Re: NEC 4X 7 CD Changer In-Reply-To: from Paul Griffith at "Feb 26, 98 12:57:35 pm" To: paulg@interlog.com (Paul Griffith) Date: Thu, 26 Feb 1998 17:12:16 -0700 (MST) Cc: freebsd-hardware@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL28s (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hardware@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Paul Griffith wrote... > I just picked up a new NEC Multispin 4X 7 CD changer for about $35CDN to > replace my old Toshiba 1X drive. On restart my FreeBSD system sees the > CD changer, and all 7 LUNs, plus my other Toshiba 4X. So we have something > like this: > > SCSI 4 - Toshiba 4X cd0 > SCSI 5 - NEC 4X changer cd1 ....cd7 > > So I run the MAKEDEV script to add the additional /dev entries, on the last > one MAKEDEV cd7 I get the following error: > > Bad unit for disk in: cd7 > > I quick look at MAKEDEV show it only 7 CD-ROM's (cd0 - cd6). I modified > MAKEDEV to allow 7 CD-ROM's (cd0-cd7). I ran into the same problem with MAKEDEV, so I modified the version in the CAM tree to be a little smarter about making CD devices: ===== cut here ===== ==== //depot/cam/etc/etc.i386/MAKEDEV#13 - //depot/cam/etc/etc.i386/MAKEDEV#14 ==== *************** *** 667,694 **** cd*|mcd*|scd*) umask $disk_umask case $i in ! cd*) unit=`expr $i : '..\(.*\)'`; name=cd; blk=6; chr=15;; ! mcd*) unit=`expr $i : '...\(.*\)'`; name=mcd; blk=7; chr=29;; ! scd*) unit=`expr $i : '...\(.*\)'`; name=scd; blk=16; chr=45;; esac ! case $unit in ! 0|1|2|3|4|5|6) ! mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0` ! mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2` ! mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0` ! mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2` ! chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h] ! case $name in ! cd) ! mknod r${name}${unit}.ctl c $chr `expr $unit '*' 8 + $scsictl ` ! chmod 600 r${name}${unit}.ctl ! ;; ! esac ! ;; ! *) ! echo bad unit for disk in: $i ! ;; ! esac umask 77 ;; --- 667,699 ---- cd*|mcd*|scd*) umask $disk_umask case $i in ! cd*) units=`expr $i : '..\(.*\)'`; name=cd; blk=6; chr=15;; ! mcd*) units=`expr $i : '...\(.*\)'`; name=mcd; blk=7; chr=29;; ! scd*) units=`expr $i : '...\(.*\)'`; name=scd; blk=16; chr=45;; esac ! if [ "X${units}" = "X" -o ${units} -le 0 ]; then ! units=1 ! fi ! if [ "${units}" -le 31 ]; then ! eval `echo ${chr} ${blk} ${units} ${name} |awk \ ! '{ c=$1; b=$2; n=$3; name=$4;} END{ ! for (i = 0; i < n; i++){ ! printf("rm -f %s%d* r%s%d*; \ ! mknod %s%da b %d %d; \ ! mknod %s%dc b %d %d; \ ! mknod r%s%da c %d %d; \ ! mknod r%s%dc c %d %d; \ ! chgrp operator %s%d* r%s%d*;", ! name, i, name, i, ! name, i, b, (i * 8), ! name, i, b, (i * 8) + 2, ! name, i, c, (i * 8), ! name, i, c, (i * 8) + 2, ! name, i, name, i); }}'` ! ! else ! echo "$i is invalid -- can't have more than 32 cd devices" ! fi umask 77 ;; ===== cut here ===== So, with that change, you can type: sh MAKEDEV 12 If you want 12 CD devices. > That seem to work fine, execpt I > have to issue the mount command twice, since it times out the first time. > Maybe I should add SLOW_SCSI/SCSI_DELAY in the kernal and re-compile ? That probably won't help, since AFAIK, SCSI_DELAY only affects the bus settle delay during probe, and SCSI_SLOW doesn't exist. My guess is that your problem is that one of the commands that is sent to mount the CD is timing out. The changer probably isn't changing fast enough to service the request before the timeout hits. The reason the second mount works is because the changer has already changed to that disk, so it can service the request before the timeout hits. One problem I found with the 2x NEC 7-cd changer that Lars Fredriksen lent me is that it doesn't seem to disconnect from the bus when probed. (and probably at other times as well) If you're just having trouble mounting the CD, that probably isn't your problem, though. > I would perfer to use the ch driver, Do I have to hard-wire it down in the > kernel ? If you can point me in the right directions please let me know ? > I already tried man 4 ch. Unless the NEC drive probes as a changer device as well as a bunch of CD devices, you can't use the ch(4) driver. CD switching is done based upon which cd device you access. The CAM CD driver has much better changer support than the CD driver in -current. I would suggest checking out the next CAM snapshot, it may fix things for you. Ken -- Kenneth Merry ken@plutotech.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hardware" in the body of the message