Bit 7 of the pci device header type is an indicator of multi-function
devices, so needs to be masked when examining the bridge type.
Thanks go to Chih-Pin Wu for finding the bug and its fix.
https://bugs.launchpad.net/ubuntu/+source/libpciaccess/+bug/681207
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Bryce Harrington <bryce@canonical.com>
case 0x04:
if (priv->bridge.pci == NULL)
read_bridge_info(priv);
- if (priv->header_type == 0x01) {
+ if ((priv->header_type & 0x7f) == 0x01) {
*primary_bus = priv->bridge.pci->primary_bus;
*secondary_bus = priv->bridge.pci->secondary_bus;
*subordinate_bus = priv->bridge.pci->subordinate_bus;
case 0x07:
if (priv->bridge.pcmcia == NULL)
read_bridge_info(priv);
- if (priv->header_type == 0x02) {
+ if ((priv->header_type & 0x7f) == 0x02) {
*primary_bus = priv->bridge.pcmcia->primary_bus;
*secondary_bus = priv->bridge.pcmcia->card_bus;
*subordinate_bus = priv->bridge.pcmcia->subordinate_bus;