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.
This commit is contained in:
parent
fa5db0b120
commit
d55842d81e
|
@ -1,5 +1,10 @@
|
||||||
2009-06-08 Oliver Henshaw <oliver.henshaw@gmail.com>
|
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
|
* bus/usb/ohci.c (grub_ohci_pci_iter): Check that programming
|
||||||
interface is OHCI. Add grub_dprintf for symmetry with
|
interface is OHCI. Add grub_dprintf for symmetry with
|
||||||
bus/usb/uhci.c.
|
bus/usb/uhci.c.
|
||||||
|
|
|
@ -116,6 +116,7 @@ static int NESTED_FUNC_ATTR
|
||||||
grub_ohci_pci_iter (int bus, int device, int func,
|
grub_ohci_pci_iter (int bus, int device, int func,
|
||||||
grub_pci_id_t pciid __attribute__((unused)))
|
grub_pci_id_t pciid __attribute__((unused)))
|
||||||
{
|
{
|
||||||
|
grub_uint32_t class_code;
|
||||||
grub_uint32_t class;
|
grub_uint32_t class;
|
||||||
grub_uint32_t subclass;
|
grub_uint32_t subclass;
|
||||||
grub_uint32_t interf;
|
grub_uint32_t interf;
|
||||||
|
@ -126,11 +127,11 @@ grub_ohci_pci_iter (int bus, int device, int func,
|
||||||
grub_uint32_t frame_interval;
|
grub_uint32_t frame_interval;
|
||||||
|
|
||||||
addr = grub_pci_make_address (bus, device, func, 2);
|
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;
|
interf = class_code & 0xFF;
|
||||||
subclass = (class >> 16) & 0xFF;
|
subclass = (class_code >> 8) & 0xFF;
|
||||||
class >>= 24;
|
class = class_code >> 16;
|
||||||
|
|
||||||
/* If this is not an OHCI controller, just return. */
|
/* If this is not an OHCI controller, just return. */
|
||||||
if (class != 0x0c || subclass != 0x03 || interf != 0x10)
|
if (class != 0x0c || subclass != 0x03 || interf != 0x10)
|
||||||
|
|
|
@ -141,6 +141,7 @@ static int NESTED_FUNC_ATTR
|
||||||
grub_uhci_pci_iter (int bus, int device, int func,
|
grub_uhci_pci_iter (int bus, int device, int func,
|
||||||
grub_pci_id_t pciid __attribute__((unused)))
|
grub_pci_id_t pciid __attribute__((unused)))
|
||||||
{
|
{
|
||||||
|
grub_uint32_t class_code;
|
||||||
grub_uint32_t class;
|
grub_uint32_t class;
|
||||||
grub_uint32_t subclass;
|
grub_uint32_t subclass;
|
||||||
grub_uint32_t interf;
|
grub_uint32_t interf;
|
||||||
|
@ -151,11 +152,11 @@ grub_uhci_pci_iter (int bus, int device, int func,
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
addr = grub_pci_make_address (bus, device, func, 2);
|
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;
|
interf = class_code & 0xFF;
|
||||||
subclass = (class >> 16) & 0xFF;
|
subclass = (class_code >> 8) & 0xFF;
|
||||||
class >>= 24;
|
class = class_code >> 16;
|
||||||
|
|
||||||
/* If this is not an UHCI controller, just return. */
|
/* If this is not an UHCI controller, just return. */
|
||||||
if (class != 0x0c || subclass != 0x03 || interf != 0x00)
|
if (class != 0x0c || subclass != 0x03 || interf != 0x00)
|
||||||
|
|
Loading…
Reference in New Issue