Home | History | Annotate | Download | only in ic
History log of /src/sys/dev/ic/ncr53c9x.c
RevisionDateAuthorComments
 1.156  05-Dec-2021  msaitoh s/timout/timeout/
 1.155  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.154  24-Apr-2021  thorpej branches: 1.154.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.153  13-Apr-2020  chs branches: 1.153.4;
slightly change and fix the semantics of pool_set*wat(), pool_sethardlimit()
and pool_prime() (and their pool_cache_* counterparts):

- the pool_set*wat() APIs are supposed to specify thresholds for the count of
free items in the pool before pool pages are automatically allocated or freed
during pool_get() / pool_put(), whereas pool_sethardlimit() and pool_prime()
are supposed to specify minimum and maximum numbers of total items
in the pool (both free and allocated). these were somewhat conflated
in the existing code, so separate them as they were intended.

- change pool_prime() to take an absolute number of items to preallocate
rather than an increment over whatever was done before, and wait for
any memory allocations to succeed. since pool_prime() can no longer fail
after this, change its return value to void and adjust all callers.

- pool_setlowat() is documented as not immediately attempting to allocate
any memory, but it was changed some time ago to immediately try to allocate
up to the lowat level, so just fix the manpage to describe the current
behaviour.

- add a pool_cache_prime() to complete the API set.
 1.152  10-Nov-2019  chs branches: 1.152.6;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.151  10-Feb-2019  christos Introduce PR_ZERO to avoid open-coding memset()s everywhere. OK riastradh@.
 1.150  03-Feb-2019  mrg - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
this case, and thus can't be marked __dead easily
 1.149  03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.148  01-Jul-2017  macallan branches: 1.148.4; 1.148.6;
do what other SCSI drivers do - ack MSG_IGN_WIDE_RESIDUE messages and move on
instead of erroring out and resetting the drive
while there, when rejecting a message print which one it is
now my U2 boots without resetting its disk 3 times
 1.147  11-Jan-2017  skrll adatper -> adapter
 1.146  24-Dec-2016  macallan avoid accessing condition variables which belong to a scsibus before actually
attaching the scsibus
now my SS20 boots again
 1.145  18-Jun-2012  martin branches: 1.145.2; 1.145.16; 1.145.20;
When issuing a non-dma command, make sure to set the "remaining length of
command to be transfered via dma" (sc_cmdlen) to zero upfront, otherwise we
might get confused on command completition interrupt (no dma active but still
data left to transfer).
 1.144  10-Mar-2012  mrg take the kernel lock in functions called from attach*().
 1.143  31-Jul-2011  jakllsch branches: 1.143.2; 1.143.6; 1.143.8;
simple_lock to mutex conversion.
 1.142  04-Jul-2011  joerg Fix memset usage.
 1.141  07-Sep-2009  tsutsui Whitespace nits.
 1.140  02-Sep-2009  tsutsui Some backends may use ncr53c9x_abort(), so remove static declaration from
the function and explicitly declare it in ncr53c9xvar.h. Noticed by he@.
 1.139  29-Aug-2009  tsutsui Uncomment /*static*/ function declarations,
and #ifdef'ed out an unused function.
 1.138  01-May-2009  martin Add missing braces - patch from Kurt Lidl in PR port-vax/41314.
 1.137  13-May-2008  christos branches: 1.137.8; 1.137.12; 1.137.14;
don't play with timevals directly, use the macros. From OpenBSD
 1.136  28-Apr-2008  martin branches: 1.136.2;
Remove clause 3 and 4 from TNF licenses
 1.135  13-Apr-2008  tsutsui branches: 1.135.2; 1.135.4;
Fix another typo.
 1.134  13-Apr-2008  mlelstv fix format strings for DIAGNOSTIC output
 1.133  13-Apr-2008  tsutsui Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.132  08-Apr-2008  cegger use aprint_*_dev and device_xname
 1.131  01-Oct-2007  martin branches: 1.131.18;
Back out accidently commited part of previous
 1.130  01-Oct-2007  martin Do not stop callouts for polled commands.
 1.129  20-Aug-2007  tsutsui branches: 1.129.2; 1.129.4;
KNF, ANSIfy, TAB/space cosmetics.
 1.128  09-Jul-2007  ad branches: 1.128.2; 1.128.6;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.127  12-Mar-2007  ad branches: 1.127.2;
Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
 1.126  04-Mar-2007  christos branches: 1.126.2;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.125  09-Jan-2007  itohy branches: 1.125.2;
