summaryrefslogtreecommitdiffstats
path: root/sys/dev/ic/ncr53c9x.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Since dlg@'s 2009 scsi midlayer refactoring the 'struct scsi_generic *cmd'krw2020-09-221-3/+3
| | | | | | | | | | | | member of 'struct scsi_xfer' has always been pointed at the 'struct scsi_generic cmdstore' member of the same instance. So nuke 'cmdstore' and remove the '*' from cmd. Take the address of cmd as required by the various casts. No intentional functional change. luna88k test by aoyama@, sparc64 test by jmatthew@ Identification of 2009's last *cmd use and ok jmatthew@
* Move remaining scsi bus initialization info from "prototype scsi link"krw2020-07-201-5/+5
| | | | | | | fields to struct scsibus_attach_args. Nuke the struct scsi_link * (saa_sc_link) in scaibus_attach_args. Explicitly initialize each field in scsibus_attach_args variables.
* Move the adapter related items (luns, adapter, adapter_target,krw2020-07-191-5/+6
| | | | | | | adapter_buswidth, adapter_softc) from struct scsi_link to struct scsibus_attach_args. Additional compile tests by jmatthew@ (sparc64) and aoyam@ (luna88k).
* Access adapter softc via link->bus->sb_adapter_softc.krw2020-07-161-5/+5
| | | | | | | | In sparc64 autoconf access 'luns' via sb_luns and 'adapter_buswidth' via sb_adapter_buswidth. Removes last post-config uses of the copies of bus related information in scsi_link.
* Expunge some Captain Obvious comments, tweak whitespace a bit, move a debugkrw2020-07-111-7/+1
| | | | statement. All to make upcoming diff(s) smaller and easier to read.
* Nuke trailing whitespace.krw2020-06-271-12/+12
|
* No need to bzero()/memset() 'struct scsibus_attach_args' variableskrw2020-06-271-2/+1
| | | | immediately before initializing the only field in the struct.
* kernel: use gettime(9)/getuptime(9) in lieu of time_second(9)/time_uptime(9)cheloha2020-06-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | time_second(9) and time_uptime(9) are widely used in the kernel to quickly get the system UTC or system uptime as a time_t. However, time_t is 64-bit everywhere, so it is not generally safe to use them on 32-bit platforms: you have a split-read problem if your hardware cannot perform atomic 64-bit reads. This patch replaces time_second(9) with gettime(9), a safer successor interface, throughout the kernel. Similarly, time_uptime(9) is replaced with getuptime(9). There is a performance cost on 32-bit platforms in exchange for eliminating the split-read problem: instead of two register reads you now have a lockless read loop to pull the values from the timehands. This is really not *too* bad in the grand scheme of things, but compared to what we were doing before it is several times slower. There is no performance cost on 64-bit (__LP64__) platforms. With input from visa@, dlg@, and tedu@. Several bugs squashed by visa@. ok kettenis@
* wdsc(4), ncr53c9x: timestamp LUNs with time_uptime(9), not time_second(9)cheloha2020-04-151-3/+3
| | | | | | | Use a monotonic clock for timestamping LUNs to avoid problems when the UTC clock jumps. ok krw@
* Let's all agree to call our scsi_adapter variable '<dev>_switch'.krw2020-02-141-3/+3
|
* Nuke unnecessary abstraction 'scsi_minphys()' which just callskrw2020-02-051-2/+2
| | | | | | 'minphys()'. Just use & check for NULL instead, since 'minphys()' is always called on the code path ([cd|sd|st]minphys) that calls physio().
* Use a consistant idiom/format when declaring scsi_adapter structureskrw2020-01-231-6/+3
| | | | | | | | | | | in drivers. Terse one liners, NULLs instead of 0's, explicitly specify all members, etc. Nuke #ifdef notyet blocks related to the scsi_adapter in aic. No intentional functional change. ok tedu@
* Fix delay logic: measure w/ uptime, pack timeval correctly. ok krw@cheloha2019-05-071-4/+4
|
* If you use sys/param.h, you don't need sys/types.hderaadt2017-09-081-2/+1
|
* all pools have their ipl set via pool_setipl, so fold it into pool_init.dlg2016-09-151-4/+3
| | | | | | | | | | | | | | | | | | | | | | the ioff argument to pool_init() is unused and has been for many years, so this replaces it with an ipl argument. because the ipl will be set on init we no longer need pool_setipl. most of these changes have been done with coccinelle using the spatch below. cocci sucks at formatting code though, so i fixed that by hand. the manpage and subr_pool.c bits i did myself. ok tedu@ jmatthew@ @ipl@ expression pp; expression ipl; expression s, a, o, f, m, p; @@ -pool_init(pp, s, a, o, f, m, p); -pool_setipl(pp, ipl); +pool_init(pp, s, a, ipl, f, m, p);
* Convert %q to %ll in format stringsguenther2016-08-231-3/+3
| | | | ok natano@ krw@
* Merge NetBSD 1.145:miod2015-11-081-1/+5
| | | | | | | 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).
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* remove uneeded proc.h includesjsg2014-09-141-2/+1
| | | | ok mpi@ kspillner@
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-2/+2
| | | | after discussions with beck deraadt kettenis.
* Quoting an old commit message:miod2014-01-261-1/+2
| | | | | | ``Callers of scsi_iopool_init() ought to set up the pool member in struct scsi_link accordingly, for bad things will happen without (and this was a real pita to debug).''
* move the declaration of ncr53c9x_scsi_cmd into the .c file, its the onlydlg2014-01-181-1/+2
| | | | place that uses it.
* replace XS_NO_CCB with an iopool around the ecb_pool.dlg2014-01-181-39/+21
| | | | take advantage of pool_setipl while here.
* get rid of a XS_NO_CCB thats caused by a failure to allocate thedlg2014-01-181-84/+54
| | | | | | | | | thing that stores state for luns. instead of checking and allocating it in the scsi_cmd path, and doing weird things all over the place to free it (eg, there's a timeout that ran every 10m to gc luns), use the scsi_probe and scsi_free things the midlayer calls.
* instead of having every bit of glue set up and attach an identicaldlg2014-01-181-4/+11
| | | | | | scsi_adapter struct, just do it once in the chip code. ok krw@
* ncr53c9x (a.k.a. esp on sparc64) does not like 16-byte SCSI commandskrw2011-11-081-1/+16
| | | | | | | | | | | | such as READ_CAPACITY_16. So plugging SCSI-3 devices onto such a bus can be problematic. Cap the acceptable xs->cmdlen at 12 in ncr53c9x.c. Problem noted and fix tested by Kurt Mosiejczuk. Thanks! Diff mostly from miod@ with kibitzing from me. ok miod@
* protect sc->sc_state access and ncr53c9x_sched() call with splbio inmiod2011-08-291-1/+3
| | | | | | ncr53c9x_poll(). Fixes a race causing *some* drives to trigger a panic in ncr53c9x_sched() at attach time on vax. ok dlg@ krw@
* Pass a few more M_ZERO to malloc() or its wrappers, when useful; ok krw@miod2010-11-111-5/+5
|
* do not assume PR_NOWAIT is 0; it is not anymorederaadt2010-09-281-2/+2
|
* Remove all adapter-specific 'struct scsi_device's. They are never used. Firstkrw2010-06-281-4/+2
| | | | | | | | step in elminating 'struct scsi_device' entirely. Spotted and initial diff from matthew@. ok matthew@ dlg@ deraadt@ marco@ miod@
* Don't #include <sys/user.h> into files that don't need the stuffguenther2010-06-261-2/+1
| | | | | | | | it defines. In some cases, this means pulling in uvm.h or pcb.h instead, but most of the inclusions were just noise. Tested on alpha, amd64, armish, hppa, i386, macpcc, sgi, sparc64, and vax, mostly by krw and naddy. ok krw@
* New scsi code seems to be stable. Pluck previously identifiedkrw2010-05-201-8/+2
| | | | | | | low-hanging splbio/splx pairs that are no longer needed and see if this reveals any hidden scsi flaws. ok dlg@
* Change the scsi_cmd function member of scsi_adapter from int tokrw2010-03-231-7/+15
| | | | | | | | | | | | | void. Use XS_NO_CCB error in the scsi command (xs) to report the NO_CCB condition. Eliminates all SUCCESSFULLY_QUEUED and COMPLETE confusion and untangles the midlayer from the adapter a bit more. Eyes and some fixes by miod@ There may be some compile issues on little used (i.e. I don't have any) drivers but the change is mechanical and thus easy to remedy. ok dlg@
* Remove a few more settings of ITSDONE in drivers. Only a couplekrw2010-01-131-3/+1
| | | | more to go. Should be a no-op.
* Nuke SCSI_URGENT after removing its only use, in ncr53c9x.c. That usekrw2009-12-061-3/+1
| | | | | | was to try to play dangerous games with tagged queuing. ok marco@
* Bring last drivers fully into the NO_CCB world by replacingkrw2009-11-221-2/+2
| | | | | | | | | | | TRY_AGAIN_LATER uses with equivalent NO_CCB. Eliminates confusion between the two as was always intended. buf I/O's that can't be started get pushed back onto the front of the queue and retried. Others get sent back to originator as failures. No more epi-cycle looping inside the SCSI midlayer hoping the problem goes away. Various testers, no objection from miod@ as vs(4) was tested by nick@.
* Move IS[12]BYTEMSG and ISEXTMSG defines to a common place.fgsch2009-11-011-5/+1
| | | | Pointed out by miod@. krw@ miod@ ok.
* Return NO_CCB instead of TRY_AGAIN_LATER when ccb's run out.krw2008-11-241-2/+2
| | | | "I'm all for it." marco@ "Yeah" deraadt@
* Convert timeout_add() calls using multiples of hz to timeout_add_sec()blambert2008-09-101-2/+2
| | | | | | | Really just the low-hanging fruit of (hopefully) forthcoming timeout conversions. ok art@, krw@
* Fix redundant device name and/or target printing after callingmiod2008-08-311-3/+2
| | | | sc_print_addr(); ok krw@
* Don't print SCSI ID, it's redundant now that scsibus(4) prints the samekettenis2008-05-271-3/+3
| | | | information.
* More scsi_done() at SPLBIO. Wrap more interrupt function calls whilekrw2007-11-051-3/+11
| | | | | | | polling in splbio/splx. Put belts and suspenders splbio/splx around the scsi_done() call since it may be possible to get there other ways. Partly from thib@
* more remove unneeded declarations that shadows existing vars; ok by many.fgsch2007-10-151-2/+1
|
* Fix some "that that"s.tom2007-08-061-2/+2
| | | | ok miod@ jmc@
* give scsi controllers a real attach args to fill in when attaching scsibus.dlg2006-11-281-2/+7
| | | | ok miod@ marco@ deraadt@
* Enable wide targets on FAS366 esp; note that this changes the way espmiod2006-06-261-10/+21
| | | | | user-controllable device flags are parsed, be sure to rerun config(8) on your next kernel compile.
* In NCR53C9X_DEBUG code, compute debug values after the values they depend onmiod2006-05-231-3/+8
| | | | have been computed.
* Use more queue macros rather than doing it by hand; ok otto@ krw@miod2006-03-051-10/+9
|
* Delay a bit after sending a reset command if the chip is an 53C94 or a 53C96;miod2006-01-091-1/+15
| | | | ok deraadt@ krw@
* NCRDMA_SETUP() should be called before NCR_SET_COUNT() and NCRCMD_DMA commandbrad2006-01-091-3/+4
| | | | | | | | in ncr53c9x_select(). From tsutsui NetBSD ok miod@