EmulatorPkg: Apply uncrustify changes

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737

Apply uncrustify changes to .c/.h files in the EmulatorPkg 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: Ray Ni <ray.ni@intel.com>
This commit is contained in:
Michael Kubacki
2021-12-05 14:53:57 -08:00
committed by mergify[bot]
parent e7108d0e96
commit a550d468a6
111 changed files with 6170 additions and 6345 deletions

View File

@@ -15,9 +15,7 @@ Abstract:
#include "EmuSnpDxe.h"
EFI_SIMPLE_NETWORK_PROTOCOL gEmuSnpTemplate = {
EFI_SIMPLE_NETWORK_PROTOCOL gEmuSnpTemplate = {
EFI_SIMPLE_NETWORK_PROTOCOL_REVISION,
EmuSnpStart,
EmuSnpStop,
@@ -34,9 +32,9 @@ EFI_SIMPLE_NETWORK_PROTOCOL gEmuSnpTemplate = {
EmuSnpReceive,
NULL, // WaitForPacket
NULL // Mode
};
};
EFI_SIMPLE_NETWORK_MODE gEmuSnpModeTemplate = {
EFI_SIMPLE_NETWORK_MODE gEmuSnpModeTemplate = {
EfiSimpleNetworkStopped, // State
NET_ETHER_ADDR_LEN, // HwAddressSize
NET_ETHER_HEADER_SIZE, // MediaHeaderSize
@@ -48,7 +46,9 @@ EFI_SIMPLE_NETWORK_MODE gEmuSnpModeTemplate = {
MAX_MCAST_FILTER_CNT, // MaxMCastFilterCount
0, // MCastFilterCount
{
{ { 0 } }
{
{ 0 }
}
}, // MCastFilter
{
{ 0 }
@@ -66,7 +66,6 @@ EFI_SIMPLE_NETWORK_MODE gEmuSnpModeTemplate = {
TRUE // MediaPresent
};
/**
Changes the state of a network interface from "stopped" to "started".
@@ -77,12 +76,12 @@ EFI_SIMPLE_NETWORK_MODE gEmuSnpModeTemplate = {
**/
EFI_STATUS
EFIAPI
EmuSnpStart(
IN EFI_SIMPLE_NETWORK_PROTOCOL *This
EmuSnpStart (
IN EFI_SIMPLE_NETWORK_PROTOCOL *This
)
{
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
@@ -90,7 +89,6 @@ EmuSnpStart(
return Status;
}
/**
Changes the state of a network interface from "started" to "stopped".
@@ -102,11 +100,11 @@ EmuSnpStart(
EFI_STATUS
EFIAPI
EmuSnpStop (
IN EFI_SIMPLE_NETWORK_PROTOCOL *This
IN EFI_SIMPLE_NETWORK_PROTOCOL *This
)
{
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
@@ -114,7 +112,6 @@ EmuSnpStop (
return Status;
}
/**
Resets a network adapter and allocates the transmit and receive buffers
required by the network interface; optionally, also requests allocation
@@ -138,13 +135,13 @@ EmuSnpStop (
EFI_STATUS
EFIAPI
EmuSnpInitialize (
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 Status;
EMU_SNP_PRIVATE_DATA *Private;
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
@@ -167,12 +164,12 @@ EmuSnpInitialize (
EFI_STATUS
EFIAPI
EmuSnpReset (
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
IN BOOLEAN ExtendedVerification
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
IN BOOLEAN ExtendedVerification
)
{
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
@@ -192,11 +189,11 @@ EmuSnpReset (
EFI_STATUS
EFIAPI
EmuSnpShutdown (
IN EFI_SIMPLE_NETWORK_PROTOCOL *This
IN EFI_SIMPLE_NETWORK_PROTOCOL *This
)
{
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
@@ -228,16 +225,16 @@ EmuSnpShutdown (
EFI_STATUS
EFIAPI
EmuSnpReceiveFilters (
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
IN UINT32 EnableBits,
IN UINT32 DisableBits,
IN BOOLEAN ResetMcastFilter,
IN UINTN McastFilterCount OPTIONAL,
IN EFI_MAC_ADDRESS *McastFilter OPTIONAL
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
IN UINT32 EnableBits,
IN UINT32 DisableBits,
IN BOOLEAN ResetMcastFilter,
IN UINTN McastFilterCount OPTIONAL,
IN EFI_MAC_ADDRESS *McastFilter OPTIONAL
)
{
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
@@ -266,13 +263,13 @@ EmuSnpReceiveFilters (
EFI_STATUS
EFIAPI
EmuSnpStationAddress (
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
IN BOOLEAN Reset,
IN EFI_MAC_ADDRESS *NewMacAddr OPTIONAL
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
IN BOOLEAN Reset,
IN EFI_MAC_ADDRESS *NewMacAddr OPTIONAL
)
{
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
@@ -302,14 +299,14 @@ EmuSnpStationAddress (
EFI_STATUS
EFIAPI
EmuSnpStatistics (
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
IN BOOLEAN Reset,
IN OUT UINTN *StatisticsSize OPTIONAL,
OUT EFI_NETWORK_STATISTICS *StatisticsTable OPTIONAL
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
IN BOOLEAN Reset,
IN OUT UINTN *StatisticsSize OPTIONAL,
OUT EFI_NETWORK_STATISTICS *StatisticsTable OPTIONAL
)
{
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
@@ -339,14 +336,14 @@ EmuSnpStatistics (
EFI_STATUS
EFIAPI
EmuSnpMcastIptoMac (
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
IN BOOLEAN Ipv6,
IN EFI_IP_ADDRESS *Ip,
OUT EFI_MAC_ADDRESS *Mac
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
IN BOOLEAN Ipv6,
IN EFI_IP_ADDRESS *Ip,
OUT EFI_MAC_ADDRESS *Mac
)
{
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
@@ -354,7 +351,6 @@ EmuSnpMcastIptoMac (
return Status;
}
/**
Performs read and write operations on the NVRAM device attached to a
network interface.
@@ -374,15 +370,15 @@ EmuSnpMcastIptoMac (
EFI_STATUS
EFIAPI
EmuSnpNvdata (
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
IN BOOLEAN ReadOrWrite,
IN UINTN Offset,
IN UINTN BufferSize,
IN OUT VOID *Buffer
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
IN BOOLEAN ReadOrWrite,
IN UINTN Offset,
IN UINTN BufferSize,
IN OUT VOID *Buffer
)
{
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
@@ -390,7 +386,6 @@ EmuSnpNvdata (
return Status;
}
/**
Reads the current interrupt status and recycled transmit buffer status from
a network interface.
@@ -415,13 +410,13 @@ EmuSnpNvdata (
EFI_STATUS
EFIAPI
EmuSnpGetStatus (
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
OUT UINT32 *InterruptStatus,
OUT VOID **TxBuffer
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
OUT UINT32 *InterruptStatus,
OUT VOID **TxBuffer
)
{
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
@@ -429,7 +424,6 @@ EmuSnpGetStatus (
return Status;
}
/**
Places a packet in the transmit queue of a network interface.
@@ -463,17 +457,17 @@ EmuSnpGetStatus (
EFI_STATUS
EFIAPI
EmuSnpTransmit (
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
IN UINTN HeaderSize,
IN UINTN BufferSize,
IN VOID* Buffer,
IN EFI_MAC_ADDRESS *SrcAddr OPTIONAL,
IN EFI_MAC_ADDRESS *DestAddr OPTIONAL,
IN UINT16 *Protocol OPTIONAL
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
IN UINTN HeaderSize,
IN UINTN BufferSize,
IN VOID *Buffer,
IN EFI_MAC_ADDRESS *SrcAddr OPTIONAL,
IN EFI_MAC_ADDRESS *DestAddr OPTIONAL,
IN UINT16 *Protocol OPTIONAL
)
{
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
@@ -522,17 +516,17 @@ EmuSnpTransmit (
EFI_STATUS
EFIAPI
EmuSnpReceive (
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
OUT UINTN *HeaderSize OPTIONAL,
IN OUT UINTN *BuffSize,
OUT VOID *Buffer,
OUT EFI_MAC_ADDRESS *SourceAddr OPTIONAL,
OUT EFI_MAC_ADDRESS *DestinationAddr OPTIONAL,
OUT UINT16 *Protocol OPTIONAL
IN EFI_SIMPLE_NETWORK_PROTOCOL *This,
OUT UINTN *HeaderSize OPTIONAL,
IN OUT UINTN *BuffSize,
OUT VOID *Buffer,
OUT EFI_MAC_ADDRESS *SourceAddr OPTIONAL,
OUT EFI_MAC_ADDRESS *DestinationAddr OPTIONAL,
OUT UINT16 *Protocol OPTIONAL
)
{
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private;
Private = EMU_SNP_PRIVATE_DATA_FROM_SNP_THIS (This);
@@ -548,8 +542,6 @@ EmuSnpReceive (
return Status;
}
/**
Test to see if this driver supports ControllerHandle. This service
is called by the EFI boot service ConnectController(). In
@@ -583,15 +575,15 @@ EmuSnpDriverBindingSupported (
if (RemainingDevicePath != NULL) {
if (!IsDevicePathEnd (RemainingDevicePath)) {
Node = (MAC_ADDR_DEVICE_PATH *)RemainingDevicePath;
if (Node->Header.Type != MESSAGING_DEVICE_PATH ||
Node->Header.SubType != MSG_MAC_ADDR_DP) {
if ((Node->Header.Type != MESSAGING_DEVICE_PATH) ||
(Node->Header.SubType != MSG_MAC_ADDR_DP))
{
// If the remaining device path does not match we don't support the request
return EFI_UNSUPPORTED;
}
}
}
//
// Open the IO Abstraction(s) needed to perform the supported test
//
@@ -611,12 +603,11 @@ EmuSnpDriverBindingSupported (
// Close the I/O Abstraction(s) used to perform the supported test
//
gBS->CloseProtocol (
ControllerHandle,
&gEmuIoThunkProtocolGuid,
This->DriverBindingHandle,
ControllerHandle
);
ControllerHandle,
&gEmuIoThunkProtocolGuid,
This->DriverBindingHandle,
ControllerHandle
);
//
// Open the EFI Device Path protocol needed to perform the supported test
@@ -624,7 +615,7 @@ EmuSnpDriverBindingSupported (
Status = gBS->OpenProtocol (
ControllerHandle,
&gEfiDevicePathProtocolGuid,
(VOID **) &ParentDevicePath,
(VOID **)&ParentDevicePath,
This->DriverBindingHandle,
ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER
@@ -649,16 +640,15 @@ EmuSnpDriverBindingSupported (
// Close protocol, don't use device path protocol in the Support() function
//
gBS->CloseProtocol (
ControllerHandle,
&gEfiDevicePathProtocolGuid,
This->DriverBindingHandle,
ControllerHandle
);
ControllerHandle,
&gEfiDevicePathProtocolGuid,
This->DriverBindingHandle,
ControllerHandle
);
return Status;
}
/**
Start this driver on ControllerHandle. This service is called by the
EFI boot service ConnectController(). In order to make
@@ -683,21 +673,21 @@ EmuSnpDriverBindingStart (
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
)
{
EFI_STATUS Status;
EMU_IO_THUNK_PROTOCOL *EmuIoThunk;
EMU_SNP_PRIVATE_DATA *Private;
MAC_ADDR_DEVICE_PATH Node;
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
EFI_STATUS Status;
EMU_IO_THUNK_PROTOCOL *EmuIoThunk;
EMU_SNP_PRIVATE_DATA *Private;
MAC_ADDR_DEVICE_PATH Node;
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
Private = NULL;
//
// Grab the protocols we need
//
Status = gBS->OpenProtocol(
Status = gBS->OpenProtocol (
ControllerHandle,
&gEfiDevicePathProtocolGuid,
( VOID ** ) &ParentDevicePath,
(VOID **)&ParentDevicePath,
This->DriverBindingHandle,
ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER
@@ -739,15 +729,14 @@ EmuSnpDriverBindingStart (
CopyMem (&Private->Snp, &gEmuSnpTemplate, sizeof (EFI_SIMPLE_NETWORK_PROTOCOL));
CopyMem (&Private->Mode, &gEmuSnpModeTemplate, sizeof (EFI_SIMPLE_NETWORK_MODE));
Private->Signature = EMU_SNP_PRIVATE_DATA_SIGNATURE;
Private->IoThunk = EmuIoThunk;
Private->Io = EmuIoThunk->Interface;
Private->EfiHandle = ControllerHandle;
Private->DeviceHandle = NULL;
Private->Snp.Mode = &Private->Mode;
Private->Signature = EMU_SNP_PRIVATE_DATA_SIGNATURE;
Private->IoThunk = EmuIoThunk;
Private->Io = EmuIoThunk->Interface;
Private->EfiHandle = ControllerHandle;
Private->DeviceHandle = NULL;
Private->Snp.Mode = &Private->Mode;
Private->ControllerNameTable = NULL;
Status = Private->Io->CreateMapping (Private->Io, &Private->Mode);
if (EFI_ERROR (Status)) {
goto Done;
@@ -759,11 +748,11 @@ EmuSnpDriverBindingStart (
//
ZeroMem (&Node, sizeof (MAC_ADDR_DEVICE_PATH));
Node.Header.Type = MESSAGING_DEVICE_PATH;
Node.Header.SubType = MSG_MAC_ADDR_DP;
Node.IfType = Private->Mode.IfType;
Node.Header.Type = MESSAGING_DEVICE_PATH;
Node.Header.SubType = MSG_MAC_ADDR_DP;
Node.IfType = Private->Mode.IfType;
SetDevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL * )&Node, sizeof (MAC_ADDR_DEVICE_PATH));
SetDevicePathNodeLength ((EFI_DEVICE_PATH_PROTOCOL *)&Node, sizeof (MAC_ADDR_DEVICE_PATH));
CopyMem (&Node.MacAddress, &Private->Mode.CurrentAddress, sizeof (EFI_MAC_ADDRESS));
@@ -795,10 +784,12 @@ EmuSnpDriverBindingStart (
//
// Create Child Handle
//
Status = gBS->InstallMultipleProtocolInterfaces(
Status = gBS->InstallMultipleProtocolInterfaces (
&Private->DeviceHandle,
&gEfiSimpleNetworkProtocolGuid, &Private->Snp,
&gEfiDevicePathProtocolGuid, Private->DevicePath,
&gEfiSimpleNetworkProtocolGuid,
&Private->Snp,
&gEfiDevicePathProtocolGuid,
Private->DevicePath,
NULL
);
if (EFI_ERROR (Status)) {
@@ -822,13 +813,14 @@ Done:
if (Private != NULL) {
FreePool (Private);
}
if (ParentDevicePath != NULL) {
gBS->CloseProtocol(
ControllerHandle,
&gEfiDevicePathProtocolGuid,
This->DriverBindingHandle,
ControllerHandle
);
gBS->CloseProtocol (
ControllerHandle,
&gEfiDevicePathProtocolGuid,
This->DriverBindingHandle,
ControllerHandle
);
}
}
@@ -855,16 +847,16 @@ Done:
EFI_STATUS
EFIAPI
EmuSnpDriverBindingStop (
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;
EMU_SNP_PRIVATE_DATA *Private = NULL;
EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
VOID *EmuIoThunk;
EFI_STATUS Status;
EMU_SNP_PRIVATE_DATA *Private = NULL;
EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
VOID *EmuIoThunk;
//
// Complete all outstanding transactions to Controller.
@@ -892,14 +884,13 @@ EmuSnpDriverBindingStop (
ASSERT (NumberOfChildren == 1);
//
// Get our context back.
//
Status = gBS->OpenProtocol(
Status = gBS->OpenProtocol (
ChildHandleBuffer[0],
&gEfiSimpleNetworkProtocolGuid,
( VOID ** ) &Snp,
(VOID **)&Snp,
This->DriverBindingHandle,
ControllerHandle,
EFI_OPEN_PROTOCOL_GET_PROTOCOL
@@ -912,7 +903,7 @@ EmuSnpDriverBindingStop (
ASSERT (Private->DeviceHandle == ChildHandleBuffer[0]);
ASSERT (Private->EfiHandle == ControllerHandle);
Status = gBS->CloseProtocol(
Status = gBS->CloseProtocol (
ControllerHandle,
&gEmuIoThunkProtocolGuid,
This->DriverBindingHandle,
@@ -920,10 +911,12 @@ EmuSnpDriverBindingStop (
);
ASSERT_EFI_ERROR (Status);
Status = gBS->UninstallMultipleProtocolInterfaces(
Status = gBS->UninstallMultipleProtocolInterfaces (
Private->DeviceHandle,
&gEfiSimpleNetworkProtocolGuid, &Private->Snp,
&gEfiDevicePathProtocolGuid, Private->DevicePath,
&gEfiSimpleNetworkProtocolGuid,
&Private->Snp,
&gEfiDevicePathProtocolGuid,
Private->DevicePath,
NULL
);
if (EFI_ERROR (Status)) {
@@ -947,8 +940,7 @@ EmuSnpDriverBindingStop (
return Status;
}
EFI_DRIVER_BINDING_PROTOCOL gEmuSnpDriverBinding = {
EFI_DRIVER_BINDING_PROTOCOL gEmuSnpDriverBinding = {
EmuSnpDriverBindingSupported,
EmuSnpDriverBindingStart,
EmuSnpDriverBindingStop,
@@ -957,8 +949,6 @@ EFI_DRIVER_BINDING_PROTOCOL gEmuSnpDriverBinding = {
NULL
};
/**
This is the declaration of an EFI image entry point. This entry point is
the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
@@ -975,22 +965,22 @@ EFI_STATUS
EFIAPI
InitializeEmuSnpDriver (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
EFI_STATUS Status;
//
// Install the Driver Protocols
//
Status = EfiLibInstallDriverBindingComponentName2(
ImageHandle,
SystemTable,
&gEmuSnpDriverBinding,
ImageHandle,
&gEmuSnpDriverComponentName,
&gEmuSnpDriverComponentName2
);
Status = EfiLibInstallDriverBindingComponentName2 (
ImageHandle,
SystemTable,
&gEmuSnpDriverBinding,
ImageHandle,
&gEmuSnpDriverComponentName,
&gEmuSnpDriverComponentName2
);
return Status;
}