Example #1
0
/*
 * Determine if the device is present
 */
static int
cs_isa_probe(device_t dev)
{
	int error = 0;

	/* Check isapnp ids */
	error = ISA_PNP_PROBE(device_get_parent(dev), dev, cs_ids);

	/* If the card had a PnP ID that didn't match any we know about */
	if (error == ENXIO)
                goto end;

        /* If we had some other problem. */
        if (!(error == 0 || error == ENOENT))
                goto end;

	error = cs_cs89x0_probe(dev);
end:
	/* Make sure IRQ is assigned for probe message and available */
	if (error == 0)
                error = cs_alloc_irq(dev, 0, 0);

        cs_release_resources(dev);
        return (error);
}
Example #2
0
static int
cs_isa_attach(device_t dev)
{
        struct cs_softc *sc = device_get_softc(dev);
        
	cs_alloc_port(dev, 0, CS_89x0_IO_PORTS);
        cs_alloc_irq(dev, sc->irq_rid);
                
        return (cs_attach(dev));
}
Example #3
0
/*
 * Determine if the device is present
 */
static int
cs_isa_probe(device_t dev)
{
	int error = 0;

	/* Check isapnp ids */
	error = ISA_PNP_PROBE(device_get_parent(dev), dev, cs_ids);

	/* If the card had a PnP ID that didn't match any we know about */
        if (!(error == 0 || error == ENOENT))
		return error;

	error = cs_cs89x0_probe(dev);
	if (error == 0)
                error = cs_alloc_irq(dev, 0, 0);

        cs_release_resources(dev);
        return (error);
}
Example #4
0
static int
cs_pccard_attach(device_t dev)
{
	struct cs_softc *sc = device_get_softc(dev);
	int error;

	sc->flags |= CS_NO_IRQ;
	error = cs_cs89x0_probe(dev);
	if (error != 0)
		return (error);
	error = cs_alloc_irq(dev, sc->irq_rid);
	if (error != 0)
		goto bad;

	return (cs_attach(dev));
bad:
	cs_release_resources(dev);
	return (error);
}
Example #5
0
static int
cs_isa_attach(device_t dev)
{
        struct cs_softc *sc = device_get_softc(dev);
        int flags = device_get_flags(dev);
        int error;
        
	cs_alloc_port(dev, 0, CS_89x0_IO_PORTS);
	/* XXX mem appears to not be used at all */
        if (sc->mem_used)
                cs_alloc_memory(dev, sc->mem_rid, sc->mem_used);
        cs_alloc_irq(dev, sc->irq_rid, 0);
                
        error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET,
	    csintr, sc, &sc->irq_handle);
        if (error) {
                cs_release_resources(dev);
                return (error);
        }              

        return (cs_attach(sc, device_get_unit(dev), flags));
}
static int
cs_pccard_attach(device_t dev)
{
	struct cs_softc *sc = device_get_softc(dev);
	int error;

	sc->flags |= CS_NO_IRQ;
	error = cs_cs89x0_probe(dev);
	if (error != 0)
		return (error);
	error = cs_alloc_irq(dev, sc->irq_rid, 0);
	if (error != 0)
		goto bad;
	error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET,
	    NULL, csintr, sc, &sc->irq_handle);
	if (error != 0)
		goto bad;

	return (cs_attach(dev));
bad:
	cs_release_resources(dev);
	return (error);
}