Register resources in a more opportune order for the hardware.
This commit is contained in:
parent
4940b0a8a7
commit
449976b827
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user