summaryrefslogtreecommitdiff
path: root/sys/dev/ata
AgeCommit message (Collapse)Author
2010-06-19Remove more splbio/splx pairs from around scsi_done() calls.Kenneth R Westerback
From Matthew Dempsky.
2010-06-07partial backout of 1.81 as invoking standby in shutdownJonathan Gray
breaks at least socppc and armish
2010-05-26Reintroduce bufqs. A few changes since it was backed out after some goodThordur I. Bjornsson
comments from dlg@. No need for a separate bufq.h, keep all of in buf.h; As requested by kittens and deraadt. Only sd(4) and wd(4) for now. The rest of the drivers will be converted soon, also other goodies like heuristics for sd(4) for selecting the bufq type and the death of disksort() are forthcoming. Tested on: i386, amd64, sparc64, macppc, loongson and alpha by myself and phessler. OK art@, beck@, kettenis@, oga@
2010-05-26the addr field in read cap 16 is 8 bytes, not 4. pity, i had really bigDavid Gwynne
disks for a few minutes there.
2010-05-24Flush cache before suspend.Mark Kettenis
ok krw@, marco@
2010-05-23Place drive in standby mode before shutdown. Avoids the loud click heard onMark Kettenis
many laptops when powering them down. ok jsg@, oga@, krw@
2010-05-18dont let sys/ioctl.h imply that you get the ioctls in dkio.h. thisDavid Gwynne
gets rid of #include <sys/dkio.h> in sys/ioctl.h and adds #include <sys/dkio.h> to the places that actually want and use the disk ioctls. this became an issue when krw@'s X build failed when he was testing a change to dkio.h. tested by krw@ help from and ok miod@
2010-05-05map the ATA data set management stuff (ie, trim) to the SCSI thinDavid Gwynne
provisioning bits in read cap 16
2010-04-29Revert r1.80, leaving iopools in place. Fixes PR#6365. Why WD3200KS-00PKenneth R Westerback
disks on ATI SBx00 care is mysterious but let's keep them working. Fix tested by Josh Elsasser, submitter of PR#6365. Thanks! ok dlg@
2010-04-23Recycle unused disklabel fields in order to create a disklabel uniqueJoel Sing
identifier, allowing the disk to be identified without relying on the device name. ok deraadt@ krw@ beck@ marco@ todd@
2010-04-23the SAT spec from t10.org defines messages for tunnelling ATA commands overDavid Gwynne
SCSI when you're talking to a scsi to ata translation layer (satl). this implements the ata command ioctl handler in scsi_ioctl.c that wraps the ata command requests up in these scsi commands and then issues them against the hardware. this cuts atascsi over to interpreting these scsi commands rather than the ioctls directly. this should allow mpi users (with a relatively recent firmware) to use atactl against their SATA disks. i cant test cos my mpi(4) parts are too old to either support these scsi commands or too old to take recent firmwares. ok marco@ @krw tested by krw@ and me on ahci/atascsi
2010-04-22cut atascsi over to providing and using iopools. this gets rid of NO_CCBDavid Gwynne
and makes the ioctl path more reliable on busy disks by allowing it to sleep in the runqueue for an io to use. mk@ did the original diff and figured most of the problems out. ok mk@
2010-04-19move the stupid throwing away of ata_xfers out the run of the first scsiDavid Gwynne
inquiry against the device up to when the port is probed. this has been bugging me for ages.
2010-04-11Send "STANDBY IMMEDIATE" command to ATA disks upon suspend. For this to work,Mark Kettenis
pciide(4) needs to formward DVACT_SUSPEND and DVACT_RESUME events to its children, so do that. Gets rid of the nasty "click" sound from the disk on many laptops. ok marco@, jsg@
2010-04-05fill in the the lowest aligned logical block address field. itDavid Gwynne
indicates the LBA of the first logical block that is located at the beginning of a physical block implemented as best as i can by my understanding of the spec. not tested yet.
2010-04-05populate the logical per physical exponent of the read cap 16 reply byDavid Gwynne
factoring the processing that the limits vpd page does out. this will be easier when i get hold of a disk that does provide values in these ata identify fields.
2010-04-05add support for READ_CAPACITY_16.David Gwynne
2010-04-05add support for ata disks with block sizes other than 512 bytes. i haventDavid Gwynne
ever seen one, but the spec describes how to do it.
2010-04-03byteswap the cmdset word properly so we enable the right features onDavid Gwynne
bigendian archs.
2010-04-03remove some debug outputDavid Gwynne
2010-04-03add support for emulating the disk characteristics and disk limits vpdDavid Gwynne
pages. this if the first step in figuring out if disks use a different physical block size compared to the logical block size they present to the operating system.
2010-03-23Change the scsi_cmd function member of scsi_adapter from int toKenneth R Westerback
void. Use XS_NO_CCB error in the scsi command (xs) to report the NO_CCB condition. Eliminates all SUCCESSFULLY_QUEUED and COMPLETE confusion and untangles the midlayer from the adapter a bit more. Eyes and some fixes by miod@ There may be some compile issues on little used (i.e. I don't have any) drivers but the change is mechanical and thus easy to remedy. ok dlg@
2010-01-09Zap all setting of ITSDONE in drivers that don't look at it. NobodyKenneth R Westerback
else cares so it's just noise. Drivers that actually look at ITSDONE are unchanged. ok marco@ (for his files) dlg@ beck@
2009-12-08the ata identify structure is stupid. its full of buffers you haveDavid Gwynne
to swap to use. this diff doesnt swap fields the identify structure when its fetched, but adds a function that swaps them and copies them into a destination buffer. there is no functional change to the existing users of these fields, specifically the scsi inquiry faker and the device serial vpd page. this does fix the devid vpd page though. if a disk has a wwn we now present it correctly.
2009-12-08krw and marco found another problem with my atascsi chanages.David Gwynne
turns out you cant send atapi devices the ata IDENTIFY command, they dont grok it. you have to send a PACKET IDENTIFY instead, which is exactly the same but with a different command id. this diff changes it so we send a PACKET IDENTIFY to atapi devices. my diff "broke" this because it actually checks to see if the IDENTIFY succeeded rather than just completed. the previous code was wrong with regard to atapi devices. it is just lucky we dont use the IDENTIFY output for atapi devs. my apologies to marco@ and krw@
2009-12-07oops, wrong version of previous diff.David Gwynne
we have to exec a command (with ata_exec) before we check if its done with ata_polled. of course an unstarted command will not be done. found by and debugged with krw@ ok krw@
2009-12-07get rid of the return codes from command submission, ata_cmd handlersDavid Gwynne
now return void. all state about a command is now represented within the ata_xfer structure, and all layers using it (both hba and atascsi) now check only ata_xfer. this relies on my scsi midlayer changes. it was written just before the second last backout of the midlayer.
2009-10-22gc unused globalDavid Gwynne
2009-10-13Get rid of devact enum, substitute it with an int and coresponding defines.Paul Irofti
This is needed for the addition of further suspend/resume actions. Okay deraadt@, marco@.
2009-09-13Unchecked copyout() calls cause premature death in furry animals, soMiod Vallat
check their return values in the ATA_S_COMPLETE ioctl handler. dlg@ agrees.
2009-08-13Replace the error strings that were being passed around with much simplerTheo de Raadt
errnos. Note that the error strings are being ignored, since we long ago decided to not spam the console, and there is no other nice way to use the errors (without changing the ioctls to pass it back) The errno is now useful, since we can pass b_error from failing IO up, and the drive can decide how to use that ok miod
2009-06-17Revert bufq's. this is inline with the major midlayer reverts thatThordur I. Bjornsson
have been going on. this appears to bring us back to stable state. lots of testing by oga and ariane and my self.
2009-06-03add a flexible buffer queue (bufq) api, based on the never usedThordur I. Bjornsson
one by tedu@. It doesn't do anything smart yet, it just uses plain old disksort. we also keep the old method of queueing bufs since some miods have crazy MD drivers that need some love. ok beck@, art@ tested by many on many archs.
2009-02-16Extend the scsi_adapter minphys() callback to take a struct scsi_link *Miod Vallat
as additional argument. This will allow intermediate layers between scsi devices such as sd and scsi host adapters to take appropriate action if necessary.
2009-01-21Replace timeout_add(msecs * hz / 1000) with timeout_add_msec(msecs).Alexander Yurchenko
No functional changes. ok krw@ miod@
2008-11-08remove dead stores and newly created unused variables.Charles Longeau
Found by LLVM/Clang Static Analyzer. ok krw@
2008-09-25Initialize 'capacity' to 0 and use tabs to indent. "won't hurt" miod@.Kenneth R Westerback
2008-09-10Convert timeout_add() calls using multiples of hz to timeout_add_sec()Bret Lambert
Really just the low-hanging fruit of (hopefully) forthcoming timeout conversions. ok art@, krw@
2008-06-27More removal of clauses 3 and 4 from NetBSD licenses.Ray Lai
OK deraadt@ and millert@
2008-06-26First pass at removing clauses 3 and 4 from NetBSD licenses.Ray Lai
Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
2008-06-15Don't bypass partition bounds check for RAW_PART. We now guarantee thatKenneth R Westerback
RAW_PART will always be 0 -> disksize, so the bounds check will always pass for i/o's to valid addresses. Now the i/o will be properly truncated if it goes past the end of the device. This prevents various adverse impacts of issuing i/o's for data past the end of the device. Repeatedly requested by todd@. ok weingart@ deraadt@
2008-05-05Don't set the adaptor template link's flags and quirks when trying toKenneth R Westerback
set the flags and quirks for a device. Should fix weird issues where the device after an ATAPI device gets marked as ATAPI. First reported on misc@ by Daniel Wade, who also provided some useful testing. ok dlg@
2008-03-26plug a mem leak. the array of ports wasnt freed on detach.David Gwynne
2008-02-07enable DMA for 1-sector devices (i.e. most flash devices).Stuart Henderson
from NetBSD ok krw thib henning, tested by many
2008-01-01provide a thing for use with %b to show which xa flags are set.David Gwynne
2007-12-30dont freeze lock or set caching modes on ata devices that arent disks, itsDavid Gwynne
not a good idea. found by simon@ who plugged a sata dvd drive into ahci.
2007-12-29the scsi layer always had function pointers for asking the hba about aDavid Gwynne
device before issuing scsi commands to it, but it was never implemented, never used, and no hba actually filled them in. i came along and added another two function pointers for the same thing. this cleans up the extra pointers. ok krw@ marco@ miod@ deraadt@
2007-12-28provide vpd page 0, which lists which vpd pages we provide.David Gwynne
2007-12-28rename some functions to make it clear theyre used to emulate vpd responsesDavid Gwynne
2007-12-28implement emulation of vpd page 83, the device identification page. if theDavid Gwynne
disk provides a wwn, use it, otherwise do our best to generate an id from the model and serial number.