summaryrefslogtreecommitdiffstats
path: root/sys/dev/ic/cac.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Replace local *_copy_internal_data() with scsi_copy_internal_data().krw2020-10-151-21/+4
|
* Since dlg@'s 2009 scsi midlayer refactoring the 'struct scsi_generic *cmd'krw2020-09-221-6/+6
| | | | | | | | | | | | 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@
* Replace '32' with SID_SCSI2_ALEN (a.k.a. 31) when building emulated INQUIRYkrw2020-09-051-2/+2
| | | | | responses. This is what the SCSI specifications say is the correct value and already used in several cases.
* Replace '.response_format = 2' with '.response_format = SID_SCSI2_RESPONSE'.krw2020-09-031-2/+2
|
* When building emulated INQUIRY results use the SCSI_REV_* #define's tokrw2020-09-021-2/+2
| | | | initialize the 'version' field. Not numbers.
* Rename [READ|WRITE]_BIG to [READ|WRITE]_10. Rename struct scsi_rw_big tokrw2020-09-011-9/+9
| | | | | | struct scsi_rw_10. ok gnezdo@ jmatthew@ (who also did sparc64 compile test)
* SC_DEBUG() and friends are for debugging the SCSI code, not for scattered randomkrw2020-07-281-3/+4
| | | | | | uses in drivers. Use a CAC_DEBUG sections like the other debug output does.
* Turning on various scsi drivers' *DEBUG options reveals that this haskrw2020-07-241-3/+3
| | | | | | | | rarely (if ever) been done. Fix many printf format errors to calm clang and gcc on amd64, i386, hppa. Missing #include, complaints if 'option <blah>DEBUG' is used in config files, etc. All in debug code.
* Move remaining scsi bus initialization info from "prototype scsi link"krw2020-07-201-7/+7
| | | | | | | 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-2/+2
| | | | | | | | 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.
* Cache a scsibus_softc * and use it rather than cludging indirectkrw2020-07-111-3/+4
| | | | comparisons to sc_link.
* No need to bzero()/memset() 'struct scsibus_attach_args' variableskrw2020-06-271-2/+1
| | | | immediately before initializing the only field in the struct.
* Use SDEV_NO_ADAPTER_TARGET instead of the value that is beingkrw2020-06-241-2/+2
| | | | | | | aassigned to adapter_buswidth to indicate the adapter is not a target on the bus. ok dlg@ as part of a larger diff.
* *_minphys() functions that cap i/o sizes at a value larger than thekrw2020-02-151-10/+2
| | | | | | | | | | | | | | | value minphys() uses (MAXPHYS) are pointless since minphys() is always called after the *_minphys() function. MAXPHYS (64 * 1024) == 16 * 4096. 4096 is the smallest PAGE_SIZE we have. So a *_minphys() function that caps the i/o size at N * PAGE_SIZE where N is > 16 is just wasting cycles. Nuke adv_minphys (40 * PAGE_SIZE), adw_minphys (254 * PAGE_SIZE), ahc_minphys (128 * PAGE_SIZE), ahd_minphys (128 * PAGE_SIZE), ami_minphys (26 * PAGE_SIZE), cac_minphys (65535 (!!!) * 512), iha_minphsy (32 * PAGE_SIZE), trm_minphys (31 * PAGE_SIZE), twe_minphys (62 * PAGE_SIZE). uha_minphys (32 * PAGE_SIZE),
* Shuffle some names around to make reading the code less headachekrw2020-01-261-4/+4
| | | | | | | | inducing. Rename scsi_adapter member 'scsi_minphys' to 'dev_minphys' to reflect what it is supposed to do. Use consistent naming convention (<dev>_minphys) for the actual device functions. No functional change.
* Drivers that implement their own *minphys() don't need to call thekrw2020-01-251-2/+1
| | | | | | | system minphys(). scsi_minphys() will do that and cd/sd/st will call scsi_minphys(). ok jmatthew@ as part of larger diff
* Use a consistant idiom/format when declaring scsi_adapter structureskrw2020-01-231-2/+2
| | | | | | | | | | | 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@
* size for free()deraadt2015-09-011-2/+3
|
* another handful of bcopy -> memcpy because there is no overlapderaadt2014-12-191-2/+2
|
* remove uneeded proc.h includesjsg2014-09-141-2/+1
| | | | ok mpi@ kspillner@
* Some reallocarray() use; review Jean-Philippe Ouellet, patrick keshishianderaadt2014-07-131-5/+5
| | | | ok tedu
* 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.
* Enforce ca_activate tree-walks over the entire heirarchy for all events,deraadt2013-05-301-26/+1
| | | | | | cleaning up some shutdown-hook related code on the way. (A few drivers related to sparc are still skipped at kettenis' request) ok kettenis mlarkin, tested by many others too
* Initialize variables before use. From Pedro Martelletto, tweaked bykrw2011-10-271-7/+9
| | | | me to add more paranoia.
* Backout a bunch of my SCSI commits from c2k11. At least one of thesematthew2011-07-171-2/+2
| | | | | | is causing problems when trying to boot sparc64 from an isp(4). Verified to fix the sparc64/isp(4) regression by krw@; ok deraadt@
* First batch of converting SCSI HBAs from setting saa_targets andmatthew2011-07-081-2/+2
| | | | | | saa_luns instead of adapter_buswidth and luns in the prototype link. ok dlg@, miod@
* Fix after poolification. For reasons not completely understood, theotto2011-05-231-10/+11
| | | | fifo full check has to be protected by the mutex. ok dlg@ krw@
* Avoid double scsi_done(xs) in error path; ok dlg@ krw@otto2011-05-201-2/+1
|
* A plausible iopoolification. Utter dearth of interested partieskrw2011-04-211-37/+67
| | | | | | | after more than a year of grovelling emails shows further effort is pointless. ok matthew@ dlg@
* - use nitems() no binary change on amd64jasper2011-04-051-2/+2
| | | | "reads OK" claudio@
* Force openings to 1 for devices that can't do tagged i/o, i.e. morekrw2010-10-121-1/+2
| | | | | | | | | | | | | | than 1 i/o active at once. This reduces the chances that concurrent i/o's for such devices will confuse the device or the adapter code. It also eliminates a reason for adapter code to maintain its own queues. Tweak all drivers that fake INQUIRY results to set the SID_CmdQue flag, thus continuing to claim to be able to do tagged i/o. Positive feedback from matthew@ and marco@ for an earlier version. ok dlg@
* Use SSD_ERRCODE_CURRENT instead of magic 0x70.krw2010-09-201-2/+2
| | | | ok dlg@ matthew@
* Change scsibus(4)'s scsi_link array to an SLIST to save memory onmatthew2010-07-011-3/+5
| | | | | | sparsely populated buses. ok dlg@, krw@
* Remove all adapter-specific 'struct scsi_device's. They are never used. Firstkrw2010-06-281-6/+1
| | | | | | | | step in elminating 'struct scsi_device' entirely. Spotted and initial diff from matthew@. ok matthew@ dlg@ deraadt@ marco@ miod@
* New scsi code seems to be stable. Pluck previously identifiedkrw2010-05-201-3/+1
| | | | | | | low-hanging splbio/splx pairs that are no longer needed and see if this reveals any hidden scsi flaws. ok dlg@
* BUS_DMA_ZERO instead of alloc, map, bzero.oga2010-05-191-3/+2
| | | | ok krw@
* Initialize various uninitialized variables. Found by jsg@ via Clang.krw2010-03-291-2/+3
| | | | | | Feedback from miod@ and kettenis@. ok beck@
* Change the scsi_cmd function member of scsi_adapter from int tokrw2010-03-231-14/+11
| | | | | | | | | | | | | 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@
* Zap all setting of ITSDONE in drivers that don't look at it. Nobodykrw2010-01-091-3/+1
| | | | | | | else cares so it's just noise. Drivers that actually look at ITSDONE are unchanged. ok marco@ (for his files) dlg@ beck@
* Bring last drivers fully into the NO_CCB world by replacingkrw2009-11-221-5/+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@.
* Need to scsi_done() before returning COMPLETE for untranslated commands,miod2009-09-301-1/+3
| | | | | such a Test Unit Ready; found the hard way by jbg@, and inexplicably missed during dlg@ and I audit of hba drivers behaviour.
* Missing scsi_done() in some error path returning COMPLETE; ok dlg@miod2009-09-041-1/+5
|
* No need to spam log with 'unable to alloc CCB' messages now thatkrw2009-03-071-1/+3
| | | | | | | NO_CCB is in place and the I/O is retried rather than discarded. So move the message inside a #ifdef CAC_DEBUG. Noticed by jbg@.
* Bring NO_CCB to cac(4), which helps bio work better withoutkrw2009-02-201-3/+3
| | | | | | generating worrying error messages. Or possibly losing i/o's. tested by jbg@ ok deraadt@
* Extend the scsi_adapter minphys() callback to take a struct scsi_link *miod2009-02-161-4/+3
| | | | | | as additional argument. This will allow intermediate layers between scsi devices such as sd and scsi host adapters to take appropriate action if necessary.
* Add initial bio support; only volume status is handled.brad2008-10-291-3/+226
| | | | | | | | | Based on cac(4) bio support from NetBSD which is derived from OpenBSD's ciss(4) bio support. Tested by otto@ jbg@ ok marco@
* First pass at removing clauses 3 and 4 from NetBSD licenses.ray2008-06-261-8/+1
| | | | | | | | | Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
* More scsi_done() at SPLBIO.krw2007-11-061-2/+4
|
* More easy bzero() -> M_ZERO. Use 'p = malloc(sizeof(*p) ...'.krw2007-10-011-3/+2
|