Exemple #1
0
static int
bcma_nexus_probe(device_t dev)
{
	const struct bhnd_chipid *cid = BHND_BUS_GET_CHIPID(device_get_parent(dev), dev);

	/* Check bus type */
	if (cid->chip_type != BHND_CHIPTYPE_BCMA)
		return (ENXIO);

	/* Delegate to default probe implementation */
	return (bcma_probe(dev));
}
static int
bcma_bhndb_probe(device_t dev)
{
	const struct bhnd_chipid	*cid;
	int				 error;

	/* Defer to default probe implementation */
	if ((error = bcma_probe(dev)) > 0)
		return (error);

	/* Check bus type */
	cid = BHNDB_GET_CHIPID(device_get_parent(dev), dev);
	if (cid->chip_type != BHND_CHIPTYPE_BCMA)
		return (ENXIO);

	/* Set device description */
	bhnd_set_default_bus_desc(dev, cid);

	return (error);
}
Exemple #3
0
static int
bcma_nexus_probe(device_t dev)
{
	int error;

	switch (bcm_get_platform()->cid.chip_type) {
	case BHND_CHIPTYPE_BCMA:
	case BHND_CHIPTYPE_BCMA_ALT:
	case BHND_CHIPTYPE_UBUS:
		break;
	default:
		return (ENXIO);
	}

	if ((error = bcma_probe(dev)) > 0)
		return (error);

	/* Set device description */
	bhnd_set_default_bus_desc(dev, &bcm_get_platform()->cid);

	return (BUS_PROBE_SPECIFIC);
}
Exemple #4
0
static int
bcma_nexus_probe(device_t dev)
{
	struct bcma_nexus_softc	*sc;
	int			 error;

	sc = device_get_softc(dev);

	/* Read the ChipCommon info using the hints the kernel
	 * was compiled with. */
	if ((error = bhnd_nexus_read_chipid(dev, &sc->bcma_cid)))
		return (error);

	if (sc->bcma_cid.chip_type != BHND_CHIPTYPE_BCMA)
		return (ENXIO);

	if ((error = bcma_probe(dev)) > 0) {
		device_printf(dev, "error %d in probe\n", error);
		return (error);
	}

	return (0);
}