Move guts of pciide_print_modes() to wdc_print_modes() so that non-pciide
wdc drivers (like macppc's obio IDE interface) can use it. Also add support to both wd attach line and to wdc_print_modes() to print Ultra/{33,66,100} for respective UDMA modes (From Manuel Bouyer).
This commit is contained in:
parent
a88f368787
commit
88cbfbe36d
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: wdc.c,v 1.92 2000/06/28 17:13:06 mrg Exp $ */
|
||||
/* $NetBSD: wdc.c,v 1.93 2000/11/08 17:57:36 wrstuden Exp $ */
|
||||
|
||||
|
||||
/*
|
||||
@ -1094,6 +1094,12 @@ wdc_probe_caps(drvp)
|
||||
continue;
|
||||
if (!printed) {
|
||||
printf("%s Ultra-DMA mode %d", sep, i);
|
||||
if (i == 2)
|
||||
printf(" (Ultra/33)");
|
||||
else if (i == 4)
|
||||
printf(" (Ultra/66)");
|
||||
else if (i == 5)
|
||||
printf(" (Ultra/100)");
|
||||
sep = ",";
|
||||
printed = 1;
|
||||
}
|
||||
@ -1590,3 +1596,34 @@ wdc_delref(chp)
|
||||
(void) (*adapter->_generic.scsipi_enable)(wdc, 0);
|
||||
splx(s);
|
||||
}
|
||||
|
||||
void
|
||||
wdc_print_modes(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->drv_softc->dv_xname,
|
||||
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);
|
||||
if (drvp->UDMA_mode == 2)
|
||||
printf(" (Ultra/33)");
|
||||
else if (drvp->UDMA_mode == 4)
|
||||
printf(" (Ultra/66)");
|
||||
else if (drvp->UDMA_mode == 5)
|
||||
printf(" (Ultra/100)");
|
||||
}
|
||||
if (drvp->drive_flags & (DRIVE_DMA | DRIVE_UDMA))
|
||||
printf(" (using DMA data transfers)");
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: wdcvar.h,v 1.25 2000/06/12 21:10:41 bouyer Exp $ */
|
||||
/* $NetBSD: wdcvar.h,v 1.26 2000/11/08 17:57:37 wrstuden Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -194,6 +194,8 @@ int wdc_addref __P((struct channel_softc *));
|
||||
void wdc_delref __P((struct channel_softc *));
|
||||
void wdc_kill_pending __P((struct channel_softc *));
|
||||
|
||||
void wdc_print_modes (struct channel_softc *);
|
||||
|
||||
/*
|
||||
* ST506 spec says that if READY or SEEKCMPLT go off, then the read or write
|
||||
* command is aborted.
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pciide.c,v 1.89 2000/11/05 21:14:59 matt Exp $ */
|
||||
/* $NetBSD: pciide.c,v 1.90 2000/11/08 17:57:37 wrstuden Exp $ */
|
||||
|
||||
|
||||
/*
|
||||
@ -1156,28 +1156,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->drv_softc->dv_xname,
|
||||
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_modes(&cp->wdc_channel);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user