summaryrefslogtreecommitdiffstats
path: root/sys/dev/ic/iha.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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@
* 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.
* Shuffle things around so that sc->sc_link initialization iskrw2020-07-021-22/+2
| | | | done just before config_found(), as all other drivers do.
* If the adapter card needs to keep track of its own id on the bus, orkrw2020-07-011-3/+4
| | | | | | | | | | | 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.
* Trailing whitespace is icky. Some KNF whitespace tweakskrw2020-02-181-52/+52
| | | | tossed it too.
* *_minphys() functions that cap i/o sizes at a value larger than thekrw2020-02-151-15/+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-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-3/+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@
* 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@
* Close races where timer is started on a command and then an splbio()krw2012-02-041-3/+5
| | | | | | | | is called before the command is started. This might have resulted in the timeout firing and invalidating the command before it is started. Move the timeout_add_* inside the relevant splbio()/splx(). ok miod@ tedu@
* ansify and de'register some prototypesdhill2012-01-111-205/+76
| | | | ok miod@
* iopoolification. Tested on my Initio INIC-950. Various eyes includingkrw2010-10-031-37/+28
| | | | miod@, oga@, dlg@, matthew@.
* 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@
* New scsi code seems to be stable. Pluck previously identifiedkrw2010-05-201-13/+2
| | | | | | | 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@
* Change the scsi_cmd function member of scsi_adapter from int tokrw2010-03-231-13/+10
| | | | | | | | | | | | | 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-5/+1
| | | | | | in the drivers just before calling scsi_done(). ok dlg@ beck@
* Missing scsi_done() in some error path returning COMPLETE; ok dlg@miod2009-09-041-2/+14
|
* Extend the scsi_adapter minphys() callback to take a struct scsi_link *miod2009-02-161-3/+2
| | | | | | 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-4/+4
| | | | | | 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@
* SCSI_DATA_UIO is never used. Code which checks for it is either dead ormiod2008-09-121-13/+5
| | | | | | commented out, remove it. Unifdef TFS while there. ok marco@ krw@
* fix comments after the members of scsi_adapter were changed.dlg2007-12-291-5/+5
| | | | prompted by krw@
* Take a bit more care to ensure that SCSI_POLL commands always returnkrw2007-11-051-4/+4
| | | | COMPLETE and never SUCCESSFULLY_QUEUED.
* avoid splassert, caused by the fact that iha_main() is calledotto2007-10-181-1/+4
| | | | unprotected by iha_exec_scb(). With help and ok miod@
* ``it's'' -> ``its'' when the grammar gods require this change.miod2007-04-101-2/+2
|
* 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.
* Don't tempt fate by TAILQ_REMOVE()'ing inside TAILQ_FOREACH(), even ifkrw2005-11-051-23/+12
| | | | | | we currently return immediately after the remove. Use for() idiom instead of TAILQ_FOREACH. Make clear we are doing a TAILQ_REMOVE() by eliminating wrapper function.
* Rename a few defines to avoid namespace pollution. The only one used was 'READ' which is now 'NVREAD'.krw2004-01-191-2/+2
| | | | Potential conflict with SCSI 'READ' spotted by tdeval@.
* typos from Tom Cosgrove;jmc2003-10-211-3/+3
| | | | | | | | 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
* As long as I am here pull in some useful changes from NetBSD.krw2003-03-301-66/+68
| | | | | | 1) Eliminate some magic numbers. 2) Eliminate some double semi-colons. 3) Rename iha_scsi_req_q to iha_scb.
* A few final (I hope) tweaks to the dma fixes.krw2003-03-291-20/+42
| | | | | | | | | | | | 1) Return XS_DRIVER_STUFFUP if request sense cannot be loaded. 2) Try to avoid bus_dmamap_unload()'ing maps that have already been unloaded. 3) Try to avoid bus_dmamap_load()'ing maps that are loaded. 4) Be extra paranoid and ensure bus_dmamap_sync()'s are done before a bus_dmamap_unload().
* Another chunk of bus_dma fixes. May actually approach correctness now.krw2003-03-291-121/+158
| | | | | | | | | | | | | | | | | | | | | | 1) Actually map and sync scatter gather list that is also DMA'd. 2) Actually map and sync request sense buffer. 3) Actually POSTREAD/WRITE sync data buffer after I/O, rather than skipping it because the I/O was successful and no chars were left to xfer. 4) Eliminate extra fields, clarify some names, reorder fields to clarify their use. 5) Put common scatter gather preparation logic into separate function. 6) If insertion of request sense command fails, complete active command with XS_SENSE, but zero'd sense data. 7) Eliminate physical address arithmetic as much as possible, centralizing remaining manipulations in code actually sending addresses to adapter.
* Use sc_print_addr() where possible to improve messages.krw2003-03-291-17/+23
| | | | | | Put debug messages in #ifdef sections. Eliminate a less than useful error message.
* Fix REQUEST SENSE handling based on lessons learned struggling withkrw2003-03-281-18/+24
| | | | | | | | | | | | | | | | | | osiop. 1) bus_dmamap_sync(POSTREAD) the request sense buffer *before* copying it to xs->sense. 2) Always terminate timeout on completion of command, starting new one for any REQUEST SENSE that is issued for non-polling commands. 3) Use pScb->SCB_Flags rather than xs->flags to ensure correct flags are used during REQUEST_SENSE processing. 4) bzero() sense buffer before reading data into it. This fixes a long standing problem where my Yamaha SCSI CD reported bogus errors during probe.
* Rework iha copyight verbiage to make clear what needs to be clear forkrw2002-11-141-18/+9
| | | | | | it to remain in the tree. With agreement of Initio. ok deraadt@
* Remove trailing '\n's from panic messages.krw2002-10-091-2/+2
| | | | | | Started by a commit to siop from provos@netbsd.org. ok miod@ millert@
* fix the use of "cuz" in the tree; these are all in commentsjsyn2002-06-091-2/+2
| | | | noticed by aaron@, recommended by deraadt@
* First round of __P removal in sysmillert2002-03-141-90/+90
|
* Remove local defines for SCSI status codes and use those nowkrw2001-11-111-5/+5
| | | | defined in scsi_all.h.
* Switch everything to the new bus_dmamap_sync API.art2001-11-051-3/+3
| | | | | Most work by Wilbern Cobb <vedge@csoft.org> with some fixes from me, mickey@ and drahn@.
* Andreas Gunnarsson found a bug in iha that causes system crasheskrw2001-10-141-5/+3
| | | | | | | | | | | | | | | | when running a DIAGNOSTIC kernel. This was exposed by the recent migration of the SCSI layer to use pools. timeout_del() was being called on de-allocated memory after every completed SCSI command. Which worked as long as the memory was not reused or zapped ... This patch, slightly modified from Andreas's original diff, moves the timeout_del() to before the call to scsi_done() which de-allocates the memory holding the timeout. All scb's that start a timeout go through this logic and have the timeout_del() called. ok millert@ deraadt@
* Prepare for transition to 5-parameter bus_dmamap_sync() by creating andkrw2001-08-261-5/+7
| | | | | | | | | | using *_bus_dmamap_sync() defines that are defined appropriately depending on __HAS_NEW_BUS_DMAMAP_SYNC. Most of the code changes are simple reversions to the original NetBSD code. Slip in a siop_script_sync() instead of a manually done code section.
* Change references to inic-950 to inic-940/950 to reflect chipskrw2001-07-131-46/+33
| | | | | | | | | | | | | | | actually supported. Update copyright to include 2001. Fold iha_se2_rd_all() into iha_read_eeprom(), eliminating magic number 31 at the same time, calculating correct offset of checksum at run time instead. Eliminate static global variable iha_nvram in favour of dynamic variable in iha_init_tulip(), which is only place it is used. Rectify a few typos in comments.
* Remove static'ness of functions in line with normal OpenBSDkrw2001-07-131-589/+415
| | | | | | | | | | | | | preferences. Rename tul_* functions/variables iha_* for consistancy, since all are now visible. As updating the EEPROM did not work, don't try. Remove now unused static dftNvram variable, and functions used only in trying to write it to EEPROM. Make iha_rate_tbl a const.
* Use offsetof() from sys/param.h, not a local define.krw2001-07-101-3/+3
|
* Minor code clean ups.krw2001-07-091-75/+62
| | | | | | | | | | | | | | | Rename some functions for better consistancy/clarity, e.g. tul_wdtr_done -> tul_wide_done tul_msgout_wide -> tul_msgout_wdtr Consolidate extended message generation into new function tul_msgout_extended() by using HCS_Msg[] array, replacing several repetitive bus_write_*() code sections. A couple of minor code clarifications to eliminate extra return statements and make absolutely sure HCS_ActScb is NULL during a reselect.
* Fix incorrect logic 'optimization' so that sync is negotiated even ifkrw2001-07-091-2/+4
| | | | | | | wide is not. Now my CD drives on the narrow channel of the INI-9100UW negotiate to the same configuration they do on other cards.
* Tone down the verbosity level slightly on the iha driver, printkrw2001-02-201-34/+33
| | | | | | | | | | | negotiation results on one line, during boot polling only, in same format as now used in siop. Move checking for probe INQUIRY commands to poll loop rather than checking every good I/O. Remove an unwanted debug statement and unneeded (resolved) XXX comment.