[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/4] Define fields in terms of the Class Code register
From: |
oliver . henshaw |
Subject: |
[PATCH 4/4] Define fields in terms of the Class Code register |
Date: |
Mon, 08 Jun 2009 18:45:19 +0100 |
User-agent: |
quilt/0.47-1 |
Changelog:
* bus/usb/ohci.c: Define the Class, Subclass and Programming Interface
fields in
terms of the 3 byte Class Code register.
* bus/usb/uhci.c: Likewise.
---
bus/usb/ohci.c | 9 +++++----
bus/usb/uhci.c | 9 +++++----
2 files changed, 10 insertions(+), 8 deletions(-)
Index: grub2/bus/usb/ohci.c
===================================================================
--- grub2.orig/bus/usb/ohci.c
+++ grub2/bus/usb/ohci.c
@@ -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,
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: grub2/bus/usb/uhci.c
===================================================================
--- grub2.orig/bus/usb/uhci.c
+++ grub2/bus/usb/uhci.c
@@ -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 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)