summaryrefslogtreecommitdiffstats
path: root/sys/dev/ic/mpi.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Since dlg@'s 2009 scsi midlayer refactoring the 'struct scsi_generic *cmd'krw2020-09-221-3/+3
| | | | | | | | | | | | 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@
* Remove needless uses of SDEV_ONLYBIG. It was always set when SDEV_UMASS was set,krw2020-08-261-2/+1
| | | | | | | | and was always checked in concert with SDEV_ATAPI. Just rely on SDEV_ATAPI and SDEV_UMASS in all but the one place sd(4) where SDEV_ONLYBIG is set independently of SDEV_ATAPI/_UMASS. ok jmatthew@
* Move remaining scsi bus initialization info from "prototype scsi link"krw2020-07-201-7/+6
| | | | | | | 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-6/+6
| | | | | | | | 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.
* Where we have a pointer (sc) to the relevant adapter_softc, usekrw2020-07-131-2/+2
| | | | | &sc->sc_dev to get a device pointer rather than using the void * whence we obtained 'sc'.
* 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.
* Cache the adapter's port_wwn and node_wwn in mpi_softc, not thekrw2020-07-111-3/+5
| | | | | | sc_link. Keeps all the sc_link initialization in one easy target, er, place.
* Expunge some Captain Obvious comments, tweak whitespace a bit, move a debugkrw2020-07-111-4/+2
| | | | statement. All to make upcoming diff(s) smaller and easier to read.
* No need to bzero()/memset() 'struct scsibus_attach_args' variableskrw2020-06-271-2/+1
| | | | immediately before initializing the only field in the struct.
* Revert r1.207. Apparently mpi(4) on sparc64 blows up ifkrw2020-04-211-6/+7
| | | | | | | | | sc_link.openings is greater than 34. Encountered by Sigi Rudzio on his Blade 2500, who kindly did some testing to discover that the answer is 34, not 42. Nuke some whitespace on the way by.
* Nuke *_minphys() functions that either simply apply MAXPHYS or dokrw2020-02-131-11/+2
| | | | | | | | nothing at all. MAXPHYS will be applied in minphys() and nothing at all, well, doesn't do anything. Also remove any '#define <blah> MAXPHYS' statements used solely to disguise MAXPHYS in said functions.
* Prototypes should not name the parameters.krw2020-01-271-2/+2
|
* 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-6/+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@
* Convert infinite sleeps to {m,t}sleep_nsec(9).mpi2019-12-311-2/+2
| | | | ok kn@
* Unleash all the available openings and let the midlayer sort thingskrw2019-11-141-2/+2
| | | | | | out like other "modern" devices. ok dlg@
* return ENOTTY rather than EINVAL to indicate an ioctl hasn't been handledjmatthew2018-08-141-2/+2
| | | | ok dlg@ deraadt@ kettenis@
* Make error handling (esp. DATA_UNDERRUN) clearer and avoid losing residkrw2016-08-171-7/+8
| | | | | | value. Specs from mikeb@, ok dlg@
* change some types in bio from u_quad_t to uint64_t, and fix casts indlg2016-08-141-3/+3
| | | | | | drivers that fill that field in too. quad types are going away.
* replace pointer arithmetic and casts with offsetofjsg2015-10-231-5/+5
| | | | ok dlg@ krw@
* sizes for free(); ok sthenderaadt2015-09-091-11/+12
|
* Fix some misuse of the | operator. In particular | has higherjsg2015-05-041-2/+2
| | | | | precedence than ?: ok guenther@ krw@ miod@
* 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@
* remove the second void * argument on tasks.dlg2015-01-271-4/+4
| | | | | | | | | | | | | | | | | | | | | when workqs were introduced, we provided a second argument so you could pass a thing and some context to work on it in. there were very few things that took advantage of the second argument, so when i introduced pools i suggested removing it. since tasks were meant to replace workqs, it was requested that we keep the second argument to make porting from workqs to tasks easier. now that workqs are gone, i had a look at the use of the second argument again and found only one good use of it (vdsp(4) on sparc64 if you're interested) and a tiny handful of questionable uses. the vast majority of tasks only used a single argument. i have since modified all tasks that used two args to only use one, so now we can remove the second argument. so this is a mechanical change. all tasks only passed NULL as their second argument, so we can just remove it. ok krw@
* be less confusing to the compiler when setting up the sge.dlg2014-09-171-2/+3
|
* mark the interrupt handler mpsafe, and drop the kernel lock in the scs_cmddlg2014-09-151-15/+26
| | | | | | paths. take it again when going back to other parts of the kernel. tested by and ok kettenis@
* remove uneeded proc.h includesjsg2014-09-141-2/+1
| | | | ok mpi@ kspillner@
* tasks dont need a mutex and a semaphore to protect against multiple usesdlg2014-09-031-27/+3
| | | | | | of the task structure like workq tasks did. tested on an fc929
* move mpi(4) from workq to taskqblambert2014-09-011-3/+5
| | | | ok dlg@
* Some reallocarray() use; review Jean-Philippe Ouellet, patrick keshishianderaadt2014-07-131-6/+6
| | | | ok tedu
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-14/+14
| | | | after discussions with beck deraadt kettenis.
* print the board name and firmware revision like we do on mpii anddlg2014-04-161-1/+48
| | | | nvme and other stuff.
* use lemtohXX and htolemXX as much as possibledlg2014-03-251-41/+39
|
* when reading from the chip you use letoh32, not htole32.dlg2014-03-251-2/+2
| | | | jmatthew@ agrees with me
* use htolemXX and lemtohXX in the scsi_cmd paths.dlg2014-03-241-6/+6
| | | | | | apart from the flags handling in sgls, this shrinks the io hot path on sparc64 and powerpc a lot. its pretty much the same on i386/amd64/alpha.
* mpi scatter gather lists are 24 bytes long and next to each other indlg2014-03-241-27/+20
| | | | | | | | | | | | | | memory. that means you cant do 8 byte loads and stores on the sg_addr member cos it wont be 8 byte aligned half the time which makes strict alignment archs (ie, the fun ones ones) upset. annotate the sge as being 4 byte aligned. replace the sg_addr member with sg_addr_lo and sg_addr_hi. replace htole64 assignment of the sg addr with a wrapper that does the right thing with a couple of htolem32 calls. generated code shrinks again.
* factor out the setting of the request context field so mpi_start does itdlg2014-03-241-16/+7
| | | | | | | | on behalf of all its callers. use htolem32 and lemtoh32 to handle the message context. both save bytes.
* bzero to memsetdlg2014-01-201-13/+13
|
* bcopy to memcpydlg2014-01-201-6/+8
|
* data transfers suit STREAMING dma maps.dlg2013-01-181-2/+2
|
* mikeb pointed at that the interrupt status register read in mpi_intr wasdlg2013-01-171-2/+6
| | | | important, as per r1.167.
* we dont need to read the interrupt status register to know if we havedlg2013-01-171-7/+7
| | | | | | | | | | | any work to do in the interrupt handler, or to clear it. the relevant bits indicate whether there's work on the doorbell and clear when there isnt. we need to read the doorbell if there is work to do, so lets just go that straight away anyway. get rid of bus_space_barriers in the io path. barriers are for enforcing ordering. the doorbell reads and writes dont depend on any other register values so ordering isnt applicable here.
* treat DVAs as 64bits all the time so we can avoid ugly casts and shifts indlg2013-01-171-2/+2
| | | | the code.
* several tweaks to make mpi(4) work for vmware emulated sas adapters.dlg2012-09-181-12/+14
| | | | | | | | | | | | | | 1. vmware advertises more scsi targets than command slots, so the maths we did for openings gave each target 0 openings. always advertise at least 16 openings. 2. if we cant configure the ATA queue depth, dont fail to attach the controller whole. finally, improve the error reporting during attach so its more obvious where things fail. mostly figured out by jmatthew@
* Use sg_addr instead of sg_lo_addr, leftovers from last commit.haesbaert2012-09-121-13/+9
| | | | ok dlg
* Make sure we don't sleep on autoconf.haesbaert2012-09-121-2/+2
| | | | ok mikeb
* htole64 works as good as htole32 twice for dma virtual addresses.dlg2012-08-261-20/+7
|
* mpi_get_ccb and mpi_put_ccb are only called via iopools now, so changedlg2012-01-161-9/+11
| | | | | their types to fit the iopools api rather than doing awful typecasts to shove them into iopool_init.
* 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@