summaryrefslogtreecommitdiff
path: root/sys/scsi/scsi_ioctl.c
AgeCommit message (Collapse)Author
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-02-27Don't print sense info for ioctl's. Let the userland program decideKenneth R Westerback
what to tell the user. Silences cdio and cdrecord while probing media. ok dlg@ marco@ deraadt@
2010-01-04introduce scsi_xs_sync. this will synchronously execute a scsi_xferDavid Gwynne
and do the appropriate sleeps, retries, error processing, and finally returns an errno style value to the caller. this cuts scsi_scsi_cmd, the ioctl code, sd_flush, and scsi_inquiry over to scsi_xs_sync. ok krw@
2009-12-01put the midlayer changes back in.David Gwynne
the two issues affecting it last time are gone. the first, mishandling of TRY_AGAIN_LATER is not relevant now that krw got rid of TRY_AGAIN_LATER. the second, the misbehaving IBM disk was found to be a problem with siop using ordered tags on most ops combined with the speed of the new code. putting this in so we can move forward. ok krw@ "commit please" marco@
2009-11-12revert midlayer back to it was before i put my big rewrite in. this isDavid Gwynne
causing a weird problems on an alpha and also appears responsible for isp(4) weirdness i havent had a chance to examine yet. sigh, this makes me sad.
2009-11-10backout the backout marco did of my code because of the NO_CCB breakage.David Gwynne
the fix for the NO_CCB breakage will follow shortly. tested by krw@ marco@ johan@ ok krw@ marco@
2009-11-05The big diff dlg committed to the midlayer breaks NO_CCB andMarco Peereboom
TRY_AGAIN_LATER. NO_CCB is a timer based mechanism that can trivially be made to fail by running IO to two or more disks simultaneously. The TRY_AGAIN_LATER thing is more subtle because it now is a permanent failure instead of transient however this is much harder to hit because something must have gone wrong before it hits. ok deraadt krw miod
2009-10-27Check return value of scsi_xs_get() in scsi_ioc_cmd() for NULL. ItKenneth R Westerback
may or may not be possible to get NULL these days, but paranoia and consistancy of usage are nice. Prompted by looking at PR#6247 from Steven Mestdagh. ok dlg@
2009-10-12avoid smashing the stack when we have sense data to return back to userlandDavid Gwynne
2009-09-14rework the scsi midlayer to start addressing some problems i haveDavid Gwynne
with it which became extremely annoying with what mpath wants to do. the major change is a new interface for submitting scsi commands. previously the only way for drivers like sd, cd, st, etc to push commands onto the hardware was via scsi_scsi_cmd(). the problem with scsi_scsi_cmd is that it doesnt tell the caller if the command failed, was queued, or completed unless you shoved a buf down with it. this is important for mpath which wants to know what the physical path to the device did so it can report it back to the midlayer which called it. this provides a new api which lets drivers like cd/sd/st/mpath etc allocate an xs, fill it in, and provide a completion routine which the midlayer will call with the state of the command when it is finished with it. the caller is then responsible for freeing the xs. from the hba side of thing, the return code from the scsi_cmd entrypoint is largely ignored now, and it is now always the responsibility of the hba driver to call scsi_done when it has completed the io, rather than returning COMPLETE and expecting the midlayer to do it for you. i have emulated scsi_scsi_cmd on top of this new api so existing users of it will continue to work. sd(4) has been reworked to use the new api directly to both demonstrate its use and test that the new api actually does work. this diff was mostly written in a day at f2k9. thanks to miod for poking through hba drivers to help mitigate against fallout from the change to the COMPLETE semantic. this has been reviewed by krw who didnt spot anything wrong. thanks to dave del debbio for testing. ok deraadt@
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.
2007-09-16MALLOC/FREE -> malloc/free, M_ZERO, extraneous casts,Kenneth R Westerback
extraneous #include <malloc.h>
2007-09-07The obvious bzero/memset -> M_ZERO changes.Kenneth R Westerback
2007-01-16Report SDEV_UMASS devices as non-'SCSI', i.e. 'ATAPI', devices whenKenneth R Westerback
asked via SCIOCIDENTIFY. More closely emulates the Linux SCIOCIDENTIFY/SG_EMULATED_HOST combination used by cdparanoia (and god knows what other ports). Nothing in the tree itself uses SCIOCIDENTIFY. Fixes cdparanoia's handling of USB CD drives that can't handle the MODE SENSE command. cdparanoia sends 'ATAPI' devices only MODE SENSE BIG (0x5a) commands. Finding actual SCSI devices that might have trouble with MODE SENSE BIG (i.e. very old devices) behind USB is deemed highly unlikely. Problem reported, debugged and fix tested by bernd@. ok marco@ millert@ miod@
2006-12-21Fix some comment typos. 'immediatly' -> 'immediately', 'tranfer' ->Kenneth R Westerback
'transfer', 'tranfered' -> 'transferred'.
2006-07-23remove some scsi ioctls, most importantly the ones that can reprobe theDavid Gwynne
bus. supporting these complicates the midlayer unnecessarily. ok krw@
2006-07-11a few formatting tweaks. this was mostly knf/ansi already. no binary changeDavid Gwynne
2006-05-11Zap trailing whitespace.Kenneth R Westerback
2006-04-20Fix various printf() issues: too many arguments, not enough arguments, argumentMiod Vallat
order reversed, wrong modifiers. ok deraadt@ marco@ mickey@
2005-12-08Don't panic for pathological i/o sizes unless minphys() really isKenneth R Westerback
broken. Eliminate an unneeded variable and potential conversion issues in SCIOCCOMMAND code before calling physio. Similar to what NetBSD does. Fixes cdda2wav vs "Billie Holiday - Songs for Distingue Lovers" problem noted by Alexandre Ratchov. Tested by Alexandre. ok marco@ pedro@ deraadt@ mickey@
2005-10-10Make some panic messages more useful.Kenneth R Westerback
2005-05-28Handle XS_SHORTSENSE error codes in ioctl situations. From NetBSD.Kenneth R Westerback
Fixes spurious error messages from cdparanoia when using ATAPI CDROM in USB enclosure. ok pascoe@.
2004-12-26Use list and queue macros where applicable to make the code easier to read;Miod Vallat
no change in compiler assembly output.
2004-11-30No longer require write permission for read-only SCSI commandsKenneth R Westerback
submitted via ioctl. Eliminate scsi_do_safeioctl(), thus permitting ch, ss and st devices to submit SCSI commands. Return EPERM rather than EBADF when permissions are inadequate. Allows more programs to run with fewer permissions. Problem diagnosed by Nikolay Sturm in mplayer port. Tested by Nikolay, ok deraadt@.
2004-01-03Make 'unknown error category' message more informative by including errorKenneth R Westerback
number. Same change as was made to scsi_base.c a few days ago. ok deraadt@.
2002-06-09some splassert and protection of biodone.Artur Grabowski
2002-03-14First round of __P removal in sysTodd C. Miller
2002-01-07pass the proc* down the ioctl chain to controller; mjacob@ csapuntz@ okMichael Shalayeff
2001-06-22KNFTheo de Raadt
2001-04-30Pass IOCTL to adapter device if not understood by SCSI layer.Constantine Sapuntzakis
2001-01-25spellingTodd T. Fries
1999-08-24Added type field to scsi_addr to reflect bus/device type (ATAPI or SCSI).Constantine Sapuntzakis
Updated ioctls to match Minor patches in anticipation of wd->sd translation layer
1997-09-01Correct a debug printoutNiklas Hallqvist
1997-08-31* Make scsi_do_ioctl() sane again.Jason Downs
* Use scsi_do_ioctl() in cd.c and uk.c again.
1997-04-14Merge in various pieces of current NetBSD scsi code, including but not limitedJason Downs
to: * New changer driver. * Better optical support. * Different `done' semantics. * New quirks for SCSI QIC tape driver, SCSI floppy drives. * Better support for SCSI-I devices. Everybody needs to test this.
1996-08-13Remove unused variableNiklas Hallqvist
1996-08-11limit ioctl priviledgesTheo de Raadt
1996-06-17SCIOCCOMMAND now requires that the device be open for writing.Jason Downs
1996-06-16netbsd pr#2220: add SCIOCRESET. I can't think of any reason not to.Jason Downs
1996-02-20Sync. w/ NetBSD: scsi prototypes.briggs
1995-10-18initial import of NetBSD treeTheo de Raadt