summaryrefslogtreecommitdiffstats
path: root/sys/dev/ic/trm.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Since dlg@'s 2009 scsi midlayer refactoring the 'struct scsi_generic *cmd'krw2020-09-221-9/+9
| | | | | | | | | | | | 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@
* Access adapter softc via link->bus->sb_adapter_softc.krw2020-07-161-3/+3
| | | | | | | | 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-2/+2
| | | | (scsi_link.adapter_softc) to a pointer of a particular softc type.
* Shuffle things around so that sc->sc_link initialization iskrw2020-07-021-21/+1
| | | | done just before config_found(), as all other drivers do.
* *_minphys() functions that cap i/o sizes at a value larger than thekrw2020-02-151-19/+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),
* Remove pointless intermediate scsi_adapter field of softc by pointingkrw2020-02-061-5/+2
| | | | sc_link.adapter at trm_switch directly.
* Soooooo much eye-searing trailing whitespace.krw2020-02-061-196/+196
|
* Shuffle some names around to make reading the code less headachekrw2020-01-261-2/+2
| | | | | | | | 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-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@
* add missing braces to code under #ifdef TRM_DEBUG0jsg2015-05-071-2/+4
| | | | ok krw@
* 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.
* Expunge debug code that uses an uninitialized variable. Without thekrw2013-07-121-6/+1
| | | | | | variable the message doesn't make much sense. Reported by Maxime Villard.
* Make sure splx() is called before exiting trm_StartWaitingSRB().krw2011-12-031-2/+3
| | | | Found by Jan Klemkow. Thanks!
* No need to splbio/splx in the interrupt routine. It's alreadykrw2011-04-271-12/+3
| | | | done around the manual invocation. Prompted by dlg@.
* Iopoolification. Installed snapshot over it and it even booted.krw2011-04-261-73/+76
| | | | ok dlg@ matthew@
* Make error message specify if a REQUEST SENSE has timed out, not thekrw2010-11-021-4/+12
| | | | | | original command. Return xs->error = XS_SENSE, when REQUEST SENSE times out, rather that XS_TIMEOUT. Reduces many useless retries of commands getting sense errors.
* Add DEBUG0 printf() for unexpected reselects. No functional change.krw2010-11-021-1/+5
|
* Consolidate duplicated code removing things from the 'going' queue.krw2010-11-021-26/+22
| | | | No functional change.
* Clean up some printf's, most but not all in DEBUG0 blocks, by usingkrw2010-11-021-35/+41
| | | | sc_print_link() properly and consistently. No functional change.
* Make trm(4) work again. Avoid use-after-free of xs fields, don'tkrw2010-10-091-7/+13
| | | | | | | | | discard devices because 2nd INQUIRY (a.k.a. scsi_inquire_vpd()) fails, avoid NULL dereferences, reset bus after a timeout since I can't see how else to account for an unsupported instruction (e.g. 0x9e, a.k.a. READ_CAPACITY_16). All found while preparing for iopoolification.
* add format strings implied by surplus argumentsjsg2010-08-201-2/+2
| | | | found via the clang static analyser
* 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@
* Remove more splbio/splx pairs from around scsi_done() calls.krw2010-06-191-11/+3
| | | | From Matthew Dempsky.
* BUS_DMA_ZERO instead of alloc, map, bzero.oga2010-05-191-3/+2
| | | | ok krw@
* Change the scsi_cmd function member of scsi_adapter from int tokrw2010-03-231-11/+12
| | | | | | | | | | | | | 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@
* Eliminate double call to scsi_done() when polling.krw2010-02-271-2/+1
| | | | Reported by and fix tested by peters at schwertfische dot de.
* A couple of missed ITSDONE setting before scsi_done().krw2010-01-101-8/+1
| | | | | | | seagate/trm/aha1742 were the only drivers paranoid enough to check ITSDONE on getting the xs to execute. And optimistic enough to think simply restting the flag would be a good thing. Have them chill out like everyone else, reducing ITSDONE noise some more.
* Set ITSDONE in scsi_done() and zap trivial instances of setting itkrw2010-01-101-3/+1
| | | | | | in the drivers just before calling scsi_done(). ok dlg@ beck@
* In trm_scsi_cmd(), in an splbio() protected block, don't bother doing splx()miod2009-09-241-5/+1
| | | | | and splbio() around a simple timeout_set() call, it won't gain us anything. ok dlg@ krw@
* call scsi_done before returning COMPLETEdlg2009-09-031-1/+15
|
* Extend the scsi_adapter minphys() callback to take a struct scsi_link *miod2009-02-161-3/+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.
* Replace timeout_add(msecs * hz / 1000) with timeout_add_msec(msecs).grange2009-01-211-3/+3
| | | | | | No functional changes. ok krw@ miod@
* 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-4/+3
| | | | sc_print_addr(); ok krw@
* The obvious bzero/memset -> M_ZERO changes.krw2007-09-071-4/+3
|
* The first thing done when XXX_scsi_cmd() returns TRY_AGAIN_LATER iskrw2005-12-031-2/+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.
* Eliminate 'Overlapping Command Attempted' errors on non-tagged drives bykrw2005-11-051-30/+14
| | | | | | | | a) Ensuring only one command is started at a time on such targets. b) Not fiddling with pSRB fields until it is really going to be started. c) Testing for a pending interrupt before starting to send stuff to the card. Found when testing queue.h stuff.
* Don't remove elements inside TAILQ_FOREACH. Change to usual for()krw2005-11-031-3/+4
| | | | idiom.
* Do not fill more than the first three fields of cfdriver structures unlessmiod2004-01-141-6/+2
| | | | necessary. No functional change.
* typos from Jonathon Gray;jmc2003-11-081-2/+2
|
* typos from Tom Cosgrove;jmc2003-10-211-6/+6
| | | | | | | | Tom: I did not commit a couple of your changes. i did not include some punctuation fixes (full stops, etc.) mnemorable -> mnemonic: i decided memorable was probably better instrunctions -> instruction: i kept the plural
* Add trm - driver for Tekram TRM-S1040 cards (DC395U/UW/F,DC315/U).krw2002-02-181-0/+2980
Thanks to Tekram for donating a couple of cards and a NetBSD driver by Erich Chen of Tekram. Thanks to Martin Akesson for a first port of the NetBSD driver to OpenBSD and thanks to Ashley Martens for the major cleanup to make it presentable and style(9)ish. Only tested on i386 at this time.