Commit Graph

980 Commits

Author SHA1 Message Date
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
mycroft 648730c4cf Do a START UNIT only if the TEST UNIT READY reports that the device is not
ready.  This avoids gratuitously starting the motor on floppy and CD-ROM
drives, and eliminates the need for the audio playing test in cdopen().

Therefore, also remove PQUIRK_NOSTARTUNIT.
2003-09-08 18:51:33 +00:00
mycroft 2bfde7f903 Attempt to deal with Martin's weirdass Sun drive by setting the mode sense
allocation length a little more precisely -- add the space for the header in
cd_mode_sense().  Also delete the XS_CTL_SILENT, since we really do want to
see errors.

Lastly, add a similar wrapper for mode select, simplifying the callers
slightly.
2003-09-08 16:16:43 +00:00
mycroft a7155b9951 Rework sd_scsibus_get_parms() a little. Try to get a block descriptor even
if our other MODE SENSEs fail.  Use this code for the optical device case,
at least for now.  (We could query the optical media type and do a table
lookup for the geometry, but why bother?  Actually, why bother with geometry
at all, but I digress...)
2003-09-08 06:31:23 +00:00
mycroft 98ba1f5667 On further investigation... don't panic if we try to do a 6-byte mode
sense/select on ATAPI.  Some tape drives require it.  And who knows?  Some
fool might wire a RBC device to ATAPI.
2003-09-08 03:50:27 +00:00
mycroft 637a6554cf Perform the exorcism on scsipi_mode_select() too. 2003-09-08 03:33:31 +00:00
mycroft 4588667f28 Exorcise something evil and wrong in scsipi_mode_sense(). 2003-09-08 03:24:12 +00:00
mycroft 0239de4901 RBC devices do in fact requre using 6-byte MODE SENSE/SELECT. This is totally
the wrong way to deal with that, but... I'll get back to it later.
2003-09-08 03:09:09 +00:00
mycroft f2a492ff6b Eliminate the separate ATAPI and SCSI attachments for "cd". 2003-09-08 01:56:33 +00:00
mycroft 5dd4bdd14c Use the const shaker. 2003-09-08 01:27:08 +00:00
mycroft 9203f63f67 We only need a single attachment for uk at scsibus and atapibus. 2003-09-08 01:26:41 +00:00
mycroft cd456a7097 Nuke some printf()s. 2003-09-08 01:13:04 +00:00
mycroft b6e043eed2 Set PQUIRK_ONLYBIG in the wdc-atapi frontend, obviating the need to ever test
the "bus type" for this.

Merge all the code in the SCSI and ATAPI backends for "cd" devices.  All of
the mode page handling and whatnot is general to SCSI MMC devices, and should
never have been separated to begin with.  This fixes a variety of problems,
and adds load/unload support for SCSI-attached devices.
2003-09-07 22:11:22 +00:00
mycroft 80605e4feb Use SMS_DBD in a several places to avoid even thinking about block descriptors. 2003-09-05 09:04:26 +00:00