Lines Matching full:probe

101 			    struct bhndb_pci_probe *probe);
106 static int bhndb_pci_probe_alloc(struct bhndb_pci_probe **probe,
108 static void bhndb_pci_probe_free(struct bhndb_pci_probe *probe);
111 struct bhndb_pci_probe *probe,
123 struct bhndb_pci_probe *probe);
150 struct bhndb_pci_probe *probe; /**< borrowed probe reference */
157 * May be safely used during probe or early device attach, prior to calling
264 struct bhndb_pci_probe *probe;
271 probe = NULL;
298 if ((error = bhndb_pci_probe_alloc(&probe, dev, hostb_devclass)))
302 if ((entry = bhndb_pci_find_core(&probe->hostb_core)) == NULL) {
313 if (probe != NULL)
314 bhndb_pci_probe_free(probe);
359 struct bhndb_pci_probe *probe;
373 probe = NULL;
384 error = bhndb_pci_probe_alloc(&probe, dev, sc->pci_devclass);
388 sc->pci_quirks = bhndb_pci_get_core_quirks(&probe->cid,
389 &probe->hostb_core);
392 if (probe->cid.chip_type == BHND_CHIPTYPE_SIBA) {
404 if ((error = bhndb_pci_srsh_pi_war(sc, probe)))
432 * Copy out the probe results and then free our probe state, releasing
438 cid = probe->cid;
439 erom_class = probe->erom_class;
440 hostb_core = probe->hostb_core;
442 error = bhndb_pci_probe_copy_core_table(probe, &cores, &ncores);
448 bhndb_pci_probe_free(probe);
449 probe = NULL;
460 /* Probe and attach our children */
479 if (probe != NULL)
480 bhndb_pci_probe_free(probe);
802 struct bhndb_pci_probe *probe)
817 md = bhnd_core_get_match_desc(&probe->hostb_core);
818 error = bhnd_erom_lookup_core_addr(probe->erom, &md, BHND_PORT_DEVICE,
828 val = bhndb_pci_probe_read(probe, pci_addr, srsh_offset, sizeof(val));
838 bhndb_pci_probe_write(probe, pci_addr, srsh_offset, val,
1266 * and return a new bhndb_pci probe state instance.
1268 * On success, the caller assumes ownership of the returned probe instance, and
1271 * @param[out] probe On success, the newly allocated probe instance.
1276 * @retval non-zero if allocating the probe state fails, a regular
1284 bhndb_pci_probe_alloc(struct bhndb_pci_probe **probe, device_t dev,
1328 /* Probe for a usable EROM class, and read the chip identifier */
1371 *probe = p;
1401 * Free the given @p probe instance and any associated host bridge resources.
1404 bhndb_pci_probe_free(struct bhndb_pci_probe *probe)
1406 bhnd_erom_free_core_table(probe->erom, probe->cores);
1407 bhnd_erom_free(probe->erom);
1408 bhndb_release_host_resources(probe->hr);
1409 free(probe, M_BHND);
1413 * Return a copy of probed core table from @p probe.
1415 * @param probe The probe instance.
1427 bhndb_pci_probe_copy_core_table(struct bhndb_pci_probe *probe,
1430 size_t len = sizeof(**cores) * probe->ncores;
1433 memcpy(*cores, probe->cores, len);
1435 *ncores = probe->ncores;
1453 * backing @p probe.
1456 bhndb_pci_probe_has_mapping(struct bhndb_pci_probe *probe, bhnd_addr_t addr,
1459 if (!probe->m_valid)
1462 KASSERT(probe->m_win != NULL, ("missing register window"));
1463 KASSERT(probe->m_res != NULL, ("missing regwin resource"));
1464 KASSERT(probe->m_win->win_type == BHNDB_REGWIN_T_DYN,
1465 ("unexpected window type %d", probe->m_win->win_type));
1467 if (addr < probe->m_target)
1470 if (addr >= probe->m_target + probe->m_win->win_size)
1473 if ((probe->m_target + probe->m_win->win_size) - addr < size)
1480 * Attempt to adjust the dynamic register window backing @p probe to permit
1483 * @param probe The bhndb_pci probe state to be modified.
1496 bhndb_pci_probe_map(struct bhndb_pci_probe *probe, bhnd_addr_t addr,
1507 device_printf(probe->dev, "invalid offset %#jx+%#jx\n", addr,
1515 if (bhndb_pci_probe_has_mapping(probe, addr, size)) {
1516 *res = probe->m_res;
1517 *res_offset = (addr - probe->m_target) +
1518 probe->m_win->win_offset;
1524 regwin_table = probe->hr->cfg->register_windows;
1528 device_printf(probe->dev, "unable to map %#jx+%#jx; no "
1535 regwin_res = bhndb_host_resource_for_regwin(probe->hr, regwin);
1537 device_printf(probe->dev, "unable to map %#jx+%#jx; no "
1546 error = bhndb_pci_compat_setregwin(probe->dev, probe->pci_dev,
1549 device_printf(probe->dev, "failed to configure dynamic "
1555 probe->m_win = regwin;
1556 probe->m_res = regwin_res;
1557 probe->m_addr = addr;
1558 probe->m_size = size;
1559 probe->m_target = target;
1560 probe->m_valid = true;
1574 * @param probe The bhndb_pci probe state to be used to perform the
1583 bhndb_pci_probe_write(struct bhndb_pci_probe *probe, bhnd_addr_t addr,
1591 error = bhndb_pci_probe_map(probe, addr, offset, width, &r,
1594 device_printf(probe->dev, "error mapping %#jx+%#jx for "
1618 * @param probe The bhndb_pci probe state to be used to perform the
1626 bhndb_pci_probe_read(struct bhndb_pci_probe *probe, bhnd_addr_t addr,
1634 error = bhndb_pci_probe_map(probe, addr, offset, width, &r,
1637 device_printf(probe->dev, "error mapping %#jx+%#jx for "
1657 * performed using @p probe.
1660 * @param probe The bhndb_pci probe state to be used to perform all
1664 bhndb_pci_eio_init(struct bhndb_pci_eio *pio, struct bhndb_pci_probe *probe)
1676 pio->probe = probe;
1730 return (bhndb_pci_probe_read(pio->probe, pio->addr, offset, width));