summaryrefslogtreecommitdiffstats
path: root/sys/dev/ed/if_ed_pci.c
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>1999-10-15 03:12:48 +0000
committermdodd <mdodd@FreeBSD.org>1999-10-15 03:12:48 +0000
commitd21234b78cc7e611247dffae6bf6c15ac69b667a (patch)
treecff1fff01b962f6d9b67f718ee1c4d5a1d8f1ab7 /sys/dev/ed/if_ed_pci.c
parent1be659671f9c8884733a59d933c65a1e4ad4b29d (diff)
downloadFreeBSD-src-d21234b78cc7e611247dffae6bf6c15ac69b667a.zip
FreeBSD-src-d21234b78cc7e611247dffae6bf6c15ac69b667a.tar.gz
- Remove the ISA, PCI, and PCCARD specific code from if_ed.c; it
now lives in the respective bus front end files. - Add various function prototypes to if_edvar.h - Clean up some debugging code that snuck into if_ed_isa.c - Turn on the right bits in files.i386
Diffstat (limited to 'sys/dev/ed/if_ed_pci.c')
-rw-r--r--sys/dev/ed/if_ed_pci.c41
1 files changed, 33 insertions, 8 deletions
diff --git a/sys/dev/ed/if_ed_pci.c b/sys/dev/ed/if_ed_pci.c
index c3a270a..d5bfcfc 100644
--- a/sys/dev/ed/if_ed_pci.c
+++ b/sys/dev/ed/if_ed_pci.c
@@ -27,17 +27,21 @@
#include <sys/systm.h>
#include <sys/socket.h>
#include <sys/kernel.h>
+
#include <sys/module.h>
#include <sys/bus.h>
-#include <machine/bus.h>
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
+#include <machine/bus.h>
+#include <sys/rman.h>
+#include <machine/resource.h>
#include <net/if.h>
#include <net/if_arp.h>
#include <net/if_mib.h>
+#include <pci/pcireg.h>
+#include <pci/pcivar.h>
+
#include <dev/ed/if_edvar.h>
static struct _pcsid
@@ -57,10 +61,8 @@ static struct _pcsid
{ 0x00000000, NULL }
};
-extern int ed_attach_NE2000_pci __P((device_t dev, int));
-
-static int ed_pci_probe __P((device_t));
-static int ed_pci_attach __P((device_t));
+static int ed_pci_probe __P((device_t));
+static int ed_pci_attach __P((device_t));
static int
ed_pci_probe (device_t dev)
@@ -81,7 +83,30 @@ ed_pci_probe (device_t dev)
static int
ed_pci_attach(device_t dev)
{
- return ed_attach_NE2000_pci(dev, PCIR_MAPS);
+ struct ed_softc *sc = device_get_softc(dev);
+ int flags = 0;
+ int error;
+
+ error = ed_probe_Novell_generic(dev, PCIR_MAPS, flags);
+ if (error)
+ return (error);
+
+ error = ed_alloc_irq(dev, 0, RF_SHAREABLE);
+ if (error) {
+ ed_release_resources(dev);
+ return (error);
+ }
+
+ error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET,
+ edintr, sc, &sc->irq_handle);
+ if (error) {
+ ed_release_resources(dev);
+ return (error);
+ }
+
+ error = ed_attach(sc, device_get_unit(dev), flags);
+
+ return (error);
}
static device_method_t ed_pci_methods[] = {
OpenPOWER on IntegriCloud