[2280] 2009-06-08 Oliver Henshaw <[email protected]>

Pavel Roskin <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2280
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2280
Author:   proski
Date:     2009-06-08 20:23:09 +0000 (Mon, 08 Jun 2009)
Log Message:
-----------
2009-06-08  Oliver Henshaw <[email protected]>

	* bus/usb/ohci.c (grub_ohci_pci_iter): Define the Class,
	Subclass and Programming Interface fields in terms of the 3 byte
	Class Code register.
	* bus/usb/uhci.c (grub_uhci_pci_iter): Likewise.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/bus/usb/ohci.c
    trunk/grub2/bus/usb/uhci.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-06-08 20:20:13 UTC (rev 2279)
+++ trunk/grub2/ChangeLog	2009-06-08 20:23:09 UTC (rev 2280)
@@ -1,5 +1,10 @@
 2009-06-08  Oliver Henshaw <[email protected]>
 
+	* bus/usb/ohci.c (grub_ohci_pci_iter): Define the Class,
+	Subclass and Programming Interface fields in terms of the 3 byte
+	Class Code register.
+	* bus/usb/uhci.c (grub_uhci_pci_iter): Likewise.
+
 	* bus/usb/ohci.c (grub_ohci_pci_iter): Check that programming
 	interface is OHCI.  Add grub_dprintf for symmetry with
 	bus/usb/uhci.c.

Modified: trunk/grub2/bus/usb/ohci.c
===================================================================
--- trunk/grub2/bus/usb/ohci.c	2009-06-08 20:20:13 UTC (rev 2279)
+++ trunk/grub2/bus/usb/ohci.c	2009-06-08 20:23:09 UTC (rev 2280)
@@ -116,6 +116,7 @@
 grub_ohci_pci_iter (int bus, int device, int func,
 		    grub_pci_id_t pciid __attribute__((unused)))
 {
+  grub_uint32_t class_code;
   grub_uint32_t class;
   grub_uint32_t subclass;
   grub_uint32_t interf;
@@ -126,11 +127,11 @@
   grub_uint32_t frame_interval;
 
   addr = grub_pci_make_address (bus, device, func, 2);
-  class = grub_pci_read (addr);
+  class_code = grub_pci_read (addr) >> 8;
 
-  interf = (class >> 8) & 0xFF;
-  subclass = (class >> 16) & 0xFF;
-  class >>= 24;
+  interf = class_code & 0xFF;
+  subclass = (class_code >> 8) & 0xFF;
+  class = class_code >> 16;
 
   /* If this is not an OHCI controller, just return.  */
   if (class != 0x0c || subclass != 0x03 || interf != 0x10)

Modified: trunk/grub2/bus/usb/uhci.c
===================================================================
--- trunk/grub2/bus/usb/uhci.c	2009-06-08 20:20:13 UTC (rev 2279)
+++ trunk/grub2/bus/usb/uhci.c	2009-06-08 20:23:09 UTC (rev 2280)
@@ -141,6 +141,7 @@
 grub_uhci_pci_iter (int bus, int device, int func,
 		    grub_pci_id_t pciid __attribute__((unused)))
 {
+  grub_uint32_t class_code;
   grub_uint32_t class;
   grub_uint32_t subclass;
   grub_uint32_t interf;
@@ -151,11 +152,11 @@
   int i;
 
   addr = grub_pci_make_address (bus, device, func, 2);
-  class = grub_pci_read (addr);
+  class_code = grub_pci_read (addr) >> 8;
 
-  interf = (class >> 8) & 0xFF;
-  subclass = (class >> 16) & 0xFF;
-  class >>= 24;
+  interf = class_code & 0xFF;
+  subclass = (class_code >> 8) & 0xFF;
+  class = class_code >> 16;
 
   /* If this is not an UHCI controller, just return.  */
   if (class != 0x0c || subclass != 0x03 || interf != 0x00)
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.