Age | Commit message (Collapse) | Author |
|
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.
|
|
devices using 'sdopen'. PR#5810 from Jozef Hatala.
ok beck@
|
|
sys/dev/pci/pciide.c from naddy@
|
|
|
|
correct st_softc. Fixes 'mt rewoffl' panics, as reported on misc@ by
Jeff Ross and reproduced on my tape machine.
|
|
of pr 5635 confirms this works for him. similar diff authored by krw
who was unaware i wrote this and mailed it to Lucas...
|
|
|
|
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
|
|
ok beck@ deraadt@
|
|
|
|
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@
|
|
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@
|
|
'transfer', 'tranfered' -> 'transferred'.
|
|
using the new NO_CCB result. Currently a no-op since no driver produces
that result.
ok dlg@ marco@ deraadt@
|
|
confusing when trying to attach scsibus to a hba, since it is really meant
for attaching scsi devices to scsibus.
ok deraadt@ marco@
|
|
ok miod@, deraadt@
|
|
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@
|
|
"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@
|
|
ok marco@ krw@
|
|
stopen(). This change was misplaced in the st roto-tilling at c2k6.
Noticed by deraadt@.
|
|
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@
|
|
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@
|
|
"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@
|
|
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@
|
|
that was just accepted by the device, no matter what the minor is.
ok beck@
|
|
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@
|
|
a #if notyet/#endif block. It's been 'notyet' since 1995. Eliminate it.
'flense!' beck@
|
|
thus allowing tape drives more time to become ready.
ok beck@
|
|
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@
|
|
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@
|
|
information that doesn't have anything to do with the device. We don't
say 'cd drive empty or not ready."
ok beck@
|
|
|
|
headers; } to just union scsi_mode_sense_buf {}. No functional change.
ok marco@
|
|
stack into malloc'd memory.
ok deraadt@
|
|
ask for it when needed. Eliminate the page_0_size quirk.
Tested on various tape drives by myself, hshoexer@ and henning@.
|
|
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.
|
|
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@.
|
|
|
|
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@
|
|
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@.
|
|
(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@.
|
|
the tape device stuffed with data and therefore it rewinds less often to reposition.
ok krw@
|
|
More informative failure message and silence "already open" message.
ok krw@
|
|
NetBSD. Try to limit special handling of sense errors in sd and st to
a minimum.
ok marco@
|
|
EJUSTRETURN and ERESTART instead. Delete unused SCSIRET_RETRY define.
From NetBSD.
ok marco@
|
|
ok miod@ tdeval@ marco@ krw@
|
|
SC_DEBUG() spacing tweaks.
ok deraadt@
|
|
krw@ ok
|
|
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
|
|
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>.
|