diff options
author | mdodd <mdodd@FreeBSD.org> | 2003-04-16 03:16:57 +0000 |
---|---|---|
committer | mdodd <mdodd@FreeBSD.org> | 2003-04-16 03:16:57 +0000 |
commit | 74c95b7f29ae970fc99cad21e8ea772eb2557bd1 (patch) | |
tree | 43770c3696a3adbe67787f9d9f8ff9d3bb30a425 /sys/dev/fxp | |
parent | ac7452631f13ef6bbb59e825e8e3ebb14d8e9a46 (diff) | |
download | FreeBSD-src-74c95b7f29ae970fc99cad21e8ea772eb2557bd1.zip FreeBSD-src-74c95b7f29ae970fc99cad21e8ea772eb2557bd1.tar.gz |
- Don't call pci_enable_io() in drivers (unless needed for resume).
- Don't test memory/port status and emit an error message; the PCI
bus code will do this now.
Diffstat (limited to 'sys/dev/fxp')
-rw-r--r-- | sys/dev/fxp/if_fxp.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index c84c29a..4dcb7c2 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -391,8 +391,6 @@ fxp_attach(device_t dev) * BIOS/Prom forgot about it. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); val = pci_read_config(dev, PCIR_COMMAND, 2); fxp_powerstate_d0(dev); @@ -411,14 +409,11 @@ fxp_attach(device_t dev) m2 = PCIM_CMD_MEMEN; } - if (val & m1) { - sc->rtp = - (m1 == PCIM_CMD_MEMEN)? SYS_RES_MEMORY : SYS_RES_IOPORT; - sc->rgd = (m1 == PCIM_CMD_MEMEN)? FXP_PCI_MMBA : FXP_PCI_IOBA; - sc->mem = bus_alloc_resource(dev, sc->rtp, &sc->rgd, + sc->rtp = (m1 == PCIM_CMD_MEMEN)? SYS_RES_MEMORY : SYS_RES_IOPORT; + sc->rgd = (m1 == PCIM_CMD_MEMEN)? FXP_PCI_MMBA : FXP_PCI_IOBA; + sc->mem = bus_alloc_resource(dev, sc->rtp, &sc->rgd, 0, ~0, 1, RF_ACTIVE); - } - if (sc->mem == NULL && (val & m2)) { + if (sc->mem == NULL) { sc->rtp = (m2 == PCIM_CMD_MEMEN)? SYS_RES_MEMORY : SYS_RES_IOPORT; sc->rgd = (m2 == PCIM_CMD_MEMEN)? FXP_PCI_MMBA : FXP_PCI_IOBA; @@ -427,7 +422,6 @@ fxp_attach(device_t dev) } if (!sc->mem) { - device_printf(dev, "could not map device registers\n"); error = ENXIO; goto fail; } |