]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-02-14 Christian Franke <franke@computer.org>
authorchrfranke <chrfranke@localhost>
Sat, 14 Feb 2009 17:26:35 +0000 (17:26 +0000)
committerchrfranke <chrfranke@localhost>
Sat, 14 Feb 2009 17:26:35 +0000 (17:26 +0000)
* commands/lspci.c (grub_pci_classes): Add `SATA Controller'.
(grub_lspci_iter): Print class code and programming interface byte.

ChangeLog
commands/lspci.c

index 893b6469522816c2f6c483acacba285b887e2439..90d9dfee68102e420d6b3a37b1d68666656b6616 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index 0f52cf5dfdce9aaff26ae2f31d3a104a57aee695..979180056ee26f9ce8e8d12b6b84352bb35c5149 100644 (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;
 }