SCSI status

From: Mike A Larson <larz_at_nospam.org>
Date: Tue Nov 30 1993 - 09:04:30 PST

Hi. Here's a status report on the VSTa SCSI driver followed by the SCSI
driver's README file for those interested in how the driver is organized.

Status
------

Enough code has been written so that the XPT function xpt_init() can
find out what SCSI devices are attached. This involves telling SIM
drivers (the Adaptec 154x driver, for now) to initialize, formatting
CAM CCB's to initiate INQUIRY operations, and starting and completing
I/O for the INQUIRY.

As implied above, a minimal SIM level driver for the Adaptec 154x
exists (I currently own an Adaptec 1542C, BTW). The driver talks
to the adaptor's registers, sets up DMA, handles interrupts, and
does various initialization and housekeeping functions.

In addition, code has been written to handle VSTa messages (the only
message used right now is M_ISR, however), do namer registration,
and other server setup functions (lots of this code was copied from
wd).

Now here's the TODO list for a minimal disk-only SCSI driver:

        1) write handlers for all VSTa messages (ie, M_CONNECT, ...,
           FS_READ, FS_WRITE, ...). Finish the PDRV disk code.

        2) clean up error reporting and debug printing code.

        3) handle scatter/gather in the SIM 154x driver.

        4) partition tables.

        5) SIM I/O completion code.

Note that the initial SCSI driver will have a number of limitations,
including:

        1) disk support only.

        2) single server - we had talked in the past about having
           seperate PDRV and XPT/SIM servers. For now, however,
           everything will run in one process.

        3) etc.

And now, the README File:

Welcome to SCSI/CAM for VSTa.

This file contains a short description of the VSTa CAM environment and
the list of files associated with the VSTa SCSI/CAM driver.

What is CAM?
------------

>From the SCSI FAQ:

        QUESTION: What is CAM?
        ANSWER From: ctjones@bnr.ca (Clifton Jones)
        ====
        
        Common Access Method.
        
        It is a proposed ANSI standard to make it easier to program
        SCSI applications by encapsulating the SCSI functions into a
        standardized calling convention.

In CAM, the disk and tape drivers are called peripheral drivers (PDRV's
for short). At the top, PDRV's system level interface similar to that
of any other device driver in the operating system
(open/close/read/write/ioctl entry points for *nix, for example).
PDRV's do their job by sending SCSI commands down to the next CAM
layer, called the transport (or XPT) layer. The commands are contained
in a data structure called a CCB (CAM Control Block).

One of the jobs of the XPT layer is to route requests from the PDRV's
above to one of the SCSI Interface Modules (SIM's) below. There may be
more than one SIM per system.

SIM's contain HBA (or dumb SCSI chip, etc.) specific code. The 154x
code is a SIM module, for example.

Quick VSTa SCSI/CAM Description
-------------------------------

The VSTa SCSI/CAM driver is loosley divided into three parts: code that
is relatively generic, code that is specific to VSTa, and hardware
specific code.

The generic code is simply a library of functions which may be called
by, or which may call functions in the VSTa code. The generic functions
include open/close/read/write/ioctl PDRV functions, most of the XPT
layer, and the "top part" the SIM layer (schedule the next request,
start a request, complete a request).

The VSTa specific code is responsible for sending and receiving
messages, interfacing with the operating system, dispatching to the
appropriate CAM code, and various utilities.

The hardware specific code is the "bottom" part of the SIM layer, which
interfaces to host adaptor hardware. Note that an attempt has been made
to package the necessary VSTa interfaces in a different module. This
may ease ports of drivers for host adaptors not currently supported by
VSTa.

Source File Description
-----------------------

cam.h - generic CAM definitions
camvsta.h - VSTa CAM definitions (constants, macros, etc.)
insque.h - C library insque/remque definitions
scsi.h - generic SCSI definitions
scsivsta.h - VSTa SCSI definitions (some typedef's)

camdata.c - configuration data
camutil.c - CAM utility functions (format { CDB, CDB } headers,
                          start I/O, etc.)
camvsta.c - VSTa CAM utilities (allocate memory, enable_io,
                          enable_isr, page_wire, etc.)
insque.c - C library insque/remque
pdisk.c - peripheral disk driver
pdskvsta.c - VSTa specific peripheral disk driver code (main(),
                          resides here, for now)
sim.c - generic CAM SIM code
sim154x.c - the Adaptec 154x SIM driver
vstautil.c - misc. utility functions (parse a device name, etc.)
xpt.c - CAM XPT code
Received on Tue Nov 30 09:29:31 1993

This archive was generated by hypermail 2.1.8 : Wed Sep 21 2005 - 21:01:53 PDT