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

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

	* bus/usb/ohci.c (grub_ohci_pci_iter): Check that programming
	interface is OHCI.  Add grub_dprintf for symmetry with
	bus/usb/uhci.c.
	* bus/usb/uhci.c (grub_uhci_pci_iter): Check that programming
	interface is UHCI.  Add interf variable for programming
	interface.  Print interface with class/subclass.

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:10:27 UTC (rev 2278)
+++ trunk/grub2/ChangeLog	2009-06-08 20:20:13 UTC (rev 2279)
@@ -1,5 +1,12 @@
 2009-06-08  Oliver Henshaw <[email protected]>
 
+	* bus/usb/ohci.c (grub_ohci_pci_iter): Check that programming
+	interface is OHCI.  Add grub_dprintf for symmetry with
+	bus/usb/uhci.c.
+	* bus/usb/uhci.c (grub_uhci_pci_iter): Check that programming
+	interface is UHCI.  Add interf variable for programming
+	interface.  Print interface with class/subclass.
+
 	* bus/usb/ohci.c: Set interf with correct field.
 
 	* bus/usb/uhci.c: Remove unneeded doubled lines.

Modified: trunk/grub2/bus/usb/ohci.c
===================================================================
--- trunk/grub2/bus/usb/ohci.c	2009-06-08 20:10:27 UTC (rev 2278)
+++ trunk/grub2/bus/usb/ohci.c	2009-06-08 20:20:13 UTC (rev 2279)
@@ -133,7 +133,7 @@
   class >>= 24;
 
   /* If this is not an OHCI controller, just return.  */
-  if (class != 0x0c || subclass != 0x03)
+  if (class != 0x0c || subclass != 0x03 || interf != 0x10)
     return 0;
 
   /* Determine IO base address.  */
@@ -159,6 +159,9 @@
   /* Reserve memory for the HCCA.  */
   o->hcca = (struct grub_ohci_hcca *) grub_memalign (256, 256);
 
+  grub_dprintf ("ohci", "class=0x%02x 0x%02x interface 0x%02x base=%p\n",
+ 		class, subclass, interf, o->iobase);
+
   /* Check if the OHCI revision is actually 1.0 as supported.  */
   revision = grub_ohci_readreg32 (o, GRUB_OHCI_REG_REVISION);
   grub_dprintf ("ohci", "OHCI revision=0x%02x\n", revision & 0xFF);

Modified: trunk/grub2/bus/usb/uhci.c
===================================================================
--- trunk/grub2/bus/usb/uhci.c	2009-06-08 20:10:27 UTC (rev 2278)
+++ trunk/grub2/bus/usb/uhci.c	2009-06-08 20:20:13 UTC (rev 2279)
@@ -143,6 +143,7 @@
 {
   grub_uint32_t class;
   grub_uint32_t subclass;
+  grub_uint32_t interf;
   grub_uint32_t base;
   grub_uint32_t fp;
   grub_pci_address_t addr;
@@ -152,11 +153,12 @@
   addr = grub_pci_make_address (bus, device, func, 2);
   class = grub_pci_read (addr);
 
+  interf = (class >> 8) & 0xFF;
   subclass = (class >> 16) & 0xFF;
   class >>= 24;
 
   /* If this is not an UHCI controller, just return.  */
-  if (class != 0x0c || subclass != 0x03)
+  if (class != 0x0c || subclass != 0x03 || interf != 0x00)
     return 0;
 
   /* Determine IO base address.  */
@@ -177,8 +179,8 @@
   u->framelist = 0;
   u->qh = 0;
   u->td = 0;
-  grub_dprintf ("uhci", "class=0x%02x 0x%02x base=0x%x\n",
-		class, subclass, u->iobase);
+  grub_dprintf ("uhci", "class=0x%02x 0x%02x interface 0x%02x base=0x%x\n",
+		class, subclass, interf, u->iobase);
 
   /* Reserve a page for the frame list.  */
   u->framelist = grub_memalign (4096, 4096);
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.