Home | History | Annotate | Download | only in ic
History log of /src/sys/dev/ic/siop_common.c
RevisionDateAuthorComments
 1.60  08-Feb-2024  andvar s/should't/shouldn't/ and s/mistmatch/mismatch/ in comments.
 1.59  25-Sep-2022  thorpej Remove unnecessary include of <sys/malloc.h>.
 1.58  03-Jun-2022  andvar fix folloing->following typos in more files.
also s/begginning/beginning/.
 1.57  23-May-2022  andvar s/beggining/beginning/ in comments.
 1.56  22-May-2022  andvar fix various small typos, mainly in comments.
 1.55  27-Dec-2019  msaitoh s/transfered/transferred/
 1.54  15-Sep-2013  martin branches: 1.54.30;
Remove unused variable/ifdef like use
 1.53  13-Nov-2010  uebayasi branches: 1.53.8; 1.53.18; 1.53.22;
Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.
 1.52  19-Oct-2009  bouyer branches: 1.52.4;
Remove closes 3 & 4 from my licence. Lots of thanks to Soren Jacobsen
for the booring work !
 1.51  04-Sep-2009  tsutsui Remove unnecessary whitespace.
 1.50  16-May-2009  tsutsui Misc cleanup:
- some KNF
- u_intNN_t -> uintNN_t
- wrap long lines and fix indent
- remove return statements at the end of void functions
- use __arraycount()

XXX: many inconsistent aprint_error_dev(9) vs printf(9)
 1.49  15-May-2009  tsutsui Split device_t/softc.

No crash on:
esiop0 at pci0 dev 11 function 0: Symbios Logic 53c875 (ultra-wide scsi)
siop0 at pci0 dev 9 function 0: Symbios Logic 53c810a (fast scsi)
siop0 at gsc0 hpa 0xf0830000 path 2/0/7 irq 3 ipl 6: NCR53C720 rev 2
 1.48  14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.47  14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.46  11-Jun-2008  kiyohara branches: 1.46.4; 1.46.10;
Support use PCI Clock(SF_CHIP_USEPCIC). We can set the value "use_pciclock"
by prop_dictionary_set_bool().
 1.45  08-Apr-2008  cegger branches: 1.45.2; 1.45.4; 1.45.6; 1.45.8;
use aprint_*_dev and device_xname
 1.44  27-Mar-2008  skrll Add support for the (non-pci) NCR 53c720/770 in big-endian mode.

From OpenBSD (Mark Kettenis)
 1.43  19-Oct-2007  ad branches: 1.43.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.42  04-Mar-2007  christos branches: 1.42.2; 1.42.14; 1.42.16; 1.42.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.41  16-Nov-2006  christos branches: 1.41.4;
__unused removal on arguments; approved by core.
 1.40  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.39  03-Sep-2006  christos branches: 1.39.2; 1.39.4;
add missing decl.
 1.38  26-Nov-2005  tsutsui branches: 1.38.4; 1.38.8;
FALLTHROUH -> FALLTHROUGH (from OpenBSD)
 1.37  27-Feb-2005  perry branches: 1.37.4; 1.37.10;
nuke trailing whitespace
 1.36  17-May-2004  bouyer branches: 1.36.4; 1.36.6;
Add support for the Ignore Wide Residue SCSI message.
 1.35  17-May-2004  bouyer when an unexpected disconnect occurs only compute the resid; do the
real save data pointers when we get the message (or rather, at disconnect
time following the message).
Factor out code to do this, and to deal with xs->resid, in siop_common.c.
 1.34  17-May-2004  bouyer Properly compute xs->resid, instead of assuming it'll always be 0 when
a command is done.
 1.33  10-Mar-2004  bouyer branches: 1.33.4;
The 1010-66 always generate AIP values on the bus, regardless of the SCNTL4
settings. Disable AIP completely, as this confuse pre-Ultra160 drives.
From FreeBSD.
 1.32  31-Jan-2003  thorpej branches: 1.32.2;
Use aprint_*().
 1.31  27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.30  29-Aug-2002  bouyer The 1010 will generate a scsi gross error if a RAM entry is read before being
written (i.e. is used uninitialised). The esiop SCRIPT may do this in some
circonstances (and it is safe) so bus_space_set_region_4() the RAM in
reset routine.
Problem reported and fix tested by Allen Briggs.
 1.29  18-Jul-2002  wiz Spell 'should' correctly.
 1.28  05-May-2002  bouyer branches: 1.28.2; 1.28.4;
