示例#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);
}
示例#2
0
static int
cs_pccard_probe(device_t dev)
{
	int error;

	error = cs_cs89x0_probe(dev);
        cs_release_resources(dev);
        return (error);
}
示例#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);
}
示例#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);
}
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);
}