Cancel commands and free allocated resources on detach.
 1.124  28-Dec-2006  itohy Stop callout on detach.
 1.123  16-Nov-2006  christos __unused removal on arguments; approved by core.
 1.122  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.121  04-Oct-2006  christos fix empty if
 1.120  07-Jun-2006  kardel branches: 1.120.6; 1.120.8;
merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
 1.119  29-Mar-2006  thorpej branches: 1.119.2;
Use device_cfdata().
 1.118  24-Dec-2005  perry branches: 1.118.4; 1.118.6; 1.118.8; 1.118.10; 1.118.12;
__inline__ -> inline
 1.117  11-Dec-2005  christos merge ktrace-lwp.
 1.116  06-Nov-2005  tsutsui NCRDMA_SETUP() should be called before NCR_SET_COUNT() and NCRCMD_DMA command
in ncr53c9x_select(). Tested with esp on SS1+ and sun3/80, and pcscp at pci.
 1.115  30-May-2005  christos branches: 1.115.2;
- add missing const
- fix variable shadowing
- remove unneeded casts
 1.114  27-Feb-2005  perry nuke trailing whitespace
 1.113  21-Feb-2005  thorpej Part 1 of a cleanup pass over the SCSI subsystem. The aim is to name
everything "scsi_*", since we really are talking about the SCSI command
set, ATAPI transport not withstanding. Improve the names of many structures,
and prepend "SCSI_" onto all SCSI command opcodes. Place items described
by the SCSI Primary Commands document into scsi_spc.h.
 1.112  10-Sep-2004  bouyer branches: 1.112.4; 1.112.6;
pool_prime() the ncr53c9x_ecb pool with one element (this will cause one page
to be allocated anyway). scsipi can deal with resources shortage, but if this
pool goes down to 0 pages we can deadlock with the scsipi_xfer, vnode or
inode pools.
Also update a comment, despite resources accounting we can return
ATAPTER_RESOURCES_SHORTAGE here.
 1.111  03-May-2004  pk On reset, clear state flags and the msgout queue and notify the upper layer.
 1.110  02-Nov-2003  wiz branches: 1.110.2;
Fix some typos. From Tom Cosgrove via jmc@openbsd.
 1.109  01-Nov-2003  jdolecek avoid strong words; use 'screw' instead
 1.108  19-Oct-2003  simonb Remove unreachable break after return and goto statements.
 1.107  25-Jul-2003  pk Print more diagnostic info on the occassions `unexpected disconnect' and
`invalid state'.
 1.106  16-Apr-2003  petrov branches: 1.106.2;
