Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mxge/if_mxge.c
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
bus_describe_intr(sc->dev, sc->msix_irq_res[i], | bus_describe_intr(sc->dev, sc->msix_irq_res[i], | ||||
sc->msix_ih[i], "s%d", i); | sc->msix_ih[i], "s%d", i); | ||||
} | } | ||||
if (mxge_verbose) { | if (mxge_verbose) { | ||||
device_printf(sc->dev, "using %d msix IRQs:", | device_printf(sc->dev, "using %d msix IRQs:", | ||||
sc->num_slices); | sc->num_slices); | ||||
for (i = 0; i < sc->num_slices; i++) | for (i = 0; i < sc->num_slices; i++) | ||||
printf(" %ld", rman_get_start(sc->msix_irq_res[i])); | printf(" %jd", rman_get_start(sc->msix_irq_res[i])); | ||||
printf("\n"); | printf("\n"); | ||||
} | } | ||||
return (0); | return (0); | ||||
abort_with_intr: | abort_with_intr: | ||||
for (i = 0; i < sc->num_slices; i++) { | for (i = 0; i < sc->num_slices; i++) { | ||||
if (sc->msix_ih[i] != NULL) { | if (sc->msix_ih[i] != NULL) { | ||||
bus_teardown_intr(sc->dev, sc->msix_irq_res[i], | bus_teardown_intr(sc->dev, sc->msix_irq_res[i], | ||||
Show All 39 Lines | |||||
} | } | ||||
sc->irq_res = bus_alloc_resource(sc->dev, SYS_RES_IRQ, &rid, 0, ~0, | sc->irq_res = bus_alloc_resource(sc->dev, SYS_RES_IRQ, &rid, 0, ~0, | ||||
1, RF_SHAREABLE | RF_ACTIVE); | 1, RF_SHAREABLE | RF_ACTIVE); | ||||
if (sc->irq_res == NULL) { | if (sc->irq_res == NULL) { | ||||
device_printf(sc->dev, "could not alloc interrupt\n"); | device_printf(sc->dev, "could not alloc interrupt\n"); | ||||
return ENXIO; | return ENXIO; | ||||
} | } | ||||
if (mxge_verbose) | if (mxge_verbose) | ||||
device_printf(sc->dev, "using %s irq %ld\n", | device_printf(sc->dev, "using %s irq %jd\n", | ||||
sc->legacy_irq ? "INTx" : "MSI", | sc->legacy_irq ? "INTx" : "MSI", | ||||
rman_get_start(sc->irq_res)); | rman_get_start(sc->irq_res)); | ||||
err = bus_setup_intr(sc->dev, sc->irq_res, | err = bus_setup_intr(sc->dev, sc->irq_res, | ||||
INTR_TYPE_NET | INTR_MPSAFE, | INTR_TYPE_NET | INTR_MPSAFE, | ||||
#if __FreeBSD_version > 700030 | #if __FreeBSD_version > 700030 | ||||
NULL, | NULL, | ||||
#endif | #endif | ||||
mxge_intr, &sc->ss[0], &sc->ih); | mxge_intr, &sc->ss[0], &sc->ih); | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | |||||
if (sc->mem_res == NULL) { | if (sc->mem_res == NULL) { | ||||
device_printf(dev, "could not map memory\n"); | device_printf(dev, "could not map memory\n"); | ||||
err = ENXIO; | err = ENXIO; | ||||
goto abort_with_lock; | goto abort_with_lock; | ||||
} | } | ||||
sc->sram = rman_get_virtual(sc->mem_res); | sc->sram = rman_get_virtual(sc->mem_res); | ||||
sc->sram_size = 2*1024*1024 - (2*(48*1024)+(32*1024)) - 0x100; | sc->sram_size = 2*1024*1024 - (2*(48*1024)+(32*1024)) - 0x100; | ||||
if (sc->sram_size > rman_get_size(sc->mem_res)) { | if (sc->sram_size > rman_get_size(sc->mem_res)) { | ||||
device_printf(dev, "impossible memory region size %ld\n", | device_printf(dev, "impossible memory region size %jd\n", | ||||
rman_get_size(sc->mem_res)); | rman_get_size(sc->mem_res)); | ||||
err = ENXIO; | err = ENXIO; | ||||
goto abort_with_mem_res; | goto abort_with_mem_res; | ||||
} | } | ||||
/* make NULL terminated copy of the EEPROM strings section of | /* make NULL terminated copy of the EEPROM strings section of | ||||
lanai SRAM */ | lanai SRAM */ | ||||
bzero(sc->eeprom_strings, MXGE_EEPROM_STRINGS_SIZE); | bzero(sc->eeprom_strings, MXGE_EEPROM_STRINGS_SIZE); | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |