static int uart_pccard_attach(device_t dev) { struct uart_softc *sc; int error; sc = device_get_softc(dev); sc->sc_class = &uart_ns8250_class; error = uart_bus_probe(dev, 0, 0, 0, 0); if (error > 0) return (error); return (uart_bus_attach(dev)); }
static int uart_scc_attach(device_t dev) { device_t parent; struct uart_softc *sc; uintptr_t mtx; parent = device_get_parent(dev); sc = device_get_softc(dev); if (BUS_READ_IVAR(parent, dev, SCC_IVAR_HWMTX, &mtx)) return (ENXIO); sc->sc_hwmtx = (struct mtx *)(void *)mtx; return (uart_bus_attach(dev)); }
static int uart_pci_attach(device_t dev) { struct uart_softc *sc; int count; sc = device_get_softc(dev); /* * Use MSI in preference to legacy IRQ if available. * Whilst some PCIe UARTs support >1 MSI vector, use only the first. */ if (pci_msi_count(dev) > 0) { count = 1; if (pci_alloc_msi(dev, &count) == 0) { sc->sc_irid = 1; device_printf(dev, "Using %d MSI message\n", count); } } return (uart_bus_attach(dev)); }