From 37623a5c029e5415fe24b86bf4f6481f8fdfad94 Mon Sep 17 00:00:00 2001 From: li-elvin Date: Tue, 30 Oct 2012 04:23:40 +0000 Subject: Add missing status code in several modules. Signed-off-by: Li Elvin Reviewed-by: Yao Jiewen Reviewed-by: Ni Ruiyu Reviewed-by: Gao Liming Reviewed-by: Tian Feng Reviewed-by: Fan Jeff git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13890 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c | 37 +++++++++++++++++++++++++++----- MdeModulePkg/Bus/Pci/UhciDxe/Uhci.h | 4 +++- MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf | 3 ++- 3 files changed, 37 insertions(+), 7 deletions(-) (limited to 'MdeModulePkg/Bus/Pci/UhciDxe') diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c b/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c index a1b0cbd121..f41c712259 100644 --- a/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c +++ b/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c @@ -2,7 +2,7 @@ The UHCI driver model and HC protocol routines. -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 @@ -53,7 +53,18 @@ Uhci2Reset ( return EFI_UNSUPPORTED; } - Uhc = UHC_FROM_USB2_HC_PROTO (This); + Uhc = UHC_FROM_USB2_HC_PROTO (This); + + if (Uhc->DevicePath != NULL) { + // + // Report Status Code to indicate reset happens + // + REPORT_STATUS_CODE_WITH_DEVICE_PATH ( + EFI_PROGRESS_CODE, + (EFI_IO_BUS_USB | EFI_IOB_PC_RESET), + Uhc->DevicePath + ); + } OldTpl = gBS->RaiseTPL (UHCI_TPL); @@ -1425,8 +1436,9 @@ ON_EXIT: **/ USB_HC_DEV * UhciAllocateDev ( - IN EFI_PCI_IO_PROTOCOL *PciIo, - IN UINT64 OriginalPciAttributes + IN EFI_PCI_IO_PROTOCOL *PciIo, + IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, + IN UINT64 OriginalPciAttributes ) { USB_HC_DEV *Uhc; @@ -1460,6 +1472,7 @@ UhciAllocateDev ( Uhc->Usb2Hc.MinorRevision = 0x1; Uhc->PciIo = PciIo; + Uhc->DevicePath = DevicePath; Uhc->OriginalPciAttributes = OriginalPciAttributes; Uhc->MemPool = UsbHcInitMemPool (PciIo, TRUE, 0); @@ -1622,6 +1635,7 @@ UhciDriverBindingStart ( UINT64 Supports; UINT64 OriginalPciAttributes; BOOLEAN PciAttributesSaved; + EFI_DEVICE_PATH_PROTOCOL *HcDevicePath; // // Open PCIIO, then enable the EHC device and turn off emulation @@ -1640,6 +1654,19 @@ UhciDriverBindingStart ( return Status; } + // + // Open Device Path Protocol for on USB host controller + // + HcDevicePath = NULL; + Status = gBS->OpenProtocol ( + Controller, + &gEfiDevicePathProtocolGuid, + (VOID **) &HcDevicePath, + This->DriverBindingHandle, + Controller, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + PciAttributesSaved = FALSE; // // Save original PCI attributes @@ -1684,7 +1711,7 @@ UhciDriverBindingStart ( goto CLOSE_PCIIO; } - Uhc = UhciAllocateDev (PciIo, OriginalPciAttributes); + Uhc = UhciAllocateDev (PciIo, HcDevicePath, OriginalPciAttributes); if (Uhc == NULL) { Status = EFI_OUT_OF_RESOURCES; diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.h b/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.h index 71b7a531a1..64ee600965 100644 --- a/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.h +++ b/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.h @@ -2,7 +2,7 @@ The definition for UHCI driver model and HC protocol routines. -Copyright (c) 2004 - 2010, 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 @@ -33,6 +33,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include #include @@ -112,6 +113,7 @@ struct _USB_HC_DEV { UINT32 Signature; EFI_USB2_HC_PROTOCOL Usb2Hc; EFI_PCI_IO_PROTOCOL *PciIo; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; UINT64 OriginalPciAttributes; // diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf b/MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf index a9299ad50e..ca813faf26 100644 --- a/MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf +++ b/MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf @@ -6,7 +6,7 @@ # It implements the interfaces of monitoring the status of all ports and transferring # Control, Bulk, Interrupt and Isochronous requests to Usb1.x device # -# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 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 @@ -71,6 +71,7 @@ BaseMemoryLib DebugLib PcdLib + ReportStatusCodeLib [Guids] gEfiEventExitBootServicesGuid ## PRODUCES ## Event -- cgit v1.2.3