Commit Graph

953 Commits

Author SHA1 Message Date
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
mycroft 677da6684c Forgot to commit this. Add the "rpm" field to the flex geometry page. 2003-09-05 09:00:08 +00:00
mycroft 5c195383ca In addition to skipping a variable-length list of block descriptors, we also
have to adjust for whether he have a "small" or "large" mode sense response.

sd_scsibus_getcache(), sd_scsibus_setache(): Set SMS_DBD so that we don't
have to deal with block descriptors here.

sd_scsibus_mode_sense(): Add a new parameter, "int *big", which tells the
caller whether it's a small or large header.

sd_scsibus_get_parms(), sd_scsibus_getcache(), sd_scsibus_setcache(): Use
the "big" value to find the data following the mode sense header correctly.

sd_scsibus_mode_sense(): Disable PQUIRK_NOBIGMODESENSE for now, as the
reasons for it were dubious and most likely fixed now.

sd_scsibus_get_parms(): Now that we're actually locating the right data,
check the returned page code to see if it's correct before using the mode
page info.

sd_scsibus_get_parms(): Get the rotational rate from the flex geometry page
too, if present.

XXX sd_scsibus_get_{opt,simplifiedparms}() need some work.
2003-09-05 08:12:09 +00:00
mycroft 8b228f0d42 sd_scsibus_get_parms():
* Use the "block descriptor length" to find the beginning of the mode page
  data.  This is critical, since some devices do not return a block descriptor
  at all.  (XXX There is disgusting structure hackery here.)
* Always use scsipi_size() (i.e. READ CAPACITY) to get the total disk size.
* Get the rotational rate from the rigid geometry page.
* Don't read the block size from the block descriptor if there was none.
* Get the block size from the flexible geometry page if possible.
* If we don't like the way page 4 smells, try page 5, rather than just punting.
2003-09-05 00:28:55 +00:00
jrf 5e1e6d519e Added three scsi IDs which were tested by Dave Barnes who sent in
three PRs regarding them: 17836, 17837, 17838. Did a few kernel
compiles with them just to make sure they are okay. Approved by
christos@, thanks to Dave for sending the PRs and verifying to me
that they work.
2003-08-07 17:54:26 +00:00
wiz 86e9cd6e52 Add a cast to avoid an integer overflow.
Fixes playing (at least some) DVDs.
Patch from Tsubai Masanari (tsubai at iri.co.jp) -- thanks a lot!
2003-07-18 14:33:54 +00:00
martin 15a7538ed4 If a CD drive reports != 2048 byte block size, try to change it into
2048 byte mode. Fixes PR kern/22090.
Reviewed by Manuel Bouyer.
2003-07-10 18:18:40 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
thorpej 292b5a8b0c Use aprint*(). 2003-05-13 03:00:07 +00:00
thorpej e43fecb228 Change bounds_check_with_label() to take a pointer to the disk structure,
rather than the label itself.  This paves the way for some future changes.
2003-05-10 23:12:28 +00:00
wiz 1ffa7b76c4 DMA, not dma nor Dma. 2003-05-03 18:10:37 +00:00
fvdl 1f81d34aa0 Local change I had lying around: add NOLUNS quirk for an older seagate
drive.
2003-05-02 12:27:49 +00:00
dsl d91455ce26 Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
2003-05-02 08:45:10 +00:00
fvdl 8775f88505 Add another IBM drive that incorrectly reports DT only. 2003-04-21 18:07:14 +00:00
fvdl ee7b6f07aa One more FreeBSD compat define. 2003-04-20 23:43:04 +00:00
fvdl 4fe822c162 Correct typo in previous. 2003-04-20 12:05:42 +00:00
fvdl 3bc3f3793f Add FreeBSD compat define for PPR_PCOM 2003-04-20 11:53:28 +00:00
fvdl 40565542e4 Add NetBSD RCS id. 2003-04-19 19:21:35 +00:00
fvdl a434795392 Add a PCAP_NODT quirk. I have two older Quantum Atlas drives that work
fine at U2W, but barf at U160, with different controllers. Unfortunately
sometimes just being initialized at U160 does the trick, so setting them
to lower speed in the BIOS may also be needed.
2003-04-19 19:16:06 +00:00
fvdl 016a1095a9 A device should always respond to inquiry or test unit ready; disable
retries for these during discovery. From Pascal Renauld at Network
Storage Solutions, Inc
2003-04-19 19:12:59 +00:00
fvdl ea399d0682 Add MSG_QAS_REQUEST definition. 2003-04-19 19:11:13 +00:00
fvdl 76a06d99f3 IU pkt/task definitions include file. From FreeBSD. 2003-04-19 19:10:25 +00:00
nathanw c4921eb479 Remove extra right paren. 2003-04-16 21:08:06 +00:00
thorpej ce68b169df * Change the APIs that handle the sync period to work with 100ths of ns,
rather than 10ths of ns.  This is necessary in order to represent
  Ultra320 SCSI.
* Add Ultra320 SCSI to the scsipi_syncparams[] table.

We're not going to bother bumping any version numbers with this change; only
the "hba" driver uses scsipi_sync_period_to_factor(), and the uses of
scsipi_sync_factor_to_period() are all internal to the scsipi code.  Most
things just pass the factor around, which is unchanged by this.

Reviewed by Frank van der Linden.
2003-04-16 20:25:59 +00:00
perry 5f549c5ea8 Add a quirk for the Tandberg SLR/5
Fix supplied by Rex McMaster in PR kern/13603
2003-04-14 16:18:23 +00:00
fvdl 8103646465 Check RAW_PART against the media size instead of the disklabel.
Add the media size in 512-byte sectors to the softc, to avoid
some 64 bit computations. Bump the capacity stored in softcs
for disks to 64 bits.
2003-04-03 22:18:23 +00:00
erh dcf3619707 Add a quirk to allow my NEO Jukebox to work again. 2003-04-03 17:41:51 +00:00