コード例 #1
0
ファイル: if_fe_cbus.c プロジェクト: UnitedMarsupials/kame
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);
}
コード例 #2
0
ファイル: if_fe_cbus.c プロジェクト: 2asoft/freebsd
/*
 * 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);
}