summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata
AgeCommit message (Collapse)AuthorFilesLines
2020-10-15Replace simple one-line bcopy()/memcpy() of faked data into scsi_xfer with callkrw1-3/+4
to scsi_copy_internal_data(). Thus getting xs->resid properly set and adding the usual uio/size sanity checks.
2020-09-22Since dlg@'s 2009 scsi midlayer refactoring the 'struct scsi_generic *cmd'krw1-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@
2020-09-05Replace '32' with SID_SCSI2_ALEN (a.k.a. 31) when building emulated INQUIRYkrw1-3/+3
responses. This is what the SCSI specifications say is the correct value and already used in several cases.
2020-09-03Replace '.response_format = 2' with '.response_format = SID_SCSI2_RESPONSE'.krw1-3/+3
2020-09-02When building emulated INQUIRY results use the SCSI_REV_* #define's tokrw1-3/+3
initialize the 'version' field. Not numbers.
2020-09-01Rename [READ|WRITE]_BIG to [READ|WRITE]_10. Rename struct scsi_rw_big tokrw1-3/+3
struct scsi_rw_10. ok gnezdo@ jmatthew@ (who also did sparc64 compile test)
2020-08-26Remove needless uses of SDEV_ONLYBIG. It was always set when SDEV_UMASS was set,krw1-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@
2020-07-22Nuke unused struct scsi_link members of adapter softc's where thekrw1-2/+1
driver successfully compiles on one or more of amd64, i386, hppa.
2020-07-20Move remaining scsi bus initialization info from "prototype scsi link"krw1-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.
2020-07-19Move the adapter related items (luns, adapter, adapter_target,krw1-6/+6
adapter_buswidth, adapter_softc) from struct scsi_link to struct scsibus_attach_args. Additional compile tests by jmatthew@ (sparc64) and aoyam@ (luna88k).
2020-07-17Always a joker hiding somewhere.krw1-4/+4
Access adapter_buswidth via link->bus->sb_adapter_buswidth.
2020-07-16Access adapter softc via link->bus->sb_adapter_softc.krw1-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.
2020-07-11Expunge some Captain Obvious comments, tweak whitespace a bit, move a debugkrw1-3/+1
statement. All to make upcoming diff(s) smaller and easier to read.
2020-07-02Shuffle things around so that sc->sc_link initialization iskrw1-4/+4
even more concentrated just before config_found().
2020-06-27Nuke trailing whitespace.krw1-6/+6
2020-06-27No need to bzero()/memset() 'struct scsibus_attach_args' variableskrw1-2/+1
immediately before initializing the only field in the struct.
2020-06-24Use SDEV_NO_ADAPTER_TARGET instead of the value that is beingkrw1-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.
2020-02-05Nuke unnecessary abstraction 'scsi_minphys()' which just callskrw1-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().
2020-01-26Shuffle some names around to make reading the code less headachekrw1-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.
2020-01-23Use a consistant idiom/format when declaring scsi_adapter structureskrw1-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@
2020-01-23we've been using LBA48 for < 137GB drives for 17 years, so perhapstedu1-2/+1
we can remove the XXX now.
2019-08-19Remove some unused code left over from an ancient (i.e. 2007) attemptkrw2-25/+2
to present wd disks as sd drives. ok deraadt@
2019-07-07Use timeout_add_msec(9)kn1-3/+4
RECOVERYTIME is twice per second, so sleep for 500 milliseconds and reflect the unit to be clear. OK patrick
2018-11-02Remove unnecessary if/else block, both branches are identical. We canfcambus1-9/+4
in fact use the ATA_DELAY macro directly. Coverity CID 1453008. OK sthen@, kn@
2017-12-30Don't pull in <sys/file.h> just to get fcntl.hguenther1-2/+2
ok deraadt@ krw@
2017-12-30Delete unnecessary <sys/file.h> includesguenther2-4/+2
ok millert@ krw@
2017-12-14Repair flushcache/standby operations to not convert AT_WAIT operationsderaadt1-12/+4
to AT_POLL, which some chip driver underneath cannot handle. tested by bluhm also
2017-10-24remove defines for ioctls the kernel doesn't recognisejsg1-28/+1
ok mpi@
2017-08-23Use the correct argument to sizeof. Coverity CID 1453382.jsg1-2/+2
2017-05-31add some details relating to SATA device power managementjmatthew1-3/+19
part of a diff from Imre Vadasz via sf@
2017-05-31fix SATA_SStatus_DET_OFFLINE value and add newer SStatus bitsjmatthew1-2/+4
from Imre Vadasz via sf@
2017-05-29Add an ioctl to tell storage devices to flush their internal cachessf1-10/+26
Currently implemented for wd and sd. Initially ported from netbsd by pedro@ ok deraadt@
2017-05-04Also pass the blk offset to disk_unbusy(), so that it can pass it toderaadt1-3/+3
the random subsystem as entropy. This value is pretty much unknown, and anyways our entropy input ring does not saturate from knowns. ok mikeb djm
2016-03-15Fix size passed to free(), found the hard way by Nick Permyakovjca1-2/+2
ok deraadt@
2016-01-20Set segflg member of uio struct with symbolic enum valuestefan1-2/+2
instead of using magic numbers. No binary change. Diff from Martin Natano. ok deraadt@
2016-01-03Fix typo in comment.kettenis1-2/+2
Pointed out by mlarkin@
2015-12-29Set UltraDMA transfer mode. Some (early?) SATA drives, such as the Maxtorkettenis2-2/+25
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@)
2015-08-28fairly simple sizes for free(); ok teduderaadt1-5/+5
2015-08-26trivial size to free()deraadt1-2/+2
2015-08-17The 80's called and want their interface back. Remove last fragments ofkrw4-14/+10
ST-506 support. Remove redundant 'precomp' variables/fields and rename remaining few to 'features' to be consistant with the rest of the code. Consensus that no ST-506 disks (requiring ISA cards, <120MB, usually rife with bad sectors that can't be worked around) are still running OpenBSD.
2015-05-15rename the probe and free members of atascsi_methods to ata_probedlg2-7/+7
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.
2015-04-04Use config_suspend() instead of dereferencing ca_activate directly tompi1-6/+2
support drivers that do not need any specific suspend/resume magic and do not have an activate function. config_suspend() will automagically propagate the event to the children of the driver. Needed at least by kauaiata(4/macppc). ok deraadt@, mlarkin@
2015-03-14Remove some includes include-what-you-use claims don'tjsg3-7/+3
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2015-01-27remove the second void * argument on tasks.dlg1-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@
2014-12-09More malloc() -> mallocarray() in the kernel.doug1-5/+5
ok deraadt@ tedu@
2014-09-14remove uneeded proc.h includesjsg3-6/+4
ok mpi@ kspillner@
2014-07-12add a size argument to free. will be used soon, but for now default to 0.tedu2-8/+8
after discussions with beck deraadt kettenis.
2014-07-10remove most of the boolean_t infection outside uvm/ddb/pmap; ok jsgderaadt1-3/+1
2014-07-09Kill unused shutdown hook pointers.mpi1-2/+1
ok miod@, deraadt@, tedu@
2013-12-09replace workq_task_add with a task. stash teh struct in the ata xfer thingdlg2-7/+11
so its now reliable.