Commit Graph

582 Commits

Author SHA1 Message Date
soren b202ac1466 Allow SCSI_DELAY to be shorter than 2 seconds. 1999-11-14 18:06:09 +00:00
matthias b45486b2a2 Make this work again by adding XS_CTL_ASYNC to the SCSI requests in
se_ifstart and se_recv.
1999-11-13 18:03:34 +00:00
bouyer fb8b192c0a Pass xfer->c_bcount instead of sc_xfer->datalen to the device, so that
it gets the rigth len for a request sense (from OpenBSD).
1999-11-04 21:16:53 +00:00
matt 31ba134e32 use __vax__ and __i386__ instead of vax and i386 1999-11-03 20:50:17 +00:00
mycroft 8efdaab402 Fix the size of start_sector, end_sector and end_sector_l0. (I'm just going to
assume the Linux people will also fix this, since I reported it to them.)
1999-10-31 14:03:16 +00:00
bouyer 98b5a519ce In sddump(), check sd->sc_dev.dv_flags once sd has been initialised.
Patch supplied by tsutsui@ceres.dti.ne.jp in kern/8708.
1999-10-30 16:35:12 +00:00
mycroft e45ef6abcd Emulate the Linux DVD_* ioctls(2). This gets us 90% of the way to running the
LiViD DVD player.  (See forthcoming mail to current-users.)
XXX NOTE: We should do something to probe capabilities, rather than allowing
these ioctls on any device.
1999-10-29 15:02:56 +00:00
enami a2369d8e97 Cancel active transfers on aic/wdc detach.
Also makes LS-120 drive works for me again.
1999-10-20 15:22:24 +00:00
ragge 2674b15280 Don't call dk_establish() on vax either. 1999-10-17 09:44:48 +00:00
enami 46f1868fe7 Cosmetic changes. 1999-10-17 06:22:05 +00:00
enami de4b3a819a ENODEV is not a value supposed to be assigned to xs->error. Use
XS_DRIVER_STUFFUP instead.
1999-10-17 06:13:01 +00:00
hwr d5103deed3 Add ad quirk for CDU-561 CD-ROM. From PR kern/8608
by SUNAGAWA Keiki <kei_sun@ba2.so-net.ne.jp>.
1999-10-11 15:28:57 +00:00
hwr eed9db126b Add a quirk to recognize a Toshiba XM-3401TA SCSI CD-ROM as
removable SCSI device. From Matthew Fredette <fredette@mit.edu> in
kern/7438.
1999-10-10 18:49:15 +00:00
mjacob 51a4d18f0f If we're discovering, don't tsleep on lbolt if we had a busy status. 1999-10-06 05:01:05 +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
soren 1d04441597 Remove outdated list of density codes. mt(1) has helpful
hints and the SCSI specification has the real, current list.
1999-09-30 12:12:41 +00:00
enami 67e874d814 Allow to detach wdc, atapibus, wd and cd. 1999-09-23 11:04:29 +00:00
enami 31e6da77de Calculate the correct device minor of the first partition. 1999-09-21 03:10:00 +00:00
nathanw 3598bf5251 Add NOLUNS quirk for another Texel CD-ROM revision. 1999-09-19 23:45:28 +00:00
thorpej f77302e768 Implement detaching SCSI and ATAPI disks. 1999-09-11 21:42:58 +00:00
thorpej e8dded5513 Implement a function to kill off all commands pending for a given
scsipi_link.
1999-09-11 21:39:53 +00:00
thorpej 5116cf4fa5 Implement detaching of SCSI busses. 1999-09-11 21:25:26 +00:00
thorpej d622281820 Rework the changer driver a bit:
- Take note of magazine changes, and enqueue "Element Status Changed" events
  that user processes can read or select on.
- Normalize some structure names.
- Report back more status about changer elements:
  * Volume tags (e.g. barcode labels on the backs of your tapes)
  * External device names (for drive units in a changer)
  * Last element a unit of media was moved from
  * Sense information for SCSI changer elements in EXCEPT condition
  * Vendor-specific data if the user requests it.
- Add support for setting volume tags.
1999-09-09 23:24:11 +00:00
hwr 31292f422e Add a quirk for Wangtec SCSI-36 (QIC-120) tape drive.
From Izumi Tsutsiu in PR 8357.
1999-09-09 20:06:52 +00:00
simonb 56a01be374 Fix tyop in a comment. 1999-09-04 09:41:15 +00:00
thorpej 61f3c9356e If scsipi_make_xs() fails, make sure to flag the buffer as error'd,
if provided, and biodone() it.  Callers of scsipi_command() expect
this to be done.
1999-08-28 22:28:35 +00:00
hannken f04bd56be1 Make `sc_ops->sdo_flush' synchronous. The flags `SDF_FLUSHING' and
`SDF_DIRTY' were never reset because `sddone' doesn't get called from
synchronous scsi commands.
1999-08-26 09:28:17 +00:00
bouyer 7eb1fae5d3 Add a missing 'return' in previous commit.
Don't use C_NEEDDONE anymore (it's safe to always call scsipi_done()).
1999-08-09 09:49:48 +00:00
mycroft 6b33521af9 Increase several timeouts to 30s. 1999-08-07 02:51:51 +00:00
bouyer fae9929734 - Add some debug printf (WDCPROBE) in _wdcreset_wait(), I've needed these
2 times in the past
- Set up timeout per xfer instead of per interrupt. This helps with
  PIO transfer (we would call timeout()/untimout() several times for a
  transfer).
- If we missed an interrupt for a PIO transfer, reset and restart it
  immedialy, don't try to recover and continue. If we missed an interrupt we
  may have lost a read/write cycle on the IDE bus. If this happens 1) we
  corrupt data and 2) we enter an interrupt loop at the end of the xfer, as
  the drive has some more data to read/write, but the host thinks the xfer is
  done.
