summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary if/else block, both branches are identical. We canfcambus2018-11-021-9/+4
| | | | | | | | in fact use the ATA_DELAY macro directly. Coverity CID 1453008. OK sthen@, kn@
* Don't pull in <sys/file.h> just to get fcntl.hguenther2017-12-301-2/+2
| | | | ok deraadt@ krw@
* Delete unnecessary <sys/file.h> includesguenther2017-12-302-4/+2
| | | | ok millert@ krw@
* Repair flushcache/standby operations to not convert AT_WAIT operationsderaadt2017-12-141-12/+4
| | | | | to AT_POLL, which some chip driver underneath cannot handle. tested by bluhm also
* remove defines for ioctls the kernel doesn't recognisejsg2017-10-241-28/+1
| | | | ok mpi@
* Use the correct argument to sizeof. Coverity CID 1453382.jsg2017-08-231-2/+2
|
* add some details relating to SATA device power managementjmatthew2017-05-311-3/+19
| | | | part of a diff from Imre Vadasz via sf@
* fix SATA_SStatus_DET_OFFLINE value and add newer SStatus bitsjmatthew2017-05-311-2/+4
| | | | from Imre Vadasz via sf@
* Add an ioctl to tell storage devices to flush their internal cachessf2017-05-291-10/+26
| | | | | | | Currently implemented for wd and sd. Initially ported from netbsd by pedro@ ok deraadt@
* Also pass the blk offset to disk_unbusy(), so that it can pass it toderaadt2017-05-041-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
* Fix size passed to free(), found the hard way by Nick Permyakovjca2016-03-151-2/+2
| | | | ok deraadt@
* Set segflg member of uio struct with symbolic enum valuestefan2016-01-201-2/+2
| | | | | | | | instead of using magic numbers. No binary change. Diff from Martin Natano. 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-292-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@)
* fairly simple sizes for free(); ok teduderaadt2015-08-281-5/+5
|
* trivial size to free()deraadt2015-08-261-2/+2
|
* The 80's called and want their interface back. Remove last fragments ofkrw2015-08-174-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.
* rename the probe and free members of atascsi_methods to ata_probedlg2015-05-152-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.
* Use config_suspend() instead of dereferencing ca_activate directly tompi2015-04-041-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@
* Remove some includes include-what-you-use claims don'tjsg2015-03-143-7/+3
| | | | | | | 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-143-6/+4
| | | | ok mpi@ kspillner@
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-122-8/+8
| | | | after discussions with beck deraadt kettenis.
* remove most of the boolean_t infection outside uvm/ddb/pmap; ok jsgderaadt2014-07-101-3/+1
|
* Kill unused shutdown hook pointers.mpi2014-07-091-2/+1
| | | | ok miod@, deraadt@, tedu@
* replace workq_task_add with a task. stash teh struct in the ata xfer thingdlg2013-12-092-7/+11
| | | | so its now reliable.
* teach the side-effect free drivers about the partition they are dealingderaadt2013-11-061-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
* Use DL_SECTOBLK() instead of handrolling same calculation to getkrw2013-10-141-3/+4
| | | | wdsize() return value.
* XXsize() returns daddr_t, so calculate the return value in a daddr_tkrw2013-10-141-2/+2
| | | | | | variable and not (usually) an int. ok miod@
* Try harder to ensure wddump() doesn't decrement the countkrw2013-09-271-6/+7
| | | | | of sectors to write by one value and increment the address the next i/o will start at by a different amount.
* return after done in atascsi_disk_unmap.dlg2013-09-181-5/+14
|
* Make it clearer that sc_wdc_bio.blkno is actuall a disk hardwarekrw2013-09-151-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@.
* final removal of daddr64_t. daddr_t has been 64 bit for a long enoughderaadt2013-06-112-8/+8
| | | | | test period; i think 3 years ago the last bugs fell out. ok otto beck others
* Add a hibernate HIB_DONE op. After the memory-side-effect driver finishesderaadt2013-01-171-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
* Revamp the sequences for suspend/hibernate -> resume so that the codederaadt2012-10-081-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
* Correct the spelling of "transferred" and "transferring"guenther2012-02-241-3/+3
| | | | from Tobias Ulmer (tobiasu at tmux.org); ok jmc@, krw@
* on failure, the hibernate io function should return an errno type variable,deraadt2011-11-151-2/+2
| | | | instead of 1.
* Use a fixed io_page for all hibernate I/O, which is needed formlarkin2011-11-141-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.
* Add some #defines for the various hibernate I/O modes, some of themlarkin2011-11-131-3/+9
| | | | | | groundwork for *_hibernate_io functions other than wd_hibernate_io These changes were sent to me by deraadt@
* KNF of mlarkin's code, requested by him. Some improvements to the interfacederaadt2011-09-222-5/+5
| | | | | for talking to the disk driver snuck in. ok mlarkin
* 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@
* Cope with the start-dma-before-init errata and some other register setupderaadt2011-07-151-4/+13
| | | | | errata for the Serverworks SATA chipset found on the macppc xserve G5. ok jmc
* 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).
* macros for TRIMdlg2011-07-081-1/+4
|