diff options
author | jhb <jhb@FreeBSD.org> | 2005-09-29 14:56:30 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2005-09-29 14:56:30 +0000 |
commit | 39e372ff0ac0b9a64390e8708e7d28d91a10e267 (patch) | |
tree | 2315888be309cb875f4a79583c7f06b8d7fb85c6 /sys/dev/en | |
parent | e0565b5794c9fb041922ccea2d6e78b8d943be8a (diff) | |
download | FreeBSD-src-39e372ff0ac0b9a64390e8708e7d28d91a10e267.zip FreeBSD-src-39e372ff0ac0b9a64390e8708e7d28d91a10e267.tar.gz |
- Use PCIR_BAR macro rather than hardcoding 0x10.
- Use pci_enable_busmaster() rather than doing it by hand.
- Remove duplicate if_free().
Diffstat (limited to 'sys/dev/en')
-rw-r--r-- | sys/dev/en/if_en_pci.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/dev/en/if_en_pci.c b/sys/dev/en/if_en_pci.c index c17e24d..15eb70d 100644 --- a/sys/dev/en/if_en_pci.c +++ b/sys/dev/en/if_en_pci.c @@ -98,7 +98,7 @@ static void adp_get_macaddr(struct en_pci_softc *); * address of config base memory address register in PCI config space * (this is card specific) */ -#define PCI_CBMA 0x10 +#define PCI_CBMA PCIR_BAR(0) /* * tonga (pci bridge). ENI cards only! @@ -193,7 +193,6 @@ en_pci_attach(device_t dev) { struct en_softc *sc; struct en_pci_softc *scp; - u_long val; int rid, error = 0; sc = device_get_softc(dev); @@ -211,9 +210,7 @@ en_pci_attach(device_t dev) /* * Enable bus mastering. */ - val = pci_read_config(dev, PCIR_COMMAND, 2); - val |= (PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN); - pci_write_config(dev, PCIR_COMMAND, val, 2); + pci_enable_busmaster(dev); /* * Map control/status registers. @@ -284,7 +281,6 @@ en_pci_attach(device_t dev) if (error) { en_reset(sc); atm_ifdetach(sc->ifp); - if_free(sc->ifp); device_printf(dev, "could not setup irq\n"); bus_release_resource(dev, SYS_RES_IRQ, 0, scp->irq); bus_release_resource(dev, SYS_RES_MEMORY, PCI_CBMA, scp->res); |