Don't bother with bits that tell of the presence of optional callbacks;

just check the function pointers for NULL.
This commit is contained in:
thorpej 2004-08-13 03:12:59 +00:00
parent 577bf67014
commit ab20886f7b
26 changed files with 128 additions and 166 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: wdc_mb.c,v 1.21 2004/01/06 18:46:07 he Exp $ */
/* $NetBSD: wdc_mb.c,v 1.22 2004/08/13 03:12:59 thorpej Exp $ */
/*-
* Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wdc_mb.c,v 1.21 2004/01/06 18:46:07 he Exp $");
__KERNEL_RCSID(0, "$NetBSD: wdc_mb.c,v 1.22 2004/08/13 03:12:59 thorpej Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -170,7 +170,7 @@ wdc_mb_attach(parent, self, aux)
*/
MFP->mf_ierb &= ~IB_DINT;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_HWLOCK |
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 |
WDC_CAPABILITY_ATA_NOSTREAM;
sc->sc_wdcdev.PIO_cap = 0;
sc->sc_wdcdev.claim_hw = &claim_hw;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pciide_pnpbios.c,v 1.15 2004/05/25 20:42:40 thorpej Exp $ */
/* $NetBSD: pciide_pnpbios.c,v 1.16 2004/08/13 03:12:59 thorpej Exp $ */
/*
* Copyright (c) 1999 Soren S. Jorvang. All rights reserved.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pciide_pnpbios.c,v 1.15 2004/05/25 20:42:40 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: pciide_pnpbios.c,v 1.16 2004/08/13 03:12:59 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -124,13 +124,12 @@ pciide_pnpbios_attach(parent, self, aux)
sc->sc_wdcdev.nchannels = 1;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_UDMA;
#if 0 /* XXX */
sc->sc_wdcdev.cap |= WDC_CAPABILITY_MODE;
#endif
sc->sc_wdcdev.PIO_cap = 4;
sc->sc_wdcdev.DMA_cap = 2; /* XXX */
sc->sc_wdcdev.UDMA_cap = 2; /* XXX */
#if 0 /* XXX */
sc->sc_wdcdev.set_modes = pciide_pnpbios_setup_channel;
#endif
cp = &sc->pciide_channels[0];
sc->wdc_chanarray[0] = &cp->wdc_channel;

View File