This last change fix the (or at last some of the) 'lookup after lost interrupt'
some peoples have been experiencing.
1999-08-06 12:00:23 +00:00
explorer 8fa3d8be55 make the JVC 2626 match more than one version, since all seem to be
returning errors on the LUN probe.
1999-07-26 22:43:13 +00:00
thorpej 40d9e23179 Define the Volume Tag format. 1999-07-22 17:43:53 +00:00
tron 62af9404e6 Skip LUN check for all versions of the UMAX Astra 1220S as suggested
by Dan McMahill in PR kern/7991.
1999-07-14 22:34:18 +00:00
bouyer e5d15c0dc6 Add another CD to the quirk table. 1999-07-08 14:24:42 +00:00
thorpej 59da37b37e Go to splbio() when calling scsipi_free_xs(), just like the SCSI counterpart.
Fixes PR #7853, Paul Dokas <dokas@cs.umn.edu>.
1999-06-25 18:58:54 +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
pk b6429ec3c5 In scsipi_done(), call scsipi_free_xs() at splbio(). 1999-06-16 07:35:31 +00:00
pk 5b4a75d281 scsipi_free_xs() wants to be called at splbio; do it. 1999-06-12 11:19:00 +00:00
lukem 7d44fa2e6e * use format_bytes() to display the disk size
* wrap a couple of printf()s
1999-05-31 12:05:39 +00:00
bouyer b87dbb8918 in cdclose(), ignore "media change" when calling scsipi_prevent(), after
a 'eject -l' some ATAPI drives report this instead of illegal request.
1999-05-27 11:19:04 +00:00
thorpej f98d358a1f Rework layer 2 protocol input routines. Instead of calling e.g. ether_input()
directly, call the function pointer (*if_input)(ifp, m).  The input routine
expects the packet header to be at the head of the packet, and will adjust
as necessary.  Privatize the layer 2 input and output routines, allowing
*_ifattach() to set them up as appropriate.
1999-05-18 23:52:51 +00:00
perry f8e8703b5e Add patch from Manuel Bouyer -- his mail message said:
By code inspection I found 2 bugs in the ATAPI code, one may be the cause
of your problem: A counter is not reset when issuing the request_sense
command. This is c_skip, the counter used to track the offset in the data
buffer when a data tranfer needs multiple phases. The effect of this is that
the sense data transfered may be stored outside the sense buffer (sense buffer
+ some, potentially several KB, offset). This can only occur in PIO mode,
DMA is not affected.
This doesn't occur in "normal" use because when reading a data CD, either
the sense is issued for a non-data command (in which case c_skip stays to
0), or an error occured and no data has been transfered, and c_skip is still 0.
I can't see a case where a data READ/WRITE could cause a sense tranfer without
error.

The second problem is that b_resid can be set to a false value (resulting of
the sense tranfer and not the data transfer). Again this is not a problem with
usual data tranfers because both values ends up being 0 when no error occurs.
1999-05-05 21:35:15 +00:00
bouyer b5f3e628a3 If setting to pio mode < 3 fails, try to set pio mode 3 before returning
EIO. The spec says ATAPI devices should support "PIO 3 or better".
They are supposed to support less as well. Setting the device to a highter
mode than the controller shoul'nt be a problem, and this is likely what
happens with legaty ISA controllers.
Solve problem reported by Ruey-Shyang Guo.
1999-04-15 16:21:27 +00:00
bouyer e91bdf1c67 Add SCSI_IGNORE_NOT_READY to the flags for CDIOCCLOSE: some devices will
attempt to spin up, and report an error if there's no CD. Fixes port-i386/7345.
1999-04-08 16:12:31 +00:00
bouyer c2752835f7 Fix a long-standing bug with the ACAP_* flags:
- the cap field is a u_int8_t, so none of the defined flags would fit in.
  Looks like nobody had a drive using 16 bytes commands.
- the ACAP_DRQ_* flags are all wrong. Just remove them and use the definitions
  from ata/atareg.h, there's no need to duplicate theses. The effect of this
  was that we were always polling for the command phase, even for drives
  with interrupt DRQ. This didn't break until the code was changed to support
  shared interrupts.

Should fix the lookup problems or 'boot hangs' reported by some users, and
kern/7111.
1999-04-08 11:29:01 +00:00
bouyer 29936d77d4 Now that we do real use of CDIOCCLOSE, we can have SSS_START|SSS_LOEJ
in scsipi_start(). Adjust test so that timeout will let enouth time to
the drive to spin up.
1999-04-07 12:47:27 +00:00
mycroft 7a304dfe1b If scsipi_command() fails, always print out the error code. 1999-04-05 19:19:34 +00:00
bouyer bf88fc82eb Adjust timeout for 'ielem' to match the comment: 5 mn (not 5s) per element +
10mn initial.
1999-04-04 12:20:48 +00:00
bouyer b43b844f6f - change the interrupt routines to take a 3rd arguments, set to 1 if we
are called from the interrupt or timeout handler, 0 otherwise.
- use this to know if we can busy-wait for wait_for_unbusy or wait_for_ready
This fixes a bug where CDs withot the DRQ_INTR capability would not busy-wait
for the CMDOUT phase.
While I'm there change 2 delay() to DELAY() for consistency, and
garbage-collect some old code from wdcintr() which has been ifdef'd out
for some time now.
1999-04-01 21:46:28 +00:00
bouyer 1ff88ee466 Avoid busy-waiting when possible if we are not polling (real IRQ or timeout
callback). Shared PCI IRQ should now work (but still untested).
1999-03-25 16:17:36 +00:00