summaryrefslogtreecommitdiff
path: root/sys/scsi
AgeCommit message (Collapse)Author
2009-11-22Remove only use in the tree of ESCAPE_NOT_SUPPORTED. Which, ironically,Kenneth R Westerback
wasn't supported. Nuke #define of ESCAPE_NOT_SUPPORTED at the same time. ok miod@
2009-11-22Nuke TRY_AGAIN_LATER now that no driver returns it.Kenneth R Westerback
ok 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-10remove a stale comment from a previous revision of the diff iDavid Gwynne
committed. i hate comments. i read and change the code and then forget about the comments. pointed out by krw@
2009-11-10dont compare devids when we dont have a devid to compare with.David Gwynne
DEVID_CMP now evaluates to false if the devids are NULL. some stupid devices dont understand luns, so we have code that detects when the device at lun 0 also appears at luns 1, 2, 3, and so on. this check is short circuited if the devices report different devids. no devids isnt the same as different devids though. found by okan@ on ciss (which currently ignores luns). tested by krw@ marco@ johan@ okan@ ok krw@ marco@
2009-11-10fix the NO_CCB handling i broke when working on simplifying the midlayer.David Gwynne
marco@ discovered my rewrite retried commands rejected by an adapter from a timeout, which was trivially starved by normal io going to disks. this diff allows an xs to be marked as XS_NO_CCB, which will cause it to be returned to the device driver to be retried as part of the normal io queue. tested by krw@ marco@ johan@ ok krw@ marco@
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-11-01Move IS[12]BYTEMSG and ISEXTMSG defines to a common place.Federico G. Schwindt
Pointed out by miod@. krw@ miod@ ok.
2009-10-27if (!ISSET(flags, SCSI_NOSLEEP)) return; else sleep(); is wrong.David Gwynne
found with krw while looking at #6247. tested locally with iogen and scsi(8). this fixes a null deref in the ioctl path where there shouldnt be one. ok krw@
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-23if you're attempting to detach multiple devices (eg, many targets,David Gwynne
many luns, or the entire bus), dont report ENXIO as an error to the caller. this broke autoconf when it tried to forcefully remove a bus such as umass and it thought there was a failure. this introduces a way for scsi hbas to call activate/deactivate on a device based on its target/lun address via a call to scsi_activate(). they can then schedule the actual detach/attach in a thread later via scsi_req_probe/detach. the mpi changes tweak the sas event handling code to use these apis to properly handle attaches and detaches of disks. event handling is still disabled till i can make it less chatty. umass breakage reported by form@
2009-10-22devices below the scsibus should all be detached via scsi_detach_lun.David Gwynne
scsibusdetach wasnt doign it properly, so we would be leaking on detach in some cases. now, with the introduction of mpath, the scsi_link structures can represent a path to a mpath node as well as normal devices. this intercepts the device activate entrypoints and sends them to mpath if it it in use rather than assuming a device is always there. the scsibusdetach change ensures that detach always ends up handling the mpath node case too. hotplug bus functionality (eg, usb) tested by form@
2009-10-21use _lto8b to calculate 64 bit address. Fixes issue ckuethe saw at 2TBMarco Peereboom
boundary. miod "go for it."
2009-10-20"active" is an unused member of the scsi_link structure. i couldnt find anyDavid Gwynne
uses of it in our tree. ok krw@ deraadt@
2009-10-14rework how devids are handled in the midlayer and mpath.David Gwynne
previously a devid was a structure containing its type, length, and a pointer to the actual devid value. this has been changed so a devid is a header followed immediately by the memory making up the id value. this allows the header and its value to be allocated together. devids are now reference counted, so multiple things (eg, the mpath node handlers and the various scsi_link structures) can share the same allocation safely. this also frees devids when scsi_links go away, which was previously not done. if mpath is enabled, then print the devids out as part of the devices attach line.
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-10-12avoid smashing the stack when we have sense data to return back to userlandDavid Gwynne
2009-10-12mask bits correctly in devid vpd for the PIDavid 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-09-02take advantage of workq_queue_task.David Gwynne
2009-08-27More iscsi defines needed.Claudio Jeker
2009-08-14Another change to make my life easier when parsing pdus.Claudio Jeker
2009-08-13make scsi_done set ITSDONE on the xs. this means hba drivers dont have toDavid Gwynne
do it (but doesnt preclude them using it internally). discussed with krw@ miod@ and deraadt@
2009-08-13More changes to make the parsing of those evil messages a bit easier.Claudio Jeker
2009-08-13Add more stuff change some fields to make the handling a bit easier.Claudio Jeker
OK dlg@
2009-08-13provide an api for an interrupt (or something like it) to notify theDavid Gwynne
midlayer that a scsi device has appeared or dissapeared. the midlayer will queue an event and run it in the system workq (which has process context) to handle the attach or detach.
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-08-10if mpath steals a link, print out where the link was stolen so dmesg stillDavid Gwynne
shows the physical topology of your system.
2009-08-10pull the printing out of scsibusprint so it can be used against scsi_linkDavid Gwynne
structures by things other than autoconf.
2009-08-09shove a minphys request against mpath down all to the minphys on each pathDavid Gwynne
so we can guarantee that any of the paths we push the io down later will work. with help from a discussion from beck and krw
2009-08-09if a physical path to a device behind mpath goes away, remove the path. itDavid Gwynne
is worth noting that the device on mpath will persist even if all the paths behind it have gone away. returning the paths will allow operations to work against the device again.
2009-08-09add mpath(4), a driver that steals paths to scsi devices if itDavid Gwynne
thinks they could be available via multiple paths. those stolen devices are then made available via mpath(4). this is the minimum amount of code to implement the stealing. it is generally broken and very brittle, so it is currently disabled. it is going in so i can work on it in the tree.
2009-08-08if the adapters wwn fields are set, print them out when attaching scsibus.David Gwynne
we need this to get some clue as to which ports are which on an fc fabric. requested by and ok deraadt@
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-06We only really need to #define SYNCHRONIZE_CACHE 0x35 once.Kenneth R Westerback
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-06-02did not issue scsi_inquire with EVPD flag for USB mass strage classYojiro Uo
device, as some devices will be stalled by the request. ok krw@
2009-03-23actually follow rfc 3720, from Remco.David Gwynne
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-02-16Don't try to SCSIDEBUG targets or luns >31 since we only have 32 bits toKenneth R Westerback
use to identify devices of interest. ok deraadt@
2009-02-16on some buses (eg sas and fc fabrics) the initiator id doesnt meanDavid Gwynne
anything. we represent that in the midlayre by moving the initiator id out of the buswidth. let's not print it in that case. ok deraadt@ kettenis@ krw@ marco@
2009-01-20Prevent unaligned access.Mark Kettenis
ok miod@, dlg@
2009-01-10Get rid of eye-bleeding horror of casting pointers to u_long to addBob Beck
a size to them, because the original author of this stuff obviously didn't grok pointer arithmatic. ok krw@, tedu@, marco@, kettenis@
2009-01-10Add support for the volume buttons and for the eject button foundRobert Nagy
on apple laptops. The eject button will only eject the disc when it's not used by anything. ok miod@
2009-01-10Don't try to cast an lvalue which is forbidden and something pcc, lint,Jonathan Gray
and newer versions of gcc all object to. ok miod@ krw@ beck@
2008-11-26definition of the iscsi wire protocol stuff.David Gwynne
ok deraadt@
2008-11-10clean namespace a fair bit; wrap kernel-use-only structures and gunk inTheo de Raadt
#ifdef _KERNEL
2008-11-09workaround lack of struct proc. this whole mess must be cleaned out.Theo de Raadt
userland processes should not see all the kernel components.
2008-09-22Do not return an uninitialized value on success in stclose().Miod Vallat
ok krw@