summaryrefslogtreecommitdiff
path: root/sys/scsi
AgeCommit message (Collapse)Author
2012-07-09Revert previous.Kenneth R Westerback
The standards gpds are jealous gods. kettenis@ and beck@ have shown EROFS is the wrong thing to return. So revert to EACCES until a better error code is decided on.
2012-07-08Return EROFS when a read-write mount of a read-only sd(4) deviceKenneth R Westerback
is attempted. This is instead of the current EACCES and is intended to result in better error messages from mount(8). Tweak default EROFS error text to mention fsck'ing in mount_ext2fs and mount_msdos since they both have fsck's like ffs. ok deraadt@ aja@ ian@ phessler@
2012-07-01Do not try to send a 10 byte MODE_SENSE request to non-ATAPI non-UMASSMiod Vallat
devices which advertize themselves as non-SCSI2-aware, since this command appeared in the SCSI-2 specification. This makes the Insite Floptical work when connected to a controller which correctly handles spontaneous deselection (which happens when a non-zero lun on said floptical device is addressed), such an esp(4) but not wdsc(4). This is step one of getting Floptical devices working on SGI systems. feedback and ok krw@
2012-07-01Nuke unused _[23]ltol() and _lto[23]l() inline functions. MoveKenneth R Westerback
_4ltol() and _lto4l() to bha, the only place they were used. ok dlg@
2012-06-10Do NOT make all check condition results report EIO. Only use EIOKenneth R Westerback
when b_error has not already been set to something more informative, e.g. EROFS. DO check the result of ffs_sbupdate() and error out of a mount() call when ffs_sbupdate() reports EROFS while attempting a rw mount. Letting RW mounts proceed regardless of EROFS led to crashes and usb problems for Oliver Seufer while using the RW/RO switches on some usb devices. Fix developed using devices kindly supplied by Oliver & Co. ok miod@
2012-03-23Add an entry to the asym list for the NetBSD iSCSI target.Claudio Jeker
OK dlg@
2011-10-10Put the drive in standby mode when we're powering down the machine.Mark Kettenis
tested by dcoppa@, ok krw@, miod@
2011-09-22Fix order of arguments passed to malloc(9) - type first then flags.Joel Sing
2011-09-02generate a devid from vpd page 80 if vpd page 83 doesnt exist or work.David Gwynne
ok krw@
2011-07-18Fix an off-by-1 error and a 32-bit integer arithmetic overflow bugMatthew Dempsky
that caused large disks to appear offline. Discovered and tested by mlarkin@; ok dlg@
2011-07-17Backout a bunch of my SCSI commits from c2k11. At least one of theseMatthew Dempsky
is causing problems when trying to boot sparc64 from an isp(4). Verified to fix the sparc64/isp(4) regression by krw@; ok deraadt@
2011-07-12fix some notyet codeDavid Gwynne
2011-07-12now that we know if a disk is thin provisioned (or an ssd), we can chooseDavid Gwynne
to use the fifo bufq sorting on such disks. there's no point ordering io if the real blocks arent in the order we think they are. ok krw@ tedu@ miod@
2011-07-11ask the disk about unmap (read trim) parameters. check if we have theDavid Gwynne
required vpd pages, then read them for the values we want. we look for the max blocks per unmap, the max descriptors per unmap, and which scsi command to use for unmapping (unmap will be preferred). two fixes and ok matthew@
2011-07-11support "failover" style access to volumes, ie, only use one activeDavid Gwynne
path when talking to an array until it goes away, then you fail over to the next active path. im using this to talk to ses(4) in my dell, and allows us to support arrays that have multiple controllers but have no way of reporting which one is active. using the MRU semantic means we can talk to them without them flipping the active role between its controllers all the time. claudios transtec iscsi box is like this.
2011-07-11disks report trim^Wunmap^Wif theyre thin provisioned via a bit inDavid Gwynne
the read cap 16 data. move the read cap code into sd.c so i can get at this bit without much contorting, and to make it trivial to get at the other interesting things in there later. thin disks report themselves as "thin" in dmesg along with their size now. ok matthew@
2011-07-09Add SCSI_NO_ADAPTER_TARGET as a value for adapters to setMatthew Dempsky
adapter_target to if their adapter isn't addressable on the bus. ok dlg@, krw@
2011-07-08First batch of converting SCSI HBAs from setting saa_targets andMatthew Dempsky
saa_luns instead of adapter_buswidth and luns in the prototype link. ok dlg@, miod@
2011-07-08describe the ata vpd pageDavid Gwynne
2011-07-08sbc3 defines a thin provisioning vpd pageDavid Gwynne
2011-07-08white space fixesDavid Gwynne
2011-07-08add the UGAVALID flag to the block limits vpd pageDavid Gwynne
2011-07-06Eliminate redundant buf validation checks in xxstrategy() methods nowMatthew Dempsky
that they're implemented consistently in bounds_check_with_label(). Also, per krw's request, change bounds_check_with_label() to return 0 if the checks succeed, and change the drivers to test == -1 instead of <= 0. (Man page update to follow; intentionally omitting arch/vax/mba/hp.c from this commit because it doesn't even build currently and miod@ promises to kill it soon.) ok krw@
2011-07-06Add {sc,saa}_{targets,luns} to scsibus_softc and scsibus_attach_args.Matthew Dempsky
These will be used to replace scsi_link's adapter_buswidth and luns fields, but for now we stay compatible with existing SCSI adapter driver conventions while I update them to set the scsibus_attach_args fields directly. ok dlg@
2011-07-05Garbage collect SDEV_S_WAITING and scsi_link->scsibus now that nothingMatthew Dempsky
needs either of them. ok krw@
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@