summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata
AgeCommit message (Collapse)AuthorFilesLines
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.
2013-11-06teach the side-effect free drivers about the partition they are dealingderaadt1-2/+11
by passing a start/length in the HIB_INIT op. Then rebase all hibernate-time block offsets to be relative to the start of that partition. This simplifies things a lot. ok mlarkin
2013-10-14Use DL_SECTOBLK() instead of handrolling same calculation to getkrw1-3/+4
wdsize() return value.
2013-10-14XXsize() returns daddr_t, so calculate the return value in a daddr_tkrw1-2/+2
variable and not (usually) an int. ok miod@
2013-09-27Try harder to ensure wddump() doesn't decrement the countkrw1-6/+7
of sectors to write by one value and increment the address the next i/o will start at by a different amount.
2013-09-18return after done in atascsi_disk_unmap.dlg1-5/+14
2013-09-15Make it clearer that sc_wdc_bio.blkno is actuall a disk hardwarekrw1-8/+9
address by using the DL_BLKTOSEC() and DL_SECTOBLK() defines rather than handrolling the equivalent. Fixes current addition of a 512-byte block value (b_blkno) to a disk hardware address (DL_GETPOFFSET()). Tested on real wd(4) hardware by guenther@.
2013-06-11final removal of daddr64_t. daddr_t has been 64 bit for a long enoughderaadt2-8/+8
test period; i think 3 years ago the last bugs fell out. ok otto beck others
2013-01-17Add a hibernate HIB_DONE op. After the memory-side-effect driver finishesderaadt1-1/+11
IO to the disk, DVACT_RESUME the controller back to normal operation. That allows us to do the full DVACT_POWERDOWN sequence afterwards. ok mlarkin
2012-10-08Revamp the sequences for suspend/hibernate -> resume so that the codederaadt1-21/+5
paths are reflexive. It is now possible to fail part-way through a suspend sequence, and recover along the resume code path. Split DVACT_SUSPEND by adding a new DVACT_POWERDOWN method is used after hibernate (and suspend too) to finish the job. Some drivers must be converted at the same time to use this instead of shutdown hooks (the others will follow at a later time) ok kettenis mlarkin
2012-02-24Correct the spelling of "transferred" and "transferring"guenther1-3/+3
from Tobias Ulmer (tobiasu at tmux.org); ok jmc@, krw@
2011-11-15on failure, the hibernate io function should return an errno type variable,deraadt1-2/+2
instead of 1.
2011-11-14Use a fixed io_page for all hibernate I/O, which is needed formlarkin1-1/+5
ahci_hibernate_io, a skeleton of which is also provided in this diff. This code is from deraadt@. Tested on a few wd machines to ensure it works there as well.
2011-11-13Add some #defines for the various hibernate I/O modes, some of themlarkin1-3/+9
groundwork for *_hibernate_io functions other than wd_hibernate_io These changes were sent to me by deraadt@
2011-09-22KNF of mlarkin's code, requested by him. Some improvements to the interfacederaadt2-5/+5
for talking to the disk driver snuck in. ok mlarkin
2011-08-03Alexander Polakov found a use of an uninitialized pointer in the scsidlg1-1/+2
unmap handling.
2011-07-17Backout a bunch of my SCSI commits from c2k11. At least one of thesematthew1-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@
2011-07-15Cope with the start-dma-before-init errata and some other register setupderaadt1-4/+13
errata for the Serverworks SATA chipset found on the macppc xserve G5. ok jmc