For PCIe devices of PCI Bridge type is Primary Bus Number not used and the
default value is 0. PCIe devices capture their Bus and Device numbers
automatically from PCIe TLP packets.
Instead of Primary Bus Number use Device Number because zero value confuse
tree building algorithm. Existing code already expects that Device Number
of PCI Bridge is already set to Primary Bus Number.
{
b = xmalloc(sizeof(struct bridge));
b->domain = dd->domain;
+ b->primary = dd->bus;
if (ht == PCI_HEADER_TYPE_BRIDGE)
{
- b->primary = get_conf_byte(d, PCI_PRIMARY_BUS);
b->secondary = get_conf_byte(d, PCI_SECONDARY_BUS);
b->subordinate = get_conf_byte(d, PCI_SUBORDINATE_BUS);
}
else
{
- b->primary = get_conf_byte(d, PCI_CB_PRIMARY_BUS);
b->secondary = get_conf_byte(d, PCI_CB_CARD_BUS);
b->subordinate = get_conf_byte(d, PCI_CB_SUBORDINATE_BUS);
}