Home | History | Annotate | Download | only in scsipi
History log of /src/sys/dev/scsipi/atapiconf.h
RevisionDateAuthorComments
 1.23  19-Oct-2009  bouyer Remove closes 3 & 4 from my licence. Lots of thanks to Soren Jacobsen
for the booring work !
 1.22  24-Mar-2008  cube branches: 1.22.4;
Split device_t and softc for atapibus(4).
 1.21  23-Nov-2006  he branches: 1.21.48;
This file needs to know the size of "struct device", so include
<sys/device.h> here. This should allow the sparc GENERIC_SUN4U and
sparc64 kernels to build sata_subr.c again.
 1.20  11-Dec-2005  christos branches: 1.20.20; 1.20.22;
merge ktrace-lwp.
 1.19  17-Sep-2004  mycroft branches: 1.19.12;
Change the way bustype_cmd is used. Rather than having it be responsible for
calling scsipi_make_xs() and scsipi_execute_xs(), instead push these into
scsipi_command. Make bustype_cmd and PHOLD/PRELE be called from
scsipi_execute_xs(). This allows us to create a xfer structure -- possibly on
the stack -- and call scsipi_execute_xs() directly.
 1.18  09-Sep-2004  bouyer Make the xxstart() functions reentrant again, as some drivers HBA can call
scsipi_done() from their scsipi_request().
For this, add a struct scsipi_xfer * argument to scsipi_command().
If not NULL scsipi_command() will use this to enqueue this xfer, otherwise
it'll try to allocate a new one. This scsipi_xfer has to be allocated
and initialised by scsipi_make_xs() or equivalent.
In xxstart(), allocate a scsipi_xfer using scsipi_make_xs(), and if not NULL,
dequeue the buffer before calling scsipi_command(). This makes sure that
scsipi_command() will not fail, and also makes sure that xxstart() won't
be called again between the BUFQ_PEEK() and BUFQ_GET().

Fix "dequeued wrong buf" panics reported by Juergen Hannken-Illjes in
private mail and Andreas Wrede on current-users@.
Thanks to Jason Thorpe and Chuck Silver for review, and Andreas Wrede for
testing the patch.
 1.17  21-Aug-2004  thorpej De-__P.
 1.16  12-Aug-2004  thorpej Protect against multiple inclusion.
 1.15  04-Aug-2004  bouyer Remove an unused prototype.
 1.14  03-Dec-2001  bouyer branches: 1.14.16; 1.14.18;
Update my copyrigth.
 1.13  02-Dec-2001  bouyer Clean up attach of wd/atapibus:
kill ata_atapi_attach. Change atapibus to use a struct scsipi_channel instead
of ata_atapi_attach as attach arch. Create a ata_device, compatible with
scsipi_channel, to attach wd.
 1.12  14-May-2001  bouyer branches: 1.12.2;
Use SCSI/ATAPI common definition for MODE_{SELECT,SENSE}{,_BIG}. Define
functions to send theses commands in scsipi_base.c and use them instead
of ad-hoc commands setups.
 1.11  25-Apr-2001  bouyer Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.10  02-Apr-2000  augustss branches: 1.10.6;
Let the device thet gets an atapibus attached specify how to kill pending
transfers by giving a function pointer.
The old method always called wdc specific code.
 1.9  01-Apr-2000  bouyer - DMA code cleanup: pciide_dma_finish() doesn't stop/unload the current DMA op