Comment out debug printf.
 1.105  04-Feb-2003  pk Make this driver MP-safe by using a single spin lock to guard all its entrances.
 1.104  30-Jan-2003  pk The introduction of FAS366 support annihilated the `reselect-while-selecting'
workaround for the ESP100 variant.
 1.103  06-Oct-2002  petrov Reset the driver on scsibus reset.
 1.102  27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.101  25-Sep-2002  mycroft Update copyright.
 1.100  25-Sep-2002  mycroft Additional fixes to make 16 targets work on FAS366.
 1.99  24-Sep-2002  mycroft Oof, this driver needs a lot more work to support 16 targets.
 1.98  22-Sep-2002  mycroft Tell the scsibus layer we have 16 targets on the FAS366.
 1.97  16-Sep-2002  petrov Use driver reset in case 'internal state mismatch'.
 1.96  26-Aug-2002  petrov Accept WDTR from device(based on John Heasley patch for SCSI3 drive).
Do not define NCR53C9X_DEBUG.
 1.95  26-Aug-2002  petrov Start SYNC/WIDE renegotiating in controller reset, rearrange debug output.
 1.94  21-Jun-2002  lukem implement SCBUSIORESET by calling ncr53c9x_scsi_reset()
 1.93  05-Apr-2002  bouyer branches: 1.93.2; 1.93.4;
Implement mstohz() as discussed on tech-kern, and use it in SCSI drivers
to convert xs->timeout to callout() parameter.
 1.92  02-Apr-2002  petrov Return from interrupt handler after chip init(reset).
 1.91  24-Mar-2002  jdolecek ncr53c9x_attach(): if sc_rev is NCR53C90_86C01, set it to ESP100 once
the variant name is printed.
This fixes a problem that the card would be treated as ESP100 in
ncr53c9x_reset(), but not on couple other places (pointed out by
Andy Doran in private e-mail).

g/c now redundant case entry in ncr53c9x_reset()
 1.90  08-Mar-2002  thorpej Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map). Try to deal with this:

* Group all information about the backend allocator for a pool in a
separate structure. The pool references this structure, rather than
the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
to become available, but will still fail if it cannot callocate KVA
space for the pages. If this happens, carefully drain all pools using
the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
some pages, and use that information to make draining easier and more
efficient.
* Get rid of PR_URGENT. There was only one use of it, and it could be
dealt with by the caller.

From art@openbsd.org.
 1.89  12-Jan-2002  tsutsui Call malloc(9) with M_ZERO flag instead of memset() after malloc().
 1.88  03-Dec-2001  jdolecek add NCR_VARIANT_NCR53C90_86C01 "NCR53C90 (86C01)"
treat exactly like NCR_VARIANT_ESP100
 1.87  15-Nov-2001  lukem don't need <sys/types.h> when including <sys/param.h>
 1.86  13-Nov-2001  lukem add/cleanup RCSID
 1.85  04-Nov-2001  tsutsui Use common macro to check message length.
 1.84  26-Jul-2001  tsutsui branches: 1.84.4;
Fix timeout overflow caused by "scsictl format" on machines HZ==100.
 1.83  10-Jul-2001  chs branches: 1.83.2;
add a missing newline in a printf.
 1.82  07-Jul-2001  thorpej bzero -> memset
 1.81  07-Jul-2001  thorpej bcopy -> memcpy
 1.80  23-May-2001  petrov adjust fas register fields names
 1.79  18-May-2001  bouyer Enable tagged queuing again; should work now with scsipi_base rev 1.42
 1.78  30-Apr-2001  bouyer Ops, don't forget to increment li->used for each tagged command.
 1.77  28-Apr-2001  bouyer - don't wait when called from interrupt context (basically this means we
can't sleep in HBA drivers)
- pool_get can fail, so return XS_RESOURCE_SHORTAGE instead of panic()
- don't try to bzero() a NULL pointer
 1.76  26-Apr-2001  bouyer Disable tagged queuing for now, it causes commands timeouts.
Note that it's not worse since thorpej_scsipi integration: tagged queuing
was not used before, because of a tag message rejected at probe time.
 1.75  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.74  21-Apr-2001  tsutsui Make sure to check SC_ACCEL_TAGS in ncr53c9x_ioctl()
even if sync transfer is disabled or not supported.
 1.73  21-Apr-2001  tsutsui Clean up ncr53c9x_select():
- Define NCR_F_SELATN3 for sc_features and use it to check if the chip
supports SELATN3 command
- Make conditions of sending messages a bit simpler.
 1.72  20-Apr-2001  tsutsui Cosmetics. (tab/space etc.)
 1.71  29-Mar-2001  petrov fas support added
 1.70  19-Jan-2001  eeh branches: 1.70.2;
Use the SCSIACCEL ioctl() to turn on TAG QUEUEs.
 1.69  20-Dec-2000  briggs Make _sure_ that we do not use selatn3 when it is not present. Fixes a
problem on pmax reported by Izumi Tsutsui. Tested also on alpha and mac68k.
 1.68  20-Dec-2000  eeh Make the driver negotiate sync again and remove some (hopefully) superfluous
DELAY()s.
 1.67  19-Dec-2000  pk Fix reversed logic when setting setting sync-negotiation ability flag
 1.66  18-Dec-2000  briggs If the target rejects a tag message, turn off tagged transfers for that target.
Also, adjust message/command construction in ncr53c9x_select() to work no
matter how the structure alignment works out (needed at least for m68k).
Tested by me on mac68k & alpha, and sanity-checked by eeh.
 1.65  17-Dec-2000  briggs Back out previous change. It appears to be in error. There is something
else that is causing the esp driver on the mac68k to fail miserably.
 1.64  17-Dec-2000  briggs At least the 53c96 does not work with the selatn3 command. Disable it
for both the 53c94 and 53c96. This also addresses PR port-mac68k/11716.
 1.63  10-Dec-2000  eeh Fix for chips that don't grok NCRCMD_SELATN3.
 1.62  04-Dec-2000  fvdl 'error' was not initialized in the _ioctl function, potentially returning
!= 0 values in the non-error case.
 1.61  03-Dec-2000  eeh Fix bug in non-dma select code i added.
 1.60  01-Dec-2000  augustss Make this compile again (on i386).
 1.59  30-Nov-2000  pk We don't need <sys/proc.h>, <sys/user.h> and <machine/cpu.h>.
 1.58  30-Nov-2000  pk De-__P().
 1.57  30-Nov-2000  pk KNF patrol.
 1.56  30-Nov-2000  thorpej Fix some printf formats, and remove SPARC-specific debugging stuff.
 1.55  30-Nov-2000  pk Fix two cases of reversed arguments to printf();
 1.54  30-Nov-2000  eeh Add TAG QUEUE support to the ncr53c9x driver.
 1.53  13-Nov-2000  pk Define ncr53c9x_ioctl() and use it to start sync negotiation.
 1.52  04-Jul-2000  nisimura Fix negative timeout symptoms caused by integer multiply overflow,
which is revealed with larger HZ systems like NetBSD/pmax (256Hz)
and NetBSD/alpha (1024Hz) as reported by PR#8645. Polled tape
drive access is done with maximum 6 hour timeout which ended up
with negative time and then confused SCSI bus severely.
 1.51  05-Jun-2000  tsutsui branches: 1.51.2;
Oops, struct scsipi_adapter was changed recently.
 1.50  05-Jun-2000  nisimura Have MI ncr53c9x_attach() the 2nd and 3rd arguments for scsipi_adater
and scsipi_device respectively, with size reduction of ncr53c9x_softc.
Specifying NULL instructs the driver to use default adapter and default
device codes. Every target port has ncr53c9x_attach(sc, NULL, NULL) anyway.
 1.49  29-Mar-2000  tsutsui branches: 1.49.2;
Nuke register declarations.
 1.48  23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.47  22-Mar-2000  mycroft There's no need to frob cfg4/cfg5 in _attach(), since _reset() does it.
 1.46  20-Mar-2000  tsutsui Use sc_cfg4 for the Am53c974.
 1.45  20-Mar-2000  mycroft Reset CFG4 and CFG5 correctly in the reset routine.
 1.44  19-Mar-2000  mycroft For the ESP406/FAS408, add sc_cfg4 and sc_cfg5.
Add a detach routine, and do the addref/delref.
 1.43  18-Mar-2000  mycroft Expose ncr53c9x_init().
 1.42  18-Mar-2000  mycroft Adjust ncr53c9x_intr() prototype.
 1.41  09-Mar-2000  matt change Mb/s to MB/s (Megabit to megabyte).
 1.40  25-Jan-2000  pk Prevent possible wayward loop.
 1.39  10-Nov-1999  mycroft branches: 1.39.2;
Modification to the previous:
We still have to preload the command, when selecting without ATN. (We could
probably avoid this by being more careful in the interrupt handler...)
 1.38  10-Nov-1999  mycroft When sending a REQUEST SENSE, do *not* attempt to create an I_T_L nexus. This
is technically wrong, and some targets (like my 4x NEC CD-ROM drive) misbehave
when we do.
 1.37  10-Nov-1999  mycroft A residual after select with DMA step 2 is legitimate (in fact, *not* having a
residual would probably be cause for concern), so don't spew about it.
 1.36  30-Sep-1999  thorpej branches: 1.36.2; 1.36.4; 1.36.6;
Update for SCSPI changes.
 1.35  22-Sep-1999  mhitch Define config register 3 values for NCR53C9x/FAS216.

Add sc_cfg3_fscsi to the softc and use it to set the chip into Fast SCSI
mode for the chips that use it.
 1.34  12-Feb-1999  thorpej branches: 1.34.2;
Fix printf format problems on Alpha.
 1.33  06-Jan-1999  thorpej Changes to NCR53c9x driver necessary to add support for the AMD Am53c974
PCscsi-PCI SCSI controller. From Izumi Tsutsui, PR #6654.
 1.32  05-Dec-1998  mjacob Update HBAs to incorporate the new max_lun property.
 1.31  30-Nov-1998  pk Update previous: we don't have the required information all the time.
 1.30  30-Nov-1998  pk Some more misc. cleanup in the same style as previous.
 1.29  30-Nov-1998  pk Announce negotiation of async mode consistently (Soren Jorvang; PR#6512)
 1.28  19-Nov-1998  thorpej Adapt to the new scsipi_adapter interface.
 1.27  15-Aug-1998  mycroft Assign my copyrights to TNF.
 1.26  26-May-1998  thorpej If we have an NCR53CF9x (indicated by the front-end by setting a flag
in the softc's new "features" word), set FSCSI bit in CFG3 if the sync
period is <= 200ns, or clear it otherwise.
 1.25  04-May-1998  pk Eliminate the degenerate loop in `ncr53c9x_intr()'. Retain the delay heuristic
