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/Scsi/ScsiBusDxe/ScsiBus.c | 49 ++++++++++++++++++++++++- MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.h | 43 +++++++++++----------- MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf | 3 +- 3 files changed, 71 insertions(+), 24 deletions(-) (limited to 'MdeModulePkg/Bus/Scsi') diff --git a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c index 7387a44dbe..a0833cfaf4 100644 --- a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c +++ b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c @@ -2,7 +2,7 @@ SCSI Bus driver that layers on every SCSI Pass Thru and Extended SCSI Pass Thru protocol in the system. -Copyright (c) 2006 - 2011, 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 which accompanies this distribution. The full text of the license may be found at @@ -341,6 +341,15 @@ SCSIBusDriverBindingStart ( return DevicePathStatus; } + // + // Report Status Code to indicate SCSI bus starts + // + REPORT_STATUS_CODE_WITH_DEVICE_PATH ( + EFI_PROGRESS_CODE, + (EFI_IO_BUS_SCSI | EFI_IOB_PC_INIT), + ParentDevicePath + ); + // // To keep backward compatibility, UEFI ExtPassThru Protocol is supported as well as // EFI PassThru Protocol. From priority perspective, ExtPassThru Protocol is firstly @@ -451,6 +460,15 @@ SCSIBusDriverBindingStart ( ScsiBusDev = SCSI_BUS_CONTROLLER_DEVICE_FROM_THIS (BusIdentify); } + // + // Report Status Code to indicate detecting devices on bus + // + REPORT_STATUS_CODE_WITH_DEVICE_PATH ( + EFI_PROGRESS_CODE, + (EFI_IO_BUS_SCSI | EFI_IOB_PC_DETECT), + ParentDevicePath + ); + Lun = 0; if (RemainingDevicePath == NULL) { // @@ -828,6 +846,15 @@ ScsiResetBus ( ScsiIoDevice = SCSI_IO_DEV_FROM_THIS (This); + // + // Report Status Code to indicate reset happens + // + REPORT_STATUS_CODE_WITH_DEVICE_PATH ( + EFI_PROGRESS_CODE, + (EFI_IO_BUS_ATA_ATAPI | EFI_IOB_PC_RESET), + ScsiIoDevice->ScsiBusDeviceData->DevicePath + ); + if (ScsiIoDevice->ExtScsiSupport){ return ScsiIoDevice->ExtScsiPassThru->ResetChannel (ScsiIoDevice->ExtScsiPassThru); } else { @@ -857,6 +884,16 @@ ScsiResetDevice ( UINT8 Target[TARGET_MAX_BYTES]; ScsiIoDevice = SCSI_IO_DEV_FROM_THIS (This); + + // + // Report Status Code to indicate reset happens + // + REPORT_STATUS_CODE_WITH_DEVICE_PATH ( + EFI_PROGRESS_CODE, + (EFI_IO_BUS_ATA_ATAPI | EFI_IOB_PC_RESET), + ScsiIoDevice->ScsiBusDeviceData->DevicePath + ); + CopyMem (Target,&ScsiIoDevice->Pun, TARGET_MAX_BYTES); @@ -1121,6 +1158,7 @@ ScsiScanCreateDevice ( } ScsiIoDevice->Signature = SCSI_IO_DEV_SIGNATURE; + ScsiIoDevice->ScsiBusDeviceData = ScsiBusDev; CopyMem(&ScsiIoDevice->Pun, TargetId, TARGET_MAX_BYTES); ScsiIoDevice->Lun = Lun; @@ -1141,6 +1179,15 @@ ScsiScanCreateDevice ( ScsiIoDevice->ScsiIo.ResetDevice = ScsiResetDevice; ScsiIoDevice->ScsiIo.ExecuteScsiCommand = ScsiExecuteSCSICommand; + // + // Report Status Code here since the new SCSI device will be discovered + // + REPORT_STATUS_CODE_WITH_DEVICE_PATH ( + EFI_PROGRESS_CODE, + (EFI_IO_BUS_SCSI | EFI_IOB_PC_ENABLE), + ScsiBusDev->DevicePath + ); + if (!DiscoverScsiDevice (ScsiIoDevice)) { Status = EFI_OUT_OF_RESOURCES; goto ErrorExit; diff --git a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.h b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.h index 8f86444a4c..ed90a6d458 100644 --- a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.h +++ b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.h @@ -1,7 +1,7 @@ /** @file Header file for SCSI Bus Driver. -Copyright (c) 2006 - 2011, 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 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 @@ -54,27 +55,10 @@ typedef struct { VOID *Data2; } SCSI_EVENT_DATA; - -typedef struct { - UINT32 Signature; - EFI_HANDLE Handle; - EFI_SCSI_IO_PROTOCOL ScsiIo; - EFI_DEVICE_PATH_PROTOCOL *DevicePath; - BOOLEAN ExtScsiSupport; - EFI_SCSI_PASS_THRU_PROTOCOL *ScsiPassThru; - EFI_EXT_SCSI_PASS_THRU_PROTOCOL *ExtScsiPassThru; - SCSI_TARGET_ID Pun; - UINT64 Lun; - UINT8 ScsiDeviceType; - UINT8 ScsiVersion; - BOOLEAN RemovableDevice; -} SCSI_IO_DEV; - -#define SCSI_IO_DEV_FROM_THIS(a) CR (a, SCSI_IO_DEV, ScsiIo, SCSI_IO_DEV_SIGNATURE) - // // SCSI Bus Controller device strcuture // +#define SCSI_BUS_DEVICE_SIGNATURE SIGNATURE_32 ('s', 'c', 's', 'i') // // The ScsiBusProtocol is just used to locate ScsiBusDev @@ -87,9 +71,6 @@ typedef struct _EFI_SCSI_BUS_PROTOCOL { UINT64 Reserved; } EFI_SCSI_BUS_PROTOCOL; -#define SCSI_BUS_DEVICE_SIGNATURE SIGNATURE_32 ('s', 'c', 's', 'i') - - typedef struct _SCSI_BUS_DEVICE { UINTN Signature; EFI_SCSI_BUS_PROTOCOL BusIdentify; @@ -101,6 +82,24 @@ typedef struct _SCSI_BUS_DEVICE { #define SCSI_BUS_CONTROLLER_DEVICE_FROM_THIS(a) CR (a, SCSI_BUS_DEVICE, BusIdentify, SCSI_BUS_DEVICE_SIGNATURE) +typedef struct { + UINT32 Signature; + EFI_HANDLE Handle; + EFI_SCSI_IO_PROTOCOL ScsiIo; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + BOOLEAN ExtScsiSupport; + EFI_SCSI_PASS_THRU_PROTOCOL *ScsiPassThru; + EFI_EXT_SCSI_PASS_THRU_PROTOCOL *ExtScsiPassThru; + SCSI_BUS_DEVICE *ScsiBusDeviceData; + SCSI_TARGET_ID Pun; + UINT64 Lun; + UINT8 ScsiDeviceType; + UINT8 ScsiVersion; + BOOLEAN RemovableDevice; +} SCSI_IO_DEV; + +#define SCSI_IO_DEV_FROM_THIS(a) CR (a, SCSI_IO_DEV, ScsiIo, SCSI_IO_DEV_SIGNATURE) + // // Global Variables // diff --git a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf index 99abb2f584..73665117f7 100644 --- a/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf +++ b/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf @@ -4,7 +4,7 @@ # each of them. After this the driver installs the Device Path Protocol and SCSI I/O Protocol on # these handles. # -# 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 # which accompanies this distribution. The full text of the license may be found at @@ -55,6 +55,7 @@ UefiDriverEntryPoint DebugLib MemoryAllocationLib + ReportStatusCodeLib [Protocols] -- cgit v1.2.3