summaryrefslogtreecommitdiffstats
path: root/sys/scsi (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Fold st_identify_drive() into stattach().krw2019-09-071-33/+19
|
* Tweak some comments and code layout to make MTSETBSIZE and MTSETDENSITYkrw2019-09-071-5/+5
| | | | cases look the same.
* ST_USER_BLKSIZE and ST_QUIRK_BLKSIZE are only tested as an or'd pair.krw2019-09-071-13/+10
| | | | | | Ditto for ST_USER_DENSITY and ST_QUIRK_DENSITY. Thus the origin of the value stored in the mode is irrelevant. Just use two flags (ST_MODE_BLKSIZE and ST_MODE_DENSITY) instead of the existing four.
* ST_Q_FORCE_BLKSIZE is superfluous since it is only used in combination withkrw2019-09-071-12/+11
| | | | | a non-zero value of blksize in the quirkdata. So just check for non-zero value of blksize, as is already done for density.
* Nuke unused flag ST_BLOCK_SET.krw2019-09-071-3/+1
|
* Various struct/variables "modes" -> "mode" since there is only one.krw2019-09-071-13/+13
|
* Nuke some 25+year old comments that the oracles at delphi would havekrw2019-09-051-15/+7
| | | | | | | | found obscure. Repair a broken WangTEK 5150ES quirks entry that apparently suffered some damage when imported in 1995. It never made NetBSD/FreeBSD quirk lists at all. Some whitespace tweaking to make everything line up.
* Devices that have no quirks don't need to appear in the list ofkrw2019-09-051-21/+1
| | | | devices with quirks.
* Nuke unused struct block_desc_cipher. The Eighties called and wantkrw2019-09-051-12/+1
| | | | their "CIPHER ST150S (old drive)" devices back.
* Nuke unused st_softc field 'numblks'.krw2019-09-051-4/+2
|
* There can be only one -- mode.krw2019-09-051-39/+32
| | | | | So fold 'modeflags' field of st_softc into 'flags' field of same. Nuke a bunch of dubious/obvious comments.
* Shuffle sdstart() and sdminphys() declarations closer to their friends.krw2019-09-041-34/+11
| | | | | Nuke pointless 'quirkdata' pointer in st_softc. We use the data once at attach time and don't need to remember where we got it from.
* Hoist the quirks up another rung. drive_quirks is superfluous, justkrw2019-09-041-7/+3
| | | | store the discovered quirks in st_softc's 'quirks' field.
* 'quirks' field of struct modes is superfluous. There is only 1 mode. Just usekrw2019-09-041-30/+29
| | | | the 'quirks' field of struct quirksdata.
* Various whitespace nits.krw2019-09-041-39/+39
| | | | | Reformat quirks array the way the autoindenter likes it to minimize the effort needed to keep diffs short.
* The great density mode purge of 2006 (r1.62) was never carried throughkrw2019-09-041-6/+2
| | | | | | | | to a logical conclusion. Start cleaning up the left overs. First, delete the unused quirk ST_Q_BLKSIZE and simplify the one condition referencing it in light of the fact that !ST_Q_BLKSIZE would always be true.
* Shorten normal dmesg attach verbiage and expand SCSIDEBUG verbiage.krw2019-09-031-134/+128
| | | | ok deraadt@
* Adopt the SCSI versioning #define's from FreeBSD. Eliminate thekrw2019-09-017-49/+55
| | | | | | | | | | | now unneeded version_to_spc() mapping array, a duplicate #define and a couple of magic numbers. Toss in some comments for future generations of spelunkers. Makes it possible to check for specific SPC versions when new features or eliminated features require such a check. No intentional functional change.
* Rectify error made in 2006. SPC-2 == SCSI-3, not SCSI-2!!krw2019-08-301-2/+2
| | | | | | | | Some cd/sd/safte/ses devices will now be correctly identified as SCSI-3 and gain all the advantages associated with that lofty status. e.g. READ CAP 16, REPORT LUNS. ok deraadt@
* Recast "SCSISPC() != 2" into "!SCSI2() || SCSI3()", i.e. "!= 2" intokrw2019-08-281-2/+2
| | | | | "< 2 || > 2". Step towards allowing SCSISPC() to be updated to return actual SPC values.
* Introduce SCSI0(), SCSI2() and SCSI3() defines to clarify (some) useskrw2019-08-286-19/+19
| | | | of SCSISPC() when checking the values of the INQUIRY version field.
* Refactor probing logic to mirror detach logic. i.e. put smarts inkrw2019-08-272-80/+105
| | | | | | | | | | | | scsi_probe() and make scsi_probe_bus(), scsi_probe_target() and scsi_probe_lun() simple wrappers around scsi_probe(). Abstract the determination of which luns to probe into a separate function. Thus eliminating the need to remove/add lun 0 link while probing devices modern enough to support REPORTLUNS. Which means the lun 0 link is no longer in different positions in the scsi_link list for such devices compared to older devices which are blindly probed until an invalid LUN is encountered.
* Simply logic of detaching things. scsi_detach_bus() folded intokrw2019-08-242-55/+45
| | | | | | | scsi_detach(), scsi_detach_target() and scsi_detach_lun() become simple wrappers of scsi_detach() invocations. No intentional functional change.
* KNF tweak.krw2019-08-241-2/+2
|
* T10/BSR INCITS 503 (SPC-5) is apparently a thing. Updatekrw2019-08-221-4/+4
| | | | | | | | | | version_to_spc() to map the formerly reserved value 0x07 in the INQUIRY version field to 5 (a.k.a. SPC-5), instead of 0 (a.k.a. device does not claim support for any SPC version). Tweak comment for 0x03 mapping to note it means compliance to SPC, not SPC-3. Tweak comment for 0x06 mappoing to specify the ANSI INCITS 513-2005 that documents SPC-4.
* scsi_probe_bus() always returns 0. Nobody but scsi_probe() evenkrw2019-08-202-8/+8
| | | | | pretended to care. So just make in a void, and explicitly return 0 in the appropriate case in scsi_probe().
* Every "goto bad" in scsi_probedev() deserves a SC_DEBUG().krw2019-08-181-6/+17
|
* Rename 'link' to 'link0' as it refers to target 0 only.krw2019-08-181-9/+9
|
* When activating or detaching a target don't search the scsi_link SLISTkrw2019-08-181-17/+37
| | | | | | | for each target:lun. Just travese the SLIST once taking care of relevant scsi_link's as they are encountered. ok jmatthew@
* sc_buswidth field in struct scsi_link is redundant. Just usekrw2019-08-182-7/+5
| | | | | adapter_link->adapter_buswidth, which supplied the value for sc_buswidth and is never changed.
* Nuke some unused variables, tweak some declarations andkrw2019-08-177-32/+26
| | | | variable names into a consistant idiom.
* scsi_[add|remove]_link() are local functions so move theirkrw2019-08-142-6/+4
| | | | declarations.
* Whitespace nit. Add {} around body of SLIST_FOREACH().krw2019-08-141-3/+4
|
* Tweak some comments.krw2019-08-141-7/+7
|
* "non-existant" is one of those words that don't exist, so use "non-existent"phessler2019-02-101-4/+4
| | | | | | | instead From Pamela Mosiejczuk, many thanks! OK phessler@ deraadt@
* No leading space(s) before labels.krw2019-01-203-14/+14
| | | | Prodded by guenther@
* When retiring a SCSI request, sometimes the buf's b_error value iskrw2019-01-203-14/+21
| | | | | | | | forcibly set to a value. Make sure that in all those cases the B_ERROR flag is cleared (if b_error is being set to 0) or set (if b_error is being set to non-zero) appropriately. ok dlg@ jmatthew@
* Remove the port id check entirely. We don't do anything with the portjmatthew2018-08-091-2/+2
| | | | | | id after that, so it seems like a silly reason to reject a target. ok dlg@ deraadt@
* hds arrays can have more ports now, apparently; this lets theo use 4 pathsjmatthew2018-07-271-2/+2
| | | | | | to his array rather than just 2. ok dlg@
* Delete superfluous includes of <sys/file.>guenther2018-04-271-2/+1
| | | | ok krw@
* Don't pull in <sys/file.h> just to get fcntl.hguenther2017-12-302-4/+4
| | | | ok deraadt@ krw@
* Fix a broken compilation when using SCSIDEBUG options(4).mlarkin2017-11-111-5/+7
| | | | | | Diff from Carlos Cardenas, thanks! ok krw@
* If you use sys/param.h, you don't need sys/types.hderaadt2017-09-087-15/+8
|
* sd: flush cache when closing writable FDsf2017-05-291-4/+5
| | | | | | | | | Don't skip the cache flush until the last opening of the device is closed. Otherwise, when umounting a writable partition while a different partition is still mounted read-only, the necessary disk flush may be delayed for a very long time. ok krw@ deraadt@
* Add an ioctl to tell storage devices to flush their internal cachessf2017-05-291-11/+25
| | | | | | | Currently implemented for wd and sd. Initially ported from netbsd by pedro@ ok deraadt@
* To prevent anyone else from stumbling on this (now) archaic bit ofkrw2017-05-295-36/+5
| | | | | | | | history, nuke all mentions of XS_NO_CCB and the #define. 2006 - 2017. R.I.P. ok kettenis@ inferred ok dlg@
* Add some comments about the assumptions of the scsi mid layersf2017-05-191-2/+8
| | | | ok krw@
* Also pass the blk offset to disk_unbusy(), so that it can pass it toderaadt2017-05-042-6/+6
| | | | | | the random subsystem as entropy. This value is pretty much unknown, and anyways our entropy input ring does not saturate from knowns. ok mikeb djm
* all pools have their ipl set via pool_setipl, so fold it into pool_init.dlg2016-09-151-8/+5
| | | | | | | | | | | | | | | | | | | | | | the ioff argument to pool_init() is unused and has been for many years, so this replaces it with an ipl argument. because the ipl will be set on init we no longer need pool_setipl. most of these changes have been done with coccinelle using the spatch below. cocci sucks at formatting code though, so i fixed that by hand. the manpage and subr_pool.c bits i did myself. ok tedu@ jmatthew@ @ipl@ expression pp; expression ipl; expression s, a, o, f, m, p; @@ -pool_init(pp, s, a, o, f, m, p); -pool_setipl(pp, ipl); +pool_init(pp, s, a, ipl, f, m, p);
* Remove support for tape block devices. Nobody mount(8)s tapes any longer.naddy2016-09-041-13/+2
| | | | ok deraadt@ guenther@