Commit Graph

993 Commits

Author SHA1 Message Date
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
thorpej
c490cdc5be Warn if a sync period requiring DT was negotiated on a peripheral not
capable of DT.
2003-10-10 05:58:56 +00:00
bouyer
99d6009c2a Make the ATA mid-layer appears as atabus, as proposed in
http://mail-index.netbsd.org/tech-kern/2003/09/25/0006.html
This adds a device (atabus) between IDE controllers and wd or atapibus, to
have each ATA channel show up in the device tree. Later there will be atabus
devices in /dev, so that we can do IOCTL on them.
Each atabus has its own kernel thread, to handle operations that needs polling,
e.g. reset and others.

Device probing on each bus it defered to the atabus thread creation.
This allows to do the reset and basic device probes in parallel, which reduce
boot time on systems with several pciide controllers.
2003-10-08 10:58:12 +00:00
bouyer
7b066791c8 Remove references to University of California from my copyright notices. 2003-10-05 17:48:49 +00:00
mycroft
d40837608f 1) Use config_interrupts() to attach IDE and ATAPI drives. This eliminates
most polling.
2) Clean up some goofiness in pciide -- get rid of the whole "candisable" path
   (it's gratuitous) and simplify the code by calling pciide_map_compat_intr(),
   *_set_modes() and wdc_print_modes() from central locations.
3) Add a register writability and register ghost test to eliminate phantom
   drives more quickly.
2003-09-19 21:35:56 +00:00
mycroft
e80260e91f Whoops, make sure 6-byte commands work again. 2003-09-18 06:55:53 +00:00
mycroft
f96fe2cc8a Don't print junk if an INQUIRY fails (usually with an ILLEGAL REQUEST due to
an unused LUN).  Also, if the qualifier says the LUN is non-existant, don't
try to attach a device here.
2003-09-18 05:06:53 +00:00
mycroft
9dbb8c86d4 Merge the geometry and cache handling code for all direct access and optical
devices, as it's general to all SCSI MMC devices.  In the process, remove
PQUIRK_NO_FLEX_PAGE.
2003-09-18 00:06:31 +00:00
mycroft
e873dbd7ad If READ CAPACITY fails, try a READ FORMAT CAPACITIES. Separate this into
another function, always doing a page 0 MODE SENSE to get the block
descriptor if we use READ CAPACITY, and use SMS_DBD on the page 4/5 MODE
SENSE.  This does one extra command in some cases, but it separates and
simplifies the code a little.

Why do we prefer READ CAPACITY over READ FORMAT CAPACITIES?  Two reasons:
1) It's much older and is much less likely to have had its command code
abused, and is thus "safer" to try first.  2) ALL of my USB flash readers
and pen drives screw up their capacity descriptors -- mostly off-by-one
errors in the size (they return the maximum LBA number instead, a la READ
CAPACITY, which has *never* been how READ FORMAT CAPACITIES was documented
in the MMC spec), and one returns the "no media" code on slots that have
media inserted (despite returning almost-correct data otherwise)!

F*** me with a chainsaw.
2003-09-17 23:33:43 +00:00
mycroft
b2d9db1002 Remove PQUIRK_BYTE5_ZERO. 2003-09-17 19:14:56 +00:00
mycroft
10675507e9 Don't be silent if there is no media present. 2003-09-13 15:49:04 +00:00
mycroft
953ba0b251 Make sure the "raw partition" can always be opened again. 2003-09-13 14:44:50 +00:00
mycroft
af0c320925 Some devices really want INQUIRY to be the first command they receive. Also,
the result of the extra TEST UNIT READY was being ignored anyway.  So, I wrote
it, I nuke it.
2003-09-12 16:39:25 +00:00
mycroft
5118c3e1e9 Set up the blank fields in the INQUIRY buffer *before* executing the command --
because we can't really rely on the "additional length" being correct (any
more?).  Fixes some problems with devices showing up as "<, , >".
2003-09-10 05:35:50 +00:00
mycroft
3ce80fb07e Make similar changes as with cd_mode_{sense,select}(). 2003-09-09 06:32:14 +00:00
mycroft
f733d9708b Remove NOMODESENSE quirks for Iomega drives -- they're totally unneeded. 2003-09-09 03:57:57 +00:00
mycroft
1c4e2cf723 Delete the NOMODESENSE quirks for Maxtor USB hard drives, as these are no
doubt resolved (and were never actually needed in the first place -- someone
was let out without supervision).
2003-09-09 03:01:27 +00:00
mycroft
67ed54a25b In the test for whether to start the unit, I used the wrong error code.
ENODEV is only returned when we get "medium not present," which we can fail
immediately on.  All other "not ready" cases return EIO.
2003-09-09 02:43:34 +00:00
mycroft
06fca94595 Exorcise PQUIRK_NODOORLOCK. 2003-09-09 02:37:55 +00:00
mycroft
7365679351 Oops. Fix a typo in cd_mode_select(). 2003-09-08 23:44:29 +00:00
mycroft
ab5fff1eda Fix an error path where we might scsipi_prevent() on a non-removable device. 2003-09-08 23:43:35 +00:00
mycroft
5ad03464f5 There is absolutely no sense in having a PQUIRK_NODOORLOCK entry for a
non-removable device.  Nuke it.
2003-09-08 23:43:05 +00:00
mycroft
a599f64320 If maxlun>0, automatically set PQUIRK_FORCELUNS, rather than using quirk
table entries.
2003-09-08 19:57:29 +00:00