@ -1,4 +1,4 @@
/* $NetBSD: kauai.c,v 1.13 2004/05/25 20:42:41 thorpej Exp $ */
/* $NetBSD: kauai.c,v 1.14 2004/08/13 03:12:59 thorpej Exp $ */
/*-
* Copyright (c) 2003 Tsubai Masanari. All rights reserved.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kauai.c,v 1.13 2004/05/25 20:42:41 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: kauai.c,v 1.14 2004/08/13 03:12:59 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -175,7 +175,7 @@ kauai_attach(parent, self, aux)
sc->sc_wdcdev.PIO_cap = 4;
sc->sc_wdcdev.DMA_cap = 2;
sc->sc_wdcdev.UDMA_cap = 5;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_UDMA;
sc->wdc_chanptr = chp;
sc->sc_wdcdev.channels = &sc->wdc_chanptr;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wdc_obio.c,v 1.37 2004/05/25 20:42:41 thorpej Exp $ */
/* $NetBSD: wdc_obio.c,v 1.38 2004/08/13 03:12:59 thorpej Exp $ */
/*-
* Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wdc_obio.c,v 1.37 2004/05/25 20:42:41 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: wdc_obio.c,v 1.38 2004/08/13 03:12:59 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -206,7 +206,7 @@ wdc_obio_attach(parent, self, aux)
}
sc->sc_wdcdev.PIO_cap = 4;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16;
sc->wdc_chanptr = chp;
sc->sc_wdcdev.channels = &sc->wdc_chanptr;
sc->sc_wdcdev.nchannels = 1;
@ -336,13 +336,12 @@ adjust_timing(chp)
#endif
sc->sc_dmaconf[drive] = conf;
}
sc->sc_wdcdev.cap &= ~WDC_CAPABILITY_SELECT;
sc->sc_wdcdev.select = 0;
if (sc->sc_dmaconf[0]) {
wdc_obio_select(chp,0);
if (sc->sc_dmaconf[1] && (sc->sc_dmaconf[0] != sc->sc_dmaconf[1])) {
if (sc->sc_dmaconf[1] &&
(sc->sc_dmaconf[0] != sc->sc_dmaconf[1])) {
sc->sc_wdcdev.select = wdc_obio_select;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_SELECT;
}
} else if (sc->sc_dmaconf[1]) {
wdc_obio_select(chp,1);
@ -405,13 +404,12 @@ ata4_adjust_timing(chp)
#endif
sc->sc_dmaconf[drive] = conf;
}
sc->sc_wdcdev.cap &= ~WDC_CAPABILITY_SELECT;
sc->sc_wdcdev.select = 0;
if (sc->sc_dmaconf[0]) {
wdc_obio_select(chp,0);
if (sc->sc_dmaconf[1] && (sc->sc_dmaconf[0] != sc->sc_dmaconf[1])) {
if (sc->sc_dmaconf[1] &&
(sc->sc_dmaconf[0] != sc->sc_dmaconf[1])) {
sc->sc_wdcdev.select = wdc_obio_select;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_SELECT;
}
} else if (sc->sc_dmaconf[1]) {
wdc_obio_select(chp,1);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ata.c,v 1.45 2004/08/13 02:16:40 thorpej Exp $ */
/* $NetBSD: ata.c,v 1.46 2004/08/13 03:12:59 thorpej Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.45 2004/08/13 02:16:40 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.46 2004/08/13 03:12:59 thorpej Exp $");
#ifndef WDCDEBUG
#define WDCDEBUG
@ -562,7 +562,7 @@ atastart(struct wdc_channel *chp)
if ((chp->ch_flags & WDCF_IRQ_WAIT) != 0)
panic("atastart: channel waiting for irq");
#endif
if (wdc->cap & WDC_CAPABILITY_HWLOCK)
if (wdc->claim_hw)
if (!(*wdc->claim_hw)(chp, 0))
return;
@ -602,7 +602,7 @@ ata_free_xfer(struct wdc_channel *chp, struct ata_xfer *xfer)
struct wdc_softc *wdc = chp->ch_wdc;
int s;
if (wdc->cap & WDC_CAPABILITY_HWLOCK)
if (wdc->free_hw)
(*wdc->free_hw)(chp);
s = splbio();
pool_put(&ata_xfer_pool, xfer);
@ -723,7 +723,7 @@ ata_downgrade_mode(struct ata_drive_datas *drvp, int flags)
/* if drive or controller don't know its mode, we can't do much */
if ((drvp->drive_flags & DRIVE_MODE) == 0 ||
(wdc->cap & WDC_CAPABILITY_MODE) == 0)
(wdc->set_modes == NULL))
return 0;
/* current drive mode was set by a config flag, let it this way */
if ((cf_flags & ATA_CONFIG_PIO_SET) ||
@ -836,7 +836,7 @@ ata_probe_caps(struct ata_drive_datas *drvp)
* assume the defaults are good, so don't try
* to set it
*/
if ((wdc->cap & WDC_CAPABILITY_MODE) != 0)
if (wdc->set_modes)
/*
* It's OK to pool here, it's fast enouth
* to not bother waiting for interrupt
@ -854,8 +854,7 @@ ata_probe_caps(struct ata_drive_datas *drvp)
* If controller's driver can't set its PIO mode,
* get the highter one for the drive.
*/
if ((wdc->cap & WDC_CAPABILITY_MODE) == 0 ||
wdc->PIO_cap >= i + 3) {
if (wdc->set_modes == NULL || wdc->PIO_cap >= i + 3) {
drvp->PIO_mode = i + 3;
drvp->PIO_cap = i + 3;
break;
@ -874,7 +873,7 @@ ata_probe_caps(struct ata_drive_datas *drvp)
if ((params.atap_dmamode_supp & (1 << i)) == 0)
continue;
if ((wdc->cap & WDC_CAPABILITY_DMA) &&
(wdc->cap & WDC_CAPABILITY_MODE))
wdc->set_modes != NULL)
if (ata_set_mode(drvp, 0x20 | i, AT_WAIT)
!= CMD_OK)
continue;
@ -884,7 +883,7 @@ ata_probe_caps(struct ata_drive_datas *drvp)
printed = 1;
}
if (wdc->cap & WDC_CAPABILITY_DMA) {
if ((wdc->cap & WDC_CAPABILITY_MODE) &&
if (wdc->set_modes != NULL &&
wdc->DMA_cap < i)
continue;
drvp->DMA_mode = i;
@ -899,7 +898,7 @@ ata_probe_caps(struct ata_drive_datas *drvp)
if ((params.atap_udmamode_supp & (1 << i))
== 0)
continue;
if ((wdc->cap & WDC_CAPABILITY_MODE) &&
if (wdc->set_modes != NULL &&
(wdc->cap & WDC_CAPABILITY_UDMA))
if (ata_set_mode(drvp, 0x40 | i,
AT_WAIT) != CMD_OK)
@ -919,7 +918,7 @@ ata_probe_caps(struct ata_drive_datas *drvp)
printed = 1;
}
if (wdc->cap & WDC_CAPABILITY_UDMA) {
if ((wdc->cap & WDC_CAPABILITY_MODE) &&
if (wdc->set_modes != NULL &&
wdc->UDMA_cap < i)
continue;
drvp->UDMA_mode = i;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ata_wdc.c,v 1.69 2004/08/13 02:16:40 thorpej Exp $ */
/* $NetBSD: ata_wdc.c,v 1.70 2004/08/13 03:12:59 thorpej Exp $ */
/*
* Copyright (c) 1998, 2001, 2003 Manuel Bouyer.
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ata_wdc.c,v 1.69 2004/08/13 02:16:40 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: ata_wdc.c,v 1.70 2004/08/13 03:12:59 thorpej Exp $");
#ifndef WDCDEBUG
#define WDCDEBUG
@ -230,7 +230,7 @@ wdc_ata_bio_start(struct wdc_channel *chp, struct ata_xfer *xfer)
*/
bus_space_write_1(chp->ctl_iot, chp->ctl_ioh, wd_aux_ctlr,
WDCTL_4BIT | WDCTL_IDS);
if (wdc->cap & WDC_CAPABILITY_SELECT)
if (wdc->select)
wdc->select(chp, xfer->c_drive);
bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_sdh], 0,
WDSD_IBM | (xfer->c_drive << 4));
@ -247,7 +247,7 @@ wdc_ata_bio_start(struct wdc_channel *chp, struct ata_xfer *xfer)
if (chp->ch_status & (WDCS_ERR | WDCS_DWF))
goto ctrlerror;
/* Don't try to set modes if controller can't be adjusted */
if ((wdc->cap & WDC_CAPABILITY_MODE) == 0)
if (wdc->set_modes == NULL)
goto geometry;
/* Also don't try if the drive didn't report its mode */
if ((drvp->drive_flags & DRIVE_MODE) == 0)
@ -426,7 +426,7 @@ again:
return;
}
/* Initiate command */
if (wdc->cap & WDC_CAPABILITY_SELECT)
if (wdc->select)
wdc->select(chp, xfer->c_drive);
bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_sdh],
0, WDSD_IBM | (xfer->c_drive << 4));
@ -467,7 +467,7 @@ again:
WDCC_READ : WDCC_WRITE;
}
/* Initiate command! */
if (wdc->cap & WDC_CAPABILITY_SELECT)
if (wdc->select)
wdc->select(chp, xfer->c_drive);
bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_sdh], 0,
WDSD_IBM | (xfer->c_drive << 4));
@ -591,7 +591,7 @@ wdc_ata_bio_intr(struct wdc_channel *chp, struct ata_xfer *xfer, int irq)
wdc_ata_bio_done(chp, xfer);
return 1;
}
if (wdc->cap & WDC_CAPABILITY_IRQACK)
if (wdc->irqack)
wdc->irqack(chp);
drv_err = wdc_ata_err(drvp, ata_bio);

