OvmfPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the OvmfPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Andrew Fish <afish@apple.com>
This commit is contained in:
committed by
mergify[bot]
parent
d1050b9dff
commit
ac0a286f4d
@@ -28,9 +28,9 @@
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
Out8 (
|
||||
IN LSI_SCSI_DEV *Dev,
|
||||
IN UINT32 Addr,
|
||||
IN UINT8 Data
|
||||
IN LSI_SCSI_DEV *Dev,
|
||||
IN UINT32 Addr,
|
||||
IN UINT8 Data
|
||||
)
|
||||
{
|
||||
return Dev->PciIo->Io.Write (
|
||||
@@ -46,9 +46,9 @@ Out8 (
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
Out32 (
|
||||
IN LSI_SCSI_DEV *Dev,
|
||||
IN UINT32 Addr,
|
||||
IN UINT32 Data
|
||||
IN LSI_SCSI_DEV *Dev,
|
||||
IN UINT32 Addr,
|
||||
IN UINT32 Data
|
||||
)
|
||||
{
|
||||
return Dev->PciIo->Io.Write (
|
||||
@@ -64,9 +64,9 @@ Out32 (
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
In8 (
|
||||
IN LSI_SCSI_DEV *Dev,
|
||||
IN UINT32 Addr,
|
||||
OUT UINT8 *Data
|
||||
IN LSI_SCSI_DEV *Dev,
|
||||
IN UINT32 Addr,
|
||||
OUT UINT8 *Data
|
||||
)
|
||||
{
|
||||
return Dev->PciIo->Io.Read (
|
||||
@@ -82,9 +82,9 @@ In8 (
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
In32 (
|
||||
IN LSI_SCSI_DEV *Dev,
|
||||
IN UINT32 Addr,
|
||||
OUT UINT32 *Data
|
||||
IN LSI_SCSI_DEV *Dev,
|
||||
IN UINT32 Addr,
|
||||
OUT UINT32 *Data
|
||||
)
|
||||
{
|
||||
return Dev->PciIo->Io.Read (
|
||||
@@ -100,7 +100,7 @@ In32 (
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
LsiScsiReset (
|
||||
IN LSI_SCSI_DEV *Dev
|
||||
IN LSI_SCSI_DEV *Dev
|
||||
)
|
||||
{
|
||||
return Out8 (Dev, LSI_REG_ISTAT0, LSI_ISTAT0_SRST);
|
||||
@@ -109,12 +109,12 @@ LsiScsiReset (
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
ReportHostAdapterOverrunError (
|
||||
OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet
|
||||
OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet
|
||||
)
|
||||
{
|
||||
Packet->SenseDataLength = 0;
|
||||
Packet->SenseDataLength = 0;
|
||||
Packet->HostAdapterStatus =
|
||||
EFI_EXT_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN;
|
||||
EFI_EXT_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN;
|
||||
Packet->TargetStatus = EFI_EXT_SCSI_STATUS_TARGET_GOOD;
|
||||
return EFI_BAD_BUFFER_SIZE;
|
||||
}
|
||||
@@ -146,40 +146,42 @@ ReportHostAdapterOverrunError (
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
LsiScsiCheckRequest (
|
||||
IN LSI_SCSI_DEV *Dev,
|
||||
IN UINT8 Target,
|
||||
IN UINT64 Lun,
|
||||
IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet
|
||||
IN LSI_SCSI_DEV *Dev,
|
||||
IN UINT8 Target,
|
||||
IN UINT64 Lun,
|
||||
IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet
|
||||
)
|
||||
{
|
||||
if (Target > Dev->MaxTarget || Lun > Dev->MaxLun ||
|
||||
Packet->DataDirection > EFI_EXT_SCSI_DATA_DIRECTION_BIDIRECTIONAL ||
|
||||
if ((Target > Dev->MaxTarget) || (Lun > Dev->MaxLun) ||
|
||||
(Packet->DataDirection > EFI_EXT_SCSI_DATA_DIRECTION_BIDIRECTIONAL) ||
|
||||
//
|
||||
// Trying to receive, but destination pointer is NULL, or contradicting
|
||||
// transfer direction
|
||||
//
|
||||
(Packet->InTransferLength > 0 &&
|
||||
(Packet->InDataBuffer == NULL ||
|
||||
Packet->DataDirection == EFI_EXT_SCSI_DATA_DIRECTION_WRITE
|
||||
)
|
||||
) ||
|
||||
((Packet->InTransferLength > 0) &&
|
||||
((Packet->InDataBuffer == NULL) ||
|
||||
(Packet->DataDirection == EFI_EXT_SCSI_DATA_DIRECTION_WRITE)
|
||||
)
|
||||
) ||
|
||||
|
||||
//
|
||||
// Trying to send, but source pointer is NULL, or contradicting transfer
|
||||
// direction
|
||||
//
|
||||
(Packet->OutTransferLength > 0 &&
|
||||
(Packet->OutDataBuffer == NULL ||
|
||||
Packet->DataDirection == EFI_EXT_SCSI_DATA_DIRECTION_READ
|
||||
)
|
||||
)
|
||||
) {
|
||||
((Packet->OutTransferLength > 0) &&
|
||||
((Packet->OutDataBuffer == NULL) ||
|
||||
(Packet->DataDirection == EFI_EXT_SCSI_DATA_DIRECTION_READ)
|
||||
)
|
||||
)
|
||||
)
|
||||
{
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (Packet->DataDirection == EFI_EXT_SCSI_DATA_DIRECTION_BIDIRECTIONAL ||
|
||||
(Packet->InTransferLength > 0 && Packet->OutTransferLength > 0) ||
|
||||
Packet->CdbLength > sizeof Dev->Dma->Cdb) {
|
||||
if ((Packet->DataDirection == EFI_EXT_SCSI_DATA_DIRECTION_BIDIRECTIONAL) ||
|
||||
((Packet->InTransferLength > 0) && (Packet->OutTransferLength > 0)) ||
|
||||
(Packet->CdbLength > sizeof Dev->Dma->Cdb))
|
||||
{
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
@@ -187,6 +189,7 @@ LsiScsiCheckRequest (
|
||||
Packet->InTransferLength = sizeof Dev->Dma->Data;
|
||||
return ReportHostAdapterOverrunError (Packet);
|
||||
}
|
||||
|
||||
if (Packet->OutTransferLength > sizeof Dev->Dma->Data) {
|
||||
Packet->OutTransferLength = sizeof Dev->Dma->Data;
|
||||
return ReportHostAdapterOverrunError (Packet);
|
||||
@@ -221,32 +224,32 @@ LsiScsiCheckRequest (
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
LsiScsiProcessRequest (
|
||||
IN LSI_SCSI_DEV *Dev,
|
||||
IN UINT8 Target,
|
||||
IN UINT64 Lun,
|
||||
IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet
|
||||
IN LSI_SCSI_DEV *Dev,
|
||||
IN UINT8 Target,
|
||||
IN UINT64 Lun,
|
||||
IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINT32 *Script;
|
||||
UINT8 *Cdb;
|
||||
UINT8 *MsgOut;
|
||||
UINT8 *MsgIn;
|
||||
UINT8 *ScsiStatus;
|
||||
UINT8 *Data;
|
||||
UINT8 DStat;
|
||||
UINT8 SIst0;
|
||||
UINT8 SIst1;
|
||||
UINT32 Csbc;
|
||||
UINT32 CsbcBase;
|
||||
UINT32 Transferred;
|
||||
EFI_STATUS Status;
|
||||
UINT32 *Script;
|
||||
UINT8 *Cdb;
|
||||
UINT8 *MsgOut;
|
||||
UINT8 *MsgIn;
|
||||
UINT8 *ScsiStatus;
|
||||
UINT8 *Data;
|
||||
UINT8 DStat;
|
||||
UINT8 SIst0;
|
||||
UINT8 SIst1;
|
||||
UINT32 Csbc;
|
||||
UINT32 CsbcBase;
|
||||
UINT32 Transferred;
|
||||
|
||||
Script = Dev->Dma->Script;
|
||||
Cdb = Dev->Dma->Cdb;
|
||||
Data = Dev->Dma->Data;
|
||||
MsgIn = Dev->Dma->MsgIn;
|
||||
MsgOut = &Dev->Dma->MsgOut;
|
||||
ScsiStatus = &Dev->Dma->Status;
|
||||
Script = Dev->Dma->Script;
|
||||
Cdb = Dev->Dma->Cdb;
|
||||
Data = Dev->Dma->Data;
|
||||
MsgIn = Dev->Dma->MsgIn;
|
||||
MsgOut = &Dev->Dma->MsgOut;
|
||||
ScsiStatus = &Dev->Dma->Status;
|
||||
|
||||
*ScsiStatus = 0xFF;
|
||||
|
||||
@@ -308,7 +311,7 @@ LsiScsiProcessRequest (
|
||||
//
|
||||
// 2. Select LUN.
|
||||
//
|
||||
*MsgOut = 0x80 | (UINT8) Lun; // 0x80: Identify bit
|
||||
*MsgOut = 0x80 | (UINT8)Lun; // 0x80: Identify bit
|
||||
*Script++ = LSI_INS_TYPE_BLK | LSI_INS_BLK_SCSIP_MSG_OUT |
|
||||
(UINT32)sizeof Dev->Dma->MsgOut;
|
||||
*Script++ = LSI_SCSI_DMA_ADDR (Dev, MsgOut);
|
||||
@@ -416,21 +419,23 @@ LsiScsiProcessRequest (
|
||||
// Poll the device registers (DSTAT, SIST0, and SIST1) until the SIR
|
||||
// bit sets.
|
||||
//
|
||||
for(;;) {
|
||||
for ( ; ;) {
|
||||
Status = In8 (Dev, LSI_REG_DSTAT, &DStat);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Error;
|
||||
}
|
||||
|
||||
Status = In8 (Dev, LSI_REG_SIST0, &SIst0);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Error;
|
||||
}
|
||||
|
||||
Status = In8 (Dev, LSI_REG_SIST1, &SIst1);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Error;
|
||||
}
|
||||
|
||||
if (SIst0 != 0 || SIst1 != 0) {
|
||||
if ((SIst0 != 0) || (SIst1 != 0)) {
|
||||
goto Error;
|
||||
}
|
||||
|
||||
@@ -449,7 +454,7 @@ LsiScsiProcessRequest (
|
||||
// SCSI Message Code 0x00: COMMAND COMPLETE
|
||||
// SCSI Status Code 0x00: Good
|
||||
//
|
||||
if (MsgIn[0] != 0 || *ScsiStatus != 0) {
|
||||
if ((MsgIn[0] != 0) || (*ScsiStatus != 0)) {
|
||||
goto Error;
|
||||
}
|
||||
|
||||
@@ -504,15 +509,21 @@ LsiScsiProcessRequest (
|
||||
return EFI_SUCCESS;
|
||||
|
||||
Error:
|
||||
DEBUG ((DEBUG_VERBOSE, "%a: dstat: %02X, sist0: %02X, sist1: %02X\n",
|
||||
__FUNCTION__, DStat, SIst0, SIst1));
|
||||
DEBUG ((
|
||||
DEBUG_VERBOSE,
|
||||
"%a: dstat: %02X, sist0: %02X, sist1: %02X\n",
|
||||
__FUNCTION__,
|
||||
DStat,
|
||||
SIst0,
|
||||
SIst1
|
||||
));
|
||||
//
|
||||
// Update the request packet to reflect the status.
|
||||
//
|
||||
if (*ScsiStatus != 0xFF) {
|
||||
Packet->TargetStatus = *ScsiStatus;
|
||||
Packet->TargetStatus = *ScsiStatus;
|
||||
} else {
|
||||
Packet->TargetStatus = EFI_EXT_SCSI_STATUS_TARGET_TASK_ABORTED;
|
||||
Packet->TargetStatus = EFI_EXT_SCSI_STATUS_TARGET_TASK_ABORTED;
|
||||
}
|
||||
|
||||
if (SIst0 & LSI_SIST0_PAR) {
|
||||
@@ -557,17 +568,17 @@ Error:
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
LsiScsiPassThru (
|
||||
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
|
||||
IN UINT8 *Target,
|
||||
IN UINT64 Lun,
|
||||
IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet,
|
||||
IN EFI_EVENT Event OPTIONAL
|
||||
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
|
||||
IN UINT8 *Target,
|
||||
IN UINT64 Lun,
|
||||
IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet,
|
||||
IN EFI_EVENT Event OPTIONAL
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
LSI_SCSI_DEV *Dev;
|
||||
EFI_STATUS Status;
|
||||
LSI_SCSI_DEV *Dev;
|
||||
|
||||
Dev = LSI_SCSI_FROM_PASS_THRU (This);
|
||||
Dev = LSI_SCSI_FROM_PASS_THRU (This);
|
||||
Status = LsiScsiCheckRequest (Dev, *Target, Lun, Packet);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
@@ -579,15 +590,15 @@ LsiScsiPassThru (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
LsiScsiGetNextTargetLun (
|
||||
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
|
||||
IN OUT UINT8 **TargetPointer,
|
||||
IN OUT UINT64 *Lun
|
||||
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
|
||||
IN OUT UINT8 **TargetPointer,
|
||||
IN OUT UINT64 *Lun
|
||||
)
|
||||
{
|
||||
LSI_SCSI_DEV *Dev;
|
||||
UINTN Idx;
|
||||
UINT8 *Target;
|
||||
UINT16 LastTarget;
|
||||
LSI_SCSI_DEV *Dev;
|
||||
UINTN Idx;
|
||||
UINT8 *Target;
|
||||
UINT16 LastTarget;
|
||||
|
||||
//
|
||||
// the TargetPointer input parameter is unnecessarily a pointer-to-pointer
|
||||
@@ -597,8 +608,9 @@ LsiScsiGetNextTargetLun (
|
||||
//
|
||||
// Search for first non-0xFF byte. If not found, return first target & LUN.
|
||||
//
|
||||
for (Idx = 0; Idx < TARGET_MAX_BYTES && Target[Idx] == 0xFF; ++Idx)
|
||||
;
|
||||
for (Idx = 0; Idx < TARGET_MAX_BYTES && Target[Idx] == 0xFF; ++Idx) {
|
||||
}
|
||||
|
||||
if (Idx == TARGET_MAX_BYTES) {
|
||||
SetMem (Target, TARGET_MAX_BYTES, 0x00);
|
||||
*Lun = 0;
|
||||
@@ -611,7 +623,7 @@ LsiScsiGetNextTargetLun (
|
||||
// increment (target, LUN) pair if valid on input
|
||||
//
|
||||
Dev = LSI_SCSI_FROM_PASS_THRU (This);
|
||||
if (LastTarget > Dev->MaxTarget || *Lun > Dev->MaxLun) {
|
||||
if ((LastTarget > Dev->MaxTarget) || (*Lun > Dev->MaxLun)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
@@ -633,15 +645,15 @@ LsiScsiGetNextTargetLun (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
LsiScsiBuildDevicePath (
|
||||
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
|
||||
IN UINT8 *Target,
|
||||
IN UINT64 Lun,
|
||||
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
|
||||
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
|
||||
IN UINT8 *Target,
|
||||
IN UINT64 Lun,
|
||||
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
|
||||
)
|
||||
{
|
||||
UINT16 TargetValue;
|
||||
LSI_SCSI_DEV *Dev;
|
||||
SCSI_DEVICE_PATH *ScsiDevicePath;
|
||||
UINT16 TargetValue;
|
||||
LSI_SCSI_DEV *Dev;
|
||||
SCSI_DEVICE_PATH *ScsiDevicePath;
|
||||
|
||||
if (DevicePath == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
@@ -649,7 +661,7 @@ LsiScsiBuildDevicePath (
|
||||
|
||||
CopyMem (&TargetValue, Target, sizeof TargetValue);
|
||||
Dev = LSI_SCSI_FROM_PASS_THRU (This);
|
||||
if (TargetValue > Dev->MaxTarget || Lun > Dev->MaxLun || Lun > 0xFFFF) {
|
||||
if ((TargetValue > Dev->MaxTarget) || (Lun > Dev->MaxLun) || (Lun > 0xFFFF)) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
@@ -660,10 +672,10 @@ LsiScsiBuildDevicePath (
|
||||
|
||||
ScsiDevicePath->Header.Type = MESSAGING_DEVICE_PATH;
|
||||
ScsiDevicePath->Header.SubType = MSG_SCSI_DP;
|
||||
ScsiDevicePath->Header.Length[0] = (UINT8) sizeof *ScsiDevicePath;
|
||||
ScsiDevicePath->Header.Length[1] = (UINT8) (sizeof *ScsiDevicePath >> 8);
|
||||
ScsiDevicePath->Header.Length[0] = (UINT8)sizeof *ScsiDevicePath;
|
||||
ScsiDevicePath->Header.Length[1] = (UINT8)(sizeof *ScsiDevicePath >> 8);
|
||||
ScsiDevicePath->Pun = TargetValue;
|
||||
ScsiDevicePath->Lun = (UINT16) Lun;
|
||||
ScsiDevicePath->Lun = (UINT16)Lun;
|
||||
|
||||
*DevicePath = &ScsiDevicePath->Header;
|
||||
return EFI_SUCCESS;
|
||||
@@ -672,30 +684,33 @@ LsiScsiBuildDevicePath (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
LsiScsiGetTargetLun (
|
||||
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
|
||||
OUT UINT8 **TargetPointer,
|
||||
OUT UINT64 *Lun
|
||||
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
|
||||
OUT UINT8 **TargetPointer,
|
||||
OUT UINT64 *Lun
|
||||
)
|
||||
{
|
||||
SCSI_DEVICE_PATH *ScsiDevicePath;
|
||||
LSI_SCSI_DEV *Dev;
|
||||
UINT8 *Target;
|
||||
SCSI_DEVICE_PATH *ScsiDevicePath;
|
||||
LSI_SCSI_DEV *Dev;
|
||||
UINT8 *Target;
|
||||
|
||||
if (DevicePath == NULL || TargetPointer == NULL || *TargetPointer == NULL ||
|
||||
Lun == NULL) {
|
||||
if ((DevicePath == NULL) || (TargetPointer == NULL) || (*TargetPointer == NULL) ||
|
||||
(Lun == NULL))
|
||||
{
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (DevicePath->Type != MESSAGING_DEVICE_PATH ||
|
||||
DevicePath->SubType != MSG_SCSI_DP) {
|
||||
if ((DevicePath->Type != MESSAGING_DEVICE_PATH) ||
|
||||
(DevicePath->SubType != MSG_SCSI_DP))
|
||||
{
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
ScsiDevicePath = (SCSI_DEVICE_PATH *) DevicePath;
|
||||
Dev = LSI_SCSI_FROM_PASS_THRU (This);
|
||||
if (ScsiDevicePath->Pun > Dev->MaxTarget ||
|
||||
ScsiDevicePath->Lun > Dev->MaxLun) {
|
||||
ScsiDevicePath = (SCSI_DEVICE_PATH *)DevicePath;
|
||||
Dev = LSI_SCSI_FROM_PASS_THRU (This);
|
||||
if ((ScsiDevicePath->Pun > Dev->MaxTarget) ||
|
||||
(ScsiDevicePath->Lun > Dev->MaxLun))
|
||||
{
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
@@ -710,7 +725,7 @@ LsiScsiGetTargetLun (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
LsiScsiResetChannel (
|
||||
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This
|
||||
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This
|
||||
)
|
||||
{
|
||||
return EFI_UNSUPPORTED;
|
||||
@@ -719,9 +734,9 @@ LsiScsiResetChannel (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
LsiScsiResetTargetLun (
|
||||
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
|
||||
IN UINT8 *Target,
|
||||
IN UINT64 Lun
|
||||
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
|
||||
IN UINT8 *Target,
|
||||
IN UINT64 Lun
|
||||
)
|
||||
{
|
||||
return EFI_UNSUPPORTED;
|
||||
@@ -730,14 +745,14 @@ LsiScsiResetTargetLun (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
LsiScsiGetNextTarget (
|
||||
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
|
||||
IN OUT UINT8 **TargetPointer
|
||||
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
|
||||
IN OUT UINT8 **TargetPointer
|
||||
)
|
||||
{
|
||||
LSI_SCSI_DEV *Dev;
|
||||
UINTN Idx;
|
||||
UINT8 *Target;
|
||||
UINT16 LastTarget;
|
||||
LSI_SCSI_DEV *Dev;
|
||||
UINTN Idx;
|
||||
UINT8 *Target;
|
||||
UINT16 LastTarget;
|
||||
|
||||
//
|
||||
// the TargetPointer input parameter is unnecessarily a pointer-to-pointer
|
||||
@@ -747,8 +762,9 @@ LsiScsiGetNextTarget (
|
||||
//
|
||||
// Search for first non-0xFF byte. If not found, return first target.
|
||||
//
|
||||
for (Idx = 0; Idx < TARGET_MAX_BYTES && Target[Idx] == 0xFF; ++Idx)
|
||||
;
|
||||
for (Idx = 0; Idx < TARGET_MAX_BYTES && Target[Idx] == 0xFF; ++Idx) {
|
||||
}
|
||||
|
||||
if (Idx == TARGET_MAX_BYTES) {
|
||||
SetMem (Target, TARGET_MAX_BYTES, 0x00);
|
||||
return EFI_SUCCESS;
|
||||
@@ -777,11 +793,11 @@ STATIC
|
||||
VOID
|
||||
EFIAPI
|
||||
LsiScsiExitBoot (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
LSI_SCSI_DEV *Dev;
|
||||
LSI_SCSI_DEV *Dev;
|
||||
|
||||
Dev = Context;
|
||||
DEBUG ((DEBUG_VERBOSE, "%a: Context=0x%p\n", __FUNCTION__, Context));
|
||||
@@ -800,14 +816,14 @@ LsiScsiExitBoot (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
LsiScsiControllerSupported (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_PCI_IO_PROTOCOL *PciIo;
|
||||
PCI_TYPE00 Pci;
|
||||
EFI_STATUS Status;
|
||||
EFI_PCI_IO_PROTOCOL *PciIo;
|
||||
PCI_TYPE00 Pci;
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
@@ -832,8 +848,9 @@ LsiScsiControllerSupported (
|
||||
goto Done;
|
||||
}
|
||||
|
||||
if (Pci.Hdr.VendorId == LSI_LOGIC_PCI_VENDOR_ID &&
|
||||
Pci.Hdr.DeviceId == LSI_53C895A_PCI_DEVICE_ID) {
|
||||
if ((Pci.Hdr.VendorId == LSI_LOGIC_PCI_VENDOR_ID) &&
|
||||
(Pci.Hdr.DeviceId == LSI_53C895A_PCI_DEVICE_ID))
|
||||
{
|
||||
Status = EFI_SUCCESS;
|
||||
} else {
|
||||
Status = EFI_UNSUPPORTED;
|
||||
@@ -852,15 +869,15 @@ Done:
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
LsiScsiControllerStart (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
LSI_SCSI_DEV *Dev;
|
||||
UINTN Pages;
|
||||
UINTN BytesMapped;
|
||||
EFI_STATUS Status;
|
||||
LSI_SCSI_DEV *Dev;
|
||||
UINTN Pages;
|
||||
UINTN BytesMapped;
|
||||
|
||||
Dev = AllocateZeroPool (sizeof (*Dev));
|
||||
if (Dev == NULL) {
|
||||
@@ -877,8 +894,8 @@ LsiScsiControllerStart (
|
||||
FixedPcdGet8 (PcdLsiScsiMaxLunLimit) < 128,
|
||||
"LSI 53C895A supports LUNs [0..127]"
|
||||
);
|
||||
Dev->MaxTarget = PcdGet8 (PcdLsiScsiMaxTargetLimit);
|
||||
Dev->MaxLun = PcdGet8 (PcdLsiScsiMaxLunLimit);
|
||||
Dev->MaxTarget = PcdGet8 (PcdLsiScsiMaxTargetLimit);
|
||||
Dev->MaxLun = PcdGet8 (PcdLsiScsiMaxLunLimit);
|
||||
Dev->StallPerPollUsec = PcdGet32 (PcdLsiScsiStallPerPollUsec);
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
@@ -920,7 +937,7 @@ LsiScsiControllerStart (
|
||||
//
|
||||
// Create buffers for data transfer
|
||||
//
|
||||
Pages = EFI_SIZE_TO_PAGES (sizeof (*Dev->Dma));
|
||||
Pages = EFI_SIZE_TO_PAGES (sizeof (*Dev->Dma));
|
||||
Status = Dev->PciIo->AllocateBuffer (
|
||||
Dev->PciIo,
|
||||
AllocateAnyPages,
|
||||
@@ -934,14 +951,14 @@ LsiScsiControllerStart (
|
||||
}
|
||||
|
||||
BytesMapped = EFI_PAGES_TO_SIZE (Pages);
|
||||
Status = Dev->PciIo->Map (
|
||||
Dev->PciIo,
|
||||
EfiPciIoOperationBusMasterCommonBuffer,
|
||||
Dev->Dma,
|
||||
&BytesMapped,
|
||||
&Dev->DmaPhysical,
|
||||
&Dev->DmaMapping
|
||||
);
|
||||
Status = Dev->PciIo->Map (
|
||||
Dev->PciIo,
|
||||
EfiPciIoOperationBusMasterCommonBuffer,
|
||||
Dev->Dma,
|
||||
&BytesMapped,
|
||||
&Dev->DmaPhysical,
|
||||
&Dev->DmaMapping
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto FreeBuffer;
|
||||
}
|
||||
@@ -970,19 +987,19 @@ LsiScsiControllerStart (
|
||||
//
|
||||
// Host adapter channel, doesn't exist
|
||||
//
|
||||
Dev->PassThruMode.AdapterId = MAX_UINT32;
|
||||
Dev->PassThruMode.AdapterId = MAX_UINT32;
|
||||
Dev->PassThruMode.Attributes =
|
||||
EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_PHYSICAL |
|
||||
EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_LOGICAL;
|
||||
|
||||
Dev->PassThru.Mode = &Dev->PassThruMode;
|
||||
Dev->PassThru.PassThru = &LsiScsiPassThru;
|
||||
Dev->PassThru.Mode = &Dev->PassThruMode;
|
||||
Dev->PassThru.PassThru = &LsiScsiPassThru;
|
||||
Dev->PassThru.GetNextTargetLun = &LsiScsiGetNextTargetLun;
|
||||
Dev->PassThru.BuildDevicePath = &LsiScsiBuildDevicePath;
|
||||
Dev->PassThru.GetTargetLun = &LsiScsiGetTargetLun;
|
||||
Dev->PassThru.ResetChannel = &LsiScsiResetChannel;
|
||||
Dev->PassThru.ResetTargetLun = &LsiScsiResetTargetLun;
|
||||
Dev->PassThru.GetNextTarget = &LsiScsiGetNextTarget;
|
||||
Dev->PassThru.BuildDevicePath = &LsiScsiBuildDevicePath;
|
||||
Dev->PassThru.GetTargetLun = &LsiScsiGetTargetLun;
|
||||
Dev->PassThru.ResetChannel = &LsiScsiResetChannel;
|
||||
Dev->PassThru.ResetTargetLun = &LsiScsiResetTargetLun;
|
||||
Dev->PassThru.GetNextTarget = &LsiScsiGetNextTarget;
|
||||
|
||||
Status = gBS->InstallProtocolInterface (
|
||||
&ControllerHandle,
|
||||
@@ -1040,15 +1057,15 @@ FreePool:
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
LsiScsiControllerStop (
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE *ChildHandleBuffer
|
||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE *ChildHandleBuffer
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_EXT_SCSI_PASS_THRU_PROTOCOL *PassThru;
|
||||
LSI_SCSI_DEV *Dev;
|
||||
EFI_STATUS Status;
|
||||
EFI_EXT_SCSI_PASS_THRU_PROTOCOL *PassThru;
|
||||
LSI_SCSI_DEV *Dev;
|
||||
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
@@ -1113,7 +1130,7 @@ LsiScsiControllerStop (
|
||||
// C, 10.1 EFI Driver Binding Protocol.
|
||||
//
|
||||
STATIC
|
||||
EFI_DRIVER_BINDING_PROTOCOL gDriverBinding = {
|
||||
EFI_DRIVER_BINDING_PROTOCOL gDriverBinding = {
|
||||
&LsiScsiControllerSupported,
|
||||
&LsiScsiControllerStart,
|
||||
&LsiScsiControllerStop,
|
||||
@@ -1123,7 +1140,6 @@ EFI_DRIVER_BINDING_PROTOCOL gDriverBinding = {
|
||||
NULL // DriverBindingHandle, ditto
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// The purpose of the following scaffolding (EFI_COMPONENT_NAME_PROTOCOL and
|
||||
// EFI_COMPONENT_NAME2_PROTOCOL implementation) is to format the driver's name
|
||||
@@ -1137,20 +1153,20 @@ EFI_DRIVER_BINDING_PROTOCOL gDriverBinding = {
|
||||
//
|
||||
|
||||
STATIC
|
||||
EFI_UNICODE_STRING_TABLE mDriverNameTable[] = {
|
||||
EFI_UNICODE_STRING_TABLE mDriverNameTable[] = {
|
||||
{ "eng;en", L"LSI 53C895A SCSI Controller Driver" },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
STATIC
|
||||
EFI_COMPONENT_NAME_PROTOCOL gComponentName;
|
||||
EFI_COMPONENT_NAME_PROTOCOL gComponentName;
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
LsiScsiGetDriverName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **DriverName
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **DriverName
|
||||
)
|
||||
{
|
||||
return LookupUnicodeString2 (
|
||||
@@ -1165,27 +1181,27 @@ LsiScsiGetDriverName (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
LsiScsiGetDeviceName (
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN EFI_HANDLE DeviceHandle,
|
||||
IN EFI_HANDLE ChildHandle,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **ControllerName
|
||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||
IN EFI_HANDLE DeviceHandle,
|
||||
IN EFI_HANDLE ChildHandle,
|
||||
IN CHAR8 *Language,
|
||||
OUT CHAR16 **ControllerName
|
||||
)
|
||||
{
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
STATIC
|
||||
EFI_COMPONENT_NAME_PROTOCOL gComponentName = {
|
||||
EFI_COMPONENT_NAME_PROTOCOL gComponentName = {
|
||||
&LsiScsiGetDriverName,
|
||||
&LsiScsiGetDeviceName,
|
||||
"eng" // SupportedLanguages, ISO 639-2 language codes
|
||||
};
|
||||
|
||||
STATIC
|
||||
EFI_COMPONENT_NAME2_PROTOCOL gComponentName2 = {
|
||||
(EFI_COMPONENT_NAME2_GET_DRIVER_NAME) &LsiScsiGetDriverName,
|
||||
(EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) &LsiScsiGetDeviceName,
|
||||
EFI_COMPONENT_NAME2_PROTOCOL gComponentName2 = {
|
||||
(EFI_COMPONENT_NAME2_GET_DRIVER_NAME)&LsiScsiGetDriverName,
|
||||
(EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)&LsiScsiGetDeviceName,
|
||||
"en" // SupportedLanguages, RFC 4646 language codes
|
||||
};
|
||||
|
||||
@@ -1195,8 +1211,8 @@ EFI_COMPONENT_NAME2_PROTOCOL gComponentName2 = {
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
LsiScsiEntryPoint (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
return EfiLibInstallDriverBindingComponentName2 (
|
||||
|
Reference in New Issue
Block a user