MdeModulePkg: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
@ -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 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2018, 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
|
||||
@ -188,7 +188,7 @@ SCSIBusDriverBindingSupported (
|
||||
SetMem (TargetId, TARGET_MAX_BYTES, 0xFF);
|
||||
|
||||
//
|
||||
// To keep backward compatibility, UEFI ExtPassThru Protocol is supported as well as
|
||||
// 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.
|
||||
//
|
||||
@ -217,7 +217,7 @@ SCSIBusDriverBindingSupported (
|
||||
&gEfiExtScsiPassThruProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Controller
|
||||
);
|
||||
);
|
||||
return EFI_SUCCESS;
|
||||
} else {
|
||||
//
|
||||
@ -232,7 +232,7 @@ SCSIBusDriverBindingSupported (
|
||||
&gEfiExtScsiPassThruProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Controller
|
||||
);
|
||||
);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
@ -240,7 +240,7 @@ SCSIBusDriverBindingSupported (
|
||||
}
|
||||
|
||||
//
|
||||
// Come here in 2 condition:
|
||||
// Come here in 2 condition:
|
||||
// 1. ExtPassThru doesn't exist.
|
||||
// 2. ExtPassThru exists but RemainingDevicePath is invalid.
|
||||
//
|
||||
@ -252,22 +252,22 @@ SCSIBusDriverBindingSupported (
|
||||
Controller,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
);
|
||||
|
||||
|
||||
if (Status == EFI_ALREADY_STARTED) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Test RemainingDevicePath is valid or not.
|
||||
//
|
||||
if ((RemainingDevicePath != NULL) && !IsDevicePathEnd (RemainingDevicePath)) {
|
||||
Status = PassThru->GetTargetLun (PassThru, RemainingDevicePath, &ScsiTargetId.ScsiId.Scsi, &Lun);
|
||||
}
|
||||
|
||||
|
||||
gBS->CloseProtocol (
|
||||
Controller,
|
||||
&gEfiScsiPassThruProtocolGuid,
|
||||
@ -325,10 +325,10 @@ SCSIBusDriverBindingStart (
|
||||
FromFirstTarget = FALSE;
|
||||
ExtScsiSupport = FALSE;
|
||||
PassThruStatus = EFI_SUCCESS;
|
||||
|
||||
|
||||
TargetId = &ScsiTargetId.ScsiId.ExtScsi[0];
|
||||
SetMem (TargetId, TARGET_MAX_BYTES, 0xFF);
|
||||
|
||||
|
||||
DevicePathStatus = gBS->OpenProtocol (
|
||||
Controller,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
@ -348,10 +348,10 @@ SCSIBusDriverBindingStart (
|
||||
EFI_PROGRESS_CODE,
|
||||
(EFI_IO_BUS_SCSI | EFI_IOB_PC_INIT),
|
||||
ParentDevicePath
|
||||
);
|
||||
);
|
||||
|
||||
//
|
||||
// To keep backward compatibility, UEFI ExtPassThru Protocol is supported as well as
|
||||
// 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.
|
||||
//
|
||||
@ -386,13 +386,13 @@ SCSIBusDriverBindingStart (
|
||||
This->DriverBindingHandle,
|
||||
Controller
|
||||
);
|
||||
}
|
||||
}
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//
|
||||
// Succeed to open ExtPassThru Protocol, and meanwhile open PassThru Protocol
|
||||
// with BY_DRIVER if it is also present on the handle. The intent is to prevent
|
||||
// Succeed to open ExtPassThru Protocol, and meanwhile open PassThru Protocol
|
||||
// with BY_DRIVER if it is also present on the handle. The intent is to prevent
|
||||
// another SCSI Bus Driver to work on the same host handle.
|
||||
//
|
||||
ExtScsiSupport = TRUE;
|
||||
@ -405,7 +405,7 @@ SCSIBusDriverBindingStart (
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if (Status != EFI_ALREADY_STARTED) {
|
||||
//
|
||||
// Go through here means either ExtPassThru or PassThru Protocol is successfully opened
|
||||
@ -423,14 +423,14 @@ SCSIBusDriverBindingStart (
|
||||
if (ScsiBusDev->ExtScsiSupport) {
|
||||
ScsiBusDev->ExtScsiInterface = ExtScsiInterface;
|
||||
} else {
|
||||
ScsiBusDev->ScsiInterface = ScsiInterface;
|
||||
ScsiBusDev->ScsiInterface = ScsiInterface;
|
||||
}
|
||||
|
||||
//
|
||||
// Install EFI_SCSI_BUS_PROTOCOL to the controller handle, So ScsiBusDev could be
|
||||
// retrieved on this controller handle. With ScsiBusDev, we can know which PassThru
|
||||
// Protocol is present on the handle, UEFI ExtPassThru Protocol or EFI PassThru Protocol.
|
||||
//
|
||||
//
|
||||
Status = gBS->InstallProtocolInterface (
|
||||
&Controller,
|
||||
&gEfiCallerIdGuid,
|
||||
@ -472,17 +472,17 @@ SCSIBusDriverBindingStart (
|
||||
Lun = 0;
|
||||
if (RemainingDevicePath == NULL) {
|
||||
//
|
||||
// If RemainingDevicePath is NULL,
|
||||
// If RemainingDevicePath is NULL,
|
||||
// must enumerate all SCSI devices anyway
|
||||
//
|
||||
FromFirstTarget = TRUE;
|
||||
} else if (!IsDevicePathEnd (RemainingDevicePath)) {
|
||||
//
|
||||
// If RemainingDevicePath isn't the End of Device Path Node,
|
||||
// If RemainingDevicePath isn't the End of Device Path Node,
|
||||
// only scan the specified device by RemainingDevicePath
|
||||
//
|
||||
if (ScsiBusDev->ExtScsiSupport) {
|
||||
Status = ScsiBusDev->ExtScsiInterface->GetTargetLun (ScsiBusDev->ExtScsiInterface, RemainingDevicePath, &TargetId, &Lun);
|
||||
Status = ScsiBusDev->ExtScsiInterface->GetTargetLun (ScsiBusDev->ExtScsiInterface, RemainingDevicePath, &TargetId, &Lun);
|
||||
} else {
|
||||
Status = ScsiBusDev->ScsiInterface->GetTargetLun (ScsiBusDev->ScsiInterface, RemainingDevicePath, &ScsiTargetId.ScsiId.Scsi, &Lun);
|
||||
}
|
||||
@ -494,7 +494,7 @@ SCSIBusDriverBindingStart (
|
||||
//
|
||||
// If RemainingDevicePath is the End of Device Path Node,
|
||||
// skip enumerate any device and return EFI_SUCESSS
|
||||
//
|
||||
//
|
||||
ScanOtherPuns = FALSE;
|
||||
}
|
||||
|
||||
@ -539,11 +539,11 @@ SCSIBusDriverBindingStart (
|
||||
return EFI_SUCCESS;
|
||||
|
||||
ErrorExit:
|
||||
|
||||
|
||||
if (ScsiBusDev != NULL) {
|
||||
FreePool (ScsiBusDev);
|
||||
}
|
||||
|
||||
|
||||
if (ExtScsiSupport) {
|
||||
gBS->CloseProtocol (
|
||||
Controller,
|
||||
@ -578,7 +578,7 @@ ErrorExit:
|
||||
restrictions for this service. DisconnectController() must follow these
|
||||
calling restrictions. If any other agent wishes to call Stop() it must also
|
||||
follow these calling restrictions.
|
||||
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param ControllerHandle Handle of device to stop driver on
|
||||
@param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
|
||||
@ -650,7 +650,7 @@ SCSIBusDriverBindingStop (
|
||||
);
|
||||
//
|
||||
// When Start() succeeds to open ExtPassThru, it always tries to open PassThru BY_DRIVER.
|
||||
// Its intent is to prevent another SCSI Bus Driver from woking on the same host handle.
|
||||
// Its intent is to prevent another SCSI Bus Driver from woking on the same host handle.
|
||||
// So Stop() needs to try to close PassThru if present here.
|
||||
//
|
||||
gBS->CloseProtocol (
|
||||
@ -763,11 +763,11 @@ SCSIBusDriverBindingStop (
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param DeviceType A pointer to the device type information retrieved from
|
||||
the SCSI Controller.
|
||||
the SCSI Controller.
|
||||
|
||||
@retval EFI_SUCCESS Retrieves the device type information successfully.
|
||||
@retval EFI_INVALID_PARAMETER The DeviceType is NULL.
|
||||
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
@ -833,7 +833,7 @@ ScsiGetDeviceLocation (
|
||||
@retval EFI_DEVICE_ERROR Errors encountered when resetting the SCSI bus.
|
||||
@retval EFI_UNSUPPORTED The bus reset operation is not supported by the
|
||||
SCSI Host Controller.
|
||||
@retval EFI_TIMEOUT A timeout occurred while attempting to reset
|
||||
@retval EFI_TIMEOUT A timeout occurred while attempting to reset
|
||||
the SCSI bus.
|
||||
**/
|
||||
EFI_STATUS
|
||||
@ -893,7 +893,7 @@ ScsiResetDevice (
|
||||
(EFI_IO_BUS_ATA_ATAPI | EFI_IOB_PC_RESET),
|
||||
ScsiIoDevice->ScsiBusDeviceData->DevicePath
|
||||
);
|
||||
|
||||
|
||||
CopyMem (Target,&ScsiIoDevice->Pun, TARGET_MAX_BYTES);
|
||||
|
||||
|
||||
@ -917,47 +917,47 @@ ScsiResetDevice (
|
||||
Sends a SCSI Request Packet to the SCSI Controller for execution.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param CommandPacket The SCSI request packet to send to the SCSI
|
||||
@param CommandPacket The SCSI request packet to send to the SCSI
|
||||
Controller specified by the device handle.
|
||||
@param Event If the SCSI bus where the SCSI device is attached
|
||||
does not support non-blocking I/O, then Event is
|
||||
ignored, and blocking I/O is performed.
|
||||
does not support non-blocking I/O, then Event is
|
||||
ignored, and blocking I/O is performed.
|
||||
If Event is NULL, then blocking I/O is performed.
|
||||
If Event is not NULL and non-blocking I/O is
|
||||
If Event is not NULL and non-blocking I/O is
|
||||
supported, then non-blocking I/O is performed,
|
||||
and Event will be signaled when the SCSI Request
|
||||
Packet completes.
|
||||
|
||||
@retval EFI_SUCCESS The SCSI Request Packet was sent by the host
|
||||
successfully, and TransferLength bytes were
|
||||
transferred to/from DataBuffer.See
|
||||
HostAdapterStatus, TargetStatus,
|
||||
@retval EFI_SUCCESS The SCSI Request Packet was sent by the host
|
||||
successfully, and TransferLength bytes were
|
||||
transferred to/from DataBuffer.See
|
||||
HostAdapterStatus, TargetStatus,
|
||||
SenseDataLength, and SenseData in that order
|
||||
for additional status information.
|
||||
@retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,
|
||||
@retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,
|
||||
but the entire DataBuffer could not be transferred.
|
||||
The actual number of bytes transferred is returned
|
||||
in TransferLength. See HostAdapterStatus,
|
||||
TargetStatus, SenseDataLength, and SenseData in
|
||||
in TransferLength. See HostAdapterStatus,
|
||||
TargetStatus, SenseDataLength, and SenseData in
|
||||
that order for additional status information.
|
||||
@retval EFI_NOT_READY The SCSI Request Packet could not be sent because
|
||||
there are too many SCSI Command Packets already
|
||||
@retval EFI_NOT_READY The SCSI Request Packet could not be sent because
|
||||
there are too many SCSI Command Packets already
|
||||
queued.The caller may retry again later.
|
||||
@retval EFI_DEVICE_ERROR A device error occurred while attempting to send
|
||||
the SCSI Request Packet. See HostAdapterStatus,
|
||||
TargetStatus, SenseDataLength, and SenseData in
|
||||
@retval EFI_DEVICE_ERROR A device error occurred while attempting to send
|
||||
the SCSI Request Packet. See HostAdapterStatus,
|
||||
TargetStatus, SenseDataLength, and SenseData in
|
||||
that order for additional status information.
|
||||
@retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid.
|
||||
The SCSI Request Packet was not sent, so no
|
||||
@retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid.
|
||||
The SCSI Request Packet was not sent, so no
|
||||
additional status information is available.
|
||||
@retval EFI_UNSUPPORTED The command described by the SCSI Request Packet
|
||||
is not supported by the SCSI initiator(i.e., SCSI
|
||||
is not supported by the SCSI initiator(i.e., SCSI
|
||||
Host Controller). The SCSI Request Packet was not
|
||||
sent, so no additional status information is
|
||||
sent, so no additional status information is
|
||||
available.
|
||||
@retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI
|
||||
@retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI
|
||||
Request Packet to execute. See HostAdapterStatus,
|
||||
TargetStatus, SenseDataLength, and SenseData in
|
||||
TargetStatus, SenseDataLength, and SenseData in
|
||||
that order for additional status information.
|
||||
**/
|
||||
EFI_STATUS
|
||||
@ -973,10 +973,10 @@ ScsiExecuteSCSICommand (
|
||||
UINT8 Target[TARGET_MAX_BYTES];
|
||||
EFI_EVENT PacketEvent;
|
||||
EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *ExtRequestPacket;
|
||||
SCSI_EVENT_DATA EventData;
|
||||
SCSI_EVENT_DATA EventData;
|
||||
|
||||
PacketEvent = NULL;
|
||||
|
||||
|
||||
if (Packet == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
@ -1258,7 +1258,7 @@ ScsiScanCreateDevice (
|
||||
return EFI_SUCCESS;
|
||||
|
||||
ErrorExit:
|
||||
|
||||
|
||||
//
|
||||
// The memory space for ScsiDevicePath is allocated in
|
||||
// ScsiPassThru->BuildDevicePath() function; It is no longer used
|
||||
@ -1365,7 +1365,7 @@ DiscoverScsiDevice (
|
||||
ScsiDeviceFound = FALSE;
|
||||
goto Done;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Retrieved inquiry data successfully
|
||||
//
|
||||
|
Reference in New Issue
Block a user