]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-06-08 Oliver Henshaw <oliver.henshaw@gmail.com>
authorproski <proski@localhost>
Mon, 8 Jun 2009 20:23:09 +0000 (20:23 +0000)
committerproski <proski@localhost>
Mon, 8 Jun 2009 20:23:09 +0000 (20:23 +0000)
* 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.

ChangeLog
bus/usb/ohci.c
bus/usb/uhci.c

index 8ddd746bdda2b657330e6cde3c6c23c689b672ac..4f0fbb5872a931de3577f56acb0bb3d115fdd761 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-06-08  Oliver Henshaw <oliver.henshaw@gmail.com>
 
+       * 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.
index 146862bdeef6d201354bcceda1d513cbf8283786..ce7ea6efd8a729be0a0e39b4d67fc53e1a16da43 100644 (file)
@@ -116,6 +116,7 @@ static int NESTED_FUNC_ATTR
 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_ohci_pci_iter (int bus, int device, int func,
   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)
index f59d26b43fb462b1daaa02bdab7e77ea5cdddba7..a0836f805e7e601ab69a65d61f3d8f3ceda7762a 100644 (file)
@@ -141,6 +141,7 @@ static int NESTED_FUNC_ATTR
 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 @@ grub_uhci_pci_iter (int bus, int device, int func,
   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)