Пример #1
0
static int
aic_pccard_attach(device_t dev)
{
	struct aic_pccard_softc *sc = device_get_softc(dev);
	struct aic_softc *aic = &sc->sc_aic;
	int error;

	if (aic_pccard_alloc_resources(dev))
		return (ENXIO);
	if (aic_probe(aic)) {
		aic_pccard_release_resources(dev);
		return (ENXIO);
	}

	device_set_desc(dev, "Adaptec 6260/6360 SCSI controller");

	error = aic_attach(aic);
	if (error) {
		device_printf(dev, "attach failed\n");
		aic_pccard_release_resources(dev);
		return (error);
	}

	error = bus_setup_intr(dev, sc->sc_irq, 0, aic_intr,
			       aic, &sc->sc_ih, NULL);
	if (error) {
		device_printf(dev, "failed to register interrupt handler\n");
		aic_pccard_release_resources(dev);
		return (error);
	}
	return (0);
}
Пример #2
0
static int
aic_pccard_attach(device_t dev)
{
	struct aic_pccard_softc *sc = device_get_softc(dev);
	struct aic_softc *aic = &sc->sc_aic;
	int error;

	if (aic_pccard_alloc_resources(dev))
		return (ENXIO);
	if (aic_probe(aic)) {
		aic_pccard_release_resources(dev);
		return (ENXIO);
	}

	error = aic_attach(aic);
	if (error) {
		device_printf(dev, "attach failed\n");
		aic_pccard_release_resources(dev);
		return (error);
	}

	error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM | INTR_ENTROPY |
	    INTR_MPSAFE, NULL, aic_intr, aic, &sc->sc_ih);
	if (error) {
		device_printf(dev, "failed to register interrupt handler\n");
		aic_pccard_release_resources(dev);
		return (error);
	}
	return (0);
}
Пример #3
0
static int
aic_pccard_attach(device_t dev)
{
	struct aic_pccard_softc *sc = device_get_softc(dev);
	struct aic_softc *aic = &sc->sc_aic;
	int error;

	error = aic_pccard_alloc_resources(dev);
	if (error) {
		device_printf(dev, "resource allocation failed\n");
		return (error);
	}

	error = aic_attach(aic);
	if (error) {
		device_printf(dev, "attach failed\n");
		aic_pccard_release_resources(dev);
		return (error);
	}

	error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM, aic_intr,
	    aic, &sc->sc_ih);
	if (error) {
		device_printf(dev, "failed to register interrupt handler\n");
		aic_pccard_release_resources(dev);
		return (error);
	}
	return (0);
}
Пример #4
0
static int
aic_pccard_probe(device_t dev)
{
	struct aic_pccard_softc *sc = device_get_softc(dev);
	struct aic_softc *aic = &sc->sc_aic;

	if (aic_pccard_alloc_resources(dev))
		return (ENXIO);
	if (aic_probe(aic)) {
		aic_pccard_release_resources(dev);
		return (ENXIO);
	}
	aic_pccard_release_resources(dev);

	device_set_desc(dev, "Adaptec 6260/6360 SCSI controller");
	return (0);
}