View File

@ -1,4 +1,4 @@
/* $NetBSD: wdc.c,v 1.202 2004/08/13 02:16:40 thorpej Exp $ */
/* $NetBSD: wdc.c,v 1.203 2004/08/13 03:12:59 thorpej Exp $ */
/*
* Copyright (c) 1998, 2001, 2003 Manuel Bouyer. All rights reserved.
@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.202 2004/08/13 02:16:40 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.203 2004/08/13 03:12:59 thorpej Exp $");
#ifndef WDCDEBUG
#define WDCDEBUG
@ -215,7 +215,7 @@ wdc_drvprobe(struct wdc_channel *chp)
/* for ATA/OLD drives, wait for DRDY, 3s timeout */
for (i = 0; i < mstohz(3000); i++) {
if (chp->ch_drive[0].drive_flags & (DRIVE_ATA|DRIVE_OLD)) {
if (wdc != NULL && (wdc->cap & WDC_CAPABILITY_SELECT))
if (wdc != NULL && wdc->select)
wdc->select(chp,0);
bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_sdh],
0, WDSD_IBM);
@ -225,7 +225,7 @@ wdc_drvprobe(struct wdc_channel *chp)
}
if (chp->ch_drive[1].drive_flags & (DRIVE_ATA|DRIVE_OLD)) {
if (wdc != NULL && (wdc->cap & WDC_CAPABILITY_SELECT))
if (wdc != NULL && wdc->select)
wdc->select(chp,1);
bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_sdh],
0, WDSD_IBM | 0x10);
@ -308,7 +308,7 @@ wdc_drvprobe(struct wdc_channel *chp)
* Test registers writability (Error register not
* writable, but cyllo is), then try an ATA command.
*/
if (wdc->cap & WDC_CAPABILITY_SELECT)
if (wdc->select)
wdc->select(chp,i);
bus_space_write_1(chp->cmd_iot,
chp->cmd_iohs[wd_sdh], 0, WDSD_IBM | (i << 4));
@ -428,7 +428,7 @@ atabusconfig(struct atabus_softc *atabus_sc)
}
/* now that we know the drives, the controller can set its modes */
if (wdc->cap & WDC_CAPABILITY_MODE) {
if (wdc->set_modes) {
wdc->set_modes(chp);
ata_print_modes(chp);
}
@ -498,7 +498,7 @@ wdcprobe1(struct wdc_channel *chp, int poll)
if (wdc == NULL ||
(wdc->cap & WDC_CAPABILITY_NO_EXTRA_RESETS) == 0) {
if (wdc != NULL && (wdc->cap & WDC_CAPABILITY_SELECT))
if (wdc != NULL && wdc->select)
wdc->select(chp,0);
bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_sdh], 0,
@ -507,7 +507,7 @@ wdcprobe1(struct wdc_channel *chp, int poll)
st0 = bus_space_read_1(chp->cmd_iot,
chp->cmd_iohs[wd_status], 0);
if (wdc != NULL && (wdc->cap & WDC_CAPABILITY_SELECT))
if (wdc != NULL && wdc->select)
wdc->select(chp,1);
bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_sdh], 0,
@ -526,7 +526,7 @@ wdcprobe1(struct wdc_channel *chp, int poll)
ret_value &= ~0x02;
/* Register writability test, drive 0. */
if (ret_value & 0x01) {
if (wdc != NULL && (wdc->cap & WDC_CAPABILITY_SELECT))
if (wdc != NULL && wdc->select)
wdc->select(chp,0);
bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_sdh],
0, WDSD_IBM);
@ -596,7 +596,7 @@ wdcprobe1(struct wdc_channel *chp, int poll)
}
/* Register writability test, drive 1. */
if (ret_value & 0x02) {
if (wdc != NULL && (wdc->cap & WDC_CAPABILITY_SELECT))
if (wdc != NULL && wdc->select)
wdc->select(chp,1);
bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_sdh],
0, WDSD_IBM | 0x10);
@ -678,7 +678,7 @@ wdcprobe1(struct wdc_channel *chp, int poll)
* ATAPI device out there which don't react to the bus reset
*/
if (ret_value & 0x01) {
if (wdc != NULL && (wdc->cap & WDC_CAPABILITY_SELECT))
if (wdc != NULL && wdc->select)
wdc->select(chp,0);
bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_sdh],
0, WDSD_IBM);
@ -686,7 +686,7 @@ wdcprobe1(struct wdc_channel *chp, int poll)
ATAPI_SOFT_RESET);
}
if (ret_value & 0x02) {
if (wdc != NULL && (wdc->cap & WDC_CAPABILITY_SELECT))
if (wdc != NULL && wdc->select)
wdc->select(chp,0);
bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_sdh],
0, WDSD_IBM | 0x10);
@ -697,7 +697,7 @@ wdcprobe1(struct wdc_channel *chp, int poll)
delay(5000);
#endif
if (wdc != NULL && (wdc->cap & WDC_CAPABILITY_SELECT))
if (wdc != NULL && wdc->select)
wdc->select(chp,0);
bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_sdh], 0, WDSD_IBM);
delay(10); /* 400ns delay */
@ -712,7 +712,7 @@ wdcprobe1(struct wdc_channel *chp, int poll)
bus_space_write_1(chp->ctl_iot, chp->ctl_ioh, wd_aux_ctlr, WDCTL_4BIT);
delay(10); /* 400ns delay */
/* ACK interrupt in case there is one pending left (Promise ATA100) */
if (wdc != NULL && (wdc->cap & WDC_CAPABILITY_IRQACK))
if (wdc != NULL && wdc->irqack != NULL)
wdc->irqack(chp);
splx(s);
@ -734,7 +734,7 @@ wdcprobe1(struct wdc_channel *chp, int poll)
for (drive = 0; drive < 2; drive++) {
if ((ret_value & (0x01 << drive)) == 0)
continue;
if (wdc != NULL && wdc->cap & WDC_CAPABILITY_SELECT)
if (wdc != NULL && wdc->select)
wdc->select(chp,drive);
bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_sdh], 0,
WDSD_IBM | (drive << 4));
@ -1049,7 +1049,7 @@ wdcreset(struct wdc_channel *chp, int poll)
int drv_mask1, drv_mask2;
int s = 0;
if (wdc->cap & WDC_CAPABILITY_SELECT)
if (wdc->select)
wdc->select(chp,0);
if (poll != RESET_SLEEP)
s = splbio();
@ -1064,7 +1064,7 @@ wdcreset(struct wdc_channel *chp, int poll)
WDCTL_4BIT | WDCTL_IDS);
delay(10); /* 400ns delay */
if (poll != RESET_SLEEP) {
if (wdc->cap & WDC_CAPABILITY_IRQACK)
if (wdc->irqack)
wdc->irqack(chp);
splx(s);
}
@ -1104,7 +1104,7 @@ __wdcwait_reset(struct wdc_channel *chp, int drv_mask, int poll)
/* wait for BSY to deassert */
for (timeout = 0; timeout < nloop; timeout++) {
if ((drv_mask & 0x01) != 0) {
if (wdc && wdc->cap & WDC_CAPABILITY_SELECT)
if (wdc && wdc->select)
wdc->select(chp,0);
bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_sdh],
0, WDSD_IBM); /* master */
@ -1123,7 +1123,7 @@ __wdcwait_reset(struct wdc_channel *chp, int drv_mask, int poll)
#endif
}
if ((drv_mask & 0x02) != 0) {
if (wdc && wdc->cap & WDC_CAPABILITY_SELECT)
if (wdc && wdc->select)
wdc->select(chp,1);
bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_sdh],
0, WDSD_IBM | 0x10); /* slave */
@ -1423,7 +1423,7 @@ __wdccommand_start(struct wdc_channel *chp, struct ata_xfer *xfer)
wdc->sc_dev.dv_xname, chp->ch_channel, xfer->c_drive),
DEBUG_FUNCS);
if (wdc->cap & WDC_CAPABILITY_SELECT)
if (wdc->select)
wdc->select(chp,drive);
bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_sdh], 0,
WDSD_IBM | (drive << 4));
@ -1509,7 +1509,7 @@ __wdccommand_intr(struct wdc_channel *chp, struct ata_xfer *xfer, int irq)
ata_c->flags |= AT_TIMEOU;
goto out;
}
if (wdc->cap & WDC_CAPABILITY_IRQACK)
if (wdc->irqack)
wdc->irqack(chp);
if (ata_c->flags & AT_READ) {
if ((chp->ch_status & WDCS_DRQ) == 0) {
@ -1658,7 +1658,7 @@ wdccommand(struct wdc_channel *chp, u_int8_t drive, u_int8_t command,
chp->ch_channel, drive, command, cylin, head, sector, count,
features), DEBUG_FUNCS);
if (wdc->cap & WDC_CAPABILITY_SELECT)
if (wdc->select)
wdc->select(chp,drive);
/* Select drive, head, and addressing mode. */
@ -1693,7 +1693,7 @@ wdccommandext(struct wdc_channel *chp, u_int8_t drive, u_int8_t command,
chp->ch_channel, drive, command, (u_int32_t) blkno, count),
DEBUG_FUNCS);
if (wdc->cap & WDC_CAPABILITY_SELECT)
if (wdc->select)
wdc->select(chp,drive);
/* Select drive, head, and addressing mode. */
@ -1738,7 +1738,7 @@ wdccommandshort(struct wdc_channel *chp, int drive, int command)
wdc->sc_dev.dv_xname, chp->ch_channel, drive, command),
DEBUG_FUNCS);
if (wdc->cap & WDC_CAPABILITY_SELECT)
if (wdc->select)
wdc->select(chp,drive);
/* Select drive. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: wdcvar.h,v 1.73 2004/08/13 02:16:40 thorpej Exp $ */
/* $NetBSD: wdcvar.h,v 1.74 2004/08/13 03:12:59 thorpej Exp $ */
/*-
* Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@ -115,17 +115,13 @@ struct wdc_softc {
int cap; /* controller capabilities */
#define WDC_CAPABILITY_DATA16 0x0001 /* can do 16-bit data access */
#define WDC_CAPABILITY_DATA32 0x0002 /* can do 32-bit data access */
#define WDC_CAPABILITY_MODE 0x0004 /* controller knows its PIO/DMA modes */
#define WDC_CAPABILITY_DMA 0x0008 /* DMA */
#define WDC_CAPABILITY_UDMA 0x0010 /* Ultra-DMA/33 */
#define WDC_CAPABILITY_HWLOCK 0x0020 /* Needs to lock HW */
#define WDC_CAPABILITY_ATA_NOSTREAM 0x0040 /* Don't use stream funcs on ATA */
#define WDC_CAPABILITY_ATAPI_NOSTREAM 0x0080 /* Don't use stream f on ATAPI */
#define WDC_CAPABILITY_NO_EXTRA_RESETS 0x0100 /* only reset once */
#define WDC_CAPABILITY_PREATA 0x0200 /* ctrl can be a pre-ata one */
#define WDC_CAPABILITY_IRQACK 0x0400 /* callback to ack interrupt */
#define WDC_CAPABILITY_NOIRQ 0x1000 /* Controller never interrupts */
#define WDC_CAPABILITY_SELECT 0x2000 /* Controller selects target */
#define WDC_CAPABILITY_RAID 0x4000 /* Controller "supports" RAID */
u_int8_t PIO_cap; /* highest PIO mode supported */
u_int8_t DMA_cap; /* highest DMA mode supported */
@ -161,17 +157,20 @@ struct wdc_softc {
#define WDC_DMAST_ERR 0x02 /* DMA error */
#define WDC_DMAST_UNDER 0x04 /* DMA underrun */
/* if WDC_CAPABILITY_HWLOCK set in 'cap' */
/* Optional callbacks to lock/unlock hardware. */
int (*claim_hw)(void *, int);
void (*free_hw)(void *);
/* if WDC_CAPABILITY_MODE set in 'cap' */
/*
* Optional callback to set drive mode. Required for anything
* but basic PIO operation.
*/
void (*set_modes)(struct wdc_channel *);
/* if WDC_CAPABILITY_SELECT set in 'cap' */
/* Optional callback to select drive. */
void (*select)(struct wdc_channel *,int);
/* if WDC_CAPABILITY_IRQACK set in 'cap' */
/* Optional callback to ack IRQ. */
void (*irqack)(struct wdc_channel *);
/* overridden if the backend has a different data transfer method */

View File

@ -1,4 +1,4 @@
/* $NetBSD: acardide.c,v 1.9 2004/08/02 19:08:16 bouyer Exp $ */
/* $NetBSD: acardide.c,v 1.10 2004/08/13 03:12:59 thorpej Exp $ */
/*
* Copyright (c) 2001 Izumi Tsutsui.
@ -132,12 +132,10 @@ acard_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
sc->sc_wdcdev.sc_dev.dv_xname);
pciide_mapreg_dma(sc, pa);
aprint_normal("\n");
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32;
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_UDMA;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.irqack = pciide_irqack;
}
sc->sc_wdcdev.PIO_cap = 4;

View File

@ -1,4 +1,4 @@
/* $NetBSD: aceride.c,v 1.7 2004/08/02 19:08:16 bouyer Exp $ */
/* $NetBSD: aceride.c,v 1.8 2004/08/13 03:12:59 thorpej Exp $ */
/*
* Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@ -102,8 +102,7 @@ acer_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
sc->sc_wdcdev.sc_dev.dv_xname);
pciide_mapreg_dma(sc, pa);
aprint_normal("\n");
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32;
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA;
if (rev >= 0x20) {
@ -115,7 +114,6 @@ acer_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
else
sc->sc_wdcdev.UDMA_cap = 2;
}
sc->sc_wdcdev.cap |= WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.irqack = pciide_irqack;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: artsata.c,v 1.1 2003/12/14 01:32:02 thorpej Exp $ */
/* $NetBSD: artsata.c,v 1.2 2004/08/13 03:12:59 thorpej Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@ -115,12 +115,10 @@ artisea_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
* XXX Configure LEDs to show activity.
*/
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32;
sc->sc_wdcdev.PIO_cap = 4;
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_UDMA;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.irqack = pciide_irqack;
sc->sc_wdcdev.DMA_cap = 2;
sc->sc_wdcdev.UDMA_cap = 6;

View File

@ -1,4 +1,4 @@
/* $NetBSD: cmdide.c,v 1.11 2004/08/02 19:08:16 bouyer Exp $ */
/* $NetBSD: cmdide.c,v 1.12 2004/08/13 03:12:59 thorpej Exp $ */
/*
* Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@ -286,10 +286,9 @@ cmd0643_9_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
sc->sc_wdcdev.sc_dev.dv_xname);
pciide_mapreg_dma(sc, pa);
aprint_normal("\n");
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32;
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA;
switch (sc->sc_pp->ide_product) {
case PCI_PRODUCT_CMDTECH_649:
sc->sc_wdcdev.cap |= WDC_CAPABILITY_UDMA;
@ -460,10 +459,9 @@ cmd680_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
sc->sc_wdcdev.sc_dev.dv_xname);
pciide_mapreg_dma(sc, pa);
aprint_normal("\n");
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32;
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_UDMA;
sc->sc_wdcdev.UDMA_cap = 6;
sc->sc_wdcdev.irqack = pciide_irqack;

View File

@ -1,4 +1,4 @@
/* $NetBSD: cypide.c,v 1.8 2004/08/02 19:37:33 bouyer Exp $ */
/* $NetBSD: cypide.c,v 1.9 2004/08/13 03:12:59 thorpej Exp $ */
/*
* Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@ -130,10 +130,9 @@ cy693_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
sc->sc_dma_ok = 0;
}
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32;
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA;
sc->sc_wdcdev.irqack = pciide_irqack;
}
sc->sc_wdcdev.PIO_cap = 4;

View File

@ -1,4 +1,4 @@
/* $NetBSD: geodeide.c,v 1.2 2004/07/27 00:19:27 rumble Exp $ */
/* $NetBSD: geodeide.c,v 1.3 2004/08/13 03:12:59 thorpej Exp $ */
/*
* Copyright (c) 2004 Manuel Bouyer.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: geodeide.c,v 1.2 2004/07/27 00:19:27 rumble Exp $");
__KERNEL_RCSID(0, "$NetBSD: geodeide.c,v 1.3 2004/08/13 03:12:59 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -118,8 +118,7 @@ geodeide_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
pciide_mapreg_dma(sc, pa);
aprint_normal("\n");
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap = WDC_CAPABILITY_DMA | WDC_CAPABILITY_UDMA |
WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.cap = WDC_CAPABILITY_DMA | WDC_CAPABILITY_UDMA;
sc->sc_wdcdev.irqack = pciide_irqack;
}
sc->sc_wdcdev.PIO_cap = 4;
@ -128,8 +127,7 @@ geodeide_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
sc->sc_wdcdev.set_modes = geodeide_setup_channel;
sc->sc_wdcdev.channels = sc->wdc_chanarray;
sc->sc_wdcdev.nchannels = PCIIDE_NUM_CHANNELS;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32;
/*
* Soekris Engineering Issue #0003:

View File

@ -1,4 +1,4 @@
/* $NetBSD: hptide.c,v 1.10 2004/08/02 19:37:33 bouyer Exp $ */
/* $NetBSD: hptide.c,v 1.11 2004/08/13 03:12:59 thorpej Exp $ */
/*
* Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@ -172,11 +172,9 @@ hpt_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
sc->sc_wdcdev.sc_dev.dv_xname);
pciide_mapreg_dma(sc, pa);
aprint_normal("\n");
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32;
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_UDMA;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.irqack = pciide_irqack;
}
sc->sc_wdcdev.PIO_cap = 4;

View File

@ -1,4 +1,4 @@
/* $NetBSD: optiide.c,v 1.5 2004/01/03 22:56:53 thorpej Exp $ */
/* $NetBSD: optiide.c,v 1.6 2004/08/13 03:12:59 thorpej Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -133,11 +133,10 @@ opti_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
aprint_normal("\n");
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA32 | WDC_CAPABILITY_DATA16 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA32 | WDC_CAPABILITY_DATA16;
sc->sc_wdcdev.PIO_cap = 4;
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA;
sc->sc_wdcdev.irqack = pciide_irqack;
sc->sc_wdcdev.DMA_cap = 2;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: pciide_common.c,v 1.14 2004/08/02 22:20:54 bouyer Exp $ */
/* $NetBSD: pciide_common.c,v 1.15 2004/08/13 03:12:59 thorpej Exp $ */
/*
@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pciide_common.c,v 1.14 2004/08/02 22:20:54 bouyer Exp $");
__KERNEL_RCSID(0, "$NetBSD: pciide_common.c,v 1.15 2004/08/13 03:12:59 thorpej Exp $");
#include <sys/param.h>
#include <sys/malloc.h>
@ -853,7 +853,7 @@ default_chip_map(sc, pa)
}
aprint_normal("\n");
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA;
sc->sc_wdcdev.irqack = pciide_irqack;
}
sc->sc_wdcdev.PIO_cap = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pdcide.c,v 1.12 2004/08/02 19:08:16 bouyer Exp $ */
/* $NetBSD: pdcide.c,v 1.13 2004/08/13 03:12:59 thorpej Exp $ */
/*
* Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@ -211,11 +211,9 @@ pdc202xx_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
sc->sc_wdcdev.sc_dev.dv_xname);
pciide_mapreg_dma(sc, pa);
aprint_normal("\n");
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32;
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_UDMA;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.irqack = pciide_irqack;
}
if (PCI_CLASS(pa->pa_class) == PCI_CLASS_MASS_STORAGE &&

View File

@ -1,4 +1,4 @@
/* $NetBSD: piixide.c,v 1.9 2004/05/11 23:15:37 thorpej Exp $ */
/* $NetBSD: piixide.c,v 1.10 2004/08/13 03:12:59 thorpej Exp $ */
/*
* Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@ -188,10 +188,9 @@ piix_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
sc->sc_wdcdev.sc_dev.dv_xname);
pciide_mapreg_dma(sc, pa);
aprint_normal("\n");
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32;
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA;
sc->sc_wdcdev.irqack = pciide_irqack;
switch(sc->sc_pp->ide_product) {
case PCI_PRODUCT_INTEL_82371AB_IDE:
@ -668,12 +667,10 @@ piixsata_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
pciide_mapreg_dma(sc, pa);
aprint_normal("\n");
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32;
sc->sc_wdcdev.PIO_cap = 4;
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_UDMA;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.irqack = pciide_irqack;
sc->sc_wdcdev.DMA_cap = 2;
sc->sc_wdcdev.UDMA_cap = 6;

View File

@ -1,4 +1,4 @@
/* $NetBSD: rccide.c,v 1.7 2004/01/03 22:56:53 thorpej Exp $ */
/* $NetBSD: rccide.c,v 1.8 2004/08/13 03:12:59 thorpej Exp $ */
/*
* Copyright (c) 2003 By Noon Software, Inc. All rights reserved.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rccide.c,v 1.7 2004/01/03 22:56:53 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: rccide.c,v 1.8 2004/08/13 03:12:59 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -118,12 +118,10 @@ serverworks_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
sc->sc_wdcdev.sc_dev.dv_xname);
pciide_mapreg_dma(sc, pa);
aprint_normal("\n");
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32;
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_UDMA;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.irqack = pciide_irqack;
}
sc->sc_wdcdev.PIO_cap = 4;

View File

@ -1,4 +1,4 @@
/* $NetBSD: satalink.c,v 1.17 2004/07/19 17:04:36 msaitoh Exp $ */
/* $NetBSD: satalink.c,v 1.18 2004/08/13 03:12:59 thorpej Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@ -469,12 +469,10 @@ sii3112_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
if ((reg44 & 0x7) < cls)
ba5_write_4(sc, 0x44, (reg44 & ~0x07) | cls);
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32;
sc->sc_wdcdev.PIO_cap = 4;
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_UDMA;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.irqack = pciide_irqack;
sc->sc_wdcdev.DMA_cap = 2;
sc->sc_wdcdev.UDMA_cap = 6;
@ -710,12 +708,10 @@ sii3114_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
sii3114_mapreg_dma(sc, pa);
aprint_normal("\n");
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32;
sc->sc_wdcdev.PIO_cap = 4;
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_UDMA;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.irqack = pciide_irqack;
sc->sc_wdcdev.DMA_cap = 2;
sc->sc_wdcdev.UDMA_cap = 6;

View File

@ -1,4 +1,4 @@
/* $NetBSD: siside.c,v 1.7 2004/07/21 16:40:50 mycroft Exp $ */
/* $NetBSD: siside.c,v 1.8 2004/08/13 03:12:59 thorpej Exp $ */
/*
* Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@ -244,10 +244,9 @@ sis_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
pciide_mapreg_dma(sc, pa);
aprint_normal("\n");
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32;
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA;
sc->sc_wdcdev.irqack = pciide_irqack;
if (sc->sis_type >= SIS_TYPE_66)
sc->sc_wdcdev.cap |= WDC_CAPABILITY_UDMA;
@ -494,8 +493,7 @@ sis_sata_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
aprint_normal("\n");
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_UDMA | WDC_CAPABILITY_DMA |
WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_UDMA | WDC_CAPABILITY_DMA;
sc->sc_wdcdev.irqack = pciide_irqack;
}
sc->sc_wdcdev.PIO_cap = 4;
@ -504,8 +502,7 @@ sis_sata_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
sc->sc_wdcdev.channels = sc->wdc_chanarray;
sc->sc_wdcdev.nchannels = PCIIDE_NUM_CHANNELS;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32;
sc->sc_wdcdev.set_modes = sata_setup_channel;
for (channel = 0; channel < sc->sc_wdcdev.nchannels; channel++) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: slide.c,v 1.4 2004/01/03 22:56:53 thorpej Exp $ */
/* $NetBSD: slide.c,v 1.5 2004/08/13 03:12:59 thorpej Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -149,11 +149,10 @@ sl82c105_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
pciide_mapreg_dma(sc, pa);
aprint_normal("\n");
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA32 | WDC_CAPABILITY_DATA16 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA32 | WDC_CAPABILITY_DATA16;
sc->sc_wdcdev.PIO_cap = 4;
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA;
sc->sc_wdcdev.irqack = pciide_irqack;
sc->sc_wdcdev.DMA_cap = 2;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: stpcide.c,v 1.4 2004/01/03 22:56:53 thorpej Exp $ */
/* $NetBSD: stpcide.c,v 1.5 2004/08/13 03:12:59 thorpej Exp $ */
/*
* Copyright (c) 2003 Toru Nishimura
@ -93,10 +93,9 @@ stpc_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
sc->sc_wdcdev.sc_dev.dv_xname);
pciide_mapreg_dma(sc, pa);
aprint_normal("\n");
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32;
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA;
sc->sc_wdcdev.irqack = pciide_irqack;
}
sc->sc_wdcdev.PIO_cap = 4;

View File

@ -1,4 +1,4 @@
/* $NetBSD: viaide.c,v 1.12 2004/07/22 19:09:34 drochner Exp $ */
/* $NetBSD: viaide.c,v 1.13 2004/08/13 03:12:59 thorpej Exp $ */
/*
* Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@ -295,10 +295,9 @@ unknown:
sc->sc_wdcdev.sc_dev.dv_xname);
pciide_mapreg_dma(sc, pa);
aprint_normal("\n");
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32;
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA;
sc->sc_wdcdev.irqack = pciide_irqack;
if (sc->sc_wdcdev.UDMA_cap > 0)
sc->sc_wdcdev.cap |= WDC_CAPABILITY_UDMA;
@ -496,8 +495,7 @@ via_sata_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
aprint_normal("\n");
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_UDMA | WDC_CAPABILITY_DMA |
WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_UDMA | WDC_CAPABILITY_DMA;
sc->sc_wdcdev.irqack = pciide_irqack;
}
sc->sc_wdcdev.PIO_cap = 4;
@ -506,8 +504,7 @@ via_sata_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa)
sc->sc_wdcdev.channels = sc->wdc_chanarray;
sc->sc_wdcdev.nchannels = PCIIDE_NUM_CHANNELS;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32;
sc->sc_wdcdev.set_modes = sata_setup_channel;
for (channel = 0; channel < sc->sc_wdcdev.nchannels; channel++) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: atapi_wdc.c,v 1.84 2004/08/13 02:16:40 thorpej Exp $ */
/* $NetBSD: atapi_wdc.c,v 1.85 2004/08/13 03:12:59 thorpej Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: atapi_wdc.c,v 1.84 2004/08/13 02:16:40 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: atapi_wdc.c,v 1.85 2004/08/13 03:12:59 thorpej Exp $");
#ifndef WDCDEBUG
#define WDCDEBUG
@ -431,12 +431,12 @@ wdc_atapi_start(struct wdc_channel *chp, struct ata_xfer *xfer)
*/
bus_space_write_1(chp->ctl_iot, chp->ctl_ioh, wd_aux_ctlr,
WDCTL_4BIT | WDCTL_IDS);
if (wdc->cap & WDC_CAPABILITY_SELECT)
if (wdc->select)
wdc->select(chp, xfer->c_drive);
bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_sdh], 0,
WDSD_IBM | (xfer->c_drive << 4));
/* Don't try to set mode if controller can't be adjusted */
if ((wdc->cap & WDC_CAPABILITY_MODE) == 0)
if (wdc->set_modes == NULL)
goto ready;
/* Also don't try if the drive didn't report its mode */
if ((drvp->drive_flags & DRIVE_MODE) == 0)
@ -509,7 +509,7 @@ ready:
callout_reset(&chp->ch_callout, mstohz(sc_xfer->timeout),
wdctimeout, chp);
if (wdc->cap & WDC_CAPABILITY_SELECT)
if (wdc->select)
wdc->select(chp, xfer->c_drive);
bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_sdh], 0,
WDSD_IBM | (xfer->c_drive << 4));
@ -620,7 +620,7 @@ wdc_atapi_intr(struct wdc_channel *chp, struct ata_xfer *xfer, int irq)
}
/* Ack interrupt done in wdc_wait_for_unbusy */
if (wdc->cap & WDC_CAPABILITY_SELECT)
if (wdc->select)
wdc->select(chp, xfer->c_drive);
bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_sdh], 0,
WDSD_IBM | (xfer->c_drive << 4));
@ -639,7 +639,7 @@ wdc_atapi_intr(struct wdc_channel *chp, struct ata_xfer *xfer, int irq)
wdc_atapi_reset(chp, xfer);
return 1;
}
if (wdc->cap & WDC_CAPABILITY_IRQACK)
if (wdc->irqack)
wdc->irqack(chp);
/*