summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Yurchenko <grange@cvs.openbsd.org>2004-10-17 17:50:49 +0000
committerAlexander Yurchenko <grange@cvs.openbsd.org>2004-10-17 17:50:49 +0000
commit5e2a63b25101c6aaea4b77c014bbad44b04c0b35 (patch)
tree9aaf5fadd7c781ee1f9d145bef2d69a1fc14b42a
parent86c75be707ab0f7aad0211928afdefc9b2e5ddf5 (diff)
Add a callback drv_probe() to allow underlying ata controller driver
to probe for drives in its own way. It's a no-op for now but will be needed for native sata support.
-rw-r--r--sys/dev/ic/wdc.c14
-rw-r--r--sys/dev/ic/wdcvar.h5
2 files changed, 13 insertions, 6 deletions
diff --git a/sys/dev/ic/wdc.c b/sys/dev/ic/wdc.c
index 7aa44ad900b..e17770c97ac 100644
--- a/sys/dev/ic/wdc.c
+++ b/sys/dev/ic/wdc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wdc.c,v 1.85 2004/10/17 08:58:56 grange Exp $ */
+/* $OpenBSD: wdc.c,v 1.86 2004/10/17 17:50:48 grange Exp $ */
/* $NetBSD: wdc.c,v 1.68 1999/06/23 19:00:17 bouyer Exp $ */
@@ -792,12 +792,16 @@ wdcattach(chp)
if (!chp->_vtbl)
chp->_vtbl = &wdc_default_vtbl;
- if (wdcprobe(chp) == 0) {
- /* If no drives, abort attach here. */
+ if (chp->wdc->drv_probe != NULL) {
+ chp->wdc->drv_probe(chp);
+ } else {
+ if (wdcprobe(chp) == 0) {
+ /* If no drives, abort attach here. */
#ifndef __OpenBSD__
- wdc_delref(chp);
+ wdc_delref(chp);
#endif
- return;
+ return;
+ }
}
/* ATAPI drives need settling time. Give them 250ms */
diff --git a/sys/dev/ic/wdcvar.h b/sys/dev/ic/wdcvar.h
index 4af1b1d0ecc..d87e15a16a7 100644
--- a/sys/dev/ic/wdcvar.h
+++ b/sys/dev/ic/wdcvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wdcvar.h,v 1.36 2004/10/17 08:58:56 grange Exp $ */
+/* $OpenBSD: wdcvar.h,v 1.37 2004/10/17 17:50:48 grange Exp $ */
/* $NetBSD: wdcvar.h,v 1.17 1999/04/11 20:50:29 bouyer Exp $ */
/*-
@@ -203,6 +203,9 @@ struct wdc_softc { /* Per controller state */
/* if WDC_CAPABILITY_IRQACK set in 'cap' */
void (*irqack)(struct channel_softc *);
+
+ /* Driver callback to probe for drives */
+ void (*drv_probe)(struct channel_softc *);
};
/*