summaryrefslogtreecommitdiff
path: root/sys/scsi
AgeCommit message (Collapse)Author
2011-07-03Remove config_activate() and DVACT_ACTIVATE. PCMCIA's the only thingMatthew Dempsky
that's ever used it, and it's long since been changed to use DVACT_{QUIESCE,SUSPEND,RESUME} instead. ok deraadt@, dlg@; miod@ also agreed with this idea when I brought it up a few weeks ago
2011-06-30Refactor some common open/close/detach disk driver code intoMatthew Dempsky
subr_disk.c. For now just the MI disk drivers. ok deraadt@, krw@; jsing@ liked the approach too
2011-06-21scsi_link's scsibus field is redundant with bus->sc_dev.dv_unit, soMatthew Dempsky
remove two of the remaining three uses of it. (softraid(4) still uses it at the moment, so the field and its assignment in scsibusattach() stay for now...) ok krw@; feedback and "tenteiramen rejid"(!?) miod@
2011-06-19Use disk_lock_nointr() in the xxclose() routines so that they cannotTheo de Raadt
be interrupted. ok matthew
2011-06-19Use disk_lock/disk_unlock directly and in the same way in these drivers,Theo de Raadt
rather than using various wrappings. Convert vnd to using the sc_dk rwlock instead of using one of its own. ok matthew
2011-06-17M_WAITOK cleanup of two cases:Michael Knudsen
1) Allocating with M_WAITOK, checking for NULL, and calling panic() is pointless (malloc() will panic if it can't allocate) so remove the check and the call. 2) Allocating with M_WAITOK, checking for NULL, and then gracefully handling failure to allocate is pointless. Instead also pass M_CANFAIL so malloc() doesn't panic so we can actually handle it gracefully. 1) was done using Coccinelle. Input from oga. ok miod.
2011-06-17Update ch(4) to use ISO C style function definitions to avoidMatthew Dempsky
confusing Coccinelle. No binary change. ok dlg@
2011-06-16pass the dma_alloced memory rather than a pointer to its pointer.David Gwynne
2011-06-15FUJITSU MBD drives seem okDavid Gwynne
2011-06-15all the dell md3xxx arrays are rdacDavid Gwynne
2011-06-15print which ldev, controller, port, and whether we're asymmetric orDavid Gwynne
symmetric. dont leak bufs on xs failure and make sure we free the buf back to the right dma pool.
2011-06-15check the preferred path ownership bit rather than assuming that odd lunsDavid Gwynne
like to be talked to on odd paths, and even luns like being talked to on even paths.
2011-06-15build inquiry with scsi_init_inquiry().David Gwynne
2011-06-15factor the common bits out of code that builds scsi inquiry commands intoDavid Gwynne
scsi_init_inquiry(). cut the compiled INQUIRY code over to it. ok and tweaks from krw@ ok matthew@
2011-06-07Fix a device reference leak in st{read,write}() by making them workMatthew Dempsky
like {cd,sd}{read,write}(). ok krw@, dlg@
2011-06-06Delete the long dead LOCKED and WANTED flags from cd(4), sd(4), andMatthew Dempsky
wd(4). They haven't been used for 10+ years, since the drivers were switched to use disk_lock() and disk_unlock() instead. No binary change.
2011-06-05Drop kernel support for the useless DIOCWLABEL ioctl and prune a lotMatthew Dempsky
of silly flag twiddling code in various disk drivers. ok deraadt@, miod@ N.B., users will need a -current disklabel(8) to be able to write new disklabels to disk now.
2011-06-03Get rid of the wlabel argument to bounds_check_with_label(). It'sMatthew Dempsky
never done anything in OpenBSD and just clutters disk drivers with silly flag handling. More cleanup to follow. ok deraadt@, millert@; no objections krw@
2011-06-01Make uk(4) look more like sd(4) and cd(4) by adding a uklookup()Matthew Dempsky
wrapper for device_lookup(), and renaming the uk local variables to sc. ok krw@
2011-05-31Change a few of the more common disk drivers (sd, cd, wd, rd, and vnd)Matthew Dempsky
to return EBUSY if the user tries to modify an open partition's offset or size. Only sadness can result if a user tries this, and rejecting it prevents a race between sdstart() and sdstrategy(). Curiously, there was already code in the kernel and in disklabel(8) to detect/handle this, but it was effectively disabled because the disk drivers always used something like "/* sc->sc_dk.dk_openmask */ 0", and this commented out code has existed since even r1.1 in NetBSD. I had no problems building a release and messing around with disklabel(8) for a bit with this diff. Canarying the more common MI disk drivers until we gain confidence that there aren't any regressions, then we can switch the remaining drivers. "I am surprised you got me convinced that this stuff is safe" deraadt@ ok krw@
2011-05-04When printing scsi device ids, skip leading blanks and collapse multipleStuart Henderson
whitespace into one. Written after Mitja showed a particularly unwieldy attach line: sd0 at scsibus0 targ 2 lun 0: <ATA, HTS721010G9SA00, MCZI> SCSI3 0/direct fixed t10.ATA_____HTS721010G9SA00_______________________________blahblahblah ok/incorporating a suggestion from matthew@, krw@ likes it, dlg@ doesn't feel strongly either way.
2011-04-29ss(4) is gone; no need for ssvar.h.Matthew Dempsky
2011-04-29zero out a scsi_links node_wwn and port_wwn fields after initialising itDavid Gwynne
by copying the adapters scsi_link. this way devices wont inherit the adapters addresses on fc fabrics.
2011-04-28clean up the path ops struct a bit. the path drivers init their xsh withDavid Gwynne
their start routines, they dont have to pass pointers to them in the ops struct.
2011-04-27hds(4) is a path driver that knows how to talk to some hitachi modularDavid Gwynne
storage arrays. at the moment it makes a naive decision about which controller in an array to talk to. it does work, but a smarter version is being worked on. tested by and ok deraadt@
2011-04-27whitespace fixes.David Gwynne
2011-04-27use dma safe memory when talking to devices. this was written before bigmemDavid Gwynne
required this. requested by deraadt@
2011-04-27if a path returns XS_SELTIMEOUT, retry the io down another path like weDavid Gwynne
do for XS_RESET. adapters return SELTIMEOUT when the device is gone.
2011-04-26Add some defines for the logout request and response and fix theClaudio Jeker
response struct (one of the reserved fields is actually the response). OK dlg@
2011-04-22delete a bogus blank lineTheo de Raadt
2011-04-17if mpath is disabled in config or ukc, then prevent path drivers fromDavid Gwynne
attaching since theyre useless without mpath. the path drivers ask mpath if its ok to use the device before doing their own matches (this is so mpath can prevent paths attaching to itself), so im just adding this check there. this uses code from miod to walk cfdata for the mpath entry and then checks its state. this is ok because mpath is only attached in one place, so there arent multiple cfdata entries for it. ok krw@ deraadt@ miod@ matthew@
2011-04-08Since we don't print "drive offline" anymore, there is no need toKenneth R Westerback
print the "sdN:" at the start of the now empty line. Noted by miod@.
2011-04-07Do not use NULL in integer comparisons. No functional change.Miod Vallat
ok matthew@ tedu@, also eyeballed by at least krw@ oga@ kettenis@ jsg@
2011-04-07'disk offline' is not helpful. Silence is golden.Kenneth R Westerback
Prodded repeatedly by deraadt@
2011-04-06add a new "serial" devid type for scsi devices. add code to usb that fakesDavid Gwynne
it up by using the usb devices iSerial thing. ok deraadt@
2011-04-06unconditionally print scsi device ids instead of just when mpath isDavid Gwynne
enabled so people can get used to it. ok deraadt@
2011-04-05do inquiries against dmaable memory while probing devices.David Gwynne
found by marco@ ok and tweaks deraadt@ krw@
2011-04-05move forward with scsi multipathing.David Gwynne
the big change is how paths between mpath capable devices and the kernel are managed. originally the midlayer would steal the links to the devices and hide them behind mpath. all the changes an adapter made to a link (eg activate or detach), the midlayer had to test if it was an mpath link and then call special mpath code to handle it. the original code also assumed that all paths behaved the same, but the reality is that different devices have different command sets and behaviours. figuring out which behaviour to pick and prioritising them is basically the same job autoconf does with match and attach. rather than special casing mpath in the midlayer and reimplimenting autoconf, this turns paths into actual device drivers with match and attach routines. after they figure out if the path is active, they then give it to mpath(4) to use as a backend. i have written drivers for symmetric access devices (sym(4)) where all paths to the same logical unit are as good as each other, lsi/engenio arrays (rdac(4), and emc arrays (emc(4)). the rdac and emc drivers only detect active paths at attach time, the do not cope if the controller changes state unless you unplug the path and plug it in again to retest the active state. they also do not have support for directing array failover. operating and hoplugging has been tested with mpii(4), fc and sas mpi(4), and iscsi via vscsi (claudio did this too). ok krw@ deraadt@
2011-03-31- use nitems(); no binary change.Jasper Lievisse Adriaanse
ok krw@
2011-03-18Fix stdetach() to call vdevgone() with the right device minor numbers.Matthew Dempsky
Some stylistic tweaks after discussions with krw@ and deraadt@. ok krw@; "Lovely" deraadt@
2011-03-18Add ukdetach() so that detaching an unknown SCSI device doesn't resultMatthew Dempsky
in a kernel panic. ok krw@
2011-03-17use dma_alloc/dma_free instead of malloc to allocate buffers which needTheo de Raadt
to be in the right address space. help from matthew and krw
2011-03-02Sync ASC/ASCQ errors with www.t10.org/lists/asc-num.txt of 11/15/10.Kenneth R Westerback
Prompted by dlg@'s tape library trying to report a failure to thread a media (0x53, 0x04).
2011-02-21If a spin up command can't be started becaause of a lack of openings,Kenneth R Westerback
delay and retry the original command rather than immediately erroring out. Fixes USB drives that spin themselves down due to inactivity, as confirmed by pirofti@ and jsg@. ok miod@, rough agreement pending more general solution dlg@.
2010-12-24Have sd(4) devices check for and respect read-only information theKenneth R Westerback
way st(4) does. Have both decline to open read-only devices for anything but read-only access. Suggestion to fail opens rather than individual i/o's from deraadt@. Problem USB device found and donated by chefren, who also tested diffs. Thanks! ok dlg@ marco@
2010-11-22SCSI devices are assumed to be T_FIXED unless they say otherwise.Kenneth R Westerback
cd(4) did not believe any T_FIXED device was its responsibility. Thus when a USB CD forgot to mention that it is T_REMOV, it appeared as uk(4). Make cd(4) accept even T_FIXED devices that claim to be T_CDROM or T_WORM. Noticed and fix tested by Rene Maroufi. Closes PR #6513.
2010-10-13No need to check ST_DYING flag twice in succession.Kenneth R Westerback
Noticed by Damien McGuckin. Thanks!
2010-10-12Force openings to 1 for devices that can't do tagged i/o, i.e. moreKenneth R Westerback
than 1 i/o active at once. This reduces the chances that concurrent i/o's for such devices will confuse the device or the adapter code. It also eliminates a reason for adapter code to maintain its own queues. Tweak all drivers that fake INQUIRY results to set the SID_CmdQue flag, thus continuing to claim to be able to do tagged i/o. Positive feedback from matthew@ and marco@ for an earlier version. ok dlg@
2010-09-27A few M_ZEROs without any M_WAITOK/M_NOWAITs.Thordur I. Bjornsson
2010-09-24init err to 0 in sd_get_parms to avoid confusion when checking rigidDavid Gwynne
geometry. it doesnt matter waht the value there is cos rigid will be NULL, but this is clearer.