| 708 | } |
| 709 | |
| 710 | static unsigned |
| 711 | octopci_init_bus(device_t dev, unsigned b) |
| 712 | { |
| 713 | unsigned s, f; |
| 714 | uint8_t hdrtype; |
| 715 | unsigned secbus; |
| 716 | |
| 717 | secbus = b; |
| 718 | |
| 719 | for (s = 0; s <= PCI_SLOTMAX; s++) { |
| 720 | for (f = 0; f <= PCI_FUNCMAX; f++) { |
| 721 | hdrtype = octopci_read_config(dev, b, s, f, PCIR_HDRTYPE, 1); |
| 722 | |
| 723 | if (hdrtype == 0xff) { |
| 724 | if (f == 0) |
| 725 | break; /* Next slot. */ |
| 726 | continue; /* Next function. */ |
| 727 | } |
| 728 | |
| 729 | secbus = octopci_init_device(dev, b, s, f, secbus); |
| 730 | |
| 731 | if (f == 0 && (hdrtype & PCIM_MFDEV) == 0) |
| 732 | break; /* Next slot. */ |
| 733 | } |
| 734 | } |
| 735 | |
| 736 | return (secbus); |
| 737 | } |
| 738 | |
| 739 | static uint64_t |
| 740 | octopci_cs_addr(unsigned bus, unsigned slot, unsigned func, unsigned reg) |
no test coverage detected