Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/nvme/nvme_pci.c
Show First 20 Lines • Show All 237 Lines • ▼ Show 20 Lines | nvme_ctrlr_configure_intx(struct nvme_controller *ctrlr) | ||||
ctrlr->res = bus_alloc_resource_any(ctrlr->dev, SYS_RES_IRQ, | ctrlr->res = bus_alloc_resource_any(ctrlr->dev, SYS_RES_IRQ, | ||||
&ctrlr->rid, RF_SHAREABLE | RF_ACTIVE); | &ctrlr->rid, RF_SHAREABLE | RF_ACTIVE); | ||||
if (ctrlr->res == NULL) { | if (ctrlr->res == NULL) { | ||||
nvme_printf(ctrlr, "unable to allocate shared IRQ\n"); | nvme_printf(ctrlr, "unable to allocate shared IRQ\n"); | ||||
return (ENOMEM); | return (ENOMEM); | ||||
} | } | ||||
bus_setup_intr(ctrlr->dev, ctrlr->res, | if (bus_setup_intr(ctrlr->dev, ctrlr->res, | ||||
INTR_TYPE_MISC | INTR_MPSAFE, NULL, nvme_ctrlr_intx_handler, | INTR_TYPE_MISC | INTR_MPSAFE, NULL, nvme_ctrlr_intx_handler, | ||||
ctrlr, &ctrlr->tag); | ctrlr, &ctrlr->tag) != 0) { | ||||
if (ctrlr->tag == NULL) { | |||||
nvme_printf(ctrlr, "unable to setup intx handler\n"); | nvme_printf(ctrlr, "unable to setup intx handler\n"); | ||||
return (ENOMEM); | return (ENOMEM); | ||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
static void | static void | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |