summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus/Scsi
diff options
context:
space:
mode:
authorli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>2012-10-30 04:23:40 +0000
committerli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>2012-10-30 04:23:40 +0000
commit37623a5c029e5415fe24b86bf4f6481f8fdfad94 (patch)
tree925965b7341d07571b8bb22d51cacd39262ac0b7 /MdeModulePkg/Bus/Scsi
parentcb38c322f037a9a5d2751a4c7e351b0ee7302e96 (diff)
downloadedk2-platforms-37623a5c029e5415fe24b86bf4f6481f8fdfad94.tar.xz
Add missing status code in several modules.
Signed-off-by: Li Elvin <elvin.li@intel.com> Reviewed-by: Yao Jiewen <jiewen.yao@intel.com> Reviewed-by: Ni Ruiyu <ruiyu.ni@intel.com> Reviewed-by: Gao Liming <liming.gao@intel.com> Reviewed-by: Tian Feng <feng.tian@intel.com> Reviewed-by: Fan Jeff <jeff.fan@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13890 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus/Scsi')
-rw-r--r--MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.c49
-rw-r--r--MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBus.h43
-rw-r--r--MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf3
3 files changed, 71 insertions, 24 deletions
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.<BR>
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
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
@@ -342,6 +342,15 @@ SCSIBusDriverBindingStart (
}
//
+ // 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
// tried to open on host controller handle. If fails, then PassThru Protocol is tried instead.
@@ -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.<BR>
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
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 <Library/UefiScsiLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/DevicePathLib.h>
+#include <Library/ReportStatusCodeLib.h>
#include <IndustryStandard/Scsi.h>
@@ -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.<BR>
+# Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
# 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]