Subject: Re: scsi subsystem
To: Dante Profeta <>
From: Manuel Bouyer <>
List: tech-kern
Date: 06/19/1998 11:09:12
On Jun 17, Dante Profeta wrote
> I have to interact with the scsi subsystem.
> ...this time I didn't found any man pages... ;-)
> NetBSD doesn't seem to implement the ANSI CAM layer.
> Could you please explain to me how the scsi layer work and how to
> interface with it?
> Thanks again

At which level ? at upper level (scsi devices drivers) or lower level (
adapters drivers). For atapters drivers, I don't have much to add to
what jason said. You need to provide at last 2 functions to the
upper level via the 'struct scsipi_adapter'. 
For upper-level drivers, you can have a look at the 'uk' device - it's the
simpler driver we can have :) For more complete driver, you can have a look at
the 'cd' driver. At attach time, you need to fill in a 'struct scsipi_device'
with at last 2 function: a start function called when the next op for this
device can be started, and a done function, called when a non-sleeping command
has ben executed. The 'scsipi_command()' function sends a command to the
device. Il will queue the command, and unless you
pass the SCSI_NOSLEEP flag, it will sleep until command completion. With the
'SCSI_NOSLEEP' flag, scsipi_command() will return immediatly, and the
lower-level will call your 'done' funtion once the command is done.

Manuel Bouyer, LIP6, Universite Paris VI.