Lines Matching refs: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;
480 if (probe != NULL)
481 bhndb_pci_probe_free(probe);
803 struct bhndb_pci_probe *probe)
818 md = bhnd_core_get_match_desc(&probe->hostb_core);
819 error = bhnd_erom_lookup_core_addr(probe->erom, &md, BHND_PORT_DEVICE,
829 val = bhndb_pci_probe_read(probe, pci_addr, srsh_offset, sizeof(val));
839 bhndb_pci_probe_write(probe, pci_addr, srsh_offset, val,
1267 * and return a new bhndb_pci probe state instance.
1269 * On success, the caller assumes ownership of the returned probe instance, and
1272 * @param[out] probe On success, the newly allocated probe instance.
1277 * @retval non-zero if allocating the probe state fails, a regular
1285 bhndb_pci_probe_alloc(struct bhndb_pci_probe **probe, device_t dev,
1372 *probe = p;
1402 * Free the given @p probe instance and any associated host bridge resources.
1405 bhndb_pci_probe_free(struct bhndb_pci_probe *probe)
1407 bhnd_erom_free_core_table(probe->erom, probe->cores);
1408 bhnd_erom_free(probe->erom);
1409 bhndb_release_host_resources(probe->hr);
1410 free(probe, M_BHND);
1414 * Return a copy of probed core table from @p probe.
1416 * @param probe The probe instance.
1428 bhndb_pci_probe_copy_core_table(struct bhndb_pci_probe *probe,
1431 size_t len = sizeof(**cores) * probe->ncores;
1434 memcpy(*cores, probe->cores, len);
1436 *ncores = probe->ncores;
1454 * backing @p probe.
1457 bhndb_pci_probe_has_mapping(struct bhndb_pci_probe *probe, bhnd_addr_t addr,
1460 if (!probe->m_valid)
1463 KASSERT(probe->m_win != NULL, ("missing register window"));
1464 KASSERT(probe->m_res != NULL, ("missing regwin resource"));
1465 KASSERT(probe->m_win->win_type == BHNDB_REGWIN_T_DYN,
1466 ("unexpected window type %d", probe->m_win->win_type));
1468 if (addr < probe->m_target)
1471 if (addr >= probe->m_target + probe->m_win->win_size)
1474 if ((probe->m_target + probe->m_win->win_size) - addr < size)
1481 * Attempt to adjust the dynamic register window backing @p probe to permit
1484 * @param probe The bhndb_pci probe state to be modified.
1497 bhndb_pci_probe_map(struct bhndb_pci_probe *probe, bhnd_addr_t addr,
1508 device_printf(probe->dev, "invalid offset %#jx+%#jx\n", addr,
1516 if (bhndb_pci_probe_has_mapping(probe, addr, size)) {
1517 *res = probe->m_res;
1518 *res_offset = (addr - probe->m_target) +
1519 probe->m_win->win_offset;
1525 regwin_table = probe->hr->cfg->register_windows;
1529 device_printf(probe->dev, "unable to map %#jx+%#jx; no "
1536 regwin_res = bhndb_host_resource_for_regwin(probe->hr, regwin);
1538 device_printf(probe->dev, "unable to map %#jx+%#jx; no "
1547 error = bhndb_pci_compat_setregwin(probe->dev, probe->pci_dev,
1550 device_printf(probe->dev, "failed to configure dynamic "
1556 probe->m_win = regwin;
1557 probe->m_res = regwin_res;
1558 probe->m_addr = addr;
1559 probe->m_size = size;
1560 probe->m_target = target;
1561 probe->m_valid = true;
1575 * @param probe The bhndb_pci probe state to be used to perform the
1584 bhndb_pci_probe_write(struct bhndb_pci_probe *probe, bhnd_addr_t addr,
1592 error = bhndb_pci_probe_map(probe, addr, offset, width, &r,
1595 device_printf(probe->dev, "error mapping %#jx+%#jx for "
1619 * @param probe The bhndb_pci probe state to be used to perform the
1627 bhndb_pci_probe_read(struct bhndb_pci_probe *probe, bhnd_addr_t addr,
1635 error = bhndb_pci_probe_map(probe, addr, offset, width, &r,
1638 device_printf(probe->dev, "error mapping %#jx+%#jx for "
1658 * performed using @p probe.
1661 * @param probe The bhndb_pci probe state to be used to perform all
1665 bhndb_pci_eio_init(struct bhndb_pci_eio *pio, struct bhndb_pci_probe *probe)
1677 pio->probe = probe;
1731 return (bhndb_pci_probe_read(pio->probe, pio->addr, offset, width));