2009-02-14 Christian Franke <franke@computer.org>

* commands/lspci.c (grub_pci_classes): Add `SATA Controller'.
	(grub_lspci_iter): Print class code and programming interface byte.
This commit is contained in:
chrfranke 2009-02-14 17:26:35 +00:00
parent 6aa1169b6d
commit 353976ac0e
2 changed files with 15 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2009-02-14 Christian Franke <franke@computer.org>
* commands/lspci.c (grub_pci_classes): Add `SATA Controller'.
(grub_lspci_iter): Print class code and programming interface byte.
2009-02-14 Christian Franke <franke@computer.org>
* gendistlist.sh: Ignore `.svn' directories.

View File

@ -1,7 +1,7 @@
/* lspci.c - List PCI devices. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2008 Free Software Foundation, Inc.
* Copyright (C) 2008, 2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -37,6 +37,7 @@ static const struct grub_pci_classname grub_pci_classes[] =
{ 1, 2, "Floppy Controller" },
{ 1, 3, "IPI Controller" },
{ 1, 4, "RAID Controller" },
{ 1, 6, "SATA Controller" },
{ 1, 0x80, "Mass storage Controller" },
{ 2, 0, "Ethernet Controller" },
{ 2, 1, "Token Ring Controller" },
@ -124,7 +125,7 @@ grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid)
pciid >> 16);
addr = grub_pci_make_address (bus, dev, func, 2);
class = grub_pci_read (addr);
/* Lookup the class name, if there isn't a specific one,
retry with 0x80 to get the generic class name. */
sclass = grub_pci_get_class (class >> 24, (class >> 16) & 0xFF);
@ -133,7 +134,13 @@ grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid)
if (! sclass)
sclass = "";
grub_printf (" %s\n", sclass);
grub_printf (" [%04x] %s", (class >> 16) & 0xffff, sclass);
grub_uint8_t pi = (class >> 8) & 0xff;
if (pi)
grub_printf (" [PI %02x]", pi);
grub_printf ("\n");
return 0;
}