libpci initial stuff
This commit is contained in:
parent
bf7f7a18f4
commit
3affd0ece8
11 changed files with 147 additions and 37 deletions
|
@ -115,15 +115,16 @@ grub_pci_get_class (int class, int subclass)
|
|||
}
|
||||
|
||||
static int NESTED_FUNC_ATTR
|
||||
grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid)
|
||||
grub_lspci_iter (grub_pci_device_t dev, grub_pci_id_t pciid)
|
||||
{
|
||||
grub_uint32_t class;
|
||||
const char *sclass;
|
||||
grub_pci_address_t addr;
|
||||
|
||||
grub_printf ("%02x:%02x.%x %04x:%04x", bus, dev, func, pciid & 0xFFFF,
|
||||
pciid >> 16);
|
||||
addr = grub_pci_make_address (bus, dev, func, 2);
|
||||
grub_printf ("%02x:%02x.%x %04x:%04x", grub_pci_get_bus (dev),
|
||||
grub_pci_get_device (dev), grub_pci_get_function (dev),
|
||||
pciid & 0xFFFF, pciid >> 16);
|
||||
addr = grub_pci_make_address (dev, 2);
|
||||
class = grub_pci_read (addr);
|
||||
|
||||
/* Lookup the class name, if there isn't a specific one,
|
||||
|
@ -142,6 +143,8 @@ grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid)
|
|||
|
||||
grub_printf ("\n");
|
||||
|
||||
grub_pci_close (dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue