-#else
-
-/**
- * pci_header_show_brief() - Show the short-form PCI device header
- *
- * Reads and prints the header of the specified PCI device in short form.
- *
- * @dev: Bus+Device+Function number
- */
-void pci_header_show_brief(pci_dev_t dev)
-{
- u16 vendor, device;
- u8 class, subclass;
-
- pci_read_config_word(dev, PCI_VENDOR_ID, &vendor);
- pci_read_config_word(dev, PCI_DEVICE_ID, &device);
- pci_read_config_byte(dev, PCI_CLASS_CODE, &class);
- pci_read_config_byte(dev, PCI_CLASS_SUB_CODE, &subclass);
-
- printf("0x%.4x 0x%.4x %-23s 0x%.2x\n",
- vendor, device,
- pci_class_str(class), subclass);
-}
-
-/**
- * pciinfo() - Show a list of devices on the PCI bus
- *
- * Show information about devices on PCI bus. Depending on @short_pci_listing
- * the output will be more or less exhaustive.
- *
- * @bus_num: The number of the bus to be scanned
- * @short_pci_listing: true to use short form, showing only a brief header
- * for each device
- */
-void pciinfo(int bus_num, int short_pci_listing)
-{
- struct pci_controller *hose = pci_bus_to_hose(bus_num);
- int device;
- int function;
- unsigned char header_type;
- unsigned short vendor_id;
- pci_dev_t dev;
- int ret;
-
- if (!hose)
- return;
-
- pciinfo_header(bus_num, short_pci_listing);
-
- for (device = 0; device < PCI_MAX_PCI_DEVICES; device++) {
- header_type = 0;
- vendor_id = 0;
- for (function = 0; function < PCI_MAX_PCI_FUNCTIONS;
- function++) {
- /*
- * If this is not a multi-function device, we skip
- * the rest.
- */
- if (function && !(header_type & 0x80))
- break;
-
- dev = PCI_BDF(bus_num, device, function);
-
- if (pci_skip_dev(hose, dev))
- continue;
-
- ret = pci_read_config_word(dev, PCI_VENDOR_ID,
- &vendor_id);
- if (ret)
- goto error;
- if ((vendor_id == 0xFFFF) || (vendor_id == 0x0000))
- continue;
-
- if (!function) {
- pci_read_config_byte(dev, PCI_HEADER_TYPE,
- &header_type);
- }
-
- if (short_pci_listing) {
- printf("%02x.%02x.%02x ", bus_num, device,
- function);
- pci_header_show_brief(dev);
- } else {
- printf("\nFound PCI device %02x.%02x.%02x:\n",
- bus_num, device, function);
- pci_header_show(dev);
- }
- }
- }
-
- return;
-error:
- printf("Cannot read bus configuration: %d\n", ret);
-}
-#endif
-