summaryrefslogtreecommitdiff
path: root/sys/dev/ic/aic79xx_openbsd.c
AgeCommit message (Collapse)Author
2020-09-22Since dlg@'s 2009 scsi midlayer refactoring the 'struct scsi_generic *cmd'Kenneth R Westerback
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@
2020-07-28SC_DEBUG() and friends are for debugging the SCSI code, not for scattered randomKenneth R Westerback
uses in drivers. Use AHD_DEBUG/AHC_DEBUG sections like all the other debug output does. Don't #include scsi_debug.h.
2020-07-20Move remaining scsi bus initialization info from "prototype scsi link"Kenneth R Westerback
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.
2020-07-19Move the adapter related items (luns, adapter, adapter_target,Kenneth R Westerback
adapter_buswidth, adapter_softc) from struct scsi_link to struct scsibus_attach_args. Additional compile tests by jmatthew@ (sparc64) and aoyam@ (luna88k).
2020-07-16Access adapter softc via link->bus->sb_adapter_softc.Kenneth R Westerback
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.
2020-07-13Remove some pointless casting of void * when assigning oneKenneth R Westerback
(scsi_link.adapter_softc) to a pointer of a particular softc type.
2020-07-11Expunge some Captain Obvious comments, tweak whitespace a bit, move a debugKenneth R Westerback
statement. All to make upcoming diff(s) smaller and easier to read.
2020-07-02Shuffle things around so that sc->sc_link initialization isKenneth R Westerback
even more concentrated just before config_found().
2020-06-27No need to bzero()/memset() 'struct scsibus_attach_args' variablesKenneth R Westerback
immediately before initializing the only field in the struct.
2020-02-15*_minphys() functions that cap i/o sizes at a value larger than theKenneth R Westerback
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),
2020-02-06Whitespace tweak.Kenneth R Westerback
2020-01-25Drivers that implement their own *minphys() don't need to call theKenneth R Westerback
system minphys(). scsi_minphys() will do that and cd/sd/st will call scsi_minphys(). ok jmatthew@ as part of larger diff
2020-01-23Use a consistant idiom/format when declaring scsi_adapter structuresKenneth R Westerback
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@
2017-12-12Nuke some forward-only struct's and functions and functions therebyKenneth R Westerback
made empty. Found by new ctfconv(1) feature and validated by clang. ok mpi@
2016-08-17Move to iopool. No voluntary testers after several years of requests so nowKenneth R Westerback
everybody gets to test!
2016-03-19Reduces the noise around the global ``ticks'' variable by renamingMartin Pieuchot
all the local ones to ``nticks''. ok stefan@, deraadt@
2015-07-17Nuke a bunch of leading and trailing whitespace so I don't go blindKenneth R Westerback
reading this code. No intentional functional change.
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-01-17if the hardware is too busy or its queues are too full, return XS_BUSY,David Gwynne
not XS_NO_CCB. discussed with krw@ who agrees
2013-05-30Enforce ca_activate tree-walks over the entire heirarchy for all events,Theo de Raadt
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
2012-12-05Remove excessive sys/cdefs.h inclusionTheo de Raadt
ok guenther millert kettenis
2012-02-24Correct the spelling of "transferred" and "transferring"Philip Guenthe
from Tobias Ulmer (tobiasu at tmux.org); ok jmc@, krw@
2010-06-28Remove all adapter-specific 'struct scsi_device's. They are never used. FirstKenneth R Westerback
step in elminating 'struct scsi_device' entirely. Spotted and initial diff from matthew@. ok matthew@ dlg@ deraadt@ marco@ miod@
2010-03-23Change the scsi_cmd function member of scsi_adapter from int toKenneth R Westerback
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@
2010-01-20Remove horrible hack in ahc/ahd that made some commands retryKenneth R Westerback
endlessly. Use the shiny new XS_NO_CCB instead to retry commands that can't start. Neither dlg@ nor I can figure out why 4.6 and earlier worked. Problem noted, debugged with and fix tested by Jeff Ross and his new external enclosure. Thanks! ok dlg@
2010-01-10Set ITSDONE in scsi_done() and zap trivial instances of setting itKenneth R Westerback
in the drivers just before calling scsi_done(). ok dlg@ beck@
2009-11-22Bring last drivers fully into the NO_CCB world by replacingKenneth R Westerback
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@.
2009-02-16Extend the scsi_adapter minphys() callback to take a struct scsi_link *Miod Vallat
as additional argument. This will allow intermediate layers between scsi devices such as sd and scsi host adapters to take appropriate action if necessary.
2009-01-21Replace timeout_add(msecs * hz / 1000) with timeout_add_msec(msecs).Alexander Yurchenko
No functional changes. ok krw@ miod@
2008-11-25dontqueue is set but never used. garbage collect it.Kenneth R Westerback
2008-11-24Return NO_CCB instead of TRY_AGAIN_LATER when ccb's run out.Kenneth R Westerback
"I'm all for it." marco@ "Yeah" deraadt@
2007-10-20Put scsi_done() invocations inside existing splbio/splx pairs to makeKenneth R Westerback
damned sure scsi_done is invoked at splbio. Noted by deraadt@.
2007-09-07The obvious bzero/memset -> M_ZERO changes.Kenneth R Westerback
2006-11-28give scsi controllers a real attach args to fill in when attaching scsibus.David Gwynne
ok miod@ marco@ deraadt@
2006-05-22Attach routines can fail before calling *hook_establish(), and theyKenneth R Westerback
often rely on the detach routine for cleanup. So be consistant and careful by checking for a NULL hook before calling *hook_disestablish in detach routines. ok mickey@ brad@ dlg@
2006-03-04All CAM_* values stored in xs->error must be 'interpreted' byKenneth R Westerback
ah[cd]_done() into XS_* values understood by the SCSI code before returning xs to the tender mercies of the SCSI code. So if we bail out without calling ah[cd]_done(), because the request cdb length is excessive, don't use ah[cd]_set_transaction() to put CAM_REQ_INVALID into xs->error, just jam in XS_DRIVER_STUFFUP as ah[cd]_done() would have. If CAM_REQ_INVALID escapes it will be interpreted as XS_SHORT_SENSE as far as I can tell. This code path should never be trod so the net effect should be minimal.
2005-12-28Strip out fancy timeout code that attempts to mimic FreeBSD's threadKenneth R Westerback
based timeout handling. Use the simple timeout == bus reset model instead. Also move verbose debug output inside #ifdef/#endif. Fixes immediate crashes on encountering a timeout. Noted by per englebrecht when trying 'smartctl -d scsi -a /dev/rsd0c'. Thanks to per englebrecht and luiz gustavo for testing. Should only impact timeout handling. No change to normal processing. ok marco@
2005-11-02It is invalid to scsi_done(xs) and then return TRY_AGAIN_LATER.Kenneth R Westerback
scsi_done() can release the scsi_request xs and TRY_AGAIN_LATER will refer to it and submit it for re-execution. This was being done only if bus_dmamap_load() failed. Ensure the controller resources are freed before returning TRY_AGAIN_LATER, since new resources will be allocated when the command is executed again. Don't bother setting xs->error before returning TRY_AGAIN_LATER as the code returned to sets xs->error to XS_BUSY. ok marco@
2005-10-06Use correct timer when reinstating timeouts. Adapted from FreeBSDKenneth R Westerback
aic79xx_osm.c r1.22 fix by gibbs.
2004-12-30Current ahd timeout code does nothing. Add fbsd style timeoutKenneth R Westerback
handling which will at least try to recover. ok marco@.
2004-12-28Don't allow an infinite number of SCSI bus resets per i/o.Kenneth R Westerback
ok marco@.
2004-12-27Fix tag handling for non-U320/packetized devices. Allow tags for theseKenneth R Westerback
devices. Tidy up man page, remove lies and cruft. ok marco@.
2004-12-24Kill bit of ahc cruft. Elminate lots of leading spaces. Other KNF. NoKenneth R Westerback
functional change.
2004-12-20In the rare case that SCSI_RESET is set, ensure that xs->stimeout isKenneth R Westerback
valid and don't call ahd_setup_data() after ahd_execute_scb() may have freed the scb.
2004-12-20Activate packetized status handling.Kenneth R Westerback
ok tdeval@.
2004-12-19Reduce delta to FreeBSD by adding and using ahd_alloc() rather thanKenneth R Westerback
manually reproducing bits in ahd_pci.c. Just as in ahc, avoid allocating and freeing zero length bits of memory for platform data. Don't try to free all or part of ahd_softc, but correctly free allocated memory for seep_config if necessary. Add a final few fields to ahd_softc and scb in preparation for updating/fixing timeout handling. No functional changes.
2004-12-13Use millisends rather than microseconds in parameters to timerKenneth R Westerback
functions, and ultra-conservative calculations, to avoid possible overflow issues. Also consistant with values passed in scsi requests. Whitespace and comment tweaks. Update FreeBSD tags now that we are sync'd to the latest version. From FreeBSD aic79xx.c r1.33, aic79xx.h r1.23, aic_osm_lib.h r1.4.
2004-11-23More FreeBSD delta reduction. Use aic_* defines rather than ahd_* oneKenneth R Westerback
line and zero line functions. Fix a potential bug (ahd_set_transaction_status was used where ahd_set_scsi_status was intended) inside a currently #ifdef 0/#endif section of code. No functional changes intended except for a bit of extra locking via ahd_list_lock*. ok marco@.
2004-11-18More NetBSD cruft removal/FreeBSD delta reduction. Whitespace, function and ↵Kenneth R Westerback
variable shuffle. No functional change.
2004-11-14More NetBSD cruft removal, starting with 'struct ahd_pci_busdata' andKenneth R Westerback
the fallout from that. Ensure pcireg_t variables are being used with pci_conf_read/write functions - found one uint16_t variable (pcix_status) being used to store and restore (32 bit) pcireg_t values. Some KNF. No functional changes.