static int snc_pccard_attach(device_t dev) { struct snc_softc *sc = device_get_softc(dev); int error; bzero(sc, sizeof(struct snc_softc)); snc_alloc_port(dev, 0); snc_alloc_memory(dev, 0); snc_alloc_irq(dev, 0, 0); error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, sncintr, sc, &sc->irq_handle); if (error) { printf("snc_isa_attach: bus_setup_intr() failed\n"); snc_release_resources(dev); return (error); } /* This interface is always enabled. */ sc->sc_enabled = 1; /* pccard_get_ether(dev, ether_addr); */ return snc_attach(dev); }
static int snc_pccard_attach(device_t dev) { struct snc_softc *sc = device_get_softc(dev); int error; /* * Not sure that this belongs here or in snc_pccard_attach */ if ((error = snc_alloc_port(dev, 0)) != 0) goto err; if ((error = snc_alloc_memory(dev, 0)) != 0) goto err; if ((error = snc_alloc_irq(dev, 0, 0)) != 0) goto err; if ((error = snc_probe(dev, SNEC_TYPE_PNP)) != 0) goto err; /* This interface is always enabled. */ sc->sc_enabled = 1; /* pccard_get_ether(dev, ether_addr); */ if ((error = snc_attach(dev)) != 0) goto err; return 0; err:; snc_release_resources(dev); return error; }
static int snc_isa_attach(device_t dev) { struct snc_softc *sc = device_get_softc(dev); bzero(sc, sizeof(struct snc_softc)); snc_alloc_port(dev, 0); snc_alloc_memory(dev, 0); snc_alloc_irq(dev, 0, 0); /* This interface is always enabled. */ sc->sc_enabled = 1; return snc_attach(dev); }