summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2000-09-05 21:08:48 +0000
committerphk <phk@FreeBSD.org>2000-09-05 21:08:48 +0000
commit449976b827c4b5ac6104b259837927bec7170f5a (patch)
tree0f6b8b9fbdc298646129a7d2f9dafe72fa033768 /sys
parent4940b0a8a7927e49d74e750bfb615f72df91cbdf (diff)
downloadFreeBSD-src-449976b827c4b5ac6104b259837927bec7170f5a.zip
FreeBSD-src-449976b827c4b5ac6104b259837927bec7170f5a.tar.gz
Register resources in a more opportune order for the hardware.
Diffstat (limited to 'sys')
-rw-r--r--sys/pci/if_mn.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/sys/pci/if_mn.c b/sys/pci/if_mn.c
index 2957a650..7e273db 100644
--- a/sys/pci/if_mn.c
+++ b/sys/pci/if_mn.c
@@ -1225,23 +1225,6 @@ mn_attach (device_t self)
sc->unit = device_get_unit(self);
sprintf(sc->name, "mn%d", sc->unit);
- /* Allocate interrupt */
- rid = 0;
- sc->irq = bus_alloc_resource(self, SYS_RES_IRQ, &rid, 0, ~0,
- 1, RF_SHAREABLE | RF_ACTIVE);
-
- if (sc->irq == NULL) {
- printf("couldn't map interrupt\n");
- return(ENXIO);
- }
-
- error = bus_setup_intr(self, sc->irq, INTR_TYPE_NET, mn_intr, sc, &sc->intrhand);
-
- if (error) {
- printf("couldn't set up irq\n");
- return(ENXIO);
- }
-
rid = PCIR_MAPS;
res = bus_alloc_resource(self, SYS_RES_MEMORY, &rid,
0, ~0, 1, RF_ACTIVE);
@@ -1262,6 +1245,23 @@ mn_attach (device_t self)
sc->m1v = rman_get_virtual(res);
sc->m1p = rman_get_start(res);
+ /* Allocate interrupt */
+ rid = 0;
+ sc->irq = bus_alloc_resource(self, SYS_RES_IRQ, &rid, 0, ~0,
+ 1, RF_SHAREABLE | RF_ACTIVE);
+
+ if (sc->irq == NULL) {
+ printf("couldn't map interrupt\n");
+ return(ENXIO);
+ }
+
+ error = bus_setup_intr(self, sc->irq, INTR_TYPE_NET, mn_intr, sc, &sc->intrhand);
+
+ if (error) {
+ printf("couldn't set up irq\n");
+ return(ENXIO);
+ }
+
u = pci_read_config(self, PCIR_COMMAND, 1);
printf("%x\n", u);
pci_write_config(self, PCIR_COMMAND, u | PCIM_CMD_PERRESPEN | PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN, 1);
OpenPOWER on IntegriCloud