summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2006-05-03 02:18:48 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2006-05-03 02:18:48 +0000
commit69a8411c717e29b6c4375c6fc8f818863b775731 (patch)
tree823a0efbfa311b79b46de0da17a977936d9d9e07 /sys
parent4bbcc3640461b1f0310b36781dc58a9948d00432 (diff)
Provide a function pointer that allows for the wdc reset
method to be changed as required. This will be required for dealing with several chips in pciide.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/wdc.c12
-rw-r--r--sys/dev/ic/wdcvar.h5
2 files changed, 11 insertions, 6 deletions
diff --git a/sys/dev/ic/wdc.c b/sys/dev/ic/wdc.c
index 4a19590d8f6..8ed526472e9 100644
--- a/sys/dev/ic/wdc.c
+++ b/sys/dev/ic/wdc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wdc.c,v 1.89 2006/02/10 21:45:41 kettenis Exp $ */
+/* $OpenBSD: wdc.c,v 1.90 2006/05/03 02:18:47 jsg Exp $ */
/* $NetBSD: wdc.c,v 1.68 1999/06/23 19:00:17 bouyer Exp $ */
@@ -100,7 +100,6 @@
struct pool wdc_xfer_pool;
void __wdcerror(struct channel_softc *, char *);
-void __wdcdo_reset(struct channel_softc *);
int __wdcwait_reset(struct channel_softc *, int);
void __wdccommand_done(struct channel_softc *, struct wdc_xfer *);
void __wdccommand_start(struct channel_softc *, struct wdc_xfer *);
@@ -684,7 +683,7 @@ wdcprobe(chp)
}
/* reset the channel */
- __wdcdo_reset(chp);
+ chp->wdc->reset(chp);
ret_value = __wdcwait_reset(chp, ret_value);
WDCDEBUG_PRINT(("%s:%d: after reset, ret_value=0x%d\n",
@@ -787,6 +786,9 @@ wdcattach(chp)
if (!cold)
at_poll = AT_WAIT;
+ if (chp->wdc->reset == NULL)
+ chp->wdc->reset = wdc_do_reset;
+
timeout_set(&chp->ch_timo, wdctimeout, chp);
#ifndef __OpenBSD__
@@ -1064,7 +1066,7 @@ wdcreset(chp, verb)
if (!chp->_vtbl)
chp->_vtbl = &wdc_default_vtbl;
- __wdcdo_reset(chp);
+ chp->wdc->reset(chp);
drv_mask1 = (chp->ch_drive[0].drive_flags & DRIVE) ? 0x01:0x00;
drv_mask1 |= (chp->ch_drive[1].drive_flags & DRIVE) ? 0x02:0x00;
@@ -1083,7 +1085,7 @@ wdcreset(chp, verb)
}
void
-__wdcdo_reset(struct channel_softc *chp)
+wdc_do_reset(struct channel_softc *chp)
{
wdc_set_drive(chp, 0);
DELAY(10);
diff --git a/sys/dev/ic/wdcvar.h b/sys/dev/ic/wdcvar.h
index 9b8d4ef6fbb..4f2ae1227d4 100644
--- a/sys/dev/ic/wdcvar.h
+++ b/sys/dev/ic/wdcvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wdcvar.h,v 1.38 2006/02/10 21:45:41 kettenis Exp $ */
+/* $OpenBSD: wdcvar.h,v 1.39 2006/05/03 02:18:47 jsg Exp $ */
/* $NetBSD: wdcvar.h,v 1.17 1999/04/11 20:50:29 bouyer Exp $ */
/*-
@@ -209,6 +209,8 @@ struct wdc_softc { /* Per controller state */
/* if WDC_CAPABILITY_IRQACK set in 'cap' */
void (*irqack)(struct channel_softc *);
+ void (*reset)(struct channel_softc *);
+
/* Driver callback to probe for drives */
void (*drv_probe)(struct channel_softc *);
};
@@ -287,6 +289,7 @@ void wdccommandext(struct channel_softc *, u_int8_t, u_int8_t, u_int64_t,
u_int16_t);
void wdccommandshort(struct channel_softc *, int, int);
void wdctimeout(void *arg);
+void wdc_do_reset(struct channel_softc *);
int wdc_addref(struct channel_softc *);
void wdc_delref(struct channel_softc *);