Let us keep the bus scan light-weight. Whoever is interested
in device IDs, still has to call pci_fill_info(PCI_FILL_IDENT),
which handles this in generic way.
DIR *dir;
struct dirent *entry;
char path[NAME_MAX];
- uint32_t vd;
- uint8_t ht;
struct pci_dev *d;
dir = opendir(parent);
d->bus = bus;
d->dev = dev;
d->func = func;
-
pci_link_dev(a, d);
-
- vd = pci_read_long(d, PCI_VENDOR_ID);
- ht = pci_read_byte(d, PCI_HEADER_TYPE);
-
- d->vendor_id = vd & 0xffff;
- d->device_id = vd >> 16U;
- d->known_fields = PCI_FILL_IDENT;
- d->hdrtype = ht;
}
}