summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2001-01-29 00:20:18 +0000
committerConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2001-01-29 00:20:18 +0000
commitffe95194cfac672f90313630e2a143eeea89871e (patch)
treebaf612f42771ca9c11d9d4bee98335d58bf4d1e7 /sys/dev/ic
parentff9be00bbaa6f4df089e7c73518b9af6f6aace88 (diff)
Add wdc_print_current_modes to print current transfer modes set on the
devices. Print after attach in wdc_isa, wdc_isapnp, wdc_pcmcia. pciide_print_modes rewritten to use wdc_print_current_modes. Disable wdc_print_caps since it's not as useful. Inspired by NetBSD. Thanks to Dale and Theo for pointing out this improvement.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/wdc.c29
-rw-r--r--sys/dev/ic/wdcvar.h3
2 files changed, 30 insertions, 2 deletions
diff --git a/sys/dev/ic/wdc.c b/sys/dev/ic/wdc.c
index e9775599c74..ce069a07dfb 100644
--- a/sys/dev/ic/wdc.c
+++ b/sys/dev/ic/wdc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wdc.c,v 1.24 2001/01/23 08:50:28 aaron Exp $ */
+/* $OpenBSD: wdc.c,v 1.25 2001/01/29 00:20:16 csapuntz Exp $ */
/* $NetBSD: wdc.c,v 1.68 1999/06/23 19:00:17 bouyer Exp $ */
@@ -1367,6 +1367,9 @@ void
wdc_print_caps(drvp)
struct ata_drive_datas *drvp;
{
+ /* This is actually a lie until we fix the _probe_caps
+ algorithm. Don't print out lies */
+#if 0
printf("%s: can use ", drvp->drive_name);
if (drvp->drive_flags & DRIVE_CAP32) {
@@ -1385,6 +1388,30 @@ wdc_print_caps(drvp)
}
printf("\n");
+#endif
+}
+
+void
+wdc_print_current_modes(chp)
+ struct channel_softc *chp;
+{
+ int drive;
+ struct ata_drive_datas *drvp;
+
+ for (drive = 0; drive < 2; drive++) {
+ drvp = &chp->ch_drive[drive];
+ if ((drvp->drive_flags & DRIVE) == 0)
+ continue;
+ printf("%s(%s:%d:%d): using PIO mode %d",
+ drvp->drive_name,
+ chp->wdc->sc_dev.dv_xname,
+ chp->channel, drive, drvp->PIO_mode);
+ if (drvp->drive_flags & DRIVE_DMA)
+ printf(", DMA mode %d", drvp->DMA_mode);
+ if (drvp->drive_flags & DRIVE_UDMA)
+ printf(", Ultra-DMA mode %d", drvp->UDMA_mode);
+ printf("\n");
+ }
}
/*
diff --git a/sys/dev/ic/wdcvar.h b/sys/dev/ic/wdcvar.h
index 091d4f0ab85..80524d8f36d 100644
--- a/sys/dev/ic/wdcvar.h
+++ b/sys/dev/ic/wdcvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wdcvar.h,v 1.12 2000/10/27 20:29:28 csapuntz Exp $ */
+/* $OpenBSD: wdcvar.h,v 1.13 2001/01/29 00:20:16 csapuntz Exp $ */
/* $NetBSD: wdcvar.h,v 1.17 1999/04/11 20:50:29 bouyer Exp $ */
/*-
@@ -281,3 +281,4 @@ int wdc_select_drive __P((struct channel_softc *, int, int));
void wdc_output_bytes __P((struct ata_drive_datas *drvp, void *, unsigned int));
void wdc_input_bytes __P((struct ata_drive_datas *drvp, void *, unsigned int));
+void wdc_print_current_modes __P((struct channel_softc *));