if an IRQ was not detected, unless the force flag was given. Use this to
detect if the IRQ was for us (closer to shared IRQ for controllers which
don't have their own IRQ handler in pciide.c) and to poll for DMA xfer.
Also makes the timeout recovery code simpler.
- ATAPI cleanup: don't call controller-specific functions from atapiconf.c
(wdc_*), so that it's possible to attach an atapibus to something else
than a wdc/pciide (Hi Lennart :).
Overload struct scsi_adapter with struct atapi_adapter, defined
as struct scsi_adapter + atapi-specific callbacks. scsipi_link still points
to an scsi_adapter, atapi code casts it to atapi_adapter if needed.
Move atapi_softc to atapiconf.h so that it can be used by the underlying
controller code (e.g. atapi_wdc.c).
Add an atapi-specific callback *atapi_probedev(), which probe a drive
in a controller-specific way, allocate the sc_link and fills in the
ataparams if needed. It then calls atapi_probedev() (from atapiconf.c)
to do the generic initialisations and attach the device.
- While I'm there merge and centralise the state definitions in atavar.h.
It should now be possible to use a common ata/atapi routine to set the
drive's modes (will do later).
 1.8  20-Oct-1999  enami Cancel active transfers on aic/wdc detach.
Also makes LS-120 drive works for me again.
 1.7  12-Oct-1998  bouyer branches: 1.7.6; 1.7.12; 1.7.14; 1.7.16;
Merge bouyer-ide
 1.6  13-Feb-1998  enami branches: 1.6.2;
Backout previous change, and rather, remove all protection but the one
actually currently required. Suggested by Charles M. Hannum.
 1.5  13-Feb-1998  enami Fix or add protection for mutiple inclusion.
 1.4  15-Jan-1998  cgd add support for an ATAPI attachment for 'sd'.
fix 'cd' driver's NCD_SCSI bogosity (was using testing wrong macro!)
clean up in various ways:
* make common atapi_mode_{sense,select}() functions.
* put ATAPI data structures in more sensible headers, split up by
device type.
* include headers a bit more carefully.
* pass flags to attachment-specific cd functions, and use them.
* get rid of SCSI bits in scsipi_base.h's scsipi_make_xs(), move
them into the correct place in scsi_base.c.
* fix minor typo in struct name in scsipiconf.h (which was apparently
never used except in a #define later in the same file).
* use __attribute__ to force 4-byte alignment for xs command store,
so that architectures trying to bus_space_write_multi_N() (where
N > 1) that data to a controller won't lose.
* clean up a few comments in typos, and make a few #defines easier to
understand/maintain.
* rename cd_link.h to cdvar.h (via repository copy). This is exactly
what a 'var' file is supposed to be.
 1.3  01-Oct-1997  enami Cosmetic changes to keep coding style consistency in this directory;

- Indent with tab of width 8.
- Use four column to indent continuation line.
- Fold long line if possible.
- Use return (xx) instead of return xx.
- Compare pointer against NULL instead of testing like boolean.
- Delete whitespace at the end of line.
- Delete whitespace in front of function call operator.
- Delete whitespace after cast.
- Dereference a pointer to function explicitly.
- Add an empty line after local variable declaration.
- Use NULL instead of (char *)0.
- Dont use block for single statement.
 1.2  27-Aug-1997  bouyer branches: 1.2.2;
Merge scsipi branch in the mainline. This add support for ATAPI devices
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.
 1.1  01-Jul-1997  bouyer branches: 1.1.2;
file atapiconf.h was initially added on branch bouyer-scsipi.
 1.1.2.2  01-Jul-1997  thorpej Purely cosmetic formatting changes: some spaces -> tabs, indenting
consistency in prototypes.
 1.1.2.1  01-Jul-1997  bouyer New merged scsi/atapi code. Tested on i386 and sparc. Commiting to a branch
for now, so that it can be tested on other ports too.
The config sheme is as follow:
New merged scsi/atapi code. Tested on i386 and sparc. Commiting to a branch
for now, so that it can be tested on other ports too.
The config sheme is as follow:
scsibus at aha
sd at scsibus
cd at scsibus
atapibus at wdc
cd at atapibus
cd has bus-specific config and function front-end in scsicd.c and atapicd.c
The call to theses functions from cd.c is conditionned to
NSCSICD and NATAPICD (all defined in cd.h by config).
 1.2.2.3  14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2.2.2  27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2.2.1  27-Aug-1997  thorpej file atapiconf.h was added on branch marc-pcmcia on 1997-08-27 23:32:57 +0000
 1.6.2.2  11-Jun-1998  bouyer pciide: when setting up DMA mode, also enable fast timings for PIO modes
if possible. For ATAPI devices, commands are always send via PIO.
atapi: matain a drive state (like wd drives) and use it to set up the
timings if needed.
 1.6.2.1  04-Jun-1998  bouyer Commit changes to the IDE system in a branch. This allows a better separation
between higth-level and low-level (i.e. registers read/write) and generalize
the queue for all commands. This also add supports for IDE DMA.
 1.7.16.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.7.14.1  15-Nov-1999  fvdl Sync with -current
 1.7.12.4  21-Apr-2001  bouyer Get rid of references to sc_link/scsipi_link in debug or comments.
 1.7.12.3  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

Main changes to the scsipi code itself:
- add a scsipi_channel->type to allow umass to attach to both atapibus and
scsibus. Will die when IDE is converted from ata_atapi_attach to
scsipi_channel/scsipi_adapter
- Add a chan_defquirks to scsipi_channel so that adapters can pass a default
set of quirks to be set for each device attached
- add adapt_getgeom and adapt_accesschk callbacks
 1.7.12.2  20-Oct-1999  thorpej Sync w/ trunk.
 1.7.12.1  19-Oct-1999  thorpej Completely rewritten scsipi_xfer execution engine:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).

There is a lot more work to do, but this correctly functions for the most
part on several file servers I run.
 1.7.6.1  07-Jul-2000  he Apply patch (requested by bouyer):
Add support for the following PCIIDE controllers:
o AMD 756
o CMD PCI0648 and PCI0649
o Hightpoint HPT366
o OPTi 82c621 (and a few of its derivatives)
o Promise Ultra/33 and Ultra/66
o Intel 82801 (ICH/ICH0)
Also fix PR#10437 (detect more ATAPI devices).
 1.10.6.2  08-Jan-2002  nathanw Catch up to -current.
 1.10.6.1  21-Jun-2001  nathanw Catch up to -current.
 1.12.2.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.14.18.1  11-Sep-2004  he Pull up revision 1.18 (via patch, requested by bouyer in ticket #837):
Improve handling of memory shortage, to fix problems like:
sd3(mpt0:0:1:0): unable to allocate scsipi_xfer
sd3: not queued, error 12
The theory is that other consumers of pool memory is causing
this memory shortage in certain somewhat hard to reproduce
situations.
This is done by giving scsipi_command an extra argument to
optionally pass a preallocated scsipi_xfer, and allocating a
scsipi_xfer before dequeueing a buffer in the various *start()
functions. If the allocation of a scsipi_xfer fails, schedule
a callout for delayed invocation of the start function. Also
reserve one page for scsipi_xfer structs, to ensure that we will
eventually have some available once pending commands complete.
Should fix PR#25670.
 1.14.16.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.16.3  18-Sep-2004  skrll Sync with HEAD.
 1.14.16.2  25-Aug-2004  skrll Sync with HEAD.
 1.14.16.1  12-Aug-2004  skrll Sync with HEAD.
 1.19.12.1  30-Dec-2006  yamt sync with head.
 1.20.22.1  10-Dec-2006  yamt sync with head.
 1.20.20.1  12-Jan-2007  ad Sync with head.
 1.21.48.1  03-Apr-2008  mjf Sync with HEAD.
 1.22.4.1  11-Mar-2010  yamt sync with head

RSS XML Feed