summaryrefslogtreecommitdiffstats
path: root/sys/dev/ic/siop.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ansijsg2021-03-071-49/+21
|
* Since dlg@'s 2009 scsi midlayer refactoring the 'struct scsi_generic *cmd'krw2020-09-221-4/+4
| | | | | | | | | | | | 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@
* "#ifndef SIOP_DEBUG\n#undef SIOP_DEBUG\n#endif" is a bit silly.krw2020-07-301-2/+1
|
* 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-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-6/+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-4/+4
| | | | | | | | 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.
* Remove some pointless casting of void * when assigning onekrw2020-07-131-3/+3
| | | | (scsi_link.adapter_softc) to a pointer of a particular softc type.
* Nestle all sc_c.sc_link initialization near config_found() invocation.krw2020-07-041-4/+9
|
* If the adapter card needs to keep track of its own id on the bus, orkrw2020-07-011-8/+10
| | | | | | | | | | | the width of the bus it is providing, it should rely on info in its softc. i.e. not on info in the prototype scsi_link that is passed out for other bits of the kernel to fiddle with. Most drivers already do this. Make it so for the laggards iha(4) and siop(4). Actually use the existing softc value in wd33c93.c. No intentional functional change.
* Nuke trailing whitespace.krw2020-06-271-2/+2
|
* No need to bzero()/memset() 'struct scsibus_attach_args' variableskrw2020-06-271-2/+1
| | | | immediately before initializing the only field in the struct.
* Whitespace. Two short lines to one line.krw2020-06-191-6/+6
|
* The siop family members use various atop/ptoa dances (oosiop/osiop) orkrw2020-02-171-2/+2
| | | | | as static value of 16 * PAGE_SIZE (siop). But all end up with a max i/o size of of MAXPHYS or more. So no need for their *_minphys.
* Let's all agree to call our scsi_adapter variable '<dev>_switch'.krw2020-02-141-3/+3
|
* Use a consistant idiom/format when declaring scsi_adapter structureskrw2020-01-231-5/+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@
* sizes for free(); ok semariederaadt2015-09-091-10/+6
|
* 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@
* Use <sys/endian.h> instead of <machine/endian.h>guenther2014-12-191-2/+2
| | | | ok dlg@ mpi@ bcook@ millert@ miod@
* Some reallocarray() use; review Jean-Philippe Ouellet, patrick keshishianderaadt2014-07-131-2/+2
| | | | ok tedu
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-10/+10
| | | | after discussions with beck deraadt kettenis.
* Fix edge cases of uninitialized variables. In my tree for too long, I evenmiod2013-05-271-2/+5
| | | | got ok's for azalia but I don't remember from whom.
* a bit more ansi; ok teduderaadt2011-06-231-2/+2
|
* pull the dmamam wrapper in from all my other drivers and use it to replacedlg2011-04-051-44/+92
| | | | | | | | the siop command buffers and add dmaable buffers for sense data. matthew@ found that siop used to try to dma to the xs->sense bufer, which is not guaranteed to be dma safe. tested by matthew@ kettenis@
* Manuel Bouyer rescinded clauses 3 and 4 of his license text.jsg2010-07-231-6/+1
|
* siop sets XS_NO_CCB when it fails to allocate device state when commandsdlg2010-07-061-54/+61
| | | | | | | | | | | | | | | are first sent to target/lun, as opposed to failing to allocate a ccb (which ive already fixed). this moves the allocation and freeing of this device state in siop into the scsi_probe and scsi_free handlers. if siop cant allocate memory for a device when the midlayer is about to probe it, we dont send commands to it. if the midlayer fails to find a device at that target/lun, it asks siop to free it. simplifies the io path and avoids work during interrupts. ok deraadt@ reads good to both marco@ and krw@
* timeout_add -> timeout_add_msecblambert2010-07-021-7/+3
| | | | ok dlg@
* Remove all adapter-specific 'struct scsi_device's. They are never used. Firstkrw2010-06-281-9/+1
| | | | | | | | step in elminating 'struct scsi_device' entirely. Spotted and initial diff from matthew@. ok matthew@ dlg@ deraadt@ marco@ miod@
* Always initialize the ccb provided by the scsi layer into the properkrw2010-06-031-1/+7
| | | | | | | | | | state when starting an i/o. Necessary as the scsi layer may now re-submit a completed xs/ccb to the adapter in some error situations. Fixes panics seen by various people, reproduced and fix tested by sobrado@. ok dlg@
* modify siop to provide an iopool as a way for the midlayer to managedlg2010-04-061-20/+43
| | | | | | | access to its free ccbs. ok krw@ beck@ marco@ tested by beck@
* Change the scsi_cmd function member of scsi_adapter from int tokrw2010-03-231-10/+19
| | | | | | | | | | | | | 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@
* Set ITSDONE in scsi_done() and zap trivial instances of setting itkrw2010-01-101-2/+1
| | | | | | in the drivers just before calling scsi_done(). ok dlg@ beck@
* Don't try to be clever and mix tag queueing mechanisms. Few if anykrw2009-11-261-8/+2
| | | | | | | disks actually do queueing correctly. Keep it SIMPLE. Fixes naddy@'s magic DNES disks on siop even if dlg@'s new midlayer is active. ok marco@, tested by naddy@.
* Bring last drivers fully into the NO_CCB world by replacingkrw2009-11-221-5/+5
| | | | | | | | | | | 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@.
* Put ccb back on free list if we bail out because we can't map thekrw2009-01-181-1/+3
| | | | data buffer.
* Don't lose ccb's if there are problems allocating the structures neededkrw2009-01-181-16/+18
| | | | to issue a command.
* 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@
* Fix redundant device name and/or target printing after callingmiod2008-08-311-3/+3
| | | | sc_print_addr(); ok krw@
* The obvious bzero/memset -> M_ZERO changes.krw2007-09-071-12/+7
|
* Add support for the (non-pci) NCR 53c720/770 in big-endian mode.kettenis2007-08-051-70/+85
| | | | ok martin@, krw@, deraadt@
* turn off SIOP_STATS; ok krwderaadt2007-05-081-2/+2
|
* 'immediatly' -> 'immediately' in comments.krw2006-12-211-2/+2
|
* give scsi controllers a real attach args to fill in when attaching scsibus.dlg2006-11-281-2/+7
| | | | ok miod@ marco@ deraadt@
* - fix and prettify SIOP_DEBUGmartin2006-05-221-6/+11
| | | | | | - print device name on request sense failure ok krw@
* The first thing done when XXX_scsi_cmd() returns TRY_AGAIN_LATER iskrw2005-12-031-6/+1
| | | | | | | | to set xs->error to XS_BUSY. So it is pointless and misleading to set xs->error to XS_TIMEOUT, XS_DRIVER_STUFFUP or XS_BUSY just before returning TRY_AGAIN_LATER. No functional change.
* Un-revert backout to 20051009 and add patches from Martin Bouyer tokrw2005-11-201-37/+86
| | | | | | | | | close NetBSD PR#31990. Fixes interaction with some problematic drives found by miod@, martin@, otto@. Tested martin@ otto@ miod@ ok miod@ mickey@
* revert to 20051009 for now, need to investigate strange behaviour withmartin2005-11-031-58/+35
| | | | | | some controllers discussed with otto@ and henning@, first noted by miod@
* Add handling for IGNORE WIDE RESIDUE messages. Actually calculatekrw2005-10-101-35/+58
| | | | | | | | | resid instead of assuming it is always 0. From bouyer via NetBSD. Note we are now sync'd with the latest (1.78 siop.c, 1.37 siop_common.c) NetBSD code. Tested by various people over the last year+. Didn't solve any of their problems but didn't cause any regression either.
* 'dma' -> 'DMA' (wiz via NetBSD), save a test after TAILQ_FOREACH() bykrw2005-10-081-19/+17
| | | | | initializing siop_cmd to NULL first (matt via NetBSD), remove trailing whitespace (perry vis NetBSD).
* use TAILQ_FOREACHmartin2005-03-121-3/+2
| | | | ok krw@