Don't disable TARF_TAG when the 1010 workaround is active, otherwise
the target won't do tagged queuing again after e.g. a bus reset.
Just report to scsipi that we can't do tagged queuing.
 1.27  04-May-2002  bouyer Keep track of the current SCSI mode (SE/HVD/LVD) and don't start PPR
negotiation if it's not a LVD bus.
Remove write to SIOP_STEST0, it's bogus and I don't know why it's there at
the first place.
 1.26  04-May-2002  bouyer It seems that the 1010-33 has a bug: it sometimes generate spurious SCSI gross
errors for narrow transfers after a reselect. FreeBSD sym driver has a comment
about this, but their workaround (disable SCSI gross error reports) doesn't
work for me. Instead dissallow disconnect if the target is not wide
(FreeBSD doens't allow disconnect until the target has been fully probed, which
is why they may not have noticed my problem).
 1.25  29-Apr-2002  bouyer Factor out initialisation of t_msgout.count
clear scntl4 in sdtr/wdtr negotiation
 1.24  25-Apr-2002  bouyer It's not safe to access the SCNTL1 register while the SCRIPT is running.
On the 1010 this can wedge the chip. So abort the script instead.
the abort interrupt will trigger a bus reset.
 1.23  23-Apr-2002  bouyer More copyright fixes, pointed out by Thomas. Thanks !
 1.22  23-Apr-2002  bouyer - factor out parts of (e)siop_attach() to siop_common_attach()
- Add support for DT transfers (aka Ultra/160) in esiop

Note that DT transfers are not enabled for 53c1010-33 rev 0 yet; if I trust
FreeBSD it has a bug which prevent them to do DT properly.
From the same source there may be issues with some revs of 53c1010-66.
 1.21  23-Apr-2002  bouyer Enable software LED control based on LED0 feature, not #define.
For now, set the LED0 feature if SIOP_SYMLED is defined in siop_pci_common.c.
From Jason R Thorpe.
 1.20  22-Apr-2002  bouyer Really, don't set siop_cmd->tag in setup_table()
 1.19  22-Apr-2002  bouyer Fix last change: assign siop_cmd->tag in callers instead of siop_setuptables(),
and use siop_cmd->tag instead of xs->xs_tag_id. This way siop can use
xs->xs_tag_id + 1 without interferences with esiop.
 1.18  22-Apr-2002  bouyer In siop_setuptables(), use the proposed tag_id, not tag_id +1.
In siop.c bump siop_cmd->tag by one as tag id 0 is reserved for untagged cmds.
 1.17  20-Apr-2002  bouyer Move a few things around, so that ic/siop_common.c and pci/siop_pci_common.c
can be compiled without including siopvar.h.
 1.16  18-Apr-2002  bouyer If SIOP_SYMLED is defined, drive the activity LED though GPIO pin 1.
 1.15  13-Nov-2001  lukem add/cleanup RCSID
 1.14  25-Apr-2001  bouyer branches: 1.14.2;
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.13  12-Mar-2001  bouyer Preliminary support for SYM53C1010-33 (at 80MB/s only for now), based on
patches sent by Matthias Drochner <M.Drochner@fz-juelich.de> and
Kenneth R Westerback <kwesterback@home.com>
 1.12  11-Feb-2001  bouyer branches: 1.12.2;
Avoid sending new commands to the device if it has sense pending:
- run request sense command without disconnect
- don't restart the script before siop_scsicmd_end has been called if the
cmd didn't complete with good status.
- reserve slot 0 for request sense, to make sure it'll be sent first.
 1.11  23-Oct-2000  bouyer branches: 1.11.2;
Fixes related to QUEUE FULL status:
- move status handling in siop_scsicmd_end(), it's better than in siop_intr()
- define 2 internal SIOP status, for "no status reported by device" and
reset condition
- add a list of "urgent" command, to be executed before the list of command
queued the normal way; this is used for command which got aborted
by a QUEUE FULL and have to be requeued in order.
- Don't accept to send a Q_TAG message not immediatly folowing a IDENTIFY
 1.10  23-Oct-2000  bouyer Rearrange for script changes (scheduler core in main script, command part
of the scheduler in command table).
Add tagged command queuing support.
 1.9  18-Oct-2000  bouyer Adapt for new lun switch script.
