summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/atascsi.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Replace simple one-line bcopy()/memcpy() of faked data into scsi_xfer with callkrw2020-10-151-3/+4
| | | | | to scsi_copy_internal_data(). Thus getting xs->resid properly set and adding the usual uio/size sanity checks.
* Since dlg@'s 2009 scsi midlayer refactoring the 'struct scsi_generic *cmd'krw2020-09-221-12/+12
| | | | | | | | | | | | 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@
* Replace '32' with SID_SCSI2_ALEN (a.k.a. 31) when building emulated INQUIRYkrw2020-09-051-3/+3
| | | | | responses. This is what the SCSI specifications say is the correct value and already used in several cases.
* Replace '.response_format = 2' with '.response_format = SID_SCSI2_RESPONSE'.krw2020-09-031-3/+3
|
* When building emulated INQUIRY results use the SCSI_REV_* #define's tokrw2020-09-021-3/+3
| | | | initialize the 'version' field. Not numbers.
* Rename [READ|WRITE]_BIG to [READ|WRITE]_10. Rename struct scsi_rw_big tokrw2020-09-011-3/+3
| | | | | | struct scsi_rw_10. ok gnezdo@ jmatthew@ (who also did sparc64 compile test)
* 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@
* Nuke unused struct scsi_link members of adapter softc's where thekrw2020-07-221-2/+1
| | | | driver successfully compiles on one or more of amd64, i386, hppa.
* Move remaining scsi bus initialization info from "prototype scsi link"krw2020-07-201-4/+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).
* Always a joker hiding somewhere.krw2020-07-171-4/+4
| | | | Access adapter_buswidth via link->bus->sb_adapter_buswidth.
* Access adapter softc via link->bus->sb_adapter_softc.krw2020-07-161-13/+13
| | | | | | | | 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.
* Expunge some Captain Obvious comments, tweak whitespace a bit, move a debugkrw2020-07-111-3/+1
| | | | statement. All to make upcoming diff(s) smaller and easier to read.
* Shuffle things around so that sc->sc_link initialization iskrw2020-07-021-4/+4
| | | | even more concentrated just before config_found().
* Nuke trailing whitespace.krw2020-06-271-6/+6
|
* No need to bzero()/memset() 'struct scsibus_attach_args' variableskrw2020-06-271-2/+1
| | | | immediately before initializing the only field in the struct.
* Use SDEV_NO_ADAPTER_TARGET instead of the value that is beingkrw2020-06-241-2/+2
| | | | | | | aassigned to adapter_buswidth to indicate the adapter is not a target on the bus. ok dlg@ as part of a larger diff.
* Nuke unnecessary abstraction 'scsi_minphys()' which just callskrw2020-02-051-2/+2
| | | | | | 'minphys()'. Just use & check for NULL instead, since 'minphys()' is always called on the code path ([cd|sd|st]minphys) that calls physio().
* 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.
* 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@
* Remove some unused code left over from an ancient (i.e. 2007) attemptkrw2019-08-191-21/+1
| | | | | | to present wd disks as sd drives. ok deraadt@
* Use the correct argument to sizeof. Coverity CID 1453382.jsg2017-08-231-2/+2
|
* Fix size passed to free(), found the hard way by Nick Permyakovjca2016-03-151-2/+2
| | | | ok deraadt@
* Fix typo in comment.kettenis2016-01-031-2/+2
| | | | Pointed out by mlarkin@
* Set UltraDMA transfer mode. Some (early?) SATA drives, such as the Maxtorkettenis2015-12-291-1/+21
| | | | | | | | | | | 7Y250M0, refuse to do DMA unless the transfer mode has been set. This causes reads (and presumably writes) to time out. Unlike the wdc code, this only sets the UltraDMA transfer mode. If we ever want to support ancient PATA drivers through the atascsi layer, we probably need to set the PIO and/or MWDMA transfer modes as well. ok jmatthew@, dlg@)
* fairly simple sizes for free(); ok teduderaadt2015-08-281-5/+5
|
* rename the probe and free members of atascsi_methods to ata_probedlg2015-05-151-4/+4
| | | | | | | | and ata_free. this makes them consistent with the rest of the members, and lets me #define free to weird debug things in the kernel without screwing these files up.
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-3/+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-5/+5
| | | | | | | | | | | | | | | | | | | | | 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@
* More malloc() -> mallocarray() in the kernel.doug2014-12-091-5/+5
| | | | ok deraadt@ tedu@
* remove uneeded proc.h includesjsg2014-09-141-2/+1
| | | | ok mpi@ kspillner@
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-6/+6
| | | | after discussions with beck deraadt kettenis.
* replace workq_task_add with a task. stash teh struct in the ata xfer thingdlg2013-12-091-6/+7
| | | | so its now reliable.
* return after done in atascsi_disk_unmap.dlg2013-09-181-5/+14
|
* Alexander Polakov found a use of an uninitialized pointer in the scsidlg2011-08-031-1/+2
| | | | unmap handling.
* Backout a bunch of my SCSI commits from c2k11. At least one of thesematthew2011-07-171-10/+8
| | | | | | is causing problems when trying to boot sparc64 from an isp(4). Verified to fix the sparc64/isp(4) regression by krw@; ok deraadt@
* translate the scsi UNMAP command into an equiv TRIM, and advertise UNMAPdlg2011-07-091-2/+126
| | | | | | | | | | support via the thin provisioning page. this emul is a bit unreliable since atascsi needs to allocate memory for the TRIM command to use, but we figure that the world wont end if we lose a TRIM unlink real io. ok matthew@
* Fix fallout from my previous SCSI refactoring diff (movingmatthew2011-07-091-7/+9
| | | | | | | | | adapter_buswidth to sc_targets): gdt(4) and atascsi(4) still used it in other ways. Apply appropriate fixes; tested on ahci(4). ok krw@
* First batch of converting SCSI HBAs from setting saa_targets andmatthew2011-07-081-3/+3
| | | | | | saa_luns instead of adapter_buswidth and luns in the prototype link. ok dlg@, miod@
* fill in the ata vpd page as best we can. i dont know how to fill in thedlg2011-07-081-5/+52
| | | | | | | device signature so i left it blank, and the identify is the cached copy in the port structure. i filled the SAT vendor stuff in as "OpenBSD", "atascsi", osrelease.
* provide the thin provisining vpd page if the disk does trim. only claimdlg2011-07-081-4/+40
| | | | to do WRITE SAME 16 for now (which is all we do).
* some trim cleanups and additions.dlg2011-07-081-9/+17
| | | | | | use less magic numbers when check the block limits for trim. fill in the block limits vpd page with some conservative numbers about how much unmap we can do at a time (~32MB over 64 descriptors).
* i forgot to set the sector_count when translating WRITE SAME 16dlg2011-07-051-2/+9
| | | | | | into DSM/TRIM commands. found by tedu
* Laurence Tratt reported that his "Intel 6 Series AHCI" ahci(4) nomatthew2011-06-211-4/+3
| | | | | | | | | longer detects his OCZ Vertex 3 after atascsi.c r1.104. For some reason, the first IDENTIFY command issued silently fails without any notification. In lieu of a better fix, workaround this for now by allowing IDENTIFY to be reissued a second time for non-PMP disks. Discussed with jmatthew@ and dlg@; ok dlg@
* Small refactoring of atascsi and fix non-data ATA commands to not setmatthew2011-06-021-48/+65
| | | | | | ATA_F_PIO or ATA_F_READ. ok dlg@
* Move ata_put_xfer() from ata_xfer to atascsi_methods. It's just sillymatthew2011-05-081-3/+5
| | | | | | | | to have a non-changing function pointer be part of an object rather than it's virtual method table. ok dlg@; tested on ahci(4) by Mattieu Baptiste, jasper@, and Jason Crawford; no sili(4) testers, but identical changes to ahci(4)
* Go back to only attempting one IDENTIFY command against directlymatthew2011-05-051-5/+6
| | | | | | | | | attached devices as in the pre-port-multiplier code. (Devices attached via port multipliers still get multiple attempts though.) Also don't bother sleeping after the last iteration if all attempts failed. Discussed with dlg@ and Jonathan Matthew; ok dlg@
* Fix a few off-by-1 errors in atascsi.matthew2011-04-271-5/+5
| | | | ok dlg@
* Safer, big mem friendly, allocation of identify buf that is thekrw2011-04-021-5/+6
| | | | | | target of DMA. ok dlg@ deraadt@ thib@
* Initialize stack memory before use. Found with clang.matthew2011-02-031-1/+2
| | | | ok dlg@