NetworkPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the NetworkPkg 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: Maciej Rabeda <maciej.rabeda@linux.intel.com>
This commit is contained in:
committed by
mergify[bot]
parent
2f88bd3a12
commit
d1050b9dff
@@ -6,7 +6,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#include "Snp.h"
|
||||
|
||||
/**
|
||||
@@ -23,8 +22,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeInit (
|
||||
SNP_DRIVER *Snp,
|
||||
UINT16 CableDetectFlag
|
||||
SNP_DRIVER *Snp,
|
||||
UINT16 CableDetectFlag
|
||||
)
|
||||
{
|
||||
PXE_CPB_INITIALIZE *Cpb;
|
||||
@@ -47,9 +46,9 @@ PxeInit (
|
||||
if (Status != EFI_SUCCESS) {
|
||||
DEBUG (
|
||||
(DEBUG_ERROR,
|
||||
"\nSnp->PxeInit() AllocateBuffer %xh (%r)\n",
|
||||
Status,
|
||||
Status)
|
||||
"\nSnp->PxeInit() AllocateBuffer %xh (%r)\n",
|
||||
Status,
|
||||
Status)
|
||||
);
|
||||
|
||||
return Status;
|
||||
@@ -60,40 +59,40 @@ PxeInit (
|
||||
Snp->TxRxBuffer = Addr;
|
||||
}
|
||||
|
||||
Cpb->MemoryAddr = (UINT64)(UINTN) Snp->TxRxBuffer;
|
||||
Cpb->MemoryAddr = (UINT64)(UINTN)Snp->TxRxBuffer;
|
||||
|
||||
Cpb->MemoryLength = Snp->TxRxBufferSize;
|
||||
|
||||
//
|
||||
// let UNDI decide/detect these values
|
||||
//
|
||||
Cpb->LinkSpeed = 0;
|
||||
Cpb->TxBufCnt = 0;
|
||||
Cpb->TxBufSize = 0;
|
||||
Cpb->RxBufCnt = 0;
|
||||
Cpb->RxBufSize = 0;
|
||||
Cpb->LinkSpeed = 0;
|
||||
Cpb->TxBufCnt = 0;
|
||||
Cpb->TxBufSize = 0;
|
||||
Cpb->RxBufCnt = 0;
|
||||
Cpb->RxBufSize = 0;
|
||||
|
||||
Cpb->DuplexMode = PXE_DUPLEX_DEFAULT;
|
||||
Cpb->DuplexMode = PXE_DUPLEX_DEFAULT;
|
||||
|
||||
Cpb->LoopBackMode = LOOPBACK_NORMAL;
|
||||
Cpb->LoopBackMode = LOOPBACK_NORMAL;
|
||||
|
||||
Snp->Cdb.OpCode = PXE_OPCODE_INITIALIZE;
|
||||
Snp->Cdb.OpFlags = CableDetectFlag;
|
||||
Snp->Cdb.OpCode = PXE_OPCODE_INITIALIZE;
|
||||
Snp->Cdb.OpFlags = CableDetectFlag;
|
||||
|
||||
Snp->Cdb.CPBsize = (UINT16) sizeof (PXE_CPB_INITIALIZE);
|
||||
Snp->Cdb.DBsize = (UINT16) sizeof (PXE_DB_INITIALIZE);
|
||||
Snp->Cdb.CPBsize = (UINT16)sizeof (PXE_CPB_INITIALIZE);
|
||||
Snp->Cdb.DBsize = (UINT16)sizeof (PXE_DB_INITIALIZE);
|
||||
|
||||
Snp->Cdb.CPBaddr = (UINT64)(UINTN) Snp->Cpb;
|
||||
Snp->Cdb.DBaddr = (UINT64)(UINTN) Snp->Db;
|
||||
Snp->Cdb.CPBaddr = (UINT64)(UINTN)Snp->Cpb;
|
||||
Snp->Cdb.DBaddr = (UINT64)(UINTN)Snp->Db;
|
||||
|
||||
Snp->Cdb.StatCode = PXE_STATCODE_INITIALIZE;
|
||||
Snp->Cdb.StatFlags = PXE_STATFLAGS_INITIALIZE;
|
||||
Snp->Cdb.IFnum = Snp->IfNum;
|
||||
Snp->Cdb.Control = PXE_CONTROL_LAST_CDB_IN_LIST;
|
||||
Snp->Cdb.StatCode = PXE_STATCODE_INITIALIZE;
|
||||
Snp->Cdb.StatFlags = PXE_STATFLAGS_INITIALIZE;
|
||||
Snp->Cdb.IFnum = Snp->IfNum;
|
||||
Snp->Cdb.Control = PXE_CONTROL_LAST_CDB_IN_LIST;
|
||||
|
||||
DEBUG ((DEBUG_NET, "\nSnp->undi.initialize() "));
|
||||
|
||||
(*Snp->IssueUndi32Command) ((UINT64)(UINTN) &Snp->Cdb);
|
||||
(*Snp->IssueUndi32Command)((UINT64)(UINTN)&Snp->Cdb);
|
||||
|
||||
//
|
||||
// There are two fields need to be checked here:
|
||||
@@ -103,47 +102,47 @@ PxeInit (
|
||||
// the CDB.StatCode field contains the result of the command execution.
|
||||
//
|
||||
if ((((Snp->Cdb.StatFlags) & PXE_STATFLAGS_STATUS_MASK) == PXE_STATFLAGS_COMMAND_COMPLETE) &&
|
||||
(Snp->Cdb.StatCode == PXE_STATCODE_SUCCESS)) {
|
||||
(Snp->Cdb.StatCode == PXE_STATCODE_SUCCESS))
|
||||
{
|
||||
//
|
||||
// If cable detect feature is enabled in CDB.OpFlags, check the CDB.StatFlags to see if there is an
|
||||
// active connection to this network device. If the no media StatFlag is set, the UNDI and network
|
||||
// device are still initialized.
|
||||
//
|
||||
if (CableDetectFlag == PXE_OPFLAGS_INITIALIZE_DETECT_CABLE) {
|
||||
if(((Snp->Cdb.StatFlags) & PXE_STATFLAGS_INITIALIZED_NO_MEDIA) != PXE_STATFLAGS_INITIALIZED_NO_MEDIA) {
|
||||
if (((Snp->Cdb.StatFlags) & PXE_STATFLAGS_INITIALIZED_NO_MEDIA) != PXE_STATFLAGS_INITIALIZED_NO_MEDIA) {
|
||||
Snp->Mode.MediaPresent = TRUE;
|
||||
} else {
|
||||
Snp->Mode.MediaPresent = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
Snp->Mode.State = EfiSimpleNetworkInitialized;
|
||||
Status = EFI_SUCCESS;
|
||||
Snp->Mode.State = EfiSimpleNetworkInitialized;
|
||||
Status = EFI_SUCCESS;
|
||||
} else {
|
||||
DEBUG (
|
||||
(DEBUG_WARN,
|
||||
"\nSnp->undi.initialize() %xh:%xh\n",
|
||||
Snp->Cdb.StatFlags,
|
||||
Snp->Cdb.StatCode)
|
||||
"\nSnp->undi.initialize() %xh:%xh\n",
|
||||
Snp->Cdb.StatFlags,
|
||||
Snp->Cdb.StatCode)
|
||||
);
|
||||
|
||||
if (Snp->TxRxBuffer != NULL) {
|
||||
Snp->PciIo->FreeBuffer (
|
||||
Snp->PciIo,
|
||||
SNP_MEM_PAGES (Snp->TxRxBufferSize),
|
||||
(VOID *) Snp->TxRxBuffer
|
||||
(VOID *)Snp->TxRxBuffer
|
||||
);
|
||||
}
|
||||
|
||||
Snp->TxRxBuffer = NULL;
|
||||
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Resets a network adapter and allocates the transmit and receive buffers
|
||||
required by the network interface; optionally, also requests allocation of
|
||||
@@ -180,9 +179,9 @@ PxeInit (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SnpUndi32Initialize (
|
||||
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
|
||||
IN UINTN ExtraRxBufferSize OPTIONAL,
|
||||
IN UINTN ExtraTxBufferSize OPTIONAL
|
||||
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
|
||||
IN UINTN ExtraRxBufferSize OPTIONAL,
|
||||
IN UINTN ExtraTxBufferSize OPTIONAL
|
||||
)
|
||||
{
|
||||
EFI_STATUS EfiStatus;
|
||||
@@ -203,36 +202,37 @@ SnpUndi32Initialize (
|
||||
}
|
||||
|
||||
switch (Snp->Mode.State) {
|
||||
case EfiSimpleNetworkStarted:
|
||||
break;
|
||||
case EfiSimpleNetworkStarted:
|
||||
break;
|
||||
|
||||
case EfiSimpleNetworkStopped:
|
||||
EfiStatus = EFI_NOT_STARTED;
|
||||
goto ON_EXIT;
|
||||
case EfiSimpleNetworkStopped:
|
||||
EfiStatus = EFI_NOT_STARTED;
|
||||
goto ON_EXIT;
|
||||
|
||||
default:
|
||||
EfiStatus = EFI_DEVICE_ERROR;
|
||||
goto ON_EXIT;
|
||||
default:
|
||||
EfiStatus = EFI_DEVICE_ERROR;
|
||||
goto ON_EXIT;
|
||||
}
|
||||
|
||||
EfiStatus = gBS->CreateEvent (
|
||||
EVT_NOTIFY_WAIT,
|
||||
TPL_NOTIFY,
|
||||
&SnpWaitForPacketNotify,
|
||||
Snp,
|
||||
&Snp->Snp.WaitForPacket
|
||||
);
|
||||
EVT_NOTIFY_WAIT,
|
||||
TPL_NOTIFY,
|
||||
&SnpWaitForPacketNotify,
|
||||
Snp,
|
||||
&Snp->Snp.WaitForPacket
|
||||
);
|
||||
|
||||
if (EFI_ERROR (EfiStatus)) {
|
||||
Snp->Snp.WaitForPacket = NULL;
|
||||
EfiStatus = EFI_DEVICE_ERROR;
|
||||
EfiStatus = EFI_DEVICE_ERROR;
|
||||
goto ON_EXIT;
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
Snp->Mode.MCastFilterCount = 0;
|
||||
Snp->Mode.ReceiveFilterSetting = 0;
|
||||
Snp->Mode.MCastFilterCount = 0;
|
||||
Snp->Mode.ReceiveFilterSetting = 0;
|
||||
ZeroMem (Snp->Mode.MCastFilter, sizeof Snp->Mode.MCastFilter);
|
||||
CopyMem (
|
||||
&Snp->Mode.CurrentAddress,
|
||||
@@ -243,7 +243,7 @@ SnpUndi32Initialize (
|
||||
//
|
||||
// Compute tx/rx buffer sizes based on UNDI init info and parameters.
|
||||
//
|
||||
Snp->TxRxBufferSize = (UINT32) (Snp->InitInfo.MemoryRequired + ExtraRxBufferSize + ExtraTxBufferSize);
|
||||
Snp->TxRxBufferSize = (UINT32)(Snp->InitInfo.MemoryRequired + ExtraRxBufferSize + ExtraTxBufferSize);
|
||||
|
||||
//
|
||||
// If UNDI support cable detect for INITIALIZE command, try it first.
|
||||
@@ -254,9 +254,9 @@ SnpUndi32Initialize (
|
||||
}
|
||||
}
|
||||
|
||||
Snp->Mode.MediaPresent = FALSE;
|
||||
Snp->Mode.MediaPresent = FALSE;
|
||||
|
||||
EfiStatus = PxeInit (Snp, PXE_OPFLAGS_INITIALIZE_DO_NOT_DETECT_CABLE);
|
||||
EfiStatus = PxeInit (Snp, PXE_OPFLAGS_INITIALIZE_DO_NOT_DETECT_CABLE);
|
||||
|
||||
if (EFI_ERROR (EfiStatus)) {
|
||||
gBS->CloseEvent (Snp->Snp.WaitForPacket);
|
||||
|
Reference in New Issue
Block a user