Example #1
0
void pci_scan_func(pci_func_t f, int type, int bus, int slot, int func) {
	uint32_t dev = pci_box_device(bus, slot, func);
	if (type == -1 || type == pci_find_type(dev)) {
		pci_scan_hit(f, dev);
	}
	if (pci_find_type(dev) == PCI_TYPE_BRIDGE) {
		pci_scan_bus(f, type, pci_read_field(dev, PCI_SECONDARY_BUS, 1));
	}
}
Example #2
0
static void find_usb_device(uint32_t device, uint16_t vendorid, uint16_t deviceid, void * extra) {
	if (pci_find_type(device) == 0xc03) {
		int prog_if = (int)pci_read_field(device, PCI_PROG_IF, 1);
		if (prog_if == 0) {
			*((uint32_t *)extra)= device;
		}
	}
}