Implement SCBUSACCEL ioctl.
Snapshot of work in progress on tagged queuing: we can send/receive
queue tag messages. Infrastructure to manage multiple commands per
devices not here yet.
 1.8  06-Oct-2000  bouyer Fix recurent typo: shed->sched
 1.7  06-Oct-2000  bouyer Adapt for reselect handling from the script. While here, fix typo
(SIOP_SCXFER -> SIOP_SXFER).
 1.6  24-Jul-2000  bouyer create a funcion, siop_busreset(), to reset the scsibus.
Reset the scsi bus at attach time, to be sure all devices start in narrow/async
mode.
Defer sync/wide negotiation until after whe have a valid
xs->sc_link->device_softc, so that we can honnor the NOSYNC/NOWIDE quirks.
 1.5  28-Jun-2000  mrg remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.4  26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.3  12-Jun-2000  bouyer branches: 1.3.2;
Handle "scsi bus mode change" interrupts on 895 and higther.
Thanks to Hal Murray for reporting the problem and testing the fix.
 1.2  15-May-2000  bouyer branches: 1.2.2;
Don't enable debug message by default.
 1.1  15-May-2000  bouyer - split siop.c in script-dependant vs script-independant part, for
comming esiop
- add a reset callback for bus-dependant registers settings
 1.2.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3.2.4  29-Jan-2002  he Pull up revision 1.13 (requested by bouyer):
Add support for the 53c1010-33, and bring documentation up to
date.
 1.3.2.3  26-Feb-2001  he Pull up revision 1.12 (requested by bouyer):
Don't queue new commands to a device which has sense pending.
 1.3.2.2  16-Dec-2000  he Pull up revisions 1.7-1.11 (requested by bouyer):
Speed improvements to the siop driver, and add tagged queueing
support. As a side effect, better handling of some not so common
phase or message sequences.
 1.3.2.1  24-Jul-2000  bouyer Pull up (approved by thorpej):
sys/dev/ic/siop.c 1.25->1.26
sys/dev/ic/siop_common.c 1.5->1.6
sys/dev/ic/siopvar_common.h 1.3->1.4

create a funcion, siop_busreset(), to reset the scsibus.
Reset the scsi bus at attach time, to be sure all devices start in narrow/async
mode.
Defer sync/wide negotiation until after whe have a valid
xs->sc_link->device_softc, so that we can honnor the NOSYNC/NOWIDE quirks.
 1.11.2.8  03-Apr-2001  bouyer Remove local command queue; if we run out of start slots, just freeze the
channel; and unfreeze it at the first command complete.
 1.11.2.7  12-Mar-2001  bouyer Sync with HEAD.
 1.11.2.6  22-Jan-2001  bouyer Put URGENT requests in the urgent queue
When we get CHECK CONDITION, remove and requeue all xfer for this T/L that have
not yet been queued in the device (still in a scheduler slot or in the queues),
otherwise if one of them is accepted before the request sense, sense will be
lost.
Don't allow disconnect for REQUEST SENSE commands, as others drivers do.
 1.11.2.5  15-Jan-2001  bouyer Pass CHECK CONDITION status and reset events to the mid-layer.
 1.11.2.4  15-Dec-2000  bouyer Tell the upper layer we can do tagged queuing, so that it sends us more
than one concurent command. Leave the handling of QUEUE FULL events to the
upper layer.
 1.11.2.3  14-Dec-2000  bouyer Convert to thorpej_scsipi interface. Still some work to do to get all benefits
