From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MDiv3-00012n-H1 for mharc-grub-devel@gnu.org; Mon, 08 Jun 2009 13:46:01 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MDiv0-0000zn-52 for grub-devel@gnu.org; Mon, 08 Jun 2009 13:45:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MDiuu-0000um-1n for grub-devel@gnu.org; Mon, 08 Jun 2009 13:45:55 -0400 Received: from [199.232.76.173] (port=49903 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MDiut-0000ua-53 for grub-devel@gnu.org; Mon, 08 Jun 2009 13:45:51 -0400 Received: from mail-ew0-f163.google.com ([209.85.219.163]:64751) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MDius-0005PH-JG for grub-devel@gnu.org; Mon, 08 Jun 2009 13:45:50 -0400 Received: by ewy7 with SMTP id 7so6984ewy.18 for ; Mon, 08 Jun 2009 10:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:user-agent:date :from:to:subject:references:content-disposition; bh=xPDVdudBW07OY0tBX0r2FfeAjscViH3ajhVvablJ1vo=; b=UacxWeQ7a5xRLCo+lbZMvTfXRWyvcohH2kedrEAA7jMIaPcEcxY9YFWuNq6F1kA5DQ u5tB/q9ff2kp3jGFCTG0V4ETEA5U/wA5C62QVaDqd/ZL/hw5/01i5WiJvBQF+j+fZCXg E7Qa1i9QndRU17apjQKYaT54HMUJHD1zBeraw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:user-agent:date:from:to:subject:references :content-disposition; b=WzkdjdGTYYkqSQVpnmpoX8mVJ3nKmI/SRNwcSE2t21TeahwuBDOi7bdifktovpOdCz QuoWKAxKBIbZYLq9gnmN65UlEKVC18b1ENXNrBmQ+SsWo89LEAz6hAsanY9VWjf5rQC/ L349oA/yqXpLWrHbNtZr/2xst/dDol+U/5G/8= Received: by 10.210.136.15 with SMTP id j15mr1559826ebd.48.1244483149774; Mon, 08 Jun 2009 10:45:49 -0700 (PDT) Received: from localhost (host86-171-7-124.range86-171.btcentralplus.com [86.171.7.124]) by mx.google.com with ESMTPS id 5sm267454eyf.28.2009.06.08.10.45.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 08 Jun 2009 10:45:49 -0700 (PDT) Message-Id: <20090608174546.741998458@gmail.com> User-Agent: quilt/0.47-1 Date: Mon, 08 Jun 2009 18:45:19 +0100 From: oliver.henshaw@gmail.com To: grub-devel@gnu.org References: <6d6c12960906071127l4f73e145s38b8f0937eef8f40@mail.gmail.com> <20090608174515.881183682@gmail.com> Content-Disposition: inline; filename=usb-change-to-class_code X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [PATCH 4/4] Define fields in terms of the Class Code register X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Jun 2009 17:45:59 -0000 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)