summaryrefslogtreecommitdiff
path: root/sys/dev/isa
diff options
context:
space:
mode:
authorJason Downs <downsj@cvs.openbsd.org>1996-09-04 00:51:16 +0000
committerJason Downs <downsj@cvs.openbsd.org>1996-09-04 00:51:16 +0000
commit7ca89df0f6fccfc79741fafc70e40a64756b7f9c (patch)
tree19c83b9ff9d8e64c0c5902b1a4d5a0be3fa50746 /sys/dev/isa
parent206a918e9c83b16235d46ddaeeb5293cc0975e97 (diff)
Pull in pieces of Manuel's patch6:
- At Milton Ngan's request, wdc now probes for atapi devices first, and then wd drives, because some old atapi devices were detected as ide drives. - Integration of Milton Ngan's fix for some 'wdc_atapi_intr: unknown phase 1' due to a timing problem. Some additional changes (like ADEV_* -> AQUIRK_*) for the sake of compatibility. Manuel's additional quirk type was added as well. I'm not sure I like the retry change to wdc.c; please let me know if anyone has any problems with their drives.
Diffstat (limited to 'sys/dev/isa')
-rw-r--r--sys/dev/isa/wdc.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/sys/dev/isa/wdc.c b/sys/dev/isa/wdc.c
index 2dd372f4d94..1e141dbac30 100644
--- a/sys/dev/isa/wdc.c
+++ b/sys/dev/isa/wdc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wdc.c,v 1.5 1996/08/17 06:24:54 downsj Exp $ */
+/* $OpenBSD: wdc.c,v 1.6 1996/09/04 00:51:15 downsj Exp $ */
/* $NetBSD: wd.c,v 1.150 1996/05/12 23:54:03 mycroft Exp $ */
/*
@@ -228,6 +228,21 @@ wdcattach(parent, self, aux)
#endif
/*
+ * Attach an ATAPI bus, if configured.
+ */
+ wdc->ab_link = malloc(sizeof(struct bus_link), M_DEVBUF, M_NOWAIT);
+ if (wdc->ab_link == NULL) {
+ printf("%s: can't allocate ATAPI link\n", self->dv_xname);
+ return;
+ }
+ bzero(wdc->ab_link,sizeof(struct bus_link));
+ wdc->ab_link->type = BUS;
+ wdc->ab_link->wdc_softc = (caddr_t)wdc;
+ wdc->ab_link->ctlr_link = &(wdc->ctlr_link);
+ wdc->ab_link->ctrl = self->dv_unit;
+ (void)config_found(self, (void *)wdc->ab_link, NULL);
+
+ /*
* Attach standard IDE/ESDI/etc. disks to the controller.
*/
for (drive = 0; drive < 2; drive++) {
@@ -263,21 +278,6 @@ wdcattach(parent, self, aux)
wdcprint);
}
}
-
- /*
- * Attach an ATAPI bus, if configured.
- */
- wdc->ab_link = malloc(sizeof(struct bus_link), M_DEVBUF, M_NOWAIT);
- if (wdc->ab_link == NULL) {
- printf("%s: can't allocate ATAPI link\n", self->dv_xname);
- return;
- }
- bzero(wdc->ab_link,sizeof(struct bus_link));
- wdc->ab_link->type = BUS;
- wdc->ab_link->wdc_softc = (caddr_t)wdc;
- wdc->ab_link->ctlr_link = &(wdc->ctlr_link);
- wdc->ab_link->ctrl = self->dv_unit;
- (void)config_found(self, (void *)wdc->ab_link, NULL);
}
/*
@@ -1602,7 +1602,7 @@ wdc_atapi_intr(wdc, xfer)
bus_chipset_tag_t bc = wdc->sc_bc;
bus_io_handle_t ioh = wdc->sc_ioh;
struct atapi_command_packet *acp = xfer->atapi_cmd;
- int len, phase, i;
+ int len, phase, i, retries = 0;
int err, st, ire;
if (wait_for_unbusy(wdc) < 0) {
@@ -1616,6 +1616,7 @@ wdc_atapi_intr(wdc, xfer)
printf("wdc_atapi_intr: %s\n", wdc->sc_dev.dv_xname);
#endif
+again:
len = bus_io_read_1(bc, ioh, wd_cyl_lo) +
256 * bus_io_read_1(bc, ioh, wd_cyl_hi);
@@ -1725,6 +1726,10 @@ wdc_atapi_intr(wdc, xfer)
break;
default:
+ if (++retries < 500) {
+ DELAY(100);
+ goto again;
+ }
printf("wdc_atapi_intr: unknown phase %d\n", phase);
acp->status = ERROR;
}