it implemented under the label `shortcut:' and only use it in these
cases: (1) after successful re-relection, (2) after receiving command-complete
status, and (3) during message-in handshake.
 1.24  04-May-1998  pk Allocate SCSI message buffers in ncr53c9x_attach(), with a provision
for front-ends to override the allocation to avoid alignment
handling in their DMA engines. Note that that ncr53c9x_msgout()
can request a 1 byte DMA transfer that would be difficult to break up.
 1.23  31-Jan-1998  pk * Make sure the `ECB_NEXUS' flag accurately reflects the existence of
an initiator/target nexus and thus mark the correct queue (if any) a
command is on.

* If a disconnected command times out, just leave it on the nexus queue
and do nothing (for now). I need yet to decide on the strategy to
follow in this case. Note: we used to move the command to the `ready'
queue and then do nothing, which is worse.
 1.22  24-Jan-1998  pk * Do not remove ATN from the scsi bus if we have no messages queued but
the target still is in MSG OUT phase. We still send a message (a NO_OP)
in this case and the chip will remove ATN at the appropriate time.
Using the RSTATN command here induces a "illegal command" in some
chip revisions.

This situation only occurs if the target rejects a previous (multi-byte)
message early (by switching to MESSAGE IN and sending a MESSAGE REJECT)
before the chip has completed the entire MSG OUT transfer. ATN will
remain asserted, and the target returns to MESSAGE OUT phase.

* Account for the events above when reporting "DMA not completed"
diagnostic messages.

* Stream-line the selection code a bit, and make the DMA setup code
more like the MSG OUT & DATA XFER setup.
 1.21  26-Oct-1997  pk Apply patch from Michael L. Hitch (PR#4318):

"A sequence step of 0 after a select with ATN can be a selection
timeout, or it can also indicate the target did not respond with
a message out phase. The latter will occur on very old SCSI
devices which do not respond to the ATN signal and go directly to
the command phase".
 1.20  04-Oct-1997  mhitch branches: 1.20.2;
Add yet another chip variant: FAS216, used by the amiga Phase5 SCSI boards.
 1.19  31-Aug-1997  pk Finish work-around for the re-select bug on ESP100s by dealing with
"illegal command" interrupt apparently caused by writing to the chip
while a re-selection is in progress.
 1.18  27-Aug-1997  bouyer 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.17  04-Aug-1997  fair trivial change for PR#3815
 1.16  30-Jul-1997  pk Arrange to turn off future sync-mode negotiation after experiencing a
timeout while in a data phase.

Replace XS_STUFFUP with XS_TIMEOUT, so we get a second chance after
recovering.
 1.15  29-Jul-1997  pk branches: 1.15.2;
If state is NCR_CLEANING, do not schedule commands until reset is complete.
 1.14  22-Jul-1997  pk Relax `DMA terminal count' check to exclude any selection state to avoid
