diff options
author | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 2001-01-29 00:20:18 +0000 |
---|---|---|
committer | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 2001-01-29 00:20:18 +0000 |
commit | ffe95194cfac672f90313630e2a143eeea89871e (patch) | |
tree | baf612f42771ca9c11d9d4bee98335d58bf4d1e7 /sys/dev | |
parent | ff9be00bbaa6f4df089e7c73518b9af6f6aace88 (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')
-rw-r--r-- | sys/dev/ic/wdc.c | 29 | ||||
-rw-r--r-- | sys/dev/ic/wdcvar.h | 3 | ||||
-rw-r--r-- | sys/dev/isa/wdc_isa.c | 3 | ||||
-rw-r--r-- | sys/dev/isa/wdc_isapnp.c | 1 | ||||
-rw-r--r-- | sys/dev/pci/pciide.c | 25 | ||||
-rw-r--r-- | sys/dev/pcmcia/wdc_pcmcia.c | 3 |
6 files changed, 37 insertions, 27 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 *)); diff --git a/sys/dev/isa/wdc_isa.c b/sys/dev/isa/wdc_isa.c index 79937afcedd..033f246602f 100644 --- a/sys/dev/isa/wdc_isa.c +++ b/sys/dev/isa/wdc_isa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wdc_isa.c,v 1.5 2000/07/20 19:15:22 csapuntz Exp $ */ +/* $OpenBSD: wdc_isa.c,v 1.6 2001/01/29 00:20:17 csapuntz Exp $ */ /* $NetBSD: wdc_isa.c,v 1.15 1999/05/19 14:41:25 bouyer Exp $ */ /*- @@ -201,6 +201,7 @@ wdc_isa_attach(parent, self, aux) return; } wdcattach(&sc->wdc_channel); + wdc_print_current_modes(&sc->wdc_channel); } #if NISADMA > 0 diff --git a/sys/dev/isa/wdc_isapnp.c b/sys/dev/isa/wdc_isapnp.c index 251d5bfd1e3..bd7032dcb74 100644 --- a/sys/dev/isa/wdc_isapnp.c +++ b/sys/dev/isa/wdc_isapnp.c @@ -150,6 +150,7 @@ wdc_isapnp_attach(parent, self, aux) printf("\n"); wdcattach(&sc->wdc_channel); + wdc_print_current_modes(&sc->wdc_channel); } #ifdef notyet diff --git a/sys/dev/pci/pciide.c b/sys/dev/pci/pciide.c index 7a2676ca125..eea739b9385 100644 --- a/sys/dev/pci/pciide.c +++ b/sys/dev/pci/pciide.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pciide.c,v 1.42 2001/01/22 23:09:05 chris Exp $ */ +/* $OpenBSD: pciide.c,v 1.43 2001/01/29 00:20:17 csapuntz Exp $ */ /* $NetBSD: pciide.c,v 1.48 1999/11/28 20:05:18 bouyer Exp $ */ /* @@ -1212,28 +1212,7 @@ void pciide_print_modes(cp) struct pciide_channel *cp; { - struct pciide_softc *sc = (struct pciide_softc *)cp->wdc_channel.wdc; - int drive; - struct channel_softc *chp; - struct ata_drive_datas *drvp; - - chp = &cp->wdc_channel; - 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, - sc->sc_wdcdev.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); - if (drvp->drive_flags & (DRIVE_DMA | DRIVE_UDMA)) - printf(" (using DMA data transfers)"); - printf("\n"); - } + wdc_print_current_modes(&cp->wdc_channel); } void diff --git a/sys/dev/pcmcia/wdc_pcmcia.c b/sys/dev/pcmcia/wdc_pcmcia.c index c311d38781e..42a50af6e02 100644 --- a/sys/dev/pcmcia/wdc_pcmcia.c +++ b/sys/dev/pcmcia/wdc_pcmcia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wdc_pcmcia.c,v 1.9 2000/04/24 19:43:36 niklas Exp $ */ +/* $OpenBSD: wdc_pcmcia.c,v 1.10 2001/01/29 00:20:17 csapuntz Exp $ */ /* $NetBSD: wdc_pcmcia.c,v 1.19 1999/02/19 21:49:43 abs Exp $ */ /*- @@ -378,6 +378,7 @@ wdc_pcmcia_attach(parent, self, aux) sc->sc_flags |= WDC_PCMCIA_ATTACH; wdcattach(&sc->wdc_channel); + wdc_print_current_modes(&sc->wdc_channel); sc->sc_flags &= ~WDC_PCMCIA_ATTACH; return; |