MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tegra_pcib_msi_attach

Function tegra_pcib_msi_attach

freebsd/arm/nvidia/tegra_pcie.c:634–657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

632}
633
634static int
635tegra_pcib_msi_attach(struct tegra_pcib_softc *sc)
636{
637 int error;
638 uint32_t irq;
639 const char *name;
640
641 sc->isrcs = malloc(sizeof(*sc->isrcs) * TEGRA_PCIB_MAX_MSI, M_DEVBUF,
642 M_WAITOK | M_ZERO);
643
644 name = device_get_nameunit(sc->dev);
645 for (irq = 0; irq < TEGRA_PCIB_MAX_MSI; irq++) {
646 sc->isrcs[irq].irq = irq;
647 error = intr_isrc_register(&sc->isrcs[irq].isrc,
648 sc->dev, 0, "%s,%u", name, irq);
649 if (error != 0)
650 return (error); /* XXX deregister ISRCs */
651 }
652 if (intr_msi_register(sc->dev,
653 OF_xref_from_node(ofw_bus_get_node(sc->dev))) != 0)
654 return (ENXIO);
655
656 return (0);
657}
658
659static int
660tegra_pcib_msi_detach(struct tegra_pcib_softc *sc)

Callers 1

tegra_pcib_attach_msiFunction · 0.85

Calls 4

mallocFunction · 0.85
device_get_nameunitFunction · 0.85
intr_isrc_registerFunction · 0.85
intr_msi_registerFunction · 0.85

Tested by

no test coverage detected