triggering the message when merely probing targets.
 1.13  20-Jul-1997  pk While processing DISCONNECTs, take note of the transfer count reaching
zero. We use this later when the COMPLETE message comes in to set the
final residual count to zero. The flag is reset if the target resumes
a data phase. This obsoletes the `AUTOSAVE' quirk (for this driver).
Also, avoid overwriting the residual count if a SENSE was appended to
the current transaction.
 1.12  19-Jul-1997  pk Propagate SCSI status byte back to higher levels.
 1.11  26-Jun-1997  thorpej branches: 1.11.2;
Do not print "esp0: !TC [intr ...]" messages if:
(a) The interrupt is a RESEL interrupt, and
(b) our state is SELECTING.
This condition can occur in perfectly normal operation if we are using
DMA to select the target and we are interrupted by another target
reselecting us. Per discussion with Paul Krannenburg.
 1.10  01-May-1997  pk Preliminary support for ESP406 and FAS408 variants (from Eric Hvodza; PR#3559)
 1.9  28-Apr-1997  mjacob On alpha size_t is not an int, ergo last argument to dma setup glue
function can't be a pointer to an int.
 1.8  27-Apr-1997  pk Implement target selection using DMA.
To allow a period of testing the variable `ncr53c9x_dmaselect' is used to
enable this feature (default is 0, i.e. the old behaviour).
 1.7  01-Apr-1997  gwr Always schedule a timeout before the first occasion where
