MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / only_one_child

Function only_one_child

components/drivers/pci/probe.c:609–633  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

607}
608
609rt_inline rt_bool_t only_one_child(struct rt_pci_bus *bus)
610{
611 struct rt_pci_device *pdev;
612
613 if (rt_pci_is_root_bus(bus))
614 {
615 return RT_FALSE;
616 }
617
618 pdev = bus->self;
619
620 if (rt_pci_is_pcie(pdev))
621 {
622 rt_uint16_t exp_type = pdev->exp_flags & PCIEM_FLAGS_TYPE;
623
624 if (exp_type == PCIEM_TYPE_ROOT_PORT ||
625 exp_type == PCIEM_TYPE_DOWNSTREAM_PORT ||
626 exp_type == PCIEM_TYPE_PCIE_BRIDGE)
627 {
628 return RT_TRUE;
629 }
630 }
631
632 return RT_FALSE;
633}
634
635static int next_fn(struct rt_pci_bus *bus, struct rt_pci_device *pdev, int fn)
636{

Callers 1

rt_pci_scan_slotFunction · 0.85

Calls 2

rt_pci_is_root_busFunction · 0.85
rt_pci_is_pcieFunction · 0.85

Tested by

no test coverage detected