From 74c95b7f29ae970fc99cad21e8ea772eb2557bd1 Mon Sep 17 00:00:00 2001 From: mdodd Date: Wed, 16 Apr 2003 03:16:57 +0000 Subject: - 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. --- sys/dev/bge/if_bge.c | 9 --------- sys/dev/dc/if_dc.c | 17 ----------------- sys/dev/fxp/if_fxp.c | 14 ++++---------- sys/dev/gem/if_gem_pci.c | 1 - sys/dev/hea/hea_pci.c | 13 ------------- sys/dev/hfa/hfa_pci.c | 13 ------------- sys/dev/hme/if_hme_pci.c | 1 - sys/dev/lge/if_lge.c | 18 ------------------ sys/dev/nge/if_nge.c | 18 ------------------ sys/dev/pdq/if_fpa.c | 15 --------------- sys/dev/sf/if_sf.c | 18 ------------------ sys/dev/sk/if_sk.c | 18 ------------------ sys/dev/sound/pci/ich.c | 1 - sys/dev/sound/pci/via8233.c | 1 - sys/dev/ti/if_ti.c | 9 --------- sys/dev/txp/if_txp.c | 18 ------------------ sys/dev/vr/if_vr.c | 18 ------------------ sys/pci/if_dc.c | 17 ----------------- sys/pci/if_pcn.c | 21 +++++---------------- sys/pci/if_rl.c | 18 ------------------ sys/pci/if_sf.c | 18 ------------------ sys/pci/if_sis.c | 17 ----------------- sys/pci/if_sk.c | 18 ------------------ sys/pci/if_ste.c | 18 ------------------ sys/pci/if_ti.c | 9 --------- sys/pci/if_tl.c | 9 --------- sys/pci/if_vr.c | 18 ------------------ sys/pci/if_wb.c | 18 ------------------ sys/pci/if_xl.c | 10 ---------- 29 files changed, 9 insertions(+), 384 deletions(-) (limited to 'sys') diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index aa89e70..19201b3 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -1448,7 +1448,6 @@ bge_attach(dev) device_t dev; { int s; - u_int32_t command; struct ifnet *ifp; struct bge_softc *sc; u_int32_t hwcfg = 0; @@ -1466,14 +1465,6 @@ bge_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); - - if (!(command & PCIM_CMD_MEMEN)) { - printf("bge%d: failed to enable memory mapping!\n", unit); - error = ENXIO; - goto fail; - } rid = BGE_PCI_BAR0; sc->bge_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index 86fd9d5..f39e612 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -1916,23 +1916,6 @@ dc_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); - -#ifdef DC_USEIOSPACE - if (!(command & PCIM_CMD_PORTEN)) { - printf("dc%d: failed to enable I/O ports!\n", unit); - error = ENXIO; - goto fail; - } -#else - if (!(command & PCIM_CMD_MEMEN)) { - printf("dc%d: failed to enable memory mapping!\n", unit); - error = ENXIO; - goto fail; - } -#endif rid = DC_RID; sc->dc_res = bus_alloc_resource(dev, DC_RES, &rid, 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; } diff --git a/sys/dev/gem/if_gem_pci.c b/sys/dev/gem/if_gem_pci.c index 7c8146a..03fa1d4 100644 --- a/sys/dev/gem/if_gem_pci.c +++ b/sys/dev/gem/if_gem_pci.c @@ -163,7 +163,6 @@ gem_pci_attach(dev) * cases not do this for us on sparc64 machines. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_MEMORY); sc->sc_dev = dev; sc->sc_pci = 1; /* XXX */ diff --git a/sys/dev/hea/hea_pci.c b/sys/dev/hea/hea_pci.c index 8432f58..8d40b48 100644 --- a/sys/dev/hea/hea_pci.c +++ b/sys/dev/hea/hea_pci.c @@ -154,19 +154,6 @@ hea_pci_attach (dev) error = 0; pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_MEMORY); - - command = pci_read_config(dev, PCIR_COMMAND, 2); - if ((command & PCIM_CMD_BUSMASTEREN) == 0) { - device_printf(dev, "Unable to enable PCI busmastering.\n"); - error = ENXIO; - goto fail; - } - if ((command & PCIM_CMD_MEMEN) == 0) { - device_printf(dev, "Unable to enable PCI memory resources.\n"); - error = ENXIO; - goto fail; - } sc->mem_rid = PCIR_MAPS; sc->mem_type = SYS_RES_MEMORY; diff --git a/sys/dev/hfa/hfa_pci.c b/sys/dev/hfa/hfa_pci.c index c5c9bd4..f5f448f 100644 --- a/sys/dev/hfa/hfa_pci.c +++ b/sys/dev/hfa/hfa_pci.c @@ -129,19 +129,6 @@ hfa_pci_attach (dev) error = 0; pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_MEMORY); - - command = pci_read_config(dev, PCIR_COMMAND, 2); - if ((command & PCIM_CMD_BUSMASTEREN) == 0) { - device_printf(dev, "Unable to enable PCI busmastering.\n"); - error = ENXIO; - goto fail; - } - if ((command & PCIM_CMD_MEMEN) == 0) { - device_printf(dev, "Unable to enable PCI memory resources.\n"); - error = ENXIO; - goto fail; - } sc->mem_rid = PCA200E_PCI_MEMBASE; sc->mem_type = SYS_RES_MEMORY; diff --git a/sys/dev/hme/if_hme_pci.c b/sys/dev/hme/if_hme_pci.c index 5c06c61..8a89b6b 100644 --- a/sys/dev/hme/if_hme_pci.c +++ b/sys/dev/hme/if_hme_pci.c @@ -137,7 +137,6 @@ hme_pci_attach(device_t dev) * gross; but the hme comes up with neither enabled. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_MEMORY); sc->sc_pci = 1; /* XXXXX should all be done in bus_dma. */ sc->sc_dev = dev; diff --git a/sys/dev/lge/if_lge.c b/sys/dev/lge/if_lge.c index 18a22af..703f46d 100644 --- a/sys/dev/lge/if_lge.c +++ b/sys/dev/lge/if_lge.c @@ -492,7 +492,6 @@ lge_attach(dev) { int s; u_char eaddr[ETHER_ADDR_LEN]; - u_int32_t command; struct lge_softc *sc; struct ifnet *ifp; int unit, error = 0, rid; @@ -530,23 +529,6 @@ lge_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); - -#ifdef LGE_USEIOSPACE - if (!(command & PCIM_CMD_PORTEN)) { - printf("lge%d: failed to enable I/O ports!\n", unit); - error = ENXIO;; - goto fail; - } -#else - if (!(command & PCIM_CMD_MEMEN)) { - printf("lge%d: failed to enable memory mapping!\n", unit); - error = ENXIO;; - goto fail; - } -#endif rid = LGE_RID; sc->lge_res = bus_alloc_resource(dev, LGE_RES, &rid, diff --git a/sys/dev/nge/if_nge.c b/sys/dev/nge/if_nge.c index 0c30ab2..5c9e3c6 100644 --- a/sys/dev/nge/if_nge.c +++ b/sys/dev/nge/if_nge.c @@ -822,7 +822,6 @@ nge_attach(dev) { int s; u_char eaddr[ETHER_ADDR_LEN]; - u_int32_t command; struct nge_softc *sc; struct ifnet *ifp; int unit, error = 0, rid; @@ -864,23 +863,6 @@ nge_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); - -#ifdef NGE_USEIOSPACE - if (!(command & PCIM_CMD_PORTEN)) { - printf("nge%d: failed to enable I/O ports!\n", unit); - error = ENXIO;; - goto fail; - } -#else - if (!(command & PCIM_CMD_MEMEN)) { - printf("nge%d: failed to enable memory mapping!\n", unit); - error = ENXIO;; - goto fail; - } -#endif rid = NGE_RID; sc->nge_res = bus_alloc_resource(dev, NGE_RES, &rid, diff --git a/sys/dev/pdq/if_fpa.c b/sys/dev/pdq/if_fpa.c index a8941ff..619a227 100644 --- a/sys/dev/pdq/if_fpa.c +++ b/sys/dev/pdq/if_fpa.c @@ -119,21 +119,6 @@ pdq_pci_attach(device_t dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); - - if (!(command & PCIM_CMD_PORTEN)) { - device_printf(dev, "Failed to enable PCI I/O ports.\n"); - error = ENXIO; - goto bad; - } - - if (!(command & PCIM_CMD_MEMEN)) { - device_printf(dev, "Failed to enable PCI memory mapping.\n"); - error = ENXIO; - goto bad; - } command = pci_read_config(dev, PCIR_LATTIMER, 1); if (command < DEFPA_LATENCY) { diff --git a/sys/dev/sf/if_sf.c b/sys/dev/sf/if_sf.c index ea3cf3e..a7ebb01 100644 --- a/sys/dev/sf/if_sf.c +++ b/sys/dev/sf/if_sf.c @@ -672,7 +672,6 @@ sf_attach(dev) device_t dev; { int i; - u_int32_t command; struct sf_softc *sc; struct ifnet *ifp; int unit, rid, error = 0; @@ -710,23 +709,6 @@ sf_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); - -#ifdef SF_USEIOSPACE - if (!(command & PCIM_CMD_PORTEN)) { - printf("sf%d: failed to enable I/O ports!\n", unit); - error = ENXIO; - goto fail; - } -#else - if (!(command & PCIM_CMD_MEMEN)) { - printf("sf%d: failed to enable memory mapping!\n", unit); - error = ENXIO; - goto fail; - } -#endif rid = SF_RID; sc->sf_res = bus_alloc_resource(dev, SF_RES, &rid, diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c index 8b15c5c..1093f34 100644 --- a/sys/dev/sk/if_sk.c +++ b/sys/dev/sk/if_sk.c @@ -1201,7 +1201,6 @@ static int sk_attach(dev) device_t dev; { - u_int32_t command; struct sk_softc *sc; int unit, error = 0, rid, *port; @@ -1238,23 +1237,6 @@ sk_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); - -#ifdef SK_USEIOSPACE - if (!(command & PCIM_CMD_PORTEN)) { - printf("skc%d: failed to enable I/O ports!\n", unit); - error = ENXIO; - goto fail; - } -#else - if (!(command & PCIM_CMD_MEMEN)) { - printf("skc%d: failed to enable memory mapping!\n", unit); - error = ENXIO; - goto fail; - } -#endif rid = SK_RID; sc->sk_res = bus_alloc_resource(dev, SK_RES, &rid, diff --git a/sys/dev/sound/pci/ich.c b/sys/dev/sound/pci/ich.c index 610dee4..aa5e856 100644 --- a/sys/dev/sound/pci/ich.c +++ b/sys/dev/sound/pci/ich.c @@ -685,7 +685,6 @@ ich_pci_attach(device_t dev) pci_write_config(dev, PCIR_ICH_LEGACY, ICH_LEGACY_ENABLE, 1); } - pci_enable_io(dev, SYS_RES_IOPORT); /* * Enable bus master. On ich4 this may prevent the detection of * the primary codec becoming ready in ich_init(). diff --git a/sys/dev/sound/pci/via8233.c b/sys/dev/sound/pci/via8233.c index 3988445..883012c 100644 --- a/sys/dev/sound/pci/via8233.c +++ b/sys/dev/sound/pci/via8233.c @@ -739,7 +739,6 @@ via_attach(device_t dev) return ENXIO; } - pci_enable_io(dev, SYS_RES_IOPORT); pci_set_powerstate(dev, PCI_POWERSTATE_D0); pci_enable_busmaster(dev); diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c index c8a1c63..c1b5796 100644 --- a/sys/dev/ti/if_ti.c +++ b/sys/dev/ti/if_ti.c @@ -2092,7 +2092,6 @@ static int ti_attach(dev) device_t dev; { - u_int32_t command; struct ifnet *ifp; struct ti_softc *sc; int unit, error = 0, rid; @@ -2123,14 +2122,6 @@ ti_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); - - if (!(command & PCIM_CMD_MEMEN)) { - printf("ti%d: failed to enable memory mapping!\n", unit); - error = ENXIO; - goto fail; - } rid = TI_PCI_LOMEM; sc->ti_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, diff --git a/sys/dev/txp/if_txp.c b/sys/dev/txp/if_txp.c index fb85927..542f692 100644 --- a/sys/dev/txp/if_txp.c +++ b/sys/dev/txp/if_txp.c @@ -212,7 +212,6 @@ txp_attach(dev) { struct txp_softc *sc; struct ifnet *ifp; - u_int32_t command; u_int16_t p1; u_int32_t p2; int unit, error = 0, rid; @@ -251,23 +250,6 @@ txp_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); - -#ifdef TXP_USEIOSPACE - if (!(command & PCIM_CMD_PORTEN)) { - device_printf(dev, "failed to enable I/O ports!\n"); - error = ENXIO; - goto fail; - } -#else - if (!(command & PCIM_CMD_MEMEN)) { - device_printf(dev, "failed to enable memory mapping!\n"); - error = ENXIO; - goto fail; - } -#endif rid = TXP_RID; sc->sc_res = bus_alloc_resource(dev, TXP_RES, &rid, diff --git a/sys/dev/vr/if_vr.c b/sys/dev/vr/if_vr.c index f5dc39d..793ae64 100644 --- a/sys/dev/vr/if_vr.c +++ b/sys/dev/vr/if_vr.c @@ -735,7 +735,6 @@ vr_attach(dev) { int i; u_char eaddr[ETHER_ADDR_LEN]; - u_int32_t command; struct vr_softc *sc; struct ifnet *ifp; int unit, error = 0, rid; @@ -773,25 +772,8 @@ vr_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); sc->vr_revid = pci_read_config(dev, VR_PCI_REVID, 4) & 0x000000FF; -#ifdef VR_USEIOSPACE - if (!(command & PCIM_CMD_PORTEN)) { - printf("vr%d: failed to enable I/O ports!\n", unit); - error = ENXIO; - goto fail; - } -#else - if (!(command & PCIM_CMD_MEMEN)) { - printf("vr%d: failed to enable memory mapping!\n", unit); - error = ENXIO; - goto fail; - } -#endif - rid = VR_RID; sc->vr_res = bus_alloc_resource(dev, VR_RES, &rid, 0, ~0, 1, RF_ACTIVE); diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c index 86fd9d5..f39e612 100644 --- a/sys/pci/if_dc.c +++ b/sys/pci/if_dc.c @@ -1916,23 +1916,6 @@ dc_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); - -#ifdef DC_USEIOSPACE - if (!(command & PCIM_CMD_PORTEN)) { - printf("dc%d: failed to enable I/O ports!\n", unit); - error = ENXIO; - goto fail; - } -#else - if (!(command & PCIM_CMD_MEMEN)) { - printf("dc%d: failed to enable memory mapping!\n", unit); - error = ENXIO; - goto fail; - } -#endif rid = DC_RID; sc->dc_res = bus_alloc_resource(dev, DC_RES, &rid, diff --git a/sys/pci/if_pcn.c b/sys/pci/if_pcn.c index 3c60e0f..eb92207 100644 --- a/sys/pci/if_pcn.c +++ b/sys/pci/if_pcn.c @@ -543,23 +543,12 @@ pcn_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); -#ifdef PCN_USEIOSPACE - if (!(command & PCIM_CMD_PORTEN)) { - printf("pcn%d: failed to enable I/O ports!\n", unit); - error = ENXIO; - goto fail; - } -#else - if (!(command & PCIM_CMD_MEMEN)) { - printf("pcn%d: failed to enable memory mapping!\n", unit); - error = ENXIO; - goto fail; - } -#endif + /* Retreive the chip ID */ + command = pcn_chip_id(dev); + sc->pcn_type = (command >>= 12) & PART_MASK; + device_printf(dev, "Chip ID %04x (%s)\n", + sc->pcn_type, pcn_chipid_name(sc->pcn_type)); rid = PCN_RID; sc->pcn_res = bus_alloc_resource(dev, PCN_RES, &rid, diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c index 0996597..7664dd59 100644 --- a/sys/pci/if_rl.c +++ b/sys/pci/if_rl.c @@ -861,7 +861,6 @@ rl_attach(dev) device_t dev; { u_char eaddr[ETHER_ADDR_LEN]; - u_int32_t command; u_int16_t as[3]; struct rl_softc *sc; struct ifnet *ifp; @@ -903,23 +902,6 @@ rl_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); - -#ifdef RL_USEIOSPACE - if (!(command & PCIM_CMD_PORTEN)) { - printf("rl%d: failed to enable I/O ports!\n", unit); - error = ENXIO; - goto fail; - } -#else - if (!(command & PCIM_CMD_MEMEN)) { - printf("rl%d: failed to enable memory mapping!\n", unit); - error = ENXIO; - goto fail; - } -#endif rid = RL_RID; sc->rl_res = bus_alloc_resource(dev, RL_RES, &rid, diff --git a/sys/pci/if_sf.c b/sys/pci/if_sf.c index ea3cf3e..a7ebb01 100644 --- a/sys/pci/if_sf.c +++ b/sys/pci/if_sf.c @@ -672,7 +672,6 @@ sf_attach(dev) device_t dev; { int i; - u_int32_t command; struct sf_softc *sc; struct ifnet *ifp; int unit, rid, error = 0; @@ -710,23 +709,6 @@ sf_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); - -#ifdef SF_USEIOSPACE - if (!(command & PCIM_CMD_PORTEN)) { - printf("sf%d: failed to enable I/O ports!\n", unit); - error = ENXIO; - goto fail; - } -#else - if (!(command & PCIM_CMD_MEMEN)) { - printf("sf%d: failed to enable memory mapping!\n", unit); - error = ENXIO; - goto fail; - } -#endif rid = SF_RID; sc->sf_res = bus_alloc_resource(dev, SF_RES, &rid, diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c index dfbb560..05e9575 100644 --- a/sys/pci/if_sis.c +++ b/sys/pci/if_sis.c @@ -1094,23 +1094,6 @@ sis_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); - -#ifdef SIS_USEIOSPACE - if (!(command & PCIM_CMD_PORTEN)) { - printf("sis%d: failed to enable I/O ports!\n", unit); - error = ENXIO; - goto fail; - } -#else - if (!(command & PCIM_CMD_MEMEN)) { - printf("sis%d: failed to enable memory mapping!\n", unit); - error = ENXIO; - goto fail; - } -#endif rid = SIS_RID; sc->sis_res = bus_alloc_resource(dev, SIS_RES, &rid, diff --git a/sys/pci/if_sk.c b/sys/pci/if_sk.c index 8b15c5c..1093f34 100644 --- a/sys/pci/if_sk.c +++ b/sys/pci/if_sk.c @@ -1201,7 +1201,6 @@ static int sk_attach(dev) device_t dev; { - u_int32_t command; struct sk_softc *sc; int unit, error = 0, rid, *port; @@ -1238,23 +1237,6 @@ sk_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); - -#ifdef SK_USEIOSPACE - if (!(command & PCIM_CMD_PORTEN)) { - printf("skc%d: failed to enable I/O ports!\n", unit); - error = ENXIO; - goto fail; - } -#else - if (!(command & PCIM_CMD_MEMEN)) { - printf("skc%d: failed to enable memory mapping!\n", unit); - error = ENXIO; - goto fail; - } -#endif rid = SK_RID; sc->sk_res = bus_alloc_resource(dev, SK_RES, &rid, diff --git a/sys/pci/if_ste.c b/sys/pci/if_ste.c index d6e505b..67f16f4 100644 --- a/sys/pci/if_ste.c +++ b/sys/pci/if_ste.c @@ -909,7 +909,6 @@ static int ste_attach(dev) device_t dev; { - u_int32_t command; struct ste_softc *sc; struct ifnet *ifp; int unit, error = 0, rid; @@ -958,23 +957,6 @@ ste_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); - -#ifdef STE_USEIOSPACE - if (!(command & PCIM_CMD_PORTEN)) { - printf("ste%d: failed to enable I/O ports!\n", unit); - error = ENXIO; - goto fail; - } -#else - if (!(command & PCIM_CMD_MEMEN)) { - printf("ste%d: failed to enable memory mapping!\n", unit); - error = ENXIO; - goto fail; - } -#endif rid = STE_RID; sc->ste_res = bus_alloc_resource(dev, STE_RES, &rid, diff --git a/sys/pci/if_ti.c b/sys/pci/if_ti.c index c8a1c63..c1b5796 100644 --- a/sys/pci/if_ti.c +++ b/sys/pci/if_ti.c @@ -2092,7 +2092,6 @@ static int ti_attach(dev) device_t dev; { - u_int32_t command; struct ifnet *ifp; struct ti_softc *sc; int unit, error = 0, rid; @@ -2123,14 +2122,6 @@ ti_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); - - if (!(command & PCIM_CMD_MEMEN)) { - printf("ti%d: failed to enable memory mapping!\n", unit); - error = ENXIO; - goto fail; - } rid = TI_PCI_LOMEM; sc->ti_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, diff --git a/sys/pci/if_tl.c b/sys/pci/if_tl.c index c546ad9..cbd7bb2 100644 --- a/sys/pci/if_tl.c +++ b/sys/pci/if_tl.c @@ -1114,7 +1114,6 @@ tl_attach(dev) device_t dev; { int i; - u_int32_t command; u_int16_t did, vid; struct tl_type *t; struct ifnet *ifp; @@ -1145,16 +1144,8 @@ tl_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); #ifdef TL_USEIOSPACE - if (!(command & PCIM_CMD_PORTEN)) { - device_printf(dev, "failed to enable I/O ports!\n"); - error = ENXIO; - goto fail; - } rid = TL_PCI_LOIO; sc->tl_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, diff --git a/sys/pci/if_vr.c b/sys/pci/if_vr.c index f5dc39d..793ae64 100644 --- a/sys/pci/if_vr.c +++ b/sys/pci/if_vr.c @@ -735,7 +735,6 @@ vr_attach(dev) { int i; u_char eaddr[ETHER_ADDR_LEN]; - u_int32_t command; struct vr_softc *sc; struct ifnet *ifp; int unit, error = 0, rid; @@ -773,25 +772,8 @@ vr_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); sc->vr_revid = pci_read_config(dev, VR_PCI_REVID, 4) & 0x000000FF; -#ifdef VR_USEIOSPACE - if (!(command & PCIM_CMD_PORTEN)) { - printf("vr%d: failed to enable I/O ports!\n", unit); - error = ENXIO; - goto fail; - } -#else - if (!(command & PCIM_CMD_MEMEN)) { - printf("vr%d: failed to enable memory mapping!\n", unit); - error = ENXIO; - goto fail; - } -#endif - rid = VR_RID; sc->vr_res = bus_alloc_resource(dev, VR_RES, &rid, 0, ~0, 1, RF_ACTIVE); diff --git a/sys/pci/if_wb.c b/sys/pci/if_wb.c index 61c2674..b540e00 100644 --- a/sys/pci/if_wb.c +++ b/sys/pci/if_wb.c @@ -820,7 +820,6 @@ wb_attach(dev) device_t dev; { u_char eaddr[ETHER_ADDR_LEN]; - u_int32_t command; struct wb_softc *sc; struct ifnet *ifp; int unit, error = 0, rid; @@ -859,23 +858,6 @@ wb_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); - -#ifdef WB_USEIOSPACE - if (!(command & PCIM_CMD_PORTEN)) { - printf("wb%d: failed to enable I/O ports!\n", unit); - error = ENXIO; - goto fail; - } -#else - if (!(command & PCIM_CMD_MEMEN)) { - printf("wb%d: failed to enable memory mapping!\n", unit); - error = ENXIO; - goto fail; - } -#endif rid = WB_RID; sc->wb_res = bus_alloc_resource(dev, WB_RES, &rid, diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c index 88797d4..eeb635d 100644 --- a/sys/pci/if_xl.c +++ b/sys/pci/if_xl.c @@ -1297,7 +1297,6 @@ xl_attach(dev) device_t dev; { u_char eaddr[ETHER_ADDR_LEN]; - u_int32_t command; u_int16_t xcvr[2]; struct xl_softc *sc; struct ifnet *ifp; @@ -1389,15 +1388,6 @@ xl_attach(dev) * Map control/status registers. */ pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_IOPORT); - pci_enable_io(dev, SYS_RES_MEMORY); - command = pci_read_config(dev, PCIR_COMMAND, 4); - - if (!(command & PCIM_CMD_PORTEN) && !(command & PCIM_CMD_MEMEN)) { - printf("xl%d: failed to enable I/O ports and memory mappings!\n", unit); - error = ENXIO; - goto fail; - } rid = XL_PCI_LOMEM; res = SYS_RES_MEMORY; -- cgit v1.1