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 */ member
264 struct bhndb_pci_probe *probe; in bhndb_pci_probe() local
271 probe = NULL; in bhndb_pci_probe()
298 if ((error = bhndb_pci_probe_alloc(&probe, dev, hostb_devclass))) in bhndb_pci_probe()
302 if ((entry = bhndb_pci_find_core(&probe->hostb_core)) == NULL) { in bhndb_pci_probe()
313 if (probe != NULL) in bhndb_pci_probe()
314 bhndb_pci_probe_free(probe); in bhndb_pci_probe()
359 struct bhndb_pci_probe *probe; in bhndb_pci_attach() local
373 probe = NULL; in bhndb_pci_attach()
384 error = bhndb_pci_probe_alloc(&probe, dev, sc->pci_devclass); in bhndb_pci_attach()
388 sc->pci_quirks = bhndb_pci_get_core_quirks(&probe->cid, in bhndb_pci_attach()
389 &probe->hostb_core); in bhndb_pci_attach()
392 if (probe->cid.chip_type == BHND_CHIPTYPE_SIBA) { in bhndb_pci_attach()
404 if ((error = bhndb_pci_srsh_pi_war(sc, probe))) in bhndb_pci_attach()
438 cid = probe->cid; in bhndb_pci_attach()
439 erom_class = probe->erom_class; in bhndb_pci_attach()
440 hostb_core = probe->hostb_core; in bhndb_pci_attach()
442 error = bhndb_pci_probe_copy_core_table(probe, &cores, &ncores); in bhndb_pci_attach()
448 bhndb_pci_probe_free(probe); in bhndb_pci_attach()
449 probe = NULL; in bhndb_pci_attach()
479 if (probe != NULL) in bhndb_pci_attach()
480 bhndb_pci_probe_free(probe); in bhndb_pci_attach()
802 struct bhndb_pci_probe *probe) in bhndb_pci_srsh_pi_war() argument
817 md = bhnd_core_get_match_desc(&probe->hostb_core); in bhndb_pci_srsh_pi_war()
818 error = bhnd_erom_lookup_core_addr(probe->erom, &md, BHND_PORT_DEVICE, in bhndb_pci_srsh_pi_war()
828 val = bhndb_pci_probe_read(probe, pci_addr, srsh_offset, sizeof(val)); in bhndb_pci_srsh_pi_war()
838 bhndb_pci_probe_write(probe, pci_addr, srsh_offset, val, in bhndb_pci_srsh_pi_war()
1284 bhndb_pci_probe_alloc(struct bhndb_pci_probe **probe, device_t dev, in bhndb_pci_probe_alloc() argument
1371 *probe = p; in bhndb_pci_probe_alloc()
1404 bhndb_pci_probe_free(struct bhndb_pci_probe *probe) in bhndb_pci_probe_free() argument
1406 bhnd_erom_free_core_table(probe->erom, probe->cores); in bhndb_pci_probe_free()
1407 bhnd_erom_free(probe->erom); in bhndb_pci_probe_free()
1408 bhndb_release_host_resources(probe->hr); in bhndb_pci_probe_free()
1409 free(probe, M_BHND); in bhndb_pci_probe_free()
1427 bhndb_pci_probe_copy_core_table(struct bhndb_pci_probe *probe, in bhndb_pci_probe_copy_core_table() argument
1430 size_t len = sizeof(**cores) * probe->ncores; in bhndb_pci_probe_copy_core_table()
1433 memcpy(*cores, probe->cores, len); in bhndb_pci_probe_copy_core_table()
1435 *ncores = probe->ncores; in bhndb_pci_probe_copy_core_table()
1456 bhndb_pci_probe_has_mapping(struct bhndb_pci_probe *probe, bhnd_addr_t addr, in bhndb_pci_probe_has_mapping() argument
1459 if (!probe->m_valid) in bhndb_pci_probe_has_mapping()
1462 KASSERT(probe->m_win != NULL, ("missing register window")); in bhndb_pci_probe_has_mapping()
1463 KASSERT(probe->m_res != NULL, ("missing regwin resource")); in bhndb_pci_probe_has_mapping()
1464 KASSERT(probe->m_win->win_type == BHNDB_REGWIN_T_DYN, in bhndb_pci_probe_has_mapping()
1465 ("unexpected window type %d", probe->m_win->win_type)); in bhndb_pci_probe_has_mapping()
1467 if (addr < probe->m_target) in bhndb_pci_probe_has_mapping()
1470 if (addr >= probe->m_target + probe->m_win->win_size) in bhndb_pci_probe_has_mapping()
1473 if ((probe->m_target + probe->m_win->win_size) - addr < size) in bhndb_pci_probe_has_mapping()
1496 bhndb_pci_probe_map(struct bhndb_pci_probe *probe, bhnd_addr_t addr, in bhndb_pci_probe_map() argument
1507 device_printf(probe->dev, "invalid offset %#jx+%#jx\n", addr, in bhndb_pci_probe_map()
1515 if (bhndb_pci_probe_has_mapping(probe, addr, size)) { in bhndb_pci_probe_map()
1516 *res = probe->m_res; in bhndb_pci_probe_map()
1517 *res_offset = (addr - probe->m_target) + in bhndb_pci_probe_map()
1518 probe->m_win->win_offset; in bhndb_pci_probe_map()
1524 regwin_table = probe->hr->cfg->register_windows; in bhndb_pci_probe_map()
1528 device_printf(probe->dev, "unable to map %#jx+%#jx; no " in bhndb_pci_probe_map()
1535 regwin_res = bhndb_host_resource_for_regwin(probe->hr, regwin); in bhndb_pci_probe_map()
1537 device_printf(probe->dev, "unable to map %#jx+%#jx; no " in bhndb_pci_probe_map()
1546 error = bhndb_pci_compat_setregwin(probe->dev, probe->pci_dev, in bhndb_pci_probe_map()
1549 device_printf(probe->dev, "failed to configure dynamic " in bhndb_pci_probe_map()
1555 probe->m_win = regwin; in bhndb_pci_probe_map()
1556 probe->m_res = regwin_res; in bhndb_pci_probe_map()
1557 probe->m_addr = addr; in bhndb_pci_probe_map()
1558 probe->m_size = size; in bhndb_pci_probe_map()
1559 probe->m_target = target; in bhndb_pci_probe_map()
1560 probe->m_valid = true; in bhndb_pci_probe_map()
1583 bhndb_pci_probe_write(struct bhndb_pci_probe *probe, bhnd_addr_t addr, in bhndb_pci_probe_write() argument
1591 error = bhndb_pci_probe_map(probe, addr, offset, width, &r, in bhndb_pci_probe_write()
1594 device_printf(probe->dev, "error mapping %#jx+%#jx for " in bhndb_pci_probe_write()
1626 bhndb_pci_probe_read(struct bhndb_pci_probe *probe, bhnd_addr_t addr, in bhndb_pci_probe_read() argument
1634 error = bhndb_pci_probe_map(probe, addr, offset, width, &r, in bhndb_pci_probe_read()
1637 device_printf(probe->dev, "error mapping %#jx+%#jx for " in bhndb_pci_probe_read()
1664 bhndb_pci_eio_init(struct bhndb_pci_eio *pio, struct bhndb_pci_probe *probe) in bhndb_pci_eio_init() argument
1676 pio->probe = probe; in bhndb_pci_eio_init()
1730 return (bhndb_pci_probe_read(pio->probe, pio->addr, offset, width)); in bhndb_pci_eio_read()