Commit Graph

143 Commits

Author SHA1 Message Date
thorpej 03746a443a bzero -> memset 2001-07-18 18:21:04 +00:00
wiz cc0b68092e Correct various misspellings of 'transfer' and inflected forms. 2001-07-08 18:06:42 +00:00
bouyer 0a63f01fef Snapshot of ATAPI tapes support. Known to be able to read/write to tape with:
st0 at atapibus0 drive 1: <Seagate STT8000A, , 5.51> type 1 sequential
removable
Major changes may still happen in order to properly support other ATAPI
tape drives.
2001-06-18 09:05:05 +00:00
bouyer 708bb529d3 uninitialised variable (from Krister Walfridsson):
in st_cmprss(), init flags to 0 (never changed, but this should change soon
anyway, for ATAPI tapes support)
2001-05-30 20:28:17 +00:00
lukem b6b83e2ec3 delint; use MAX(sizeof(..),sizeof(..)) instead of max(...) for array size 2001-05-15 14:03:27 +00:00
bouyer bc980d7eba Use SCSI/ATAPI common definition for MODE_{SELECT,SENSE}{,_BIG}. Define
functions to send theses commands in scsipi_base.c and use them instead
of ad-hoc commands setups.
2001-05-14 20:35:27 +00:00
hannken 3446a61cb3 Fix a typo from thorpej_scsipi merge. No-sense information with retval == 0
should only print if SCSIPI_DEBUG is defined.
2001-05-06 11:31:08 +00:00
bouyer 27155d9a6d Add an ATAPI front-end to the st driver. Completely untested for now,
but st at scsi should still work :)
2001-05-04 07:48:56 +00:00
bouyer 937a7a3ed9 Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
  ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
  to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
  peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
  recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
  scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
  (no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
  set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
  the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
  will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
2001-04-25 17:53:04 +00:00
jdolecek 34c8ae80da constify 2001-01-18 20:28:15 +00:00
soren a622a1b6d2 Remove obsolete comment. 2000-11-22 00:32:24 +00:00
pk 8ba559d056 st_touch_tape(): Pass XS_CTL_SILENT to st_mode_select(). 2000-11-03 12:08:41 +00:00
pk 4c7351ec7d * st_touch_tape(): start probing at the block size from the sense data if
we have it.

* st_unmount(): reset density to the device default. This prevents using
  stale density values after changing to a medium with different density.

  Section 9.3.3 of the SCSI specs states that a device shall return the
  density value specified in the last succesfull MODE SELECT after an
  unload operation, in case it is not able to automatically determine
  the density of the new medium.
2000-11-03 10:46:18 +00:00
pk e3aaa6c1ab * Per st(4), retrieving status and setting modes on the control device
should succeed even if no media is loaded.

* In stopen(), check the return value of st_mount_tape().
2000-11-03 10:22:02 +00:00
pk f71476a62f Introduce ST_Q_ERASE_NOIMM, a quirk indicating that the device rejects
an ERASE command with the `Immed' bit on.

Use it on the VIPER 21247 & 21531.
2000-11-02 13:34:59 +00:00
pk e4958f1fe6 Prevent printing sense information twice. 2000-11-02 13:12:58 +00:00
pk 9c058471c3 Remove useless check for SDEV_MEDIA_LOADED from st_read_block_limits().
This command should work whether or not media is present in the device.
2000-11-02 00:56:59 +00:00
pk 3867a66a9a * In st_touch_tape(), don't bail out if the MODE SELECT fails since we are,
after all, probing the device for acceptable parameters.

* In st_loadquirks(), copy mode-specific quirks from the quirk table
  to `st_softc'; otherwise all such quirks save ST_Q_FORCE_BLKSIZE are ignored.
2000-11-02 00:52:15 +00:00
matt b0c9fcd14a Add a NOPREVENT quirk which prevents the sending of PREVENT messages (some
manual 9track tapes don't support it).  Add a quirk entry for the NCR H621
9track tape drive.
2000-08-16 19:22:25 +00:00
enami 5a4b9fcbbf Prevent a process being swapped out during I/O if the data buffer is
allocated on stack.  This potential problem is noticed by Noriyuki Soda
and the idea and sample code to fix is given by Jason R. Thorpe.
2000-06-09 08:54:19 +00:00
soren cd4324537d Density codes are usually given in decimal, so print them that way. 2000-06-06 17:16:02 +00:00
kleink 5f56eae96a Add a quirk table entry for the OnStream ADR50 Drive;
from S.P.Zeidler <spz@serpens.swb.de> in kern/10118.
2000-05-19 06:55:42 +00:00
augustss fc4d9ff403 Get rid of register declarations. 2000-03-30 00:00:55 +00:00
mjacob 296fbeed2a Patches from msouth@scruz.net to handle QIC 3220 (HP T20). 2000-02-21 05:11:09 +00:00
mjacob c5f8d33f85 minor spelling change 2000-02-20 07:38:48 +00:00
mjacob 91c88eb52f PR/9271 (from srp@zgi.com)- recognize (indirectly) HP4000s via density
code and do the right QIC type dance (1 FM @EOT, fixed block size).
2000-01-22 04:29:58 +00:00
thorpej dc59bc1db3 Update for sys/buf.h/disksort_*() changes. 2000-01-21 23:39:55 +00:00
nisimura 1775fae985 Add tweaks for TEAC compact cassette tape drive. 2000-01-13 00:18:27 +00:00
mjacob 34721cbe92 Check in the implementation of the ST_MOUNT_DELAY option.
This is an attempt to allow people to change the default configuration
to try harder at 'mounting' a tape. This allows you to specify, in
seconds, the amount of time a non-control unit open will retry
(once per second) the scsipi_test_unit_ready when it tries to mount
the tape. It also turns off the over-verbose error reporting at
this time unless SCSIDEBUG is set.

The reason this is not enabled as a default is that it's a large change
of behaviour. I find it useful to 'try harder' at mounting a tape in
the tape driver, particularly when loaded via a media changer device
rather than specifying the delays in the backup program.
2000-01-12 14:46:43 +00:00
thorpej 16a9d90e17 Cleanup the scsipi_xfer flags:
- `flags' is now gone, replaced with `xs_control' and `xs_status'.
- Massive cleanup of the control flags.  Now we explicitly say that
  a job is to complete asynchronously, rather than relying on side-effects,
  and use a new flag to now that device discovery is being performed.
- Do SCSI device discovery interrupt-driven.
1999-09-30 22:57:52 +00:00
simonb 56a01be374 Fix tyop in a comment. 1999-09-04 09:41:15 +00:00
mjacob 92f90fcb92 STK 9490 && SD-3 drives incorrectly quirked as not supporting the LOAD command.
Anyway, just because a drive doesn't support the LOAD (to BOT) command does
not mean that the drive doesn't support the UNLOAD command. Also note and
print errors in rewinds and unloads (and errors in writing closing filemarks
for same).
1999-06-17 04:20:55 +00:00
mycroft 7a304dfe1b If scsipi_command() fails, always print out the error code. 1999-04-05 19:19:34 +00:00
explorer 3ebb419571 Update to slightly altered rnd_attach_source() api 1999-02-28 17:08:05 +00:00
bouyer 6dd47fe65f Abort transfer if b_blkno is negative. Closes PR kern/5553 by Johan Danielsson. 1999-02-10 12:29:50 +00:00
tron 3fbb44a7bb Make MTIOCRDSPOS, MTIOCSLOCATE, etc. work with write protected tapes.
Patch supplied by Dave Huang in PR kern/5305.
1999-01-10 21:46:39 +00:00
thorpej 624619a881 When closing, wait for pending xfers to drain before deleting the reference
to the adapter.
1998-12-08 00:19:27 +00:00
thorpej 6a60e078ee Add adapter reference counting for SCSI and ATAPI devices. 1998-11-20 00:35:39 +00:00
bouyer 00d93f776b Rename scsi_interpret_sense() to scsipi_interpret_sense() and move it from
scsi_base.c to scsipi_base.c. Rename the functions from scsi_verbose.c
too, and rename the file itself. Cleaup includes too (scsi_*.h should not
be #included in scsipi_*.h files, which are supposed to be
common to atapi and scsi).
1998-11-17 14:38:42 +00:00
mjacob 03e28bdbaf keren/6128: add an entry for the TDC 4200. Full density code set isn't known. 1998-09-11 20:10:15 +00:00
mjacob fd97cb265c typo for non-SCSIVERBOSE case 1998-09-02 02:18:48 +00:00
cgd d58173741d kill the last remnants of __BROKEN_INDIRECT_CONFIG. (only the pica port
used it, and it's non-working and apparently slated for replacement.)
1998-08-31 22:28:04 +00:00
mycroft 04f0dc658c Assign my copyrights to TNF. 1998-08-17 00:49:01 +00:00
mycroft 6d3d8a1350 Make copyright notices with my name consistent. 1998-08-15 03:02:31 +00:00
mjacob 345530343a Responding to an issue brought to my attention- when the device is
opened norewind and 2 filemarks are written at the end a phantom file
is left (just what I was afraid of, but I didn't think about it in
the last delta because somehow I had managed to convince myself that
this was a nonissue. It's not.).

So- in stdone clear ST_WRITTEN for regular reads. In st_close, preserve
the state of ST_WRITTEN, and if no error and 2FM@EOD for this device and
this is a no-rewind open, backspace one filemark. This should preserve
(for this mount session) FILE - FMK - FILE - FMK - FILE ... FILE FMK FMK EOD
sequencing.

This doesn't clean up the case of EOM appends- in this case you *will* still
get (after an MTEOM operation and a write of a file) a phantom empty file,
e.g. FILE - FMK FMK - FILE - FMK FMK EOD *unless* you follow the EOM operation
with an explicit backspace. The trouble is that this makes it difficult for
seamless interchange with other systems which don't necessarily follow.

The preferrable alternative would be to eliminate the 2FM@EOD except for
1/2" Reel tapes, but that has been pretty much nixed within developers.
1998-08-10 16:56:25 +00:00
drochner e2a2525203 fix incorrect length of LOCATE CDB (reported in PR kern/5306 by
Dave Huang <khym@bga.com>)
1998-08-06 10:20:38 +00:00
mjacob 6e34b79e01 Suggestion from Matthias Drochner: If at close you decide to write
filemark 'coz you opened write only and didn't do anything else,
call st_check_eod to possibly write TWO furshlugginer filemarks.

Also- return any errors from writing filemarks out of stclose.
1998-07-31 17:25:55 +00:00
mjacob b90b2a3798 Several more changes. First of all, move CTRL_MODE to have I/O behaviour
like a no-rewind device. Secondly figure out whether the initial TUR
for a CTRL_MODE open resulted in a tape being actually found (if so,
then do a mount session).

Move the 'sun compatibility' behaviour into stdone && stclose- don't
mark a tape as having been written in stopenm, fer gosh sakes.
1998-07-31 04:00:22 +00:00
mjacob e404c0efec Some minor comment tweaking.
Also- to be fair and on review, kern/391 isn't really addressed by
the previous commits. In reviewing, I'm embarassed to find that this
talks about reading at EOT. I'm actually going to claim that this
is 'not a bug' or 'fixed already' in that at the end of media (at the
edge of recorded media), you may continuously open the tape (should
you choose to) issue a read, and zero bytes will transfer- this is a
sufficient EOF indicator.
1998-07-30 04:11:43 +00:00
mjacob c45a129a99 Clarify and name some of the 'open' modes. Clarify a few comments. Remove
a now unused variable. Also, remove the restriction against at density
code being greater than the max SCSI 2 density code: 0x80..0xff are the
Vendor Unique codes and most certainly should be allowed. The check for
invalid values should be less than 0 or greater than 255.

Oh- yeah, the previous commit addressed kern/391.
1998-07-30 03:17:22 +00:00