we return from the driver expecting to come back due to an
interrupt, because the interrupt might not happen...
Do the untimeout in ncr53c9x_done instead of just before
almost every call to ncr53c9x_done as was done previously.
Make ncr53c9x_sense schedule its own timeout for the new
command it is starting (request sense), separate from the
timeout for the command that just completed.
 1.6  27-Mar-1997  gwr No longer need the hack that forced SCSI_POLL when cold.
 1.5  27-Mar-1997  pk Add workaround for the "extraneous bytes after re-select" problem that
ESP100 chips may exhibit.
 1.4  24-Mar-1997  gwr When cold!=0 force SCSI_POLL (otherwise swapconf will hang)
 1.3  15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.2  27-Feb-1997  briggs branches: 1.2.2;
Add the 53c96 variant.
 1.1  27-Feb-1997  thorpej Machine-independent NCR 53c9x SCSI driver, derived from the SPARC/Alpha
versions. Thanks to Chris Demetrious and Paul Krannenburg for the
initial work towards merging the two.
 1.2.2.2  12-Mar-1997  is Merge in changes from Trunk
 1.2.2.1  27-Feb-1997  is file ncr53c9x.c was added on branch is-newarp on 1997-03-12 21:22:45 +0000
 1.11.2.4  14-Aug-1997  bouyer Sync with trunk.
 1.11.2.3  30-Jul-1997  bouyer Sync with trunk.
 1.11.2.2  22-Jul-1997  bouyer Sync with trunk.
 1.11.2.1  01-Jul-1997  bouyer Updates for new scsipi subsystem. Actally known to work on i386 and sparc.
 1.15.2.4  14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.15.2.3  01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.15.2.2  27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.15.2.1  23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.20.2.4  18-Jan-1999  cgd pull up rev 1.24 from trunk (PR#5180). (pk)
 1.20.2.3  07-Feb-1998  mellon Pull up 1.23 (pk)
 1.20.2.2  07-Feb-1998  mellon Pull up 1.22 (pk)
 1.20.2.1  27-Oct-1997  mellon Pull rev 1.21 up from trunk (pk)
 1.34.2.1  04-Dec-1999  he Pull up revision 1.35 (requested by mhitch):
Fix the problems in detecting the clock speed on the TCDS Dual
SCSI Option cards, and correctly configure the Fast SCSI interfaces.
This allows installation on the 3000/500 -> 3000/900 Alphas which
have the Fast SCSI interface on the on-board SCSI adapters.
 1.36.6.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.36.4.1  15-Nov-1999  fvdl Sync with -current
 1.36.2.19  25-Apr-2001  bouyer add back a missing
ecb->flags |= ECB_READY;
I can run with tagged queuing enabled on my ultra/1 now, which is an
improvement over -current :)
 1.36.2.18  25-Apr-2001  bouyer Add back a ncr53c9x_dequeue() which has been removed by mistake, I think.
 1.36.2.17  24-Apr-2001  bouyer reset ti->width to 0 when wide negotiation didn't succeed. Use this to
report wide status; T_WIDE is only used to tell if wide nego should be
started.
While I'm there fix a bogon in tagged queueing reporting.
 1.36.2.16  23-Apr-2001  bouyer Sync with HEAD.
 1.36.2.15  21-Apr-2001  bouyer Sync with HEAD
 1.36.2.14  23-Mar-2001  bouyer Remove debugging code.
 1.36.2.13  11-Feb-2001  bouyer Sync with HEAD.
 1.36.2.12  15-Jan-2001  bouyer Make it compile again.
 1.36.2.11  05-Jan-2001  bouyer Sync with HEAD
 1.36.2.10  19-Dec-2000  bouyer Add more ncr53c9x_update_xfer_mode() where appropriate.
 1.36.2.9  16-Dec-2000  bouyer Remove debug printf.
 1.36.2.8  16-Dec-2000  bouyer Gives a single-bit flag for T_TAGOFF.
