From 16d718a55b65b1f51d450226879c48f709e5a791 Mon Sep 17 00:00:00 2001 From: erictian Date: Wed, 7 Mar 2012 08:39:35 +0000 Subject: =?UTF-8?q?MdeModulePkg:=20add=20support=20for=20ORICO=20PEUS3-2P?= =?UTF-8?q?=20card=201)=20Fix=20a=20bug=20on=20missing=20hub=20context=20e?= =?UTF-8?q?valuation=20operation.=202)=20If=20the=20usb=20keyboard=20devic?= =?UTF-8?q?e=20configuration=20has=20been=20set=20successfully,=20then=20d?= =?UTF-8?q?on=E2=80=99t=20set=20configuration=20again.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: erictian Reviewed-by: li-elvin git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13087 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c | 25 ++++++------- MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c | 41 +++++++++++----------- .../Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c | 9 ++--- 3 files changed, 34 insertions(+), 41 deletions(-) (limited to 'MdeModulePkg/Bus/Usb') diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c index b7141a0..8d031b9 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c @@ -2,7 +2,7 @@ Usb bus enumeration support. -Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -698,26 +698,23 @@ UsbEnumerateNewDev ( DEBUG (( EFI_D_INFO, "UsbEnumerateNewDev: device is of %d speed\n", Child->Speed)); - if (Child->Speed != EFI_USB_SPEED_HIGH) { + if (((Child->Speed == EFI_USB_SPEED_LOW) || (Child->Speed == EFI_USB_SPEED_FULL)) && + (Parent->Speed == EFI_USB_SPEED_HIGH)) { // - // If the child isn't a high speed device, it is necessary to + // If the child is a low or full speed device, it is necessary to // set the transaction translator. Port TT is 1-based. // This is quite simple: // 1. if parent is of high speed, then parent is our translator // 2. otherwise use parent's translator. // - if (Parent->Speed == EFI_USB_SPEED_HIGH) { - Child->Translator.TranslatorHubAddress = Parent->Address; - Child->Translator.TranslatorPortNumber = (UINT8) (Port + 1); - - } else { - Child->Translator = Parent->Translator; - } - - DEBUG (( EFI_D_INFO, "UsbEnumerateNewDev: device uses translator (%d, %d)\n", - Child->Translator.TranslatorHubAddress, - Child->Translator.TranslatorPortNumber)); + Child->Translator.TranslatorHubAddress = Parent->Address; + Child->Translator.TranslatorPortNumber = (UINT8) (Port + 1); + } else { + Child->Translator = Parent->Translator; } + DEBUG (( EFI_D_INFO, "UsbEnumerateNewDev: device uses translator (%d, %d)\n", + Child->Translator.TranslatorHubAddress, + Child->Translator.TranslatorPortNumber)); // // After port is reset, hub establishes a signal path between diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c index 09f1b04..ee774ff 100644 --- a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c +++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c @@ -1,7 +1,7 @@ /** @file Helper functions for USB Keyboard Driver. -Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -833,29 +833,28 @@ InitUSBKeyboard ( ); if (EFI_ERROR (Status)) { ConfigValue = 0x01; - } - - // - // Uses default configuration to configure the USB Keyboard device. - // - Status = UsbSetConfiguration ( - UsbKeyboardDevice->UsbIo, - ConfigValue, - &TransferResult - ); - if (EFI_ERROR (Status)) { // - // If configuration could not be set here, it means - // the keyboard interface has some errors and could - // not be initialized + // Uses default configuration to configure the USB Keyboard device. // - REPORT_STATUS_CODE_WITH_DEVICE_PATH ( - EFI_ERROR_CODE | EFI_ERROR_MINOR, - (EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_INTERFACE_ERROR), - UsbKeyboardDevice->DevicePath - ); + Status = UsbSetConfiguration ( + UsbKeyboardDevice->UsbIo, + ConfigValue, + &TransferResult + ); + if (EFI_ERROR (Status)) { + // + // If configuration could not be set here, it means + // the keyboard interface has some errors and could + // not be initialized + // + REPORT_STATUS_CODE_WITH_DEVICE_PATH ( + EFI_ERROR_CODE | EFI_ERROR_MINOR, + (EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_INTERFACE_ERROR), + UsbKeyboardDevice->DevicePath + ); - return EFI_DEVICE_ERROR; + return EFI_DEVICE_ERROR; + } } UsbGetProtocolRequest ( diff --git a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c index e3ff281..4633015 100644 --- a/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c +++ b/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c @@ -2,7 +2,7 @@ Implementation of the command set of USB Mass Storage Specification for Bootability, Revision 1.0. -Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -451,9 +451,6 @@ UsbBootReadCapacity ( Media->BlockSize = BlockSize; } - DEBUG ((EFI_D_INFO, "UsbBootReadCapacity Success LBA=%ld BlockSize=%d\n", - Media->LastBlock, Media->BlockSize)); - return Status; } @@ -734,7 +731,7 @@ UsbBootReadBlocks ( if (EFI_ERROR (Status)) { return Status; } - + DEBUG ((EFI_D_BLKIO, "UsbBootReadBlocks: LBA (0x%x), Blk (0x%x)\n", Lba, TotalBlock)); Lba += Count; Buffer += Count * BlockSize; TotalBlock -= Count; @@ -810,7 +807,7 @@ UsbBootWriteBlocks ( if (EFI_ERROR (Status)) { return Status; } - + DEBUG ((EFI_D_BLKIO, "UsbBootWriteBlocks: LBA (0x%x), Blk (0x%x)\n", Lba, TotalBlock)); Lba += Count; Buffer += Count * BlockSize; TotalBlock -= Count; -- cgit v1.1