OpenBSD CVS

CVS log for src/sys/scsi/st.c


[BACK] Up to [local] / src / sys / scsi

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.190 / (download) - annotate - [select for diffs], Thu Apr 27 18:21:44 2023 UTC (13 months, 2 weeks ago) by robert
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, HEAD
Changes since 1.189: +27 -1 lines
Diff to previous 1.189 (colored)

add support for I/O statistics so that tape speeds can be observed with
iostat(8)

Revision 1.189 / (download) - annotate - [select for diffs], Sun Feb 27 02:27:55 2022 UTC (2 years, 3 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.188: +3 -3 lines
Diff to previous 1.188 (colored)

SC_DEBUG() requires an initialized scsi_link. Shuffle
code to make it so.

Pointed out by clang when prodded with SCSIDEBUG.

Revision 1.188 / (download) - annotate - [select for diffs], Tue Jan 11 23:10:11 2022 UTC (2 years, 4 months ago) by jsg
Branch: MAIN
Changes since 1.187: +4 -4 lines
Diff to previous 1.187 (colored)

spelling

Revision 1.187 / (download) - annotate - [select for diffs], Sun Oct 24 16:57:30 2021 UTC (2 years, 7 months ago) by mpi
Branch: MAIN
Changes since 1.186: +2 -2 lines
Diff to previous 1.186 (colored)

Constify struct cfattach.

ok visa@ a long time ago, ok krw@

Revision 1.186 / (download) - annotate - [select for diffs], Fri Mar 12 10:22:46 2021 UTC (3 years, 3 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.185: +4 -4 lines
Diff to previous 1.185 (colored)

spelling

Revision 1.185 / (download) - annotate - [select for diffs], Tue Sep 22 19:32:53 2020 UTC (3 years, 8 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.184: +11 -11 lines
Diff to previous 1.184 (colored)

Since dlg@'s 2009 scsi midlayer refactoring the 'struct scsi_generic *cmd'
member of 'struct scsi_xfer' has always been pointed at the 'struct scsi_generic
cmdstore' member of the same instance. So nuke 'cmdstore' and remove the '*'
from cmd. Take the address of cmd as required by the various casts.

No intentional functional change.

luna88k test by aoyama@, sparc64 test by jmatthew@

Identification of 2009's last *cmd use and ok jmatthew@

Revision 1.184 / (download) - annotate - [select for diffs], Sat Aug 22 15:07:11 2020 UTC (3 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.183: +1 -5 lines
Diff to previous 1.183 (colored)

The last timeout_add(sc_timeout) died in the great XS_NO_CCB purge of 2017. Nuke
pointless timeout_set(sc_timoeut) and timeout_del(sc_timeout) calls and the
sc_timeout fields themselves.

Revision 1.183 / (download) - annotate - [select for diffs], Thu Aug 20 01:47:45 2020 UTC (3 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.182: +8 -8 lines
Diff to previous 1.182 (colored)

Revert DYING. At least some USB memory sticks get very upset.

Revision 1.182 / (download) - annotate - [select for diffs], Wed Aug 19 14:53:39 2020 UTC (3 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.181: +8 -8 lines
Diff to previous 1.181 (colored)

Nuke SDF_DYING, CDF_DYING and ST_DYING flags. Use the scsi_link flag
SDEV_S_DYING instead. Makes it clear that the scsi_link and the [cd|sd|st]
device  always agree on their state.

Revision 1.181 / (download) - annotate - [select for diffs], Sat Aug 15 17:50:45 2020 UTC (3 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.180: +2 -5 lines
Diff to previous 1.180 (colored)

The last SET()s of CDF_WAITING, SDF_WAITING, and ST_WAITING died in the great
XS_NO_CCB purge of 2017.

Nuke pointless ISSET()/CLR() checks and the #define's.

Revision 1.180 / (download) - annotate - [select for diffs], Tue Aug 11 15:23:57 2020 UTC (3 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.179: +2 -1 lines
Diff to previous 1.179 (colored)

Explicitly #include <scsi/scsi_debug.h> rather than assuming scsiconf.h will do
it.

Prepares for removal of #include <scsi/scsi_debug.h> from scsiconf.h as soon as
the alpha tester digs out from hurricane to compile last untested files.

Revision 1.179 / (download) - annotate - [select for diffs], Thu Jul 16 14:44:55 2020 UTC (3 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.178: +3 -3 lines
Diff to previous 1.178 (colored)

Access scsibus_softc info (luns, adapter, adapter_target,
adapter_softc, adapter_buswidth) via link->bus rather than using
copies currently residing in the link.

Revision 1.178 / (download) - annotate - [select for diffs], Tue Jun 30 18:43:37 2020 UTC (3 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.177: +3 -3 lines
Diff to previous 1.177 (colored)

Nuke unneeded 'sa_inqbuf' member of struct scsi_attach_args. It always
points to the inquiry data contained in the struct scsi_link pointed
to by the other member, sa_sc_link.

Revision 1.177 / (download) - annotate - [select for diffs], Thu Feb 20 16:26:02 2020 UTC (4 years, 3 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.176: +3 -3 lines
Diff to previous 1.176 (colored)

Relax the grip the dead hand of QBUS (a.k.a. MAXPHYS) has on the
throat of physio().

Allows individual devices to eventually be modified to support larger
physio() (a.k.a. 'raw') i/o's if they prove capable of them.

No immediate functional change.

Tested for many weeks by and ok robert@.

Revision 1.176 / (download) - annotate - [select for diffs], Wed Feb 5 16:29:30 2020 UTC (4 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.175: +5 -4 lines
Diff to previous 1.175 (colored)

Nuke unnecessary abstraction 'scsi_minphys()' which just calls
'minphys()'. Just use & check for NULL instead, since 'minphys()' is
always called on the code path ([cd|sd|st]minphys) that calls
physio().

Revision 1.175 / (download) - annotate - [select for diffs], Mon Jan 27 07:41:02 2020 UTC (4 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.174: +10 -8 lines
Diff to previous 1.174 (colored)

Make the commonalities of cdminphys, sdminphys and stminphys more
obvious by consistently using the variable names and idiom of
sdminphys.

No functional change.

Revision 1.174 / (download) - annotate - [select for diffs], Sun Jan 26 00:53:31 2020 UTC (4 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.173: +3 -3 lines
Diff to previous 1.173 (colored)

Shuffle some names around to make reading the code less headache
inducing. Rename scsi_adapter member 'scsi_minphys' to 'dev_minphys'
to reflect what it is supposed to do. Use consistent naming convention
(<dev>_minphys) for the actual device functions.

No functional change.

Revision 1.173 / (download) - annotate - [select for diffs], Sat Jan 25 21:40:35 2020 UTC (4 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.172: +3 -1 lines
Diff to previous 1.172 (colored)

Ensure scsi_minphys() is always called on the physio() path.

Will allow simplification of individual driver *minphys() functions.

ok jmatthew@ as part of larger diff

Revision 1.172 / (download) - annotate - [select for diffs], Thu Dec 5 18:42:14 2019 UTC (4 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.171: +9 -5 lines
Diff to previous 1.171 (colored)

Shrink scsi_mode_do_sense() parameter list by eliminating the three
pointers returning possible block descriptor values for block size,
block count and density. Most calls were passing "NULL, NULL, NULL"
since they did not care.

Call scsi_parse_blkdesc() directly in those few cases where one or
more of the values is of interest.

No intentional functional change.

Revision 1.171 / (download) - annotate - [select for diffs], Tue Nov 26 20:48:03 2019 UTC (4 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.170: +4 -1 lines
Diff to previous 1.170 (colored)

Don't zero existing values for density, block_count and block_size in
scsi_do_mode_sense(). Just update the values when valid data is
available. Initialize the variables passed to scsi_do_mode_sense() in
the one instance where they weren't already set.

Fixes issue with softraid crypto volumes on 4K-sector disks.

Found, fix tested, and ok tim@

Revision 1.170 / (download) - annotate - [select for diffs], Sat Nov 23 17:10:13 2019 UTC (4 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.169: +3 -3 lines
Diff to previous 1.169 (colored)

Consistently use ISSET() to check for set flags.

Revision 1.169 / (download) - annotate - [select for diffs], Sun Sep 29 17:57:36 2019 UTC (4 years, 8 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.168: +2 -4 lines
Diff to previous 1.168 (colored)

Introduce SC_DEBUG_SENSE() and simplify code by eliminating a bunch
of three line SCSIDEBUG chunks.

Revision 1.168 / (download) - annotate - [select for diffs], Sun Sep 29 17:23:24 2019 UTC (4 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.167: +5 -6 lines
Diff to previous 1.167 (colored)

Continue SCSIDEBUG cleanup by nuking pointles SC_DEBUGN() #define.

Revision 1.167 / (download) - annotate - [select for diffs], Sun Sep 29 15:47:29 2019 UTC (4 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.166: +2 -2 lines
Diff to previous 1.166 (colored)

Tweak some whitespace to make autoindenter happy. Use consistent naming idiom for
the debug functions.

Revision 1.166 / (download) - annotate - [select for diffs], Fri Sep 27 17:22:31 2019 UTC (4 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.165: +3 -3 lines
Diff to previous 1.165 (colored)

Add/tweak #endif comments to make spelunking via grep more rewarding.

Revision 1.165 / (download) - annotate - [select for diffs], Tue Sep 10 23:07:46 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.164: +3 -4 lines
Diff to previous 1.164 (colored)

Shuffle a couple of lines to make the device -> st_softc dances look
the same.

Revision 1.164 / (download) - annotate - [select for diffs], Tue Sep 10 22:39:13 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.163: +13 -28 lines
Diff to previous 1.163 (colored)

No need to check for ST_MOUNTED before calling st_mount_tape() AND in
st_mount_tape(). Just keep the latter.

st_mount_tape() is called from inside stopen() which has already found
the relevant st_softc(), incremented the device reference count, and
checked if it is dying. No need to repeast that in
st_mount_tape(). Just pass the st_softc.

Revision 1.163 / (download) - annotate - [select for diffs], Tue Sep 10 19:04:36 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.162: +51 -51 lines
Diff to previous 1.162 (colored)

return is not a funciton call. Avoid pointless parenthesis.

Revision 1.162 / (download) - annotate - [select for diffs], Tue Sep 10 18:45:45 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.161: +7 -7 lines
Diff to previous 1.161 (colored)

Explicitly check error results against 0.

Revision 1.161 / (download) - annotate - [select for diffs], Tue Sep 10 16:55:42 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.160: +15 -15 lines
Diff to previous 1.160 (colored)

Some stray bit twiddles that were using yet another idiom.

Revision 1.160 / (download) - annotate - [select for diffs], Tue Sep 10 16:08:43 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.159: +7 -7 lines
Diff to previous 1.159 (colored)

check pointer against NULL and error values against 0.

Revision 1.159 / (download) - annotate - [select for diffs], Tue Sep 10 15:44:43 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.158: +2 -2 lines
Diff to previous 1.158 (colored)

Last (?) small bit twiddling modernization.

Revision 1.158 / (download) - annotate - [select for diffs], Tue Sep 10 14:16:36 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.157: +8 -8 lines
Diff to previous 1.157 (colored)

!ISSET() for various flags.

Revision 1.157 / (download) - annotate - [select for diffs], Tue Sep 10 12:58:55 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.156: +14 -14 lines
Diff to previous 1.156 (colored)

SET/CLR/ISSET all at once for st->quirks, and a few other rare flags.

Revision 1.156 / (download) - annotate - [select for diffs], Mon Sep 9 23:28:41 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.155: +16 -16 lines
Diff to previous 1.155 (colored)

SET/CLR/ISSET all at once for the far less numerous link->flags.

Revision 1.155 / (download) - annotate - [select for diffs], Mon Sep 9 18:59:20 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.154: +27 -27 lines
Diff to previous 1.154 (colored)

Continue bit twiddling tweaks. Use SET() with st->flags.

Revision 1.154 / (download) - annotate - [select for diffs], Mon Sep 9 18:25:47 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.153: +29 -29 lines
Diff to previous 1.153 (colored)

Lots of st->flags bit clearing in a mix of old school and CLR() makes
code harder to read. Switch to CLR().

No change to executable.

Revision 1.153 / (download) - annotate - [select for diffs], Mon Sep 9 18:02:12 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.152: +36 -36 lines
Diff to previous 1.152 (colored)

Lots of st->flags checking in a mix of old school and ISSET() makes
code harder to read. Switch to ISSET() where obvious.

No change to executable.

Revision 1.152 / (download) - annotate - [select for diffs], Mon Sep 9 01:37:27 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.151: +16 -13 lines
Diff to previous 1.151 (colored)

Tweak some comments to be useful. Sort switch cases into
numerical order. Move bit of logic before calling
st_unmount() into st_unmount().

Revision 1.151 / (download) - annotate - [select for diffs], Sat Sep 7 15:26:07 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.150: +19 -33 lines
Diff to previous 1.150 (colored)

Fold st_identify_drive() into stattach().

Revision 1.150 / (download) - annotate - [select for diffs], Sat Sep 7 02:30:40 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.149: +5 -5 lines
Diff to previous 1.149 (colored)

Tweak some comments and code layout to make MTSETBSIZE and MTSETDENSITY
cases look the same.

Revision 1.149 / (download) - annotate - [select for diffs], Sat Sep 7 02:07:08 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.148: +10 -13 lines
Diff to previous 1.148 (colored)

ST_USER_BLKSIZE and ST_QUIRK_BLKSIZE are only tested as an or'd pair.
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.

Revision 1.148 / (download) - annotate - [select for diffs], Sat Sep 7 01:47:48 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.147: +11 -12 lines
Diff to previous 1.147 (colored)

ST_Q_FORCE_BLKSIZE is superfluous since it is only used in combination with
a non-zero value of blksize in the quirkdata. So just check for non-zero
value of blksize, as is already done for density.

Revision 1.147 / (download) - annotate - [select for diffs], Sat Sep 7 01:27:02 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.146: +1 -3 lines
Diff to previous 1.146 (colored)

Nuke unused flag ST_BLOCK_SET.

Revision 1.146 / (download) - annotate - [select for diffs], Sat Sep 7 01:15:41 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.145: +13 -13 lines
Diff to previous 1.145 (colored)

Various struct/variables "modes" -> "mode" since there is only one.

Revision 1.145 / (download) - annotate - [select for diffs], Thu Sep 5 18:49:03 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.144: +7 -15 lines
Diff to previous 1.144 (colored)

Nuke some 25+year old comments that the oracles at delphi would have
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.

Revision 1.144 / (download) - annotate - [select for diffs], Thu Sep 5 17:35:28 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.143: +1 -21 lines
Diff to previous 1.143 (colored)

Devices that have no quirks don't need to appear in the list of
devices with quirks.

Revision 1.143 / (download) - annotate - [select for diffs], Thu Sep 5 03:04:45 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.142: +2 -4 lines
Diff to previous 1.142 (colored)

Nuke unused st_softc field 'numblks'.

Revision 1.142 / (download) - annotate - [select for diffs], Thu Sep 5 02:37:17 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.141: +32 -39 lines
Diff to previous 1.141 (colored)

There can be only one -- mode.

So fold 'modeflags' field of st_softc into 'flags' field of same. Nuke
a bunch of dubious/obvious comments.

Revision 1.141 / (download) - annotate - [select for diffs], Wed Sep 4 23:40:28 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.140: +11 -34 lines
Diff to previous 1.140 (colored)

Shuffle sdstart() and sdminphys() declarations closer to their friends.

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.

Revision 1.140 / (download) - annotate - [select for diffs], Wed Sep 4 20:03:12 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.139: +3 -7 lines
Diff to previous 1.139 (colored)

Hoist the quirks up another rung. drive_quirks is superfluous, just
store the discovered quirks in st_softc's 'quirks' field.

Revision 1.139 / (download) - annotate - [select for diffs], Wed Sep 4 19:09:41 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.138: +29 -30 lines
Diff to previous 1.138 (colored)

'quirks' field of struct modes is superfluous. There is only 1 mode. Just use
the 'quirks' field of struct quirksdata.

Revision 1.138 / (download) - annotate - [select for diffs], Wed Sep 4 18:41:33 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.137: +39 -39 lines
Diff to previous 1.137 (colored)

Various whitespace nits.

Reformat quirks array the way the autoindenter likes it to minimize
the effort needed to keep diffs short.

Revision 1.137 / (download) - annotate - [select for diffs], Wed Sep 4 17:15:56 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.136: +2 -6 lines
Diff to previous 1.136 (colored)

The great density mode purge of 2006 (r1.62) was never carried through
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.

Revision 1.136 / (download) - annotate - [select for diffs], Sat Aug 17 15:31:41 2019 UTC (4 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.135: +2 -3 lines
Diff to previous 1.135 (colored)

Nuke some unused variables, tweak some declarations and
variable names into a consistant idiom.

Revision 1.135 / (download) - annotate - [select for diffs], Sun Jan 20 03:28:19 2019 UTC (5 years, 4 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.134: +8 -6 lines
Diff to previous 1.134 (colored)

When retiring a SCSI request, sometimes the buf's b_error value is
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@

Revision 1.134 / (download) - annotate - [select for diffs], Fri Sep 8 05:36:53 2017 UTC (6 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.133: +1 -2 lines
Diff to previous 1.133 (colored)

If you use sys/param.h, you don't need sys/types.h

Revision 1.133 / (download) - annotate - [select for diffs], Mon May 29 07:47:13 2017 UTC (7 years ago) by krw
Branch: MAIN
Changes since 1.132: +1 -10 lines
Diff to previous 1.132 (colored)

To prevent anyone else from stumbling on this (now) archaic bit of
history, nuke all mentions of XS_NO_CCB and the #define.

2006 - 2017. R.I.P.

ok kettenis@ inferred ok dlg@

Revision 1.132 / (download) - annotate - [select for diffs], Sun Sep 4 10:51:24 2016 UTC (7 years, 9 months ago) by naddy
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.131: +2 -13 lines
Diff to previous 1.131 (colored)

Remove support for tape block devices. Nobody mount(8)s tapes any longer.
ok deraadt@ guenther@

Revision 1.131 / (download) - annotate - [select for diffs], Sat Mar 12 15:16:04 2016 UTC (8 years, 3 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.130: +74 -74 lines
Diff to previous 1.130 (colored)

Standardize on calling local scsi_link variables 'link' instead of
'sc_link'. 'sc_link' is a field in the various device *_softc
structures, where the sc_ prefix was for 'softc'. Reduces potential
mental confusion. Newer code from down under was already using
'link'.

No functional change.

Prompted by bluhm@'s adventures in scsi. ok dlg@ jmatthew@

Revision 1.130 / (download) - annotate - [select for diffs], Fri Mar 11 17:12:17 2016 UTC (8 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.129: +2 -2 lines
Diff to previous 1.129 (colored)

"if (_3btol(cmd->len) != 0)" is more likely to be a useful test than
"if (cmd->len) != 0)", as cmd->len is a 3 byte array.

Broken since media_blkno accounting was introduced in r1.72 (2007!).
Might fix some obscure tape issues around miscounting variable sized blocks.

Spotted by mmcc@ and his friend clang.

Revision 1.129 / (download) - annotate - [select for diffs], Sun Jun 7 19:13:27 2015 UTC (9 years ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.128: +5 -5 lines
Diff to previous 1.128 (colored)

More damned eye searing whitespace.

Revision 1.128 / (download) - annotate - [select for diffs], Tue Dec 16 18:30:04 2014 UTC (9 years, 5 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.127: +8 -8 lines
Diff to previous 1.127 (colored)

primary change: move uvm_vnode out of vnode, keeping only a pointer.
objective: vnode.h doesn't include uvm_extern.h anymore.
followup changes: include uvm_extern.h or lock.h where necessary.
ok and help from deraadt

Revision 1.127 / (download) - annotate - [select for diffs], Sun Sep 14 14:17:26 2014 UTC (9 years, 8 months ago) by jsg
Branch: MAIN
Changes since 1.126: +1 -2 lines
Diff to previous 1.126 (colored)

remove uneeded proc.h includes
ok mpi@ kspillner@

Revision 1.126 / (download) - annotate - [select for diffs], Fri Nov 1 17:36:19 2013 UTC (10 years, 7 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.125: +2 -2 lines
Diff to previous 1.125 (colored)

Sprinkle (long long) casts where %lld is being used to print daddr_t
variables. Some random whitespace/knf repairs encountered on the way.

ok miod@ on inspection, feedback & more suggestions from millert@

Revision 1.125 / (download) - annotate - [select for diffs], Thu Oct 3 14:07:42 2013 UTC (10 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.124: +2 -2 lines
Diff to previous 1.124 (colored)

Print daddr_t variables with %lld, u_int64_t variables with %llu.

Revision 1.124 / (download) - annotate - [select for diffs], Fri Jul 5 01:22:25 2013 UTC (10 years, 11 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.123: +17 -14 lines
Diff to previous 1.123 (colored)

Tweak calculations of resid to avoid unsigned vs signed comparison and
make code clearer.

Pointed out by brad@ and his friend llvm.

Revision 1.123 / (download) - annotate - [select for diffs], Tue Jun 11 16:42:17 2013 UTC (11 years ago) by deraadt
Branch: MAIN
Changes since 1.122: +2 -2 lines
Diff to previous 1.122 (colored)

final removal of daddr64_t.  daddr_t has been 64 bit for a long enough
test period; i think 3 years ago the last bugs fell out.
ok otto beck others

Revision 1.122 / (download) - annotate - [select for diffs], Thu Jun 6 14:00:44 2013 UTC (11 years ago) by krw
Branch: MAIN
Changes since 1.121: +88 -33 lines
Diff to previous 1.121 (colored)

Fix EOM handling. Makes Bacula much happier by allowing the use of
both 'Fast Forward Space File = yes' and 'Hardware End of Medium = yes'.

Mostly taken from FreeBSD.

Constant prodding by robert@, testing actual backup and restore by
ajacoutot@.

Revision 1.121 / (download) - annotate - [select for diffs], Sun Jul 3 15:47:18 2011 UTC (12 years, 11 months ago) by matthew
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.120: +1 -4 lines
Diff to previous 1.120 (colored)

Remove config_activate() and DVACT_ACTIVATE.  PCMCIA's the only thing
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

Revision 1.120 / (download) - annotate - [select for diffs], Tue Jun 7 15:42:29 2011 UTC (13 years ago) by matthew
Branch: MAIN
Changes since 1.119: +2 -24 lines
Diff to previous 1.119 (colored)

Fix a device reference leak in st{read,write}() by making them work
like {cd,sd}{read,write}().

ok krw@, dlg@

Revision 1.119 / (download) - annotate - [select for diffs], Thu Mar 31 18:42:48 2011 UTC (13 years, 2 months ago) by jasper
Branch: MAIN
Changes since 1.118: +3 -3 lines
Diff to previous 1.118 (colored)

- use nitems(); no binary change.

ok krw@

Revision 1.118 / (download) - annotate - [select for diffs], Fri Mar 18 22:59:34 2011 UTC (13 years, 2 months ago) by matthew
Branch: MAIN
Changes since 1.117: +9 -14 lines
Diff to previous 1.117 (colored)

Fix stdetach() to call vdevgone() with the right device minor numbers.
Some stylistic tweaks after discussions with krw@ and deraadt@.

ok krw@; "Lovely" deraadt@

Revision 1.117 / (download) - annotate - [select for diffs], Thu Mar 17 21:30:24 2011 UTC (13 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.116: +67 -59 lines
Diff to previous 1.116 (colored)

use dma_alloc/dma_free instead of malloc to allocate buffers which need
to be in the right address space.
help from matthew and krw

Revision 1.116 / (download) - annotate - [select for diffs], Fri Dec 24 02:45:33 2010 UTC (13 years, 5 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.115: +12 -10 lines
Diff to previous 1.115 (colored)

Have sd(4) devices check for and respect read-only information the
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@

Revision 1.115 / (download) - annotate - [select for diffs], Wed Oct 13 02:14:52 2010 UTC (13 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.114: +1 -5 lines
Diff to previous 1.114 (colored)

No need to check ST_DYING flag twice in succession.

Noticed by Damien McGuckin. Thanks!

Revision 1.114 / (download) - annotate - [select for diffs], Wed Sep 22 01:18:57 2010 UTC (13 years, 8 months ago) by matthew
Branch: MAIN
Changes since 1.113: +3 -3 lines
Diff to previous 1.113 (colored)

All users of physio(9) now pass NULL as the buf pointer argument, so
no point in keeping it around.

"i like this" thib@ (a while back); ok krw@ and oga@; reminder to
update the man page and tweaks jmc@

Revision 1.113 / (download) - annotate - [select for diffs], Mon Sep 20 02:51:52 2010 UTC (13 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.112: +1 -2 lines
Diff to previous 1.112 (colored)

bufq_drain() does not need to be done in deactivate; we only need
to deactivate transactions we are currently doing.
ok dlg

Revision 1.112 / (download) - annotate - [select for diffs], Tue Sep 14 04:49:42 2010 UTC (13 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.111: +4 -2 lines
Diff to previous 1.111 (colored)

dont leak an xs in ststart if its called while the device is dying.

pointed out by matthew@

Revision 1.111 / (download) - annotate - [select for diffs], Tue Sep 14 04:02:43 2010 UTC (13 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.110: +2 -1 lines
Diff to previous 1.110 (colored)

scsi_xsh_del the xs handler on DEACTIVATE.

same change as sd.c r1.212. matthew@ pointed out that cd(4) and
st(4) would need the same change.

Revision 1.110 / (download) - annotate - [select for diffs], Tue Sep 14 01:43:38 2010 UTC (13 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.109: +65 -76 lines
Diff to previous 1.109 (colored)

Clean up sense mode handling to make residual value handling clearer
and more plausibly correct.

Tested by jsing@ and myself.

Revision 1.109 / (download) - annotate - [select for diffs], Wed Sep 1 23:24:03 2010 UTC (13 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.108: +2 -1 lines
Diff to previous 1.108 (colored)

Don't give xs->resid an invalid value (xs->datalen * st->blksize)
inside st_interpret_sense() and then exit without making sure it's
set back to <= xs->datalen.

Fixes 'done < 0; strategy broken' panics when un-tar'ing /cvs from
my ahci DAT tape drive.

ok dlg@ more-or-less-ok matthew@

Revision 1.108 / (download) - annotate - [select for diffs], Wed Sep 1 01:38:12 2010 UTC (13 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.107: +11 -11 lines
Diff to previous 1.107 (colored)

make struct bufq a member of the softc for devices that use it,
rather than it being a pointer to something that needs to be allocated
at attach. since all these devices need a bufq to operate, it makes
sense to have it allocated as part of the softc and get bufq_init
to just initialise all its fields. it also gets rid of the possibility
that you wont be able to allocate the bufq struct during attach,
which is something you dont want to happen.

secondly, it consistently implements a split between wrapper functions
and the per discipline implementation of the bufq handlers. it
consistently does the locking in the wrappers rather than doing
half in the wrappers and the other half in the implementations.

it also consistently handles the outstanding bufq bq pointer in the
wrappers.

this hides most of the implementation inside kern_bufq.c. the only
stuff left in buf.h is for the bits each implementation needs to
put inside struct buf.

tested by thib@ krw@ and me
ok thib@ matthew@
no objection from krw@

Revision 1.107 / (download) - annotate - [select for diffs], Mon Aug 30 02:47:56 2010 UTC (13 years, 9 months ago) by matthew
Branch: MAIN
Changes since 1.106: +10 -8 lines
Diff to previous 1.106 (colored)

Avoid possible aliasing-related compiler issues by always writing to
cmd->opcode through the type casted command pointer rather than
through xs->cmd->opcode.

Requested by deraadt@; ok krw@.

Revision 1.106 / (download) - annotate - [select for diffs], Thu Jul 22 05:26:34 2010 UTC (13 years, 10 months ago) by matthew
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.105: +9 -3 lines
Diff to previous 1.105 (colored)

In st_space() and st_write_filemarks(), if scsi_xs_get() returns NULL,
set st->media_fileno and st->media_blkno before returning.  Not sure
if this is needed or even really correct, but it's an unintentional
behavior change due to removing scsi_scsi_cmd().

ok dlg@

Revision 1.105 / (download) - annotate - [select for diffs], Thu Jul 22 00:31:06 2010 UTC (13 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.104: +127 -86 lines
Diff to previous 1.104 (colored)

Eliminate scsi_scsi_cmd() now that ss(4) is gone and with it the
last bastardized sync and buf call through scsi_scsi_cmd(). Flatten
code to call scsi_xs_sync() directly for all commands.

Airplane typos shaken out by various.

ok dlg@ matthew@ deraadt@

Revision 1.93.2.1 / (download) - annotate - [select for diffs], Tue Jul 6 08:48:50 2010 UTC (13 years, 11 months ago) by stephan
Branch: OPENBSD_4_7
Changes since 1.93: +9 -2 lines
Diff to previous 1.93 (colored) next main 1.94 (colored)

MFC, original commit from krw@:

Revision 1.104 / (download) - annotate - [select for diffs], Thu Jul 1 05:11:18 2010 UTC (13 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.103: +10 -14 lines
Diff to previous 1.103 (colored)

Die struct scsi_device! Die! Instead, save a pointer to the routine
to interpret sense errors. This is initialized to the basic
interpretation routine, and specific scsi drivers (sd/st/cd) can
replace this with their own. While here kill EJUSTRETURN dance and
make more specialized interpretation routines directly call the
basic routine if desired.

Fixes by matthew@ to my first diff. Most original work by dlg@.

ok matthew@ marco@ dlg@

Revision 1.103 / (download) - annotate - [select for diffs], Thu Jul 1 03:01:37 2010 UTC (13 years, 11 months ago) by matthew
Branch: MAIN
Changes since 1.102: +2 -1 lines
Diff to previous 1.102 (colored)

Restore setting xs->bp; fixes ncr(4) on VAX.

ok miod@, krw@

Revision 1.102 / (download) - annotate - [select for diffs], Wed Jun 30 02:17:25 2010 UTC (13 years, 11 months ago) by matthew
Branch: MAIN
Changes since 1.101: +1 -18 lines
Diff to previous 1.101 (colored)

Prune some dead assignments in st_interpret_sense(); st(4) already
always explicitly sets bp->b_resid before calling biodone(), so these
are unneeded.

ok krw@

Revision 1.101 / (download) - annotate - [select for diffs], Tue Jun 29 07:08:07 2010 UTC (13 years, 11 months ago) by matthew
Branch: MAIN
Changes since 1.100: +2 -2 lines
Diff to previous 1.100 (colored)

Change st(4) to use the FIFO buf sorting discipline rather than the
default disk-sorting one.

ok krw@

Revision 1.100 / (download) - annotate - [select for diffs], Sat Jun 26 23:24:45 2010 UTC (13 years, 11 months ago) by guenther
Branch: MAIN
Changes since 1.99: +1 -2 lines
Diff to previous 1.99 (colored)

Don't #include <sys/user.h> into files that don't need the stuff
it defines.  In some cases, this means pulling in uvm.h or pcb.h
instead, but most of the inclusions were just noise.  Tested on
alpha, amd64, armish, hppa, i386, macpcc, sgi, sparc64, and vax,
mostly by krw and naddy.
ok krw@

Revision 1.99 / (download) - annotate - [select for diffs], Fri Jun 25 04:29:39 2010 UTC (13 years, 11 months ago) by dlg
Branch: MAIN
Changes since 1.98: +79 -107 lines
Diff to previous 1.98 (colored)

move st over to using xshandlers for scheduling io. based on the
same changes in cd and sd.

tested by and ok krw@

Revision 1.98 / (download) - annotate - [select for diffs], Wed Jun 16 00:20:06 2010 UTC (13 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.97: +11 -10 lines
Diff to previous 1.97 (colored)

Bring ststrategy() into line with sdstrategy() and cdstrategy(), making
sure buf's are correctly completed.

Feedback from Matthew Dempsky.

ok dlg@

Revision 1.97 / (download) - annotate - [select for diffs], Tue Jun 15 04:11:34 2010 UTC (13 years, 11 months ago) by dlg
Branch: MAIN
Changes since 1.96: +2 -2 lines
Diff to previous 1.96 (colored)

dont pass the dev_t from the scsi device drivers into the midlayer for
ioctl requests, and dont pass the proc pointers around for any ioctl
requests in scsi land at all. neither were used, so trim the fat.

ok krw@ marco@

Revision 1.96 / (download) - annotate - [select for diffs], Fri Jun 11 12:02:44 2010 UTC (14 years ago) by krw
Branch: MAIN
Changes since 1.95: +9 -3 lines
Diff to previous 1.95 (colored)

Restore an unusual XS_SENSE semantic that inadvertantly got lost
in the great re-write. If the scsi device *_interpret_sense()
function returns 0 that means there was no error.

Fixes restore(8) problems seen on certain tape drives.

Found and fix tested by Percey Piper. Suggestions from Matthew
Dempsky. Thanks!

ok dlg@

Revision 1.95 / (download) - annotate - [select for diffs], Tue Jun 1 15:27:16 2010 UTC (14 years ago) by thib
Branch: MAIN
Changes since 1.94: +12 -17 lines
Diff to previous 1.94 (colored)

move cd, st & ss over to bufq's again.

Tested by myself and krw.
ok krw@

Revision 1.94 / (download) - annotate - [select for diffs], Mon Apr 12 09:51:48 2010 UTC (14 years, 2 months ago) by dlg
Branch: MAIN
Changes since 1.93: +4 -3 lines
Diff to previous 1.93 (colored)

i snuck fine grained locking into the midlayer as part of all the
other stuff ive been doing in here. everything that needs protection
inside the midlayer and the scsi device drivers (sd, cd, etc) uses
mutexes now.

this pushes splbio out of the midlayer. splbio is only taken before
biodone is called now.

ok beck@ marco@ krw@ deraadt@. theyre all terrified, but they all
say if we're going to do then now is the right stage of the dev
cycle.

Revision 1.93 / (download) - annotate - [select for diffs], Fri Jan 15 05:50:31 2010 UTC (14 years, 4 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE
Branch point for: OPENBSD_4_7
Changes since 1.92: +11 -75 lines
Diff to previous 1.92 (colored)

Abstract and merge the manual buf queue manipulating functions into
one place for easier debugging and maintenance. No intended functional
changes.

ok dlg@

Revision 1.92 / (download) - annotate - [select for diffs], Fri Jan 15 05:31:38 2010 UTC (14 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.91: +10 -3 lines
Diff to previous 1.91 (colored)

Restore XS_BUSY delay behaviour for buf i/o. Same as for sync path.

ok dlg@

Revision 1.91 / (download) - annotate - [select for diffs], Tue Jan 12 23:33:57 2010 UTC (14 years, 5 months ago) by dlg
Branch: MAIN
Changes since 1.90: +2 -2 lines
Diff to previous 1.90 (colored)

bring sd.c r1.180 over to the other drivers now using the antisemaphore,
ie, dont clear the WAITING flag when restarting the xxstart loops.

Revision 1.90 / (download) - annotate - [select for diffs], Mon Jan 11 08:56:17 2010 UTC (14 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.89: +29 -16 lines
Diff to previous 1.89 (colored)

Bring mutex protections to ststart, cdstart and ssstart, as already
done in sd. Make names consistant across all three.

ok dlg@ tested (cd) & ok beck@

Revision 1.89 / (download) - annotate - [select for diffs], Sat Jan 9 21:12:06 2010 UTC (14 years, 5 months ago) by dlg
Branch: MAIN
Changes since 1.88: +1 -15 lines
Diff to previous 1.88 (colored)

dont try to prevent multiple concurrent runs of a devices start routine
by setting flags around the loop. there is a race which can prevent
necessary work being completed by any of the currently running instances
of xxstart.

the caveat with the removal of this code is because multiple xxstarts can
be running at the same time they can cause io reordering, but that is less
of a problem than no io.

found by and fix tested by claudio@
debugged with krw@ claudio@ beck@ deraadt@

Revision 1.88 / (download) - annotate - [select for diffs], Sat Dec 26 09:12:55 2009 UTC (14 years, 5 months ago) by dlg
Branch: MAIN
Changes since 1.87: +157 -70 lines
Diff to previous 1.87 (colored)

move st over to the new midlayer.

much testing and debugging from krw@
his diff was a nice christmas present

Revision 1.87 / (download) - annotate - [select for diffs], Tue Oct 13 19:33:19 2009 UTC (14 years, 8 months ago) by pirofti
Branch: MAIN
Changes since 1.86: +3 -3 lines
Diff to previous 1.86 (colored)

Get rid of devact enum, substitute it with an int and coresponding defines.

This is needed for the addition of further suspend/resume actions.

Okay deraadt@, marco@.

Revision 1.86 / (download) - annotate - [select for diffs], Mon Feb 16 21:19:07 2009 UTC (15 years, 3 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.85: +18 -5 lines
Diff to previous 1.85 (colored)

Extend the scsi_adapter minphys() callback to take a struct scsi_link *
as additional argument. This will allow intermediate layers between
scsi devices such as sd and scsi host adapters to take appropriate
action if necessary.

Revision 1.85 / (download) - annotate - [select for diffs], Mon Sep 22 19:44:41 2008 UTC (15 years, 8 months ago) by miod
Branch: MAIN
Changes since 1.84: +2 -2 lines
Diff to previous 1.84 (colored)

Do not return an uninitialized value on success in stclose().

ok krw@

Revision 1.84 / (download) - annotate - [select for diffs], Sat Sep 6 15:35:02 2008 UTC (15 years, 9 months ago) by krw
Branch: MAIN
Changes since 1.83: +3 -4 lines
Diff to previous 1.83 (colored)

Return EIO when the residual is > xs->datalen, even if SCSI_SILENT is
set. SCSI_SILENT mediates printing error messages only.

Revision 1.83 / (download) - annotate - [select for diffs], Sun Jun 22 16:32:06 2008 UTC (15 years, 11 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.82: +5 -6 lines
Diff to previous 1.82 (colored)

Replace MUSTEK_RETRIES, SCANJET_RETRIES and ST_RETRIES with SCSI_RETRIES,
all defined to 4. Replace some magic number 4's with SCSI_RETRIES. Fix a
few lines that were now too long.

Revision 1.82 / (download) - annotate - [select for diffs], Mon May 12 22:14:46 2008 UTC (16 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.81: +102 -53 lines
Diff to previous 1.81 (colored)

Fix device reference counting. Now that we try to support detachable
tape drives it is nice not to crash if one is detached. Basically use
a consistant mechanism modelled on sd to lookup devices and do the
device reference increments and decrements. Problem reported (PR#5811)
and fix tested by Jozef Hatala. Still some corner cases Jozef is
looking for but we'll fix those as discovered.

Revision 1.81 / (download) - annotate - [select for diffs], Fri May 9 00:25:41 2008 UTC (16 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.80: +3 -3 lines
Diff to previous 1.80 (colored)

Oops. When detaching tape drives look for devices using 'stopen' not
devices using 'sdopen'. PR#5810 from Jozef Hatala.

ok beck@

Revision 1.80 / (download) - annotate - [select for diffs], Tue Nov 27 16:22:14 2007 UTC (16 years, 6 months ago) by martynas
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.79: +2 -2 lines
Diff to previous 1.79 (colored)

typos;  ok jmc@
sys/dev/pci/pciide.c from naddy@

Revision 1.79 / (download) - annotate - [select for diffs], Thu Nov 22 03:57:07 2007 UTC (16 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.78: +29 -99 lines
Diff to previous 1.78 (colored)

Ansi-fy.

Revision 1.78 / (download) - annotate - [select for diffs], Thu Nov 22 03:19:50 2007 UTC (16 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.77: +7 -6 lines
Diff to previous 1.77 (colored)

Ooops. Don't de-reference st until after it has been pointed at the
correct st_softc. Fixes 'mt rewoffl' panics, as reported on misc@ by
Jeff Ross and reproduced on my tape machine.

Revision 1.77 / (download) - annotate - [select for diffs], Fri Nov 16 11:28:34 2007 UTC (16 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.76: +106 -11 lines
Diff to previous 1.76 (colored)

convert code over from sd.c, to let tapes discollect.  Lucas Stefanutti
of pr 5635 confirms this works for him.  similar diff authored by krw
who was unaware i wrote this and mailed it to Lucas...

Revision 1.76 / (download) - annotate - [select for diffs], Sun Sep 16 15:54:52 2007 UTC (16 years, 8 months ago) by krw
Branch: MAIN
Changes since 1.75: +2 -3 lines
Diff to previous 1.75 (colored)

A couple of obvious bzero() -> M_ZERO changes I missed.

Revision 1.75 / (download) - annotate - [select for diffs], Wed Jun 6 17:15:14 2007 UTC (17 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.74: +2 -2 lines
Diff to previous 1.74 (colored)

now that all partition size/offsets are potentially 64-bit, change the
type of all variables to daddr64_t.  this includes the APIs for XXsize()
and XXdump(), all range checks inside bio drivers, internal variables
for disklabel handling, and even uvm's swap offsets.  re-read numerous
times by otto, miod, krw, thib to look for errors

Revision 1.74 / (download) - annotate - [select for diffs], Fri Jun 1 18:44:48 2007 UTC (17 years ago) by krw
Branch: MAIN
Changes since 1.73: +13 -14 lines
Diff to previous 1.73 (colored)

No need for tape fields to be daddr_t. int will do.

ok beck@ deraadt@

Revision 1.73 / (download) - annotate - [select for diffs], Tue Apr 10 17:47:56 2007 UTC (17 years, 2 months ago) by miod
Branch: MAIN
Changes since 1.72: +2 -2 lines
Diff to previous 1.72 (colored)

``it's'' -> ``its'' when the grammar gods require this change.

Revision 1.72 / (download) - annotate - [select for diffs], Sat Jan 20 18:21:51 2007 UTC (17 years, 4 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.71: +79 -6 lines
Diff to previous 1.71 (colored)

Add media_fileno, media_blkno into st_softc and report their values
back via MTIOCGET ioctl, rather than always reporting -1 (unknown).

Simple 'Set to 0 on rewind, increment on file marks and positioning,
and set back to -1 on any ambiguity' logic. No functional impact on
current operation.

Should allow things like Bacula to work much faster by keeping track
of the current media position.

Adapted from FreeBSD code.

ok beck@

Revision 1.71 / (download) - annotate - [select for diffs], Fri Jan 5 00:42:47 2007 UTC (17 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.70: +3 -1 lines
Diff to previous 1.70 (colored)

As first brought to my attention by Russel Sutherland, our deletion of
the mt_fileno and mt_blkno fields from the mtget struct was too hasty.

Subsequent discussions with Kern Sibbold of the Bacula project
revealed these are widely used by tape backup software on many
unicies. The de facto standard is to return -1 if you can't determine
the value.

So add them back and always return -1 as their value. Should allow
Bacula and similar software to at least compile while we investigate
providing meaningful values.

ok beck@

Revision 1.70 / (download) - annotate - [select for diffs], Thu Dec 21 02:05:46 2006 UTC (17 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.69: +3 -3 lines
Diff to previous 1.69 (colored)

Fix some comment typos. 'immediatly' -> 'immediately', 'tranfer' ->
'transfer', 'tranfered' -> 'transferred'.

Revision 1.69 / (download) - annotate - [select for diffs], Tue Dec 12 02:44:36 2006 UTC (17 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.68: +36 -5 lines
Diff to previous 1.68 (colored)

Give the SCSI layer the ability to requeue i/o's rejected by a driver
using the new NO_CCB result. Currently a no-op since no driver produces
that result.

ok dlg@ marco@ deraadt@

Revision 1.68 / (download) - annotate - [select for diffs], Tue Nov 28 16:56:50 2006 UTC (17 years, 6 months ago) by dlg
Branch: MAIN
Changes since 1.67: +3 -3 lines
Diff to previous 1.67 (colored)

rename scsibus_attach_args to scsi_attach_args. this can help avoid
confusing when trying to attach scsibus to a hba, since it is really meant
for attaching scsi devices to scsibus.

ok deraadt@ marco@

Revision 1.67 / (download) - annotate - [select for diffs], Mon Nov 27 23:14:22 2006 UTC (17 years, 6 months ago) by beck
Branch: MAIN
Changes since 1.66: +2 -2 lines
Diff to previous 1.66 (colored)

more magic removal
ok miod@, deraadt@

Revision 1.66 / (download) - annotate - [select for diffs], Mon Nov 27 18:24:43 2006 UTC (17 years, 6 months ago) by beck
Branch: MAIN
Changes since 1.65: +8 -15 lines
Diff to previous 1.65 (colored)

rework asc/ascq handling to get rid of "magic" 0x values in the code, changes
asc/ascq handling to deal with the pair together rather than seperately, since
modern scsi has long since polluted the "categories" of asc enough that you
pretty much need to always look as ascq.

ok krw@ deraadt@, dlg@

Revision 1.65 / (download) - annotate - [select for diffs], Sat Oct 7 23:40:08 2006 UTC (17 years, 8 months ago) by beck
Branch: MAIN
Changes since 1.64: +3 -3 lines
Diff to previous 1.64 (colored)

make cd-roms retry forever while the device indicates that it is
"becoming ready" - this is done in the exact same way that it
was done for tape in st.c. This commit adds a cd specific interpret_sense
routine to cd.c that will catch the becoming ready case and handle it.
This also removes the need to use crazy timeouts to catch this case.

ok krw@

Revision 1.64 / (download) - annotate - [select for diffs], Mon Oct 2 09:06:26 2006 UTC (17 years, 8 months ago) by dlg
Branch: MAIN
Changes since 1.63: +7 -7 lines
Diff to previous 1.63 (colored)

get rid of a boolean typedef. this is c, we have ints, deal with it.

ok marco@ krw@

Revision 1.63 / (download) - annotate - [select for diffs], Sun Jun 11 03:59:59 2006 UTC (18 years ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.62: +3 -2 lines
Diff to previous 1.62 (colored)

Don't spew sense informaton from the test unit ready command issued by
stopen(). This change was misplaced in the st roto-tilling at c2k6.
Noticed by deraadt@.

Revision 1.62 / (download) - annotate - [select for diffs], Thu Jun 1 05:42:01 2006 UTC (18 years ago) by krw
Branch: MAIN
Changes since 1.61: +64 -147 lines
Diff to previous 1.61 (colored)

We do not create st devices with different density modes. i.e. with device
minor numbers having bits 2 or 3 set.

Eliminate the quirks, etc. used to store info on these non-existant modes.
Also eliminate a couple of 'unimplemented' fields in the ioctl request
structure.

ok beck@ deraadt@

Revision 1.61 / (download) - annotate - [select for diffs], Sun May 28 23:58:00 2006 UTC (18 years ago) by krw
Branch: MAIN
Changes since 1.60: +24 -26 lines
Diff to previous 1.60 (colored)

Miscellaneous fixes.

1) Check the return value from st_mount_tape().

2) Always call st_unmount() if the media goes missing.

3) Use the special handling for 'Unit in the process of becoming
ready' for the TEST UNIT READY command in stopen().

4) Don't unmount a tape during stopen() just because it doesn't have
the current default density. Eliminate now unused last_dsty member of
st_softc.

tested & ok beck@

Revision 1.60 / (download) - annotate - [select for diffs], Sun May 28 23:34:34 2006 UTC (18 years ago) by beck
Branch: MAIN
Changes since 1.59: +34 -1 lines
Diff to previous 1.59 (colored)

This commit changes the interpret_sense routine for st to catch the
"Unit Becoming Ready" case, and just like ch, allow the driver to
continue waiting, as long as the unit continues to promise us that
the unit is becoming ready. This avoids the case of slow tape drives
taking forever to bring media online requiring a huge retry count
being set for all commands, and like ch, will wait indefinately
only in this case. All other cases are handled as before.

ok krw@

Revision 1.59 / (download) - annotate - [select for diffs], Sun May 28 23:26:35 2006 UTC (18 years ago) by krw
Branch: MAIN
Changes since 1.58: +3 -3 lines
Diff to previous 1.58 (colored)

In the absence of a coherent concept of 'RAW' tape devices, pass all
unhandled ioctl requests to scsi_do_ioctl() like ch.c does. Previously
only the mythical 'control devices' with certain minor numbers would
pass the requests along.

ok beck@

Revision 1.58 / (download) - annotate - [select for diffs], Sun May 28 23:19:25 2006 UTC (18 years ago) by krw
Branch: MAIN
Changes since 1.57: +11 -16 lines
Diff to previous 1.57 (colored)

Whack a 'control device' leftover. Actually save the new density, etc.
that was just accepted by the device, no matter what the minor is.

ok beck@

Revision 1.57 / (download) - annotate - [select for diffs], Sun May 28 20:04:52 2006 UTC (18 years ago) by krw
Branch: MAIN
Changes since 1.56: +5 -21 lines
Diff to previous 1.56 (colored)

We don't have 'control devices' for st. Nor are we likely to get any
in the foreseeable future. Eliminate half-baked, semi-operational code
that tried to handle such devices. People who had stumbled across the
previous control-like behaviour of erstX devices should not be relying
on these semantics.

Suggested by deraadt@.

ok beck@

Revision 1.56 / (download) - annotate - [select for diffs], Sun May 28 19:31:09 2006 UTC (18 years ago) by krw
Branch: MAIN
Changes since 1.55: +2 -12 lines
Diff to previous 1.55 (colored)

ST_NEW_MOUNT was set/reset in a number of places but only examined inside
a #if notyet/#endif block. It's been 'notyet' since 1995. Eliminate it.

'flense!' beck@

Revision 1.55 / (download) - annotate - [select for diffs], Sun May 28 07:18:30 2006 UTC (18 years ago) by krw
Branch: MAIN
Changes since 1.54: +3 -3 lines
Diff to previous 1.54 (colored)

Use TEST_READY_RETRIES_TAPE instead of TEST_READY_RETRIES_DEFAULT,
thus allowing tape drives more time to become ready.

ok beck@

Revision 1.54 / (download) - annotate - [select for diffs], Sun May 28 07:07:09 2006 UTC (18 years ago) by krw
Branch: MAIN
Changes since 1.53: +7 -5 lines
Diff to previous 1.53 (colored)

Use bit 23 of the device minor to indicate a control mode device. A
control mode device can be opened but does not permit any i/o.

Currently no such devices are created by MAKEDEV. However the previous
code used bits 0 and 1 of the minor being set to indicate a control
device. This conflicted with other uses of device minors to indicate
things like rewind and eject. This behaviour would result in an open
of a newly loaded tape drive failing until the tape was successfully
mounted as a side effect of another command like 'mt status'.

ok beck@

Revision 1.53 / (download) - annotate - [select for diffs], Sun May 28 00:47:45 2006 UTC (18 years ago) by krw
Branch: MAIN
Changes since 1.52: +12 -17 lines
Diff to previous 1.52 (colored)

Always allow ioctl's to work, even if there is no media loaded.
Analogous to what sd does for the raw partition.  Eliminates useless
error messages and premature command completion. e.g. 'mt status' will
wait for media to to finish loading.

ok beck@

Revision 1.52 / (download) - annotate - [select for diffs], Sun May 28 00:27:09 2006 UTC (18 years ago) by krw
Branch: MAIN
Changes since 1.51: +1 -23 lines
Diff to previous 1.51 (colored)

Don't print tape media information during probe. This is transitory
information that doesn't have anything to do with the device. We don't
say 'cd drive empty or not ready."

ok beck@

Revision 1.51 / (download) - annotate - [select for diffs], Thu May 11 00:45:59 2006 UTC (18 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.50: +10 -10 lines
Diff to previous 1.50 (colored)

Zap trailing whitespace.

Revision 1.50 / (download) - annotate - [select for diffs], Sun Sep 11 17:34:27 2005 UTC (18 years, 9 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.49: +28 -30 lines
Diff to previous 1.49 (colored)

Simplify code by changing struct scsi_mode_sense_buf{ union {}
headers; } to just union scsi_mode_sense_buf {}. No functional change.

ok marco@

Revision 1.49 / (download) - annotate - [select for diffs], Tue Aug 23 23:38:00 2005 UTC (18 years, 9 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.48: +71 -39 lines
Diff to previous 1.48 (colored)

Move uses of struct scsi_mode_sense_buf (255 bytes each) from the
stack into malloc'd memory.

ok deraadt@

Revision 1.48 / (download) - annotate - [select for diffs], Fri Jun 24 20:48:25 2005 UTC (18 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.47: +113 -84 lines
Diff to previous 1.47 (colored)

Move st.c to new mode sense mechanism. Don't save page0 data (if any), just
ask for it when needed. Eliminate the page_0_size quirk.

Tested on various tape drives by myself, hshoexer@ and henning@.

Revision 1.47 / (download) - annotate - [select for diffs], Sun Jun 5 21:27:07 2005 UTC (19 years ago) by krw
Branch: MAIN
Changes since 1.46: +7 -8 lines
Diff to previous 1.46 (colored)

Fix scsi_mode_select() and scsi_mode_select_big() to send just the
required number of bytes, rather than a full scsi_mode_sense_buf. Some
devices (e.g. my HP SureStore DAT/24) decline to accept such oversized
transfers. Instead, force callers to fill in the data_length field in
the header and use that information to set the size of the transfer.

Revision 1.46 / (download) - annotate - [select for diffs], Sat May 14 00:20:43 2005 UTC (19 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.45: +8 -5 lines
Diff to previous 1.45 (colored)

Add scsi_mode_[sense|select]_big() and use it instead of
atapi_mode_[sense|select](). This will allow the removal of
atapi_base.c and atapi_all.h files, and sets the stage for better usb
mode sense handling amoung other things.

Remove cd_scsibus_[get|set]_mode() and
sd_scsibus_mode_sense() shims in favour of scsi_mode_[sense|select]().
Add zero'ing of reserved length field in scsi_mode_select(). Change
some uchar * type parameters to scsi_mode_header *.

No functional changes. Mostly from NetBSD.

ok dlg@.

Revision 1.45 / (download) - annotate - [select for diffs], Wed Apr 6 02:51:13 2005 UTC (19 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.44: +2 -2 lines
Diff to previous 1.44 (colored)

De-register scsi.

Revision 1.44 / (download) - annotate - [select for diffs], Tue Apr 5 12:13:16 2005 UTC (19 years, 2 months ago) by krw
Branch: MAIN
Changes since 1.43: +7 -25 lines
Diff to previous 1.43 (colored)

Factor out scsi_mode_sense() and scsi_mode_select() like NetBSD does.
Eliminate some duplicate structures and defines along the way. SCSI CD
drives will now pay attention to the 'flags' parameter for MODE SENSE
and MODE SELECT commands. No other functional change.

ok tdeval@

Revision 1.43 / (download) - annotate - [select for diffs], Tue Nov 30 19:28:37 2004 UTC (19 years, 6 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.42: +2 -2 lines
Diff to previous 1.42 (colored)

No longer require write permission for read-only SCSI commands
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@.

Revision 1.41.2.1 / (download) - annotate - [select for diffs], Tue Nov 2 01:05:50 2004 UTC (19 years, 7 months ago) by brad
Branch: OPENBSD_3_6
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 (colored) next main 1.42 (colored)

MFC:
Fix by krw@

Fix 'Tape block size (32754) not a multiple of dump block size
(1024).' errors in restore(1).

Check for SDEV_OPEN in sc_link->flags (where it lives) rather than
sense->flags (where it doesn't).

Problem noted by John Danks on misc@ and reinforced by Otto & Hugh.

ok deraadt@ krw@

Revision 1.42 / (download) - annotate - [select for diffs], Sat Oct 16 04:05:39 2004 UTC (19 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 (colored)

Fix 'Tape block size (32754) not a multiple of dump block size
(1024).' errors in restore(1).

Check for SDEV_OPEN in sc_link->flags (where it lives) rather than
sense->flags (where it doesn't).

Problem noted by John Danks on misc@ and reinforced by Otto & Hugh.

ok marco@ hugh@.

Revision 1.41 / (download) - annotate - [select for diffs], Sun Aug 1 23:01:06 2004 UTC (19 years, 10 months ago) by marco
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE
Branch point for: OPENBSD_3_6
Changes since 1.40: +1 -2 lines
Diff to previous 1.40 (colored)

Remove openings = 1 and inherit the value from the HBA instead.  This keeps the tape device stuffed with data and therefore it rewinds less often to reposition.

ok krw@

Revision 1.40 / (download) - annotate - [select for diffs], Tue Jun 22 00:43:25 2004 UTC (19 years, 11 months ago) by marco
Branch: MAIN
Changes since 1.39: +6 -5 lines
Diff to previous 1.39 (colored)

Add additional retries in TUR to allow for tape devices to settle after a reset.
More informative failure message and silence "already open" message.

ok krw@

Revision 1.27.4.6 / (download) - annotate - [select for diffs], Sat Jun 5 23:13:09 2004 UTC (20 years ago) by niklas
Branch: SMP
Changes since 1.27.4.5: +43 -22 lines
Diff to previous 1.27.4.5 (colored) to branchpoint 1.27 (colored) next main 1.28 (colored)

Merge with the trunk

Revision 1.39 / (download) - annotate - [select for diffs], Fri May 28 23:50:15 2004 UTC (20 years ago) by krw
Branch: MAIN
CVS Tags: SMP_SYNC_B, SMP_SYNC_A
Changes since 1.38: +28 -15 lines
Diff to previous 1.38 (colored)

Clean up sense error logic and printing a bit, partly inspired by
NetBSD. Try to limit special handling of sense errors in sd and st to
a minimum.

ok marco@

Revision 1.38 / (download) - annotate - [select for diffs], Mon May 17 23:57:51 2004 UTC (20 years ago) by krw
Branch: MAIN
Changes since 1.37: +3 -3 lines
Diff to previous 1.37 (colored)

Elminate SCSIRET_* synonyms for EJUSTRETURN and ERESTART by using
EJUSTRETURN and ERESTART instead. Delete unused SCSIRET_RETRY define.
From NetBSD.

ok marco@

Revision 1.37 / (download) - annotate - [select for diffs], Mon May 17 12:37:13 2004 UTC (20 years ago) by aoyama
Branch: MAIN
Changes since 1.36: +9 -1 lines
Diff to previous 1.36 (colored)

Add a quirk entry for TEAC compact cassette tape drive, taken from NetBSD.
ok miod@ tdeval@ marco@ krw@

Revision 1.36 / (download) - annotate - [select for diffs], Sun May 9 04:01:59 2004 UTC (20 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.35: +8 -8 lines
Diff to previous 1.35 (colored)

Add missing <cr>'s to various SC_DEBUG() calls, along with a few other
SC_DEBUG() spacing tweaks.

ok deraadt@

Revision 1.27.4.5 / (download) - annotate - [select for diffs], Sat Jun 7 11:07:44 2003 UTC (21 years ago) by ho
Branch: SMP
Changes since 1.27.4.4: +9 -9 lines
Diff to previous 1.27.4.4 (colored) to branchpoint 1.27 (colored)

Sync SMP branch to -current

Revision 1.29.4.2 / (download) - annotate - [select for diffs], Mon May 19 22:28:21 2003 UTC (21 years ago) by tedu
Branch: UBC
Changes since 1.29.4.1: +19 -16 lines
Diff to previous 1.29.4.1 (colored) to branchpoint 1.29 (colored) next main 1.30 (colored)

sync

Revision 1.35 / (download) - annotate - [select for diffs], Sun May 18 16:06:35 2003 UTC (21 years ago) by mickey
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.34: +9 -9 lines
Diff to previous 1.34 (colored)

constify the quirck tables and fix the scsi_inqmatch() proto accordingly; krw@ ok

Revision 1.27.4.4 / (download) - annotate - [select for diffs], Fri Mar 28 00:08:47 2003 UTC (21 years, 2 months ago) by niklas
Branch: SMP
Changes since 1.27.4.3: +24 -17 lines
Diff to previous 1.27.4.3 (colored) to branchpoint 1.27 (colored)

Sync the SMP branch with 3.3

Revision 1.34 / (download) - annotate - [select for diffs], Tue Mar 11 01:12:09 2003 UTC (21 years, 3 months ago) by krw
Branch: MAIN
CVS Tags: UBC_SYNC_A, OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.33: +14 -13 lines
Diff to previous 1.33 (colored)

Fix incorrect restriction on valid scsi tape density code values, allowing all
currently valid values (0 - 0xff) to be used in mt(1). Add sanity
check to catch negative values.

Minor cleanup so mt_count values are stored in daddr_t variables and
not ints. Eliminate unnecessary cast of mt_op, since it is already a
shot. Leave possible move of mt_count to int32_t rather than daddr_t
to post-3.3.

Problem found, and original diff by Joseph Bender.

costa@ henning@ tdeval@ ok

Revision 1.33 / (download) - annotate - [select for diffs], Mon Dec 30 21:50:29 2002 UTC (21 years, 5 months ago) by grange
Branch: MAIN
Changes since 1.32: +6 -4 lines
Diff to previous 1.32 (colored)

Add new parameter to scsi_test_unit_ready(): retries number.
Use increased retries number and don't ignore SCSI_IGNORE_NOT_READY
when call scsi_test_unit_ready() for cd-rom, this makes system wait
if drive is loading media.
Tested by millert@ and fgsch@; some input and ok from krw@.
Problem reported by The lord of the CD-writers
Igor Grabin <violent@death.kiev.ua>.

Revision 1.29.4.1 / (download) - annotate - [select for diffs], Tue Jun 11 03:32:14 2002 UTC (22 years ago) by art
Branch: UBC
Changes since 1.29: +27 -23 lines
Diff to previous 1.29 (colored)

Sync UBC branch to -current

Revision 1.32 / (download) - annotate - [select for diffs], Sun Jun 9 00:05:57 2002 UTC (22 years ago) by art
Branch: MAIN
CVS Tags: UBC_SYNC_B, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.31: +6 -2 lines
Diff to previous 1.31 (colored)

More (the last round?) of splasserts and splbio around biodone.

Revision 1.31 / (download) - annotate - [select for diffs], Tue Jun 4 00:09:08 2002 UTC (22 years ago) by deraadt
Branch: MAIN
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

spelling; raj@cerias.purdue.edu

Revision 1.27.4.3 / (download) - annotate - [select for diffs], Thu Mar 28 14:52:01 2002 UTC (22 years, 2 months ago) by niklas
Branch: SMP
Changes since 1.27.4.2: +21 -21 lines
Diff to previous 1.27.4.2 (colored) to branchpoint 1.27 (colored)

Merge in -current from roughly a week ago

Revision 1.30 / (download) - annotate - [select for diffs], Thu Mar 14 01:27:13 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.29: +21 -21 lines
Diff to previous 1.29 (colored)

First round of __P removal in sys

Revision 1.27.4.2 / (download) - annotate - [select for diffs], Wed Jul 4 11:00:10 2001 UTC (22 years, 11 months ago) by niklas
Branch: SMP
Changes since 1.27.4.1: +6 -8 lines
Diff to previous 1.27.4.1 (colored) to branchpoint 1.27 (colored)

Merge in -current from two days ago in the SMP branch.
As usual with merges, they do not indicate progress, so do not hold
your breath for working SMP, and do not mail me and ask about the
state of it.  It has not changed.  There is work ongoing, but very, very
slowly.  The commit is done in parts as to not lock up the tree in too
big chunks at a time.

Revision 1.29 / (download) - annotate - [select for diffs], Fri Jun 22 14:35:43 2001 UTC (22 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: UBC_BASE, OPENBSD_3_0_BASE, OPENBSD_3_0
Branch point for: UBC
Changes since 1.28: +6 -8 lines
Diff to previous 1.28 (colored)

KNF

Revision 1.27.4.1 / (download) - annotate - [select for diffs], Mon May 14 22:45:00 2001 UTC (23 years, 1 month ago) by niklas
Branch: SMP
Changes since 1.27: +3 -3 lines
Diff to previous 1.27 (colored)

merge in approximately 2.9 into SMP branch

Revision 1.28 / (download) - annotate - [select for diffs], Sat Apr 8 19:19:33 2000 UTC (24 years, 2 months ago) by csapuntz
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.27: +3 -3 lines
Diff to previous 1.27 (colored)



These days, attach can occur outside the tsleep-restricted world of
BSD autoconf.

Don't use POLL & NOSLEEP mode if attaching after autoconf

Revision 1.27 / (download) - annotate - [select for diffs], Sun Sep 5 20:58:03 1999 UTC (24 years, 9 months ago) by niklas
Branch: MAIN
CVS Tags: kame_19991208, SMP_BASE, OPENBSD_2_6_BASE, OPENBSD_2_6
Branch point for: SMP
Changes since 1.26: +12 -3 lines
Diff to previous 1.26 (colored)

ATAPI tapes are always fixed blocksize

Revision 1.26 / (download) - annotate - [select for diffs], Sun Jul 25 07:09:20 1999 UTC (24 years, 10 months ago) by csapuntz
Branch: MAIN
Changes since 1.25: +10 -4 lines
Diff to previous 1.25 (colored)



Merge sd stuff from NetBSD-current. Helps with LS-120, ZIP

More SCSI logic from NetBSD-current

Some tape fixes. ATAPI tapes do not work yet for most operations.

Revision 1.25 / (download) - annotate - [select for diffs], Thu Jul 23 09:11:09 1998 UTC (25 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4
Changes since 1.24: +77 -22 lines
Diff to previous 1.24 (colored)

do delays based on command type -- this works a lot better, make "mt status"
show much more information; ross

Revision 1.24 / (download) - annotate - [select for diffs], Sun Feb 22 00:51:46 1998 UTC (26 years, 3 months ago) by niklas
Branch: MAIN
CVS Tags: OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.23: +13 -2 lines
Diff to previous 1.23 (colored)

Detect and report a weird error case (residual > request)

Revision 1.23 / (download) - annotate - [select for diffs], Mon Feb 16 06:06:38 1998 UTC (26 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.22: +8 -1 lines
Diff to previous 1.22 (colored)

Add the "VIPER 150/21531" to quirk list (ST_Q_SENSE_HELP; pk

Revision 1.22 / (download) - annotate - [select for diffs], Sat Jan 10 01:37:52 1998 UTC (26 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.21: +2 -3 lines
Diff to previous 1.21 (colored)

be silent for ILI errors ; giannici@neomedia.it

Revision 1.21 / (download) - annotate - [select for diffs], Fri Sep 5 05:56:51 1997 UTC (26 years, 9 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.20: +1 -3 lines
Diff to previous 1.20 (colored)

Add SCSITERSE option which omits the (large) ASC/ASCQ table.
Old scsi error printing code is now gone.

Revision 1.20 / (download) - annotate - [select for diffs], Wed Sep 3 17:21:49 1997 UTC (26 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

be silent for SCSI_SILENT transactions

Revision 1.19 / (download) - annotate - [select for diffs], Fri Aug 22 04:43:27 1997 UTC (26 years, 9 months ago) by millert
Branch: MAIN
Changes since 1.18: +5 -1 lines
Diff to previous 1.18 (colored)

Add more detailed SCSI error printing by Matthew Jacob.  Enabled by
default.  Use "option SCSIVERBOSE=0" to turn off (only added 8Kb to my kernel).
From the NetBSD commit message:
    Add in more detailed SCSI error printing, based off of final SCSI-2 spec.
    This will also print out things like progress indicator errors, and will
    also dump out additional sense bytes that haven't been decoded.

Revision 1.18 / (download) - annotate - [select for diffs], Tue Aug 19 03:50:59 1997 UTC (26 years, 9 months ago) by dgregor
Branch: MAIN
Changes since 1.17: +4 -2 lines
Diff to previous 1.17 (colored)

Back out part of revision 1.16 where the tape was unmounted in stclose on
a non-rewinding device.  When the tape was re-opened again, st_mount_tape
called st_load, which causes the tape to be rewound.

The best way to fix this problem would be to not call st_load in
st_mount_tape if the tape is already in the drive and has already been
loaded.  But, I haven't figured out a good, safe way to do that yet....

Revision 1.17 / (download) - annotate - [select for diffs], Fri Jul 11 19:26:00 1997 UTC (26 years, 11 months ago) by tholo
Branch: MAIN
Changes since 1.16: +7 -7 lines
Diff to previous 1.16 (colored)

Rename REWIND to DOREWIND to avoid colliding with the SCSI opcode of the
same name

Revision 1.16 / (download) - annotate - [select for diffs], Fri Jul 11 02:18:40 1997 UTC (26 years, 11 months ago) by tholo
Branch: MAIN
Changes since 1.15: +28 -17 lines
Diff to previous 1.15 (colored)

Allow media to be removed on last close even if the device used was the
no-rewind device.  Ensure we re-detect media on first open even if media
was present at boot.

Revision 1.15 / (download) - annotate - [select for diffs], Mon Apr 14 04:09:17 1997 UTC (27 years, 2 months ago) by downsj
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.14: +27 -4 lines
Diff to previous 1.14 (colored)

Merge in various pieces of current NetBSD scsi code, including but not limited
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.

Revision 1.14 / (download) - annotate - [select for diffs], Mon Feb 24 20:17:35 1997 UTC (27 years, 3 months ago) by jkatz
Branch: MAIN
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

This changes the timeout on the st device so that the new tape drives that
are recognized are usable :-) If this break things for other people,
please feel free to change it back. from port-vax@netbsd.org

Revision 1.13 / (download) - annotate - [select for diffs], Wed Dec 11 19:08:20 1996 UTC (27 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.12: +4 -2 lines
Diff to previous 1.12 (colored)

b_resid cleanups, pointed out by minoura@kw.netlaputa.or.jp in netbsd pr#3007

Revision 1.12 / (download) - annotate - [select for diffs], Sun Aug 11 23:26:07 1996 UTC (27 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.11: +3 -2 lines
Diff to previous 1.11 (colored)

limit ioctl priviledges

Revision 1.11 / (download) - annotate - [select for diffs], Fri May 10 12:31:41 1996 UTC (28 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

SC_DEBUG cleanup

Revision 1.10 / (download) - annotate - [select for diffs], Sun Apr 21 22:31:20 1996 UTC (28 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.9: +37 -40 lines
Diff to previous 1.9 (colored)

partial sync with netbsd 960418, more to come

Revision 1.9 / (download) - annotate - [select for diffs], Fri Apr 19 16:10:28 1996 UTC (28 years, 1 month ago) by niklas
Branch: MAIN
Changes since 1.8: +10 -8 lines
Diff to previous 1.8 (colored)

NetBSD 960317 merge

Revision 1.8 / (download) - annotate - [select for diffs], Tue Feb 20 01:22:02 1996 UTC (28 years, 3 months ago) by briggs
Branch: MAIN
Changes since 1.7: +169 -155 lines
Diff to previous 1.7 (colored)

Several changes from NetBSD:
- scsi prototypes
- remove #ifdef notdef made unnecessary by previous changes (PR#1597)
  put in missing "if (error)" that caused tape IO to always fail.
  (closes PR#2086)
- Minor change.

Revision 1.7 / (download) - annotate - [select for diffs], Fri Feb 9 14:45:31 1996 UTC (28 years, 4 months ago) by briggs
Branch: MAIN
Changes since 1.6: +1 -0 lines
Diff to previous 1.6 (colored)

NetBSD PR 2048.  Prototype st_erase.

Revision 1.6 / (download) - annotate - [select for diffs], Tue Jan 16 01:20:33 1996 UTC (28 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.5: +53 -49 lines
Diff to previous 1.5 (colored)

from netbsd:
Honor cache request and add the SCSI tape device configuration page.
Fixes PRs 807, 1201, and 1705. From John Kohl <jtk@kolvir.blrc.ma.us>.

Revision 1.5 / (download) - annotate - [select for diffs], Thu Dec 14 05:45:18 1995 UTC (28 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.4: +7 -0 lines
Diff to previous 1.4 (colored)

from netbsd; Add quirk for Exabyte 8200/rev. 263H (from Paul Goyette; PR#1797)

Revision 1.4 / (download) - annotate - [select for diffs], Tue Nov 21 03:53:32 1995 UTC (28 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

make this work

Revision 1.3 / (download) - annotate - [select for diffs], Mon Nov 20 14:03:29 1995 UTC (28 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +45 -0 lines
Diff to previous 1.2 (colored)

add erase support and another wangtek tape drive; from rhialto@polder.ubc.kun.nl; netbsd pr#1705

Revision 1.2 / (download) - annotate - [select for diffs], Sun Nov 19 13:27:52 1995 UTC (28 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +3 -2 lines
Diff to previous 1.1 (colored)

if you read with a smaller buffer than the block on the tape, b_resid and b_count would be incorrect; from jtk@kolvir.arlington.ma.us; netbsd pr#1597

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:53:24 1995 UTC (28 years, 8 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:53:24 1995 UTC (28 years, 8 months ago) by deraadt
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.