Exemple #1
0
/*
 *      Initialize the device - called from Slot manager.
 */
static int
fe_pccard_probe(device_t dev)
{
	struct fe_softc *sc;
	int error;

	/* Prepare for the device probe process.  */
	sc = device_get_softc(dev);
	sc->sc_unit = device_get_unit(dev);

	pccard_get_ether(dev, sc->sc_enaddr);

	/* Probe for supported cards.  */
	if ((error = fe_probe_mbh(dev)) == 0)
		goto end;
	fe_release_resource(dev);

	if ((error = fe_probe_tdk(dev)) == 0)
		goto end;
	fe_release_resource(dev);

end:
	if (error == 0)
		error = fe_alloc_irq(dev, 0);

	fe_release_resource(dev);
	return (error);
}
Exemple #2
0
static int
fe_pccard_attach(device_t dev)
{
    struct fe_softc *sc;
    const struct fe_pccard_product *pp;
    int error;

    /* Prepare for the device probe process.  */
    sc = device_get_softc(dev);
    sc->sc_unit = device_get_unit(dev);

    pp = (const struct fe_pccard_product *) pccard_product_lookup(dev,
            (const struct pccard_product *)fe_pccard_products,
            sizeof(fe_pccard_products[0]), NULL);
    if (pp == NULL)
        return (ENXIO);

    if (pp->mpp_flags & MPP_MBH10302)
        error = fe_probe_mbh(dev, pp);
    else
        error = fe_probe_tdk(dev, pp);
    if (error != 0) {
        fe_release_resource(dev);
        return (error);
    }
    error = fe_alloc_irq(dev, 0);
    if (error != 0) {
        fe_release_resource(dev);
        return (error);
    }
    return (fe_attach(dev));
}
/*
 *      Initialize the device - called from Slot manager.
 */
static int
fe_pccard_probe(device_t dev)
{
	struct fe_softc *sc;
	int i, error;
	uint8_t sum;
	const uint8_t *ether_addr;

	/* Prepare for the device probe process.  */
	sc = device_get_softc(dev);
	sc->sc_unit = device_get_unit(dev);

	ether_addr = pccard_get_ether(dev);
	for (i = 0, sum = 0; i < ETHER_ADDR_LEN; i++)
		sum |= ether_addr[i];
	if (sum)
		bcopy(ether_addr, sc->sc_enaddr, ETHER_ADDR_LEN);

	/* Probe for supported cards.  */
	if ((error = fe_probe_mbh(dev)) == 0)
		goto end;
	fe_release_resource(dev);

	if ((error = fe_probe_tdk(dev)) == 0)
		goto end;
	fe_release_resource(dev);

end:
	if (error == 0)
		error = fe_alloc_irq(dev, 0);

	fe_release_resource(dev);
	return (error);
}
Exemple #4
0
static int
fe_isa_probe(device_t dev)
{
	struct fe_softc * sc;
	int error;

	/* Check isapnp ids */
	if (isa_get_vendorid(dev))
		return (ENXIO);

	/* Prepare for the softc struct.  */
	sc = device_get_softc(dev);
	sc->sc_unit = device_get_unit(dev);

	/* Probe for supported boards.  */
#ifdef PC98
	if ((error = fe_probe_re1000(dev)) == 0)
		goto end;
	fe_release_resource(dev);

	if ((error = fe_probe_cnet9ne(dev)) == 0)
		goto end;
	fe_release_resource(dev);

	if ((error = fe_probe_rex(dev)) == 0)
		goto end;
	fe_release_resource(dev);
#endif

	if ((error = fe_probe_ssi(dev)) == 0)
		goto end;
	fe_release_resource(dev);

	if ((error = fe_probe_jli(dev)) == 0)
		goto end;
	fe_release_resource(dev);

	if ((error = fe_probe_lnx(dev)) == 0)
		goto end;
	fe_release_resource(dev);

	if ((error = fe_probe_ubn(dev)) == 0)
		goto end;
	fe_release_resource(dev);

	if ((error = fe_probe_gwy(dev)) == 0)
		goto end;
	fe_release_resource(dev);

end:
	if (error == 0)
		error = fe_alloc_irq(dev, 0);

	fe_release_resource(dev);
	return (error);
}
Exemple #5
0
static int
fe_isa_attach(device_t dev)
{
	struct fe_softc *sc = device_get_softc(dev);

	if (sc->port_used)
		fe_alloc_port(dev, sc->port_used);
	fe_alloc_irq(dev, 0);

	return fe_attach(dev);
}
Exemple #6
0
static int
fe_isa_attach(device_t dev)
{
	struct fe_softc *sc = device_get_softc(dev);
	int error = 0;

	/*
	 * Note: these routines aren't expected to fail since we also call
	 * them in the probe routine.  But coverity complains, so we'll honor
	 * that complaint since the intention here was never to ignore them..
	 */
	if (sc->port_used) {
		error = fe98_alloc_port(dev, sc->type);
		if (error != 0)
			return (error);
	}
	error = fe_alloc_irq(dev, 0);
	if (error != 0)
		return (error);

	return fe_attach(dev);
}
Exemple #7
0
/*
 * Determine if the device is present at a specified I/O address.  The
 * main entry to the driver.
 */
static int
fe_isa_probe(device_t dev)
{
	struct fe_softc *sc;
	int error;

	/* Prepare for the softc struct.  */
	sc = device_get_softc(dev);
	sc->sc_unit = device_get_unit(dev);

	/* Check isapnp ids */
	error = ISA_PNP_PROBE(device_get_parent(dev), dev, fe_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;

	/* Probe for supported boards.  */
	if ((error = fe_probe_re1000(dev)) == 0)
		goto end;
	fe_release_resource(dev);

	if ((error = fe_probe_cnet9ne(dev)) == 0)
		goto end;
	fe_release_resource(dev);

	if ((error = fe_probe_rex(dev)) == 0)
		goto end;
	fe_release_resource(dev);

	if ((error = fe_probe_ssi(dev)) == 0)
		goto end;
	fe_release_resource(dev);

	if ((error = fe_probe_jli(dev)) == 0)
		goto end;
	fe_release_resource(dev);

	if ((error = fe_probe_lnx(dev)) == 0)
		goto end;
	fe_release_resource(dev);

	if ((error = fe_probe_ubn(dev)) == 0)
		goto end;
	fe_release_resource(dev);

	if ((error = fe_probe_gwy(dev)) == 0)
		goto end;
	fe_release_resource(dev);

end:
	if (error == 0)
		error = fe_alloc_irq(dev, 0);

	fe_release_resource(dev);
	return (error);
}