summaryrefslogtreecommitdiffstats
path: root/sys/dev/tx
diff options
context:
space:
mode:
authormux <mux@FreeBSD.org>2003-04-19 00:21:34 +0000
committermux <mux@FreeBSD.org>2003-04-19 00:21:34 +0000
commit202f4add577d834c41dc92decd71fa382e2eb829 (patch)
tree689acb6abcfc173e14744ef6f7445326cc74206b /sys/dev/tx
parent3ab7b56aeb24bb978b78fdf0b5dec912f0764d45 (diff)
downloadFreeBSD-src-202f4add577d834c41dc92decd71fa382e2eb829.zip
FreeBSD-src-202f4add577d834c41dc92decd71fa382e2eb829.tar.gz
Various cleanups:
- Don't initialize if_output, ether_ifattach() does this for us. - Use pci_enable_busmaster() instead of using pci_read_config() and pci_write_config() directly. - Don't try to enable I/O, bus_alloc_resource() does this for us.
Diffstat (limited to 'sys/dev/tx')
-rw-r--r--sys/dev/tx/if_tx.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/sys/dev/tx/if_tx.c b/sys/dev/tx/if_tx.c
index 608daa0..b7453d7 100644
--- a/sys/dev/tx/if_tx.c
+++ b/sys/dev/tx/if_tx.c
@@ -214,7 +214,6 @@ epic_attach(dev)
{
struct ifnet *ifp;
epic_softc_t *sc;
- u_int32_t command;
int unit, error;
int i, s, rid, tmp;
@@ -235,7 +234,6 @@ epic_attach(dev)
ifp->if_softc = sc;
ifp->if_flags = IFF_BROADCAST|IFF_SIMPLEX|IFF_MULTICAST;
ifp->if_ioctl = epic_ifioctl;
- ifp->if_output = ether_output;
ifp->if_start = epic_ifstart;
ifp->if_watchdog = epic_ifwatchdog;
ifp->if_init = (if_init_f_t*)epic_init;
@@ -244,24 +242,7 @@ epic_attach(dev)
ifp->if_snd.ifq_maxlen = TX_RING_SIZE - 1;
/* Enable ports, memory and busmastering */
- command = pci_read_config(dev, PCIR_COMMAND, 4);
- command |= PCIM_CMD_PORTEN | PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN;
- pci_write_config(dev, PCIR_COMMAND, command, 4);
- command = pci_read_config(dev, PCIR_COMMAND, 4);
-
-#if defined(EPIC_USEIOSPACE)
- if ((command & PCIM_CMD_PORTEN) == 0) {
- device_printf(dev, "failed to enable I/O mapping!\n");
- error = ENXIO;
- goto fail;
- }
-#else
- if ((command & PCIM_CMD_MEMEN) == 0) {
- device_printf(dev, "failed to enable memory mapping!\n");
- error = ENXIO;
- goto fail;
- }
-#endif
+ pci_enable_busmaster(dev);
rid = EPIC_RID;
sc->res = bus_alloc_resource(dev, EPIC_RES, &rid, 0, ~0, 1,
OpenPOWER on IntegriCloud