aboutsummaryrefslogtreecommitdiff
path: root/sys/i386/isa/wcd.c
diff options
context:
space:
mode:
authorSøren Schmidt <sos@FreeBSD.org>1995-09-09 11:41:04 +0000
committerSøren Schmidt <sos@FreeBSD.org>1995-09-09 11:41:04 +0000
commit2bf07b2bd791b3309ef53173bc97cc5158f8aec4 (patch)
treeca13751bd7346bb88c2b3755228c1e856ebc6556 /sys/i386/isa/wcd.c
parentf3c3ae3c38edee1748f2f3f8eea69232135402bb (diff)
Patch to the atapi driver, by Serge V.Vakulenko, minor changes
by me... Original message: This patch upgrades the ATAPI CD-ROM driver to version 1.3. It has three bugs fixed: 1) The `controller not ready' message at startup and later. It was caused by staled media change bit. 2) Incorrect shuffling of model string for some drives (NEC, Mitsumi). 3) Handling of drives which report itself as been of direct-access type, instead of CD-ROM type. There is one known bug which is not fixed yet -- probing in absense of IDE disks. A work-around exists though (thanks Steve!). If you have no IDE disks attached, then remove them from the kernel config file to make the CD-ROM attach correctly. Unfortunately, there is no way to disable them from the kernel interactive config mode. Reviewed by: sos (Soren Schmidt) Submitted by: vak@gw.cronyx.msk.su (Serge V.Vakulenko)
Notes
Notes: svn path=/head/; revision=10647
Diffstat (limited to 'sys/i386/isa/wcd.c')
-rw-r--r--sys/i386/isa/wcd.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/i386/isa/wcd.c b/sys/i386/isa/wcd.c
index f16ccdffe022..901382e180d3 100644
--- a/sys/i386/isa/wcd.c
+++ b/sys/i386/isa/wcd.c
@@ -12,7 +12,7 @@
* or modify this software as long as this message is kept with the software,
* all derivative works or modified versions.
*
- * Version 1.1, Mon Jul 10 21:55:11 MSD 1995
+ * Version 1.2, Mon Jul 24 17:21:25 MSD 1995
*/
/*
@@ -262,10 +262,16 @@ void wcdattach (struct atapi *ata, int unit, struct atapi_params *ap, int debug,
}
/* Get drive capabilities. */
+ /* Do it twice to avoid the stale media changed state. */
result = atapi_request_immediate (ata, unit, ATAPI_MODE_SENSE,
0, CAP_PAGE, 0, 0, 0, 0, sizeof (t->cap) >> 8, sizeof (t->cap),
0, 0, 0, 0, 0, 0, 0, (char*) &t->cap, sizeof (t->cap));
+ if (result.code == RES_ERR && result.error == AER_SK_UNIT_ATTENTION)
+ result = atapi_request_immediate (ata, unit, ATAPI_MODE_SENSE,
+ 0, CAP_PAGE, 0, 0, 0, 0, sizeof (t->cap) >> 8,
+ sizeof (t->cap), 0, 0, 0, 0, 0, 0, 0,
+ (char*) &t->cap, sizeof (t->cap));
if (result.code == 0) {
wcd_describe (t);
if (t->flags & F_DEBUG)
@@ -367,14 +373,12 @@ int wcdopen (dev_t dev, int flags, int fmt, struct proc *p)
result = atapi_request_wait (t->ata, t->unit, ATAPI_TEST_UNIT_READY,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
- if (result.code == RES_ERR && result.error == AER_SK_UNIT_ATTENTION)
+ if (result.code == RES_ERR && result.error == AER_SK_UNIT_ATTENTION) {
t->flags |= F_MEDIA_CHANGED;
-
- if (result.code)
result = atapi_request_wait (t->ata, t->unit,
ATAPI_TEST_UNIT_READY, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0);
-
+ }
if (result.code) {
wcd_error (t, result);
return (ENXIO);