Date: Fri, 18 Sep 1998 22:59:52 -0600 (MDT) From: "Kenneth D. Merry" <ken@plutotech.com> To: root@eyelab.psy.msu.edu (Gary Schrock) Cc: freebsd-scsi@FreeBSD.ORG Subject: Re: using a cd-r as a cd-rom drive, and a general cam question Message-ID: <199809190459.WAA14878@panzer.plutotech.com> In-Reply-To: <199809190216.WAA21875@eyelab.psy.msu.edu> from Gary Schrock at "Sep 18, 98 10:16:14 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Gary Schrock wrote...
> Ok, I've got two questions here. One is that I've got a machine that I've
> got an older Pinnacle Micro rcd-1000 cd recorder. This was one of the
> early 2x recorders, from the time when they only reported themselves as
> Type 4 devices, unlike most modern ones that report themselves as Type 5
> devices which lets them be used as normal cd drives easily. Is there any
> way to get this drive to work using the cd driver under cam? I don't have
> any real need to use it as a cd recorder under freebsd, but being able to
> read from it would be very useful. Running camcontrol devlist shows me:
> vision# camcontrol devlist
> <SONY SDT-7000 0195> at scbus0 target 2 lun 0 (sa0)
> <PINNACLE RCD-1000 2.35> at scbus0 target 4 lun 0 (cd0)
> But while booting cd0 is never listed in the boot messages (sa0 is
> definitely listed there). I also never seem to be able to mount anything
> on it, getting device not configured errors (yes, I've made the /dev/cd
> devices).
Well, it looks like there are several things going on here:
- The CAM CD driver attempts to attach to any CD or WORM devices it finds.
If the worm device it finds returns errors on probe, the CD driver won't
attach to it. It won't print any errors for worm devices, since many of
them don't respond properly to CDROM commands. Your drive most likely
falls into that category, although there's one way to find out for sure.
Apply the attached patch to src/sys/cam/scsi/scsi_cd.c, and send me the
output when you boot.
- The CD driver isn't getting properly de-registered when it fails to
attach to your device. I need to look into that one.
- You don't have the passthrough device configured in your kernel.
> My other question is is there any document describing exactly what things
> you need to enable in the config file for cam? Obviously I need to enable
> the driver for my scsi card, the sa driver for the tape drive, and the cd
> driver for the cd drive, but what about the other ones? Camcontrol seems
> to require xpt, and there's also a pass device, but what are these and what
> would you need them for? The lint file doesn't seem to contain any info on
> them, and there's no man pages for them.
The only documentation is LINT, GENERIC and the camcontrol man page.
You've obviously discovered one area where CAM is quite incomplete.
Fixing that problem is on my list (and Justin's list) of things to do, but
it necessarily comes after fixing code bugs. If things calm down enough
between now and the 3.0 release, we'll probably be able to get some of the
more important man pages done at least.
Here are the list of CAM peripheral drivers you can configure in your
kernel:
device da0 -- direct access and optical disk driver
device cd0 -- CDROM driver (also attaches to WORM drives)
device sa0 -- tape driver
device ch0 -- changer driver
device pt0 -- processor target driver
device pass0 -- application passthrough driver
device targ0 -- target mode processor target driver
(It's probably best to leave this alone for now.)
The xpt device is the CAM transport layer device. It allows sending bus
and lun rescan commands, device matching commands, and other commands that
generally don't make sense to send to an individual passthrough device.
The pass device lets you send SCSI CCBs and other CCBs (CAM Control
Blocks) to a given device. The passthrough device is used by camcontrol to
send SCSI commands. It is also used by tosha, cdrecord, xmcd, SANE, etc.
Ken
--
Kenneth Merry
ken@plutotech.com
[-- Attachment #2 --]
==== //depot/cam/sys/cam/scsi/scsi_cd.c#82 - /usr/home/ken/perforce/cam/sys/cam/scsi/scsi_cd.c ====
*** /tmp/tmp.23298.0 Fri Sep 18 22:58:36 1998
--- /usr/home/ken/perforce/cam/sys/cam/scsi/scsi_cd.c Fri Sep 18 22:57:33 1998
***************
*** 1719,1725 ****
scsi_sense_key_text[sense_key],
scsi_sense_desc(asc,ascq,
&cgd.inq_data));
! else if (cgd.pd_type == T_CDROM) {
/*
* We only print out an error for
* CDROM type devices. For WORM
--- 1719,1725 ----
scsi_sense_key_text[sense_key],
scsi_sense_desc(asc,ascq,
&cgd.inq_data));
! else {
/*
* We only print out an error for
* CDROM type devices. For WORM
***************
*** 1756,1769 ****
announce_buf);
scsi_sense_print(&done_ccb->csio);
- /*
- * Free up resources.
- */
- cam_extend_release(cdperiphs,
- periph->unit_number);
- cam_periph_invalidate(periph);
- periph = NULL;
- } else {
/*
* Free up resources.
*/
--- 1756,1761 ----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809190459.WAA14878>
