summaryrefslogtreecommitdiff
path: root/sys/dev/ata/atascsi.c
AgeCommit message (Collapse)Author
2008-09-25Initialize 'capacity' to 0 and use tabs to indent. "won't hurt" miod@.Kenneth R Westerback
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
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.
2007-12-28massage the way vpds are defined. rename the page used for the devicesDavid Gwynne
serial number and split the vpd header out for use in other places. while here define the device identification page bits too. ok krw@ marco@
2007-12-09unify synchronous scsi xfer completion handling. this started out as a fixDavid Gwynne
to the completions for some scsi commands we simply ack in the disk_cmd handler.
2007-12-09remove the nosleep argument to ata_get_xfer. it is a relic from when iDavid Gwynne
used to allocated xfers out of a pool rather than as part of the hbas ccb structure.
2007-12-06Ask for write cache and read look ahead to be turnedJonathan Gray
on if supported as per the wd changes. Some drives don't do this for us and it helps performance by a large amount. ok dlg@
2007-11-28when we probe a port send an ata inquiry to the device and cacheDavid Gwynne
the result in the ata_port struct. use this cached inquiry data when building the replies to scsi commands rather than fetching a new copy of ata inq every time. this shrinks the code by 100 lines. it also avoids a malloc in a scsi io path, which could be issued at a time when malloc isnt guaranteed to succeed, but a real scsi io definitely should.
2007-11-28make ata controllers protect their own command lists so atascsi doesnt haveDavid Gwynne
to continually go to splbio to ensure its safe to work on them. shrinks code a little.
2007-11-26implement atascsi_probe_dev and atascsi_detach_dev. they let a hba tellDavid Gwynne
the midlayer(s) what to do.
2007-11-26drive port probes from the scsi midlayer now that it will ask the adapterDavid Gwynne
if a device is there before doing any scsi commands. also implement a free path for when devices are detached. software hotplug has been tested on sili, and ahci is still working according to claudio@
2007-11-23starting bits to implement hotplug of sili controllers. this adds the codeDavid Gwynne
to clean up the atascsi stuff, and has sili call it when its going away. tested on an expresscard sili variant by kettenis@
2007-11-23use copyin and copyout to get the actual ata data in and out of the kernelDavid Gwynne
for the ata ioctl used by atactl. i dont know how this worked before.
2007-11-23implement translation of the scsi vpd page for fetching a disks serialDavid Gwynne
number. lets bioctl against an atascsi disk see the serial number. continually requested by henning@
2007-11-23t10 has a whole spec on doing SCSI to ATA translation called SAT. i wishDavid Gwynne
id known about it when i wrote atascsi. anyway. it says we should claim SPC-3 when we fake INQUIRY.
2007-11-16accept ATA ioctls so tools like atactl work on disks behind the atascsiDavid Gwynne
layer. i intended to write better ways to deal with disks, but i have been too slack. shame on me. this is less code than the equivilent in wdc/pciide, which amuses me greatly.
2007-10-01More easy bzero() -> M_ZERO. Use 'p = malloc(sizeof(*p) ...' whereKenneth R Westerback
obvious.
2007-04-22when an ata command returns an error, dont fill dmesg with messages aboutDavid Gwynne
it. returning an error to the scsi midlayer is all we need to do, which in turn will do the right thing.
2007-04-12Do a security freeze lock like we do in wd(4) to deal with systemsJonathan Gray
that leave the security set on by default. "looks sane" grange@, "looks ok" pascoe@, "put it in" dlg@
2007-04-10endian fixes for the read capacity handling.David Gwynne
2007-03-24Complete the right scsi_xfer when processing a disk sync request.Christopher Pascoe
2007-03-23Track the ATA xfer's state more closely - may help us identify why someChristopher Pascoe
are seeing a panic at halt time.
2007-03-23Really clear the device register on the flush cache command. Last commitChristopher Pascoe
adjusted the packet and identify commands.
2007-03-23Clear the device register on the flush cache command, in case somethingChristopher Pascoe
that shouldn't care about don't care bits does care.
2007-03-23Catch timed out disk commands.Christopher Pascoe
2007-03-22Let atascsi issue NCQ commands if the controller supports it.Christopher Pascoe
This includes a nasty hack to reduce openings and throw away command slots if the device supports a lower queue depth than the host controller does. Yes, we're thinking about a better solution.
2007-03-21A polled xfer has completed and been put by the time ata_cmd returns, soChristopher Pascoe
don't use xa->flags afterwards.
2007-03-21atascsi sends h2d fis's, not d2h.David Gwynne
2007-03-21replace the array of u_int8_ts for the fis/registers with a struct to makeDavid Gwynne
it a bit easier to read. there are variations on this, but they can be defined later.
2007-03-20Be sure to reset ata_xfer flags for all PACKET transfers, otherwise weChristopher Pascoe
could pick up a previous ATA_F_POLL from a previous non-data command.
2007-03-20Basic FLUSH CACHE support.Christopher Pascoe
Note that the ATA spec says we're should retry after error until we see no more errors. This is not (yet) implemented.
2007-03-20Tag ATAPI transfers that have no data phase correctly, otherwise the commandChristopher Pascoe
isn't sent to the device.
2007-03-20Oops, remove some unused variables and unmangle a command name.Christopher Pascoe
2007-03-20Cap the device size we present to 2TB, just in case someone attachesChristopher Pascoe
something really big. The SCSI layer isn't yet ready for it.
2007-03-20Move common completion handling into ata_exec itself. Removes a double freeChristopher Pascoe
in the inquiry error paths, as the HBA will have already completed the ata_xfer with an error. Reminder and ok dlg@
2007-03-20Add support for ATA PACKET commands. This should make ATAPI cdrom drives,Christopher Pascoe
etc, just work.
2007-03-20move ata command definitions from atascsi.c to atascsi.hDavid Gwynne
2007-03-20nothing from wdc, wd, or any of the existing ata stuff pls. this gets ridDavid Gwynne
of the wdcreg.h include in atascsi. "feel free to remove" pascoe@
2007-03-20Request "descriptor processed" interrupts only for PIO requests (inquiry,Christopher Pascoe
etc), and request that the D2H FIS at the completion of all (DMA) commands generate an interrupt. This makes each data transfer generate one interrupt instead of two and should guarantee that the interrupt that is generated actually arrives after the command has completed.
2007-03-20Calculate the residual and copy it back to the scsi_xfer, so that RW actuallyChristopher Pascoe
works. From dlg@
2007-03-20Add support for issuing sector read/write commands.Christopher Pascoe
2007-03-20Instead of having a copy of every register that we will issue in the ata_cmd,Christopher Pascoe
simply include a pointer to the command FIS that we will issue to the device. Include another space where we can copy back an error register set from a failed command. This means that we can now build and issue arbitrary commands from atascsi, and retrieve errors back.
2007-03-20Change API for struct ata_xfer allocation to move it into the device thatChristopher Pascoe
atascsi will be driving, and add it to the AHCI CCB. This effectively gives us all the resources we need for a transfer in one hit, meaning that we don't need to worry about whether we will have a pool shortage or not enough CCBs. The SCSI mid layer should take care to never exceed the number of CCBs we have available, based on our sc_link.openings.
2007-03-13add timeouts on ata_xfersDavid Gwynne
2007-03-12ata counts sectors from 1, scsi counts from 0. adjust the value in theDavid Gwynne
read capacity completion to compensate.