Commit Graph

1015 Commits

Author SHA1 Message Date
bouyer 011181ac3e Implement an atabus control device, and define some ATA bus control
IOCTLS. Implement ATABUSIORESET, which will reset the given ATA bus.
2004-08-01 21:40:41 +00:00
bouyer 7ffa35d1a2 Implement asynchronous channel reset.
Use this to reset the channel before doing a dump, instead of the hack in
  wdc_exec_xfer() based on C_POLL. This hack was causing problems on
  controllers with a shared queue, because we now can have C_POLL set during
  concurent channels probes (problem found and analysed on sparc64 by
  Martin Husemann).
This should even make core dumps marginally more reliable on ATA drives.
2004-07-31 21:26:42 +00:00
martin 34b6ee1e7c Add prototypes for the new functions added in previous commit. 2004-06-28 20:24:16 +00:00
mycroft b583fff01b Separate page 4/5 reading into separate functions. For "removable" devices,
try page 5 (flex geometry) first.  This fixes problems with some broken USB
devices that do not handle page 4 correctly (rather than returning nothing,
or stalling, they return the CSW where there should be data).
2004-06-28 16:43:49 +00:00
seb 00421911e0 Remove special handling of ASC/ASCQ 0x29/0x00 ("Power On, Reset, or Bus
Device Reset Occurred") when the device is not opened. So let the default
error handler deal with that.

This fix the retrieval of the sense page during autoconfig.

Provided by mycroft@.
Approved by bouyer@.
2004-06-23 23:44:58 +00:00
bouyer a6469740a4 If READ_FORMAT_CAPACITIES fails with "Medium Format Corrupted" ASC/ASQ error,
handle it as if the drive was not formatted, so that "scsictl sdx format"
can open the raw device.
2004-05-21 21:14:11 +00:00
bouyer 879d21cebe Add a delay(10) after re-enabling interrupts in the control register.
Some controllers/drives (e.g. SataLink 3114 with WD Raptor) require
it. Should fix kern/23808 by Chris Gilbert, patch suplied by Chris Gilbert
on tech-kern, extended to all places enabling interrupts by me.
2004-05-08 15:03:32 +00:00
bouyer 8cdd8d251c Revert part of 1.102:
Don't decrease/check xs_retries when the device report "Power On, Reset, or
Bus Device Reset" sense condition, just retry the command. The initial bus
reset would cause the first TEST_UNIT_READY to report this condition,
and as xs_retries is set to 0 when XS_CTL_DISCOVERY is set, it would report an
error instead of being retried, causing the disk probe to report "drive
offline" instead of the geometry and capacity. Checking/decreasing
xs_retries on the bus reset reported by the adapter is enouth to avoid the
problem reported by rev 1.102.

Problem analysed by Paul Kranenburg, fix confirmed by Anders Hjalmars,
and explaination as to why the INQUIRY wasn't affected by this provided by
Bill Studenmund.
2004-04-27 18:15:37 +00:00
pk 95149aa7b9 Some older devices do not understand the `disable block descriptor' bit in
the mode sense request. So fall back on mode sense data including a block
descriptor section.

See also sd.c rev. 1.214.  Again: should we bother trying DBD at all?
2004-04-24 09:26:14 +00:00
itojun 93cf32770f use bounded string ops 2004-04-23 21:52:17 +00:00
itojun aca4c091d3 sprintf -> snprintf 2004-04-22 00:17:10 +00:00
bouyer 751597cddb cbd -> cdb
Command Block Descriptor -> Command Descriptor Block
Pointed out by Allen Briggs.
2004-03-16 19:10:43 +00:00
bouyer 542c876565 Extract the code printing the CBD from scsipi_print_sense(), so that it's
usable in other context.
Use the new scsipi_print_cbd() to dump the command in case of timeout
in siop/esiop.
2004-03-15 22:43:43 +00:00
bouyer 285ce8d78e Indent. 2004-03-15 22:28:30 +00:00
thorpej 4e473186db Use scsipi_adapter_minphys(). 2004-03-14 00:17:37 +00:00
bouyer ece6a039c7 Add a drive with broken tagged queuing support. From Jim Faulkner.
Fix PR kern/23815.
2004-03-12 23:00:40 +00:00
bouyer 567e3c10bc Decrease xs_retries before retrying aborted commands, and report EIO if it
reaches 0. Avoids looping on aborded command in some special cases.
2004-03-10 21:57:31 +00:00
yamt 395e9958f2 change the way to handle NEW_BUFQ_STRATEGY option.
instead of putting #ifdefs into each drivers,
use a global variable to indicate default strategy.

XXX should have a way to specify other strategies.
2004-02-28 06:28:47 +00:00
wiz 73e1501b98 parameter with two es. From Peter Postma. 2004-02-24 15:22:01 +00:00
mycroft 289d7af075 Remove PQUIRK_CDROM. It is definitely not correct -- witness that no other
OS needs such a hack, and the same drive works fine on Suns -- and is much
more likely to be a bug in the host adapter driver (which is corroborated by
the PQUIRK_NOLUNS).
2004-02-22 07:26:15 +00:00
enami 18a61d4783 Backout an obvious bug introduced in rev. 1.145. 2004-02-22 00:26:43 +00:00
bouyer 09bfe9c85c Clear drive_flags when wdc_atapi_get_params() fails. Avoid a panic later
when probing a slave-only bus in some cases.
2004-02-03 20:55:02 +00:00
yamt 7266a95907 store a i/o priority hint in struct buf for buffer queue discipline. 2004-01-10 14:39:50 +00:00
thorpej 197f2f50da More structure member namespace cleanup: thread -> ch_thread 2004-01-03 23:59:58 +00:00
thorpej a963286f8d More wdc_channel structure member namespace cleanup:
- channel -> ch_channel
- wdc -> ch_wdc
2004-01-03 22:56:52 +00:00
thorpej 5bd80d8373 Rename "struct channel_softc" to "struct wdc_channel". 2004-01-03 01:50:52 +00:00
thorpej f61ad169ec callout_init() after memset(). 2004-01-03 01:48:38 +00:00
thorpej 50d7e2cb8b Tidy this file up. 2004-01-01 21:57:42 +00:00
thorpej 9bc0bf3f15 Prepend "wdc_" to wait_for_drq, wait_for_unbusy, and wait_for_ready. 2004-01-01 20:25:22 +00:00
thorpej 527c829fa0 Rename:
- wdc_xfer to ata_xfer
- channel_queue to ata_queue
and move them to <dev/ata/atavar.h> so they can be used by non-wdc ATA
controllers.  Clean up the member names of these structures while at it.
2004-01-01 17:18:53 +00:00
pk d1c155d15c Some older devices do not understand the `disable block descriptors' bit in
the mode sense request. So fall back on mode sense data including a block
descriptor section.

XXX this applies to the `page 4' case. The `page 5' didn't consider the
possible presence of a block descriptor at all, though it did allow the
device to return one.  While that's fixed now, the `page 5' mode sense
does not use the `disable block descriptors' bit.

I'm not sure we should bother with this at all..
2003-12-23 13:12:25 +00:00
bjh21 9ec6a8db4d Synchronise with <ftp://ftp.t10.org/t10/drafts/spc3/asc-num.txt>:
SCSI ASC/ASCQ Assignments
Numeric Sorted Listing
as of  9/12/03
2003-12-03 23:20:53 +00:00
fvdl 6242a54566 There are some cards that map the ATA control and IDE DMA registers
in a different fashion. Individually, they have the same functionality,
but their layout is different. An example of such a chipset is
the Promise 203xx.

To be able to deal with this, transform the cmd and dma bus_space handles
into an array of handles, each seperately created with bus_space_subregion.
The code generated by using the extra indirection shouldn't change much,
since the extra indirection is negated by having the offset calculation
already done in bus_space_subregion. E.g.

	bus_space_write_4(tag, handle, offset, value)

becomes

	bus_space_write_4(tag, handles[offset], 0, value)

Reviewed by Manuel Bouyer. Tested on wdc_isa, wdc_pcmcia, viaide, piixide (i386)
and on cmdide (sparc64).
2003-11-27 23:02:40 +00:00
briggs fa618d5cf3 Use aprint_normal instead of printf in scsipi_print_xfer_mode(). 2003-11-18 21:39:12 +00:00
wiz ee1b406595 Spell address with two d's. Inspired by similar changes in OpenBSD,
originating from Jonathon Gray and forwarded by jmc@openbsd.
2003-11-10 08:51:51 +00:00
wiz d88f7b1d62 boundary, not boundry. Inspired by Tom Cosgrove. 2003-11-02 10:31:06 +00:00
bouyer 14cd9d8cff freese->freeze, as pointed out by Frederick Bruck. 2003-10-29 22:05:15 +00:00
mycroft 3fbc866a6e Back out the bogus initializer -- the compiler bug is fixed. 2003-10-29 21:26:43 +00:00
simonb 393d075aa5 Fix bogus uninitialised warning. 2003-10-28 09:52:32 +00:00
cl b8d68ee313 note 'm68k {u,}int64_t used uninitialized' bug.
add reference to gcc bug report.
mark all (known) occurrences.
2003-10-28 02:01:46 +00:00
fredb fa27252b6c Appease gcc3 -Wno-uninitialized (even though blkno is clearly assigned in
each branch of a conditional).
2003-10-27 23:03:05 +00:00
mycroft 98fb62de25 Add a code that appeared in a PR recently. 2003-10-22 00:35:41 +00:00
mycroft 568ccf202d Add a comment explaining the INQUIRE behavior. 2003-10-17 16:44:48 +00:00
mycroft f8a10571e5 Remove the Fuji quirk from here, too. 2003-10-17 00:19:46 +00:00
mycroft 055625357d Whoops, set cmd_length correctly for the 36-byte INQUIRE. 2003-10-16 22:46:07 +00:00
mycroft 0f1275cee2 Do a 36-byte SCSI 2 inquiry first, and iff that returns an additional length
>32 do a 74-byte inquiry.  Fixes problems with devices that barf on longer
inquiries.  (Linux uses 36 bytes almost everywhere, as a data point.)
2003-10-16 17:34:43 +00:00
bouyer 3d6919754d Clear chp->ch_drive[i].drive_flags if we didn't find a driver for the
drive.
2003-10-15 19:54:30 +00:00
bouyer ac8278da8c Remove this file; ATAPI_READ_FORMAT_CAPACITIES is the same as
READ_FORMAT_CAPACITIES; atapi_flex_geometry_page should probably be the same as
scsi_disk's page_flex_geometry.
2003-10-12 17:57:13 +00:00
thorpej 6fc3c06df3 Revert previous change. 2003-10-12 03:21:56 +00:00
matt 2f05a561da Remove a quirk I added for a Hitachi drive. 2003-10-10 18:04:46 +00:00