static int siba_nexus_probe(device_t dev) { struct siba_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->siba_cid))) return (error); if (sc->siba_cid.chip_type != BHND_CHIPTYPE_SIBA) return (ENXIO); if ((error = siba_probe(dev)) > 0) { device_printf(dev, "error %d in probe\n", error); return (error); } /* Set device description */ bhnd_set_default_bus_desc(dev, &sc->siba_cid); return (0); }
static int siba_bhndb_probe(device_t dev) { const struct bhnd_chipid *cid; int error; /* Defer to default probe implementation */ if ((error = siba_probe(dev)) > 0) return (error); /* Check bus type */ cid = BHNDB_GET_CHIPID(device_get_parent(dev), dev); if (cid->chip_type != BHND_CHIPTYPE_SIBA) return (ENXIO); /* Set device description */ bhnd_set_default_bus_desc(dev, cid); return (error); }
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); }