of the new middle layer, but it works.
 1.11.2.2  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.
 1.11.2.1  23-Oct-2000  bouyer file siop_common.c was added on branch thorpej_scsipi on 2000-11-20 11:40:55 +0000
 1.12.2.7  18-Oct-2002  nathanw Catch up to -current.
 1.12.2.6  29-Aug-2002  briggs Sync with head
 1.12.2.5  01-Aug-2002  nathanw Catch up to -current.
 1.12.2.4  20-Jun-2002  nathanw Catch up to -current.
 1.12.2.3  14-Nov-2001  nathanw Catch up to -current.
 1.12.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.12.2.1  09-Apr-2001  nathanw Catch up with -current.
 1.14.2.4  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.14.2.3  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.14.2.2  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.14.2.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.28.4.5  19-Mar-2005  tron Pull up revision 1.36 (requested by bouyer in ticket #1751):
Add support for the Ignore Wide Residue SCSI message.
 1.28.4.4  17-Mar-2005  tron Pull up revision 1.35 (requested by bouyer in ticket #1750):
when an unexpected disconnect occurs only compute the resid; do the
real save data pointers when we get the message (or rather, at disconnect
time following the message).
Factor out code to do this, and to deal with xs->resid, in siop_common.c.
 1.28.4.3  17-Mar-2005  tron Pull up revision 1.34 (requested by bouyer in ticket #1749):
Properly compute xs->resid, instead of assuming it'll always be 0 when
a command is done.
 1.28.4.2  17-Mar-2005  tron Pull up revision 1.33 (requested by bouyer in ticket #1748):
The 1010-66 always generate AIP values on the bus, regardless of the SCNTL4
settings. Disable AIP completely, as this confuse pre-Ultra160 drives.
From FreeBSD.
 1.28.4.1  24-Nov-2002  tron Pull up revision 1.30 (requested by bouyer in ticket #747):
The 1010 will generate a scsi gross error if a RAM entry is read before being
written (i.e. is used uninitialised). The esiop SCRIPT may do this in some
circonstances (and it is safe) so bus_space_set_region_4() the RAM in
reset routine.
Problem reported and fix tested by Allen Briggs.
 1.28.2.2  31-Aug-2002  gehenna catch up with -current.
 1.28.2.1  20-Jul-2002  gehenna catch up with -current.
 1.32.2.5  11-Dec-2005  christos Sync with head.
 1.32.2.4  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.32.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.32.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.32.2.1  03-Aug-2004  skrll Sync with HEAD
 1.33.4.3  11-May-2005  snj Pull up revision 1.36 (requested by bouyer in ticket #1366):
Add support for the Ignore Wide Residue SCSI message.
 1.33.4.2  11-May-2005  snj Pull up revision 1.35 (requested by bouyer in ticket #1365):
when an unexpected disconnect occurs only compute the resid; do the
real save data pointers when we get the message (or rather, at disconnect
time following the message).
Factor out code to do this, and to deal with xs->resid, in siop_common.c.
 1.33.4.1  11-May-2005  snj Pull up revision 1.34 (requested by bouyer in ticket #1364):
Properly compute xs->resid, instead of assuming it'll always be 0 when
a command is done.
 1.36.6.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.36.4.1  29-Apr-2005  kent sync with -current
 1.37.10.1  29-Nov-2005  yamt sync with head.
 1.37.4.4  27-Oct-2007  yamt sync with head.
 1.37.4.3  03-Sep-2007  yamt sync with head.
 1.37.4.2  30-Dec-2006  yamt sync with head.
 1.37.4.1  21-Jun-2006  yamt sync with head.
 1.38.8.1  03-Sep-2006  yamt sync with head.
 1.38.4.1  09-Sep-2006  rpaulo sync with head
 1.39.4.2  10-Dec-2006  yamt sync with head.
 1.39.4.1  22-Oct-2006  yamt sync with head
 1.39.2.1  18-Nov-2006  ad Sync with head.
 1.41.4.1  12-Mar-2007  rmind Sync with HEAD.
 1.42.20.1  25-Oct-2007  bouyer Sync with HEAD.
 1.42.16.1  06-Nov-2007  matt sync with HEAD
 1.42.14.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.42.2.1  23-Oct-2007  ad Sync with head.
 1.43.16.3  29-Jun-2008  mjf Sync with HEAD.
 1.43.16.2  02-Jun-2008  mjf Sync with HEAD.
 1.43.16.1  03-Apr-2008  mjf Sync with HEAD.
 1.45.8.1  18-Jun-2008  simonb Sync with head.
 1.45.6.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.45.4.4  11-Mar-2010  yamt sync with head
 1.45.4.3  16-Sep-2009  yamt sync with head
 1.45.4.2  16-May-2009  yamt sync with head
 1.45.4.1  04-May-2009  yamt sync with head.
 1.45.2.1  17-Jun-2008  yamt sync with head.
 1.46.10.2  23-Jul-2009  jym Sync with HEAD.
 1.46.10.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.46.4.1  28-Apr-2009  skrll Sync with HEAD.
 1.52.4.1  05-Mar-2011  rmind sync with head
 1.53.22.1  18-May-2014  rmind sync with head
 1.53.18.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.53.8.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.54.30.1  08-Apr-2020  martin Merge changes from current as of 20200406

RSS XML Feed