MCPcopy Create free account
hub / github.com/F-Stack/f-stack / octopci_init_bus

Function octopci_init_bus

freebsd/mips/cavium/octopci.c:710–737  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

708}
709
710static unsigned
711octopci_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
739static uint64_t
740octopci_cs_addr(unsigned bus, unsigned slot, unsigned func, unsigned reg)

Callers 2

octopci_attachFunction · 0.85
octopci_init_deviceFunction · 0.85

Calls 2

octopci_read_configFunction · 0.85
octopci_init_deviceFunction · 0.85

Tested by

no test coverage detected