Subject: Re: CAM in NetBSD [Was Re: aix7xxx problems with negotiating "Ultra" speeds....]
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: Kenneth D. Merry <ken@plutotech.com>
List: tech-kern
Date: 12/08/1998 10:43:29
Manuel Bouyer wrote...
> [ please note that current-users was in Bcc, and follow up to tech-kern ...]
> 
> On Dec 7, Matthew Jacob wrote
> > 
> > I'll do the work if the consensus is to have CAM in NetBSD. But I won't
> > push for the decision.
> 
> I'd like to see this in NetBSD, or at last a layer that could help porting
> drivers from/to FreeBSD. 
> I didn't look at FreeBSD's CAM yet, so I can't make any further comments.
> But if such a project is started, I could probably help, at last with
> the atapi part.
> 
> Is there any documentation on FreeBSD's CAM yet, other than source code ?

Well, it depends on what you want documentation on.  I'll give a quick
rundown of available documentation:

1.  Man pages on all userland programs.  (for now, only camcontrol(8))
2.  Man pages for userland library functions (cam(3), cam_cdbparse(3)).
    These are helper functions used for SCSI passthrough.
3.  Man pages for most, if not all peripheral drivers.  (e.g., da(4),
    cd(4), sa(4), pt(4), pass(4))  Many drivers do not have section 9 man
    pages yet.
4.  Man pages for most controller drivers.  (e.g., ahc(4), aha(4), ahb(4),
    dpt(4)...)
5.  Man pages describing kernel options and configuration.  (scsi(4) is a
    general summary, individual peripheral driver pages have more specific
    info.)
6.  CAM specs.  See: http://www.symbios.com/x3t10/drafts.htm#SWLAY
7.  Justin's slides from USENIX:  http://www.freebsd.org/~gibbs/

What's missing?

1.  Documentation of all the various CCB types.
2.  Documentation on the XPT<->SIM interface.
3.  Documentation on the peripheral driver <-> XPT interface.
4.  Misc. other docs.  e.g., probe/rescan code, error recovery.

So, there is a reasonable amount of documentation available.  But, it's
certainly not complete.

Another thing you may run into while looking at the CAM code is the devstat
code.  It's a new disk/tape/device statistics system that went into the
FreeBSD tree along with CAM.  The devstat(9) page describes the kernel
interface, and the devstat(3) man page describes the userland statistics
library functions.  (The devstat(3) library is used in systat(1),
vmstat(8), iostat(8), and rpc.rstatd(8).)

As Matt pointed out, there isn't yet an ATAPI interface in the FreeBSD CAM
implementation.  We'd like to have one eventually, but no one has gotten
around to doing the work yet.  There are several possible strategies for
implementing ATAPI support under CAM, and Justin and I will be glad to help
out anyone who wants to tackle it.

Ken
-- 
Kenneth Merry
ken@plutotech.com