| 626 | } |
| 627 | |
| 628 | void |
| 629 | dmar_dev_path(device_t child, int *busno, void *path1, int depth) |
| 630 | { |
| 631 | devclass_t pci_class; |
| 632 | device_t bus, pcib; |
| 633 | ACPI_DMAR_PCI_PATH *path; |
| 634 | |
| 635 | pci_class = devclass_find("pci"); |
| 636 | path = path1; |
| 637 | for (depth--; depth != -1; depth--) { |
| 638 | path[depth].Device = pci_get_slot(child); |
| 639 | path[depth].Function = pci_get_function(child); |
| 640 | bus = device_get_parent(child); |
| 641 | pcib = device_get_parent(bus); |
| 642 | if (device_get_devclass(device_get_parent(pcib)) != |
| 643 | pci_class) { |
| 644 | /* reached a host bridge */ |
| 645 | *busno = pcib_get_bus(bus); |
| 646 | return; |
| 647 | } |
| 648 | child = pcib; |
| 649 | } |
| 650 | panic("wrong depth"); |
| 651 | } |
| 652 | |
| 653 | static int |
| 654 | dmar_match_pathes(int busno1, const ACPI_DMAR_PCI_PATH *path1, int depth1, |
no test coverage detected