[1995] 2009-02-14 Christian Franke <[email protected]>

Christian Franke <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 1995
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=1995
Author:   chrfranke
Date:     2009-02-14 17:26:35 +0000 (Sat, 14 Feb 2009)

Log Message:
-----------
2009-02-14  Christian Franke  <[email protected]>

	* commands/lspci.c (grub_pci_classes): Add `SATA Controller'.
	(grub_lspci_iter): Print class code and programming interface byte.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/commands/lspci.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-02-14 16:02:12 UTC (rev 1994)
+++ trunk/grub2/ChangeLog	2009-02-14 17:26:35 UTC (rev 1995)
@@ -1,5 +1,10 @@
 2009-02-14  Christian Franke  <[email protected]>
 
+	* commands/lspci.c (grub_pci_classes): Add `SATA Controller'.
+	(grub_lspci_iter): Print class code and programming interface byte.
+
+2009-02-14  Christian Franke  <[email protected]>
+
 	* gendistlist.sh: Ignore `.svn' directories.
 
 2009-02-14  Felix Zielcke  <[email protected]>

Modified: trunk/grub2/commands/lspci.c
===================================================================
--- trunk/grub2/commands/lspci.c	2009-02-14 16:02:12 UTC (rev 1994)
+++ trunk/grub2/commands/lspci.c	2009-02-14 17:26:35 UTC (rev 1995)
@@ -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 @@
     { 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 @@
 	       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,8 +134,14 @@
   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;
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.