Report tagged-queuing support to upper layer, so that tagged queuing is
really used. Report QUEUE FULL events to upper layer. Bup per-target
openings to 256 as the driver supports it. Fix handling of T_SYNCOFF.
 1.36.2.7  13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.36.2.6  08-Dec-2000  bouyer Sync with HEAD.
 1.36.2.5  22-Nov-2000  bouyer Sync with HEAD.
 1.36.2.4  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.36.2.3  26-Oct-1999  thorpej Update for:

Deal a little more gracefully with the fact that xfer mode parameters
are for the I_T Nexus, and make all xfer mode updates `async events'.
 1.36.2.2  19-Oct-1999  thorpej Don't sleep waiting for a CCB; if we get to the CCB allocation phase, we're
guaranteed to have one.
 1.36.2.1  19-Oct-1999  thorpej Adapt to scsipi API changes.
 1.39.2.2  10-Nov-1999  mycroft Modification to the previous:
We still have to preload the command, when selecting without ATN. (We could
probably avoid this by being more careful in the interrupt handler...)
 1.39.2.1  10-Nov-1999  mycroft file ncr53c9x.c was added on branch comdex-fall-1999 on 1999-11-10 05:02:54 +0000
 1.49.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.51.2.1  04-Jul-2000  thorpej Pull up rev. 1.52:
Fix negative timeout symptoms caused by integer multiply overflow,
which is revealed with larger HZ systems like NetBSD/pmax (256Hz)
and NetBSD/alpha (1024Hz) as reported by PR#8645. Polled tape
drive access is done with maximum 6 hour timeout which ended up
with negative time and then confused SCSI bus severely.
 1.70.2.11  18-Oct-2002  nathanw Catch up to -current.
 1.70.2.10  27-Aug-2002  nathanw Catch up to -current.
 1.70.2.9  01-Aug-2002  nathanw Catch up to -current.
 1.70.2.8  17-Apr-2002  nathanw Catch up to -current.
 1.70.2.7  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.70.2.6  28-Feb-2002  nathanw Catch up to -current.
 1.70.2.5  08-Jan-2002  nathanw Catch up to -current.
 1.70.2.4  14-Nov-2001  nathanw Catch up to -current.
 1.70.2.3  24-Aug-2001  nathanw Catch up with -current.
 1.70.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.70.2.1  09-Apr-2001  nathanw Catch up with -current.
 1.83.2.8  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.83.2.7  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.83.2.6  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.83.2.5  16-Mar-2002  jdolecek Catch up with -current.
 1.83.2.4  11-Feb-2002  jdolecek Sync w/ -current.
 1.83.2.3  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.83.2.2  03-Aug-2001  lukem update to -current
 1.83.2.1  10-Jul-2001  lukem file ncr53c9x.c was added on branch kqueue on 2001-08-03 04:13:02 +0000
 1.84.4.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.93.4.2  03-Feb-2003  jmc Pullup revisions 1.103->1.104 (requested by pk in ticket #1138)
The introduction of FAS366 support annihilated the
`reselect-while-selecting\' workaround for the ESP100 variant.
 1.93.4.1  22-Nov-2002  tron Pull up revision 1.94-1.103 (requested by martin in ticket #948):
Additional fixes to make 16 targets work on FAS366.
 1.93.2.2  29-Aug-2002  gehenna catch up with -current.
 1.93.2.1  15-Jul-2002  gehenna catch up with -current.
 1.106.2.5  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.106.2.4  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.106.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.106.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.106.2.1  03-Aug-2004  skrll Sync with HEAD
 1.110.2.2  11-Sep-2004  he Pull up revision 1.112 (requested by bouyer in ticket #838):
Reserve one element for the ncr53c9x_ecb pool to ensure that
we will not deadlock against other pool users.
 1.110.2.1  06-May-2004  jmc Pullup rev 1.111 (requested by pk in ticket #255)

On reset, clear state flags and the msgout queue and notify the upper layer.
 1.112.6.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.112.4.1  29-Apr-2005  kent sync with -current
 1.115.2.5  27-Oct-2007  yamt sync with head.
 1.115.2.4  03-Sep-2007  yamt sync with head.
 1.115.2.3  26-Feb-2007  yamt sync with head.
 1.115.2.2  30-Dec-2006  yamt sync with head.
 1.115.2.1  21-Jun-2006  yamt sync with head.
 1.118.12.1  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.118.10.1  19-Apr-2006  elad sync with head.
 1.118.8.2  26-Jun-2006  yamt sync with head.
 1.118.8.1  01-Apr-2006  yamt sync with head.
 1.118.6.2  22-Apr-2006  simonb Sync with head.
 1.118.6.1  04-Feb-2006  simonb Adapt for timecounters: mostly use get*time() and use "time_second"
instead of "time.tv_sec".
 1.118.4.1  09-Sep-2006  rpaulo sync with head
 1.119.2.1  19-Jun-2006  chap Sync with head.
 1.120.8.2  10-Dec-2006  yamt sync with head.
 1.120.8.1  22-Oct-2006  yamt sync with head
 1.120.6.2  12-Jan-2007  ad Sync with head.
 1.120.6.1  18-Nov-2006  ad Sync with head.
 1.125.2.2  24-Mar-2007  yamt sync with head.
 1.125.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.126.2.3  09-Oct-2007  ad Sync with head.
 1.126.2.2  01-Jul-2007  ad Adapt to callout API change.
 1.126.2.1  13-Mar-2007  ad Sync with head.
 1.127.2.1  11-Jul-2007  mjf Sync with head.
 1.128.6.2  02-Oct-2007  joerg Sync with HEAD.
 1.128.6.1  03-Sep-2007  jmcneill Sync with HEAD.
 1.128.2.1  03-Sep-2007  skrll Sync with HEAD.
 1.129.4.1  06-Oct-2007  yamt sync with head.
 1.129.2.1  06-Nov-2007  matt sync with HEAD
 1.131.18.1  02-Jun-2008  mjf Sync with HEAD.
 1.135.4.3  16-Sep-2009  yamt sync with head
 1.135.4.2  04-May-2009  yamt sync with head.
 1.135.4.1  16-May-2008  yamt sync with head.
 1.135.2.1  18-May-2008  yamt sync with head.
 1.136.2.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.137.14.1  03-May-2009  bouyer branches: 1.137.14.1.2;
Pull up following revision(s) (requested by martin in ticket #734):
sys/dev/ic/ncr53c9x.c: revision 1.138
Add missing braces - patch from Kurt Lidl in PR port-vax/41314.
 1.137.14.1.2.1  21-Apr-2010  matt sync to netbsd-5
 1.137.12.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.137.8.1  03-May-2009  bouyer Pull up following revision(s) (requested by martin in ticket #734):
sys/dev/ic/ncr53c9x.c: revision 1.138
Add missing braces - patch from Kurt Lidl in PR port-vax/41314.
 1.143.8.2  25-Jul-2012  jdc Pull up revision 1.145 (requested by ryoon in ticket #439).

When issuing a non-dma command, make sure to set the "remaining length of
command to be transfered via dma" (sc_cmdlen) to zero upfront, otherwise we
might get confused on command completition interrupt (no dma active but still
data left to transfer).
 1.143.8.1  19-Mar-2012  riz Pull up following revision(s) (requested by mrg in ticket #125):
sys/dev/scsipi/scsiconf.c: revision 1.263
sys/dev/scsipi/scsiconf.c: revision 1.264
sys/dev/ic/ncr53c9x.c: revision 1.144
sys/dev/ic/ninjascsi32.c: revision 1.22
sys/dev/usb/uhub.c: revision 1.117
take the kernel lock in functions called from attach*().
scsidevdetached ioctl path enters scsipi code without kernel lock
and this upsets the newer kasserts. take kernel lock here.
take the kernel lock a few more places when doing detach, to avoid
triggering KERNEL_LOCK_P() asserts in both scsi and usb code.
with this and other recent fixes i can now "drvctl -d ehci0".
 1.143.6.1  11-Mar-2012  mrg sync to latest -current
 1.143.2.2  30-Oct-2012  yamt sync with head
 1.143.2.1  17-Apr-2012  yamt sync with head
 1.145.20.2  20-Mar-2017  pgoyette Sync with HEAD
 1.145.20.1  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.145.16.2  28-Aug-2017  skrll Sync with HEAD
 1.145.16.1  05-Feb-2017  skrll Sync with HEAD
 1.145.2.1  03-Dec-2017  jdolecek update from HEAD
 1.148.6.3  21-Apr-2020  martin Sync with HEAD
 1.148.6.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.148.6.1  10-Jun-2019  christos Sync with HEAD
 1.148.4.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.152.6.1  20-Apr-2020  bouyer Sync with HEAD
 1.153.4.1  21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.154.8.1  04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed