Add in the 1st version of ECP.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2832 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qwang12
2007-06-28 07:00:39 +00:00
parent 30d4a0c7ec
commit 3eb9473ea9
1433 changed files with 266617 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
/*++
Copyright (c) 2007, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
AcpiTable.c
Abstract:
ACPI Table Protocol from the UEFI 2.1 specification.
This protocol may be used to install or remove an ACPI table from a platform.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (AcpiTable)
EFI_GUID gEfiAcpiTableProtocolGuid = EFI_ACPI_TABLE_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiAcpiTableProtocolGuid, "UEFI ACPI Table Protocol", "UEFI ACPI Table Protocol");

View File

@@ -0,0 +1,112 @@
/*++
Copyright (c) 2007, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
AcpiTable.h
Abstract:
ACPI Table Protocol from the UEFI 2.1 specification.
This protocol may be used to install or remove an ACPI table from a platform.
--*/
#ifndef __ACPI_TABLE_H__
#define __ACPI_TABLE_H__
#include "Acpi.h"
//
// Global ID for the Acpi Table Protocol
//
#define EFI_ACPI_TABLE_PROTOCOL_GUID \
{ \
0xffe06bdd, 0x6107, 0x46a6, 0x7b, 0xb2, 0x5a, 0x9c, 0x7e, 0xc5, 0x27, 0x5c \
}
EFI_FORWARD_DECLARATION (EFI_ACPI_TABLE_PROTOCOL);
#define UEFI_ACPI_TABLE_SIGNATURE EFI_SIGNATURE_32 ('U', 'E', 'F', 'I')
#pragma pack(1)
typedef struct {
EFI_ACPI_DESCRIPTION_HEADER Header;
EFI_GUID Identifier;
UINT16 DataOffset;
} EFI_ACPI_TABLE;
#pragma pack()
typedef
EFI_STATUS
(EFIAPI *EFI_ACPI_TABLE_INSTALL_ACPI_TABLE) (
IN EFI_ACPI_TABLE_PROTOCOL *This,
IN VOID *AcpiTableBuffer,
IN UINTN AcpiTableBufferSize,
OUT UINTN *TableKey
)
/*++
Routine Description:
Installs an ACPI table into the RSDT/XSDT.
Arguments:
This - Protocol instance pointer.
AcpiTableBuffer - A pointer to a buffer containing the ACPI table to be installed.
AcpiTableBufferSize - Specifies the size, in bytes, of the AcpiTableBuffer buffer.
TableKey - Reurns a key to refer to the ACPI table.
Returns:
EFI_SUCCESS - The table was successfully inserted.
EFI_INVALID_PARAMETER - Either AcpiTableBuffer is NULL, TableKey is NULL, or AcpiTableBufferSize
and the size field embedded in the ACPI table pointed to by AcpiTableBuffer
are not in sync.
EFI_OUT_OF_RESOURCES - Insufficient resources exist to complete the request.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_ACPI_TABLE_UNINSTALL_ACPI_TABLE) (
IN EFI_ACPI_TABLE_PROTOCOL *This,
IN UINTN TableKey
)
/*++
Routine Description:
Removes an ACPI table from the RSDT/XSDT.
Arguments:
This - Protocol instance pointer.
TableKey - Specifies the table to uninstall. The key was returned from InstallAcpiTable().
Returns:
EFI_SUCCESS - The table was successfully uninstalled.
EFI_NOT_FOUND - TableKey does not refer to a valid key for a table entry.
--*/
;
//
// Interface structure for the ACPI Table Protocol
//
typedef struct _EFI_ACPI_TABLE_PROTOCOL {
EFI_ACPI_TABLE_INSTALL_ACPI_TABLE InstallAcpiTable;
EFI_ACPI_TABLE_UNINSTALL_ACPI_TABLE UninstallAcpiTable;
} EFI_ACPI_TABLE_PROTOCOL;
extern EFI_GUID gEfiAcpiTableProtocolGuid;
#endif

View File

@@ -0,0 +1,29 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Arp.c
Abstract:
UEFI Arp protocol.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (Arp)
EFI_GUID gEfiArpServiceBindingProtocolGuid = EFI_ARP_SERVICE_BINDING_PROTOCOL_GUID;
EFI_GUID gEfiArpProtocolGuid = EFI_ARP_PROTOCOL_GUID;
EFI_GUID_STRING (&gEfiArpServiceBindingProtocolGuid, "ARP Service Binding Protocol", "ARP Service Binding Protocol");
EFI_GUID_STRING (&gEfiArpProtocolGuid, "ARP Protocol", "ARP Protocol");

View File

@@ -0,0 +1,136 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Arp.h
Abstract:
UEFI Arp protocol definition.
--*/
#ifndef _ARP_H_
#define _ARP_H_
#include EFI_PROTOCOL_DEFINITION (ServiceBinding)
#define EFI_ARP_SERVICE_BINDING_PROTOCOL_GUID \
{ 0xf44c00ee, 0x1f2c, 0x4a00, 0xaa, 0x9, 0x1c, 0x9f, 0x3e, 0x8, 0x0, 0xa3 }
#define EFI_ARP_PROTOCOL_GUID \
{ 0xf4b427bb, 0xba21, 0x4f16, 0xbc, 0x4e, 0x43, 0xe4, 0x16, 0xab, 0x61, 0x9c }
EFI_FORWARD_DECLARATION (EFI_ARP_PROTOCOL);
typedef struct _EFI_ARP_FIND_DATA {
UINT32 Size;
BOOLEAN DenyFlag;
BOOLEAN StaticFlag;
UINT16 HwAddressType;
UINT16 SwAddressType;
UINT8 HwAddressLength;
UINT8 SwAddressLength;
} EFI_ARP_FIND_DATA;
//****************************************************
// EFI_ARP_CONFIG_DATA
//****************************************************
typedef struct EFI_ARP_CONFIG_DATA {
UINT16 SwAddressType; // Host byte order
UINT8 SwAddressLength;
VOID *StationAddress; // Network byte order
UINT32 EntryTimeOut;
UINT32 RetryCount;
UINT32 RetryTimeOut;
} EFI_ARP_CONFIG_DATA;
typedef
EFI_STATUS
(EFIAPI *EFI_ARP_CONFIGURE) (
IN EFI_ARP_PROTOCOL *This,
IN EFI_ARP_CONFIG_DATA *ConfigData OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_ARP_ADD) (
IN EFI_ARP_PROTOCOL *This,
IN BOOLEAN DenyFlag,
IN VOID *TargetSwAddress OPTIONAL,
IN VOID *TargetHwAddress OPTIONAL,
IN UINT32 TimeoutValue,
IN BOOLEAN Overwrite
);
typedef
EFI_STATUS
(EFIAPI *EFI_ARP_FIND) (
IN EFI_ARP_PROTOCOL *This,
IN BOOLEAN BySwAddress,
IN VOID *AddressBuffer OPTIONAL,
OUT UINT32 *EntryLength OPTIONAL,
OUT UINT32 *EntryCount OPTIONAL,
OUT EFI_ARP_FIND_DATA **Entries OPTIONAL,
IN BOOLEAN Refresh
);
typedef
EFI_STATUS
(EFIAPI *EFI_ARP_DELETE) (
IN EFI_ARP_PROTOCOL *This,
IN BOOLEAN BySwAddress,
IN VOID *AddressBuffer OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_ARP_FLUSH) (
IN EFI_ARP_PROTOCOL *This
);
typedef
EFI_STATUS
(EFIAPI *EFI_ARP_REQUEST) (
IN EFI_ARP_PROTOCOL *This,
IN VOID *TargetSwAddress OPTIONAL,
IN EFI_EVENT ResolvedEvent OPTIONAL,
OUT VOID *TargetHwAddress
);
typedef
EFI_STATUS
(EFIAPI *EFI_ARP_CANCEL) (
IN EFI_ARP_PROTOCOL *This,
IN VOID *TargetSwAddress OPTIONAL,
IN EFI_EVENT ResolvedEvent OPTIONAL
);
typedef struct _EFI_ARP_PROTOCOL {
EFI_ARP_CONFIGURE Configure;
EFI_ARP_ADD Add;
EFI_ARP_FIND Find;
EFI_ARP_DELETE Delete;
EFI_ARP_FLUSH Flush;
EFI_ARP_REQUEST Request;
EFI_ARP_CANCEL Cancel;
} EFI_ARP_PROTOCOL;
extern EFI_GUID gEfiArpServiceBindingProtocolGuid;
extern EFI_GUID gEfiArpProtocolGuid;
#endif

View File

@@ -0,0 +1,27 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Bis.c
Abstract:
This file defines the Bis protocol
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (Bis)
EFI_GUID gEfiBisProtocolGuid = EFI_BIS_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiBisProtocolGuid, "BIS Base Protocol", "BIS Base protocol");

View File

@@ -0,0 +1,233 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Bis.h
Abstract:
This file defines the BIS protocol.
--*/
#ifndef _BIS_H_
#define _BIS_H_
#include <EfiSpec.h>
//
// Basic types
//
typedef VOID *BIS_APPLICATION_HANDLE;
typedef UINT16 BIS_ALG_ID;
typedef UINT32 BIS_CERT_ID;
//
// EFI_BIS_DATA type.
//
// EFI_BIS_DATA instances obtained from BIS must be freed by calling Free( ).
//
typedef struct _EFI_BIS_DATA {
UINT32 Length; // Length of Data in 8 bit bytes.
UINT8 *Data; // 32 Bit Flat Address of data.
} EFI_BIS_DATA;
//
// EFI_BIS_VERSION type.
//
typedef struct _EFI_BIS_VERSION {
UINT32 Major; // BIS Interface version number.
UINT32 Minor; // Build number.
} EFI_BIS_VERSION;
//
// ----------------------------------------------------//
// Use these values to initialize EFI_BIS_VERSION.Major
// and to interpret results of Initialize.
// ----------------------------------------------------//
//
#define BIS_CURRENT_VERSION_MAJOR BIS_VERSION_1
#define BIS_VERSION_1 1
//
// EFI_BIS_SIGNATURE_INFO type.
//
typedef struct _EFI_BIS_SIGNATURE_INFO {
BIS_CERT_ID CertificateID; // Truncated hash of platform Boot Object
// authorization certificate.
//
BIS_ALG_ID AlgorithmID; // A signature algorithm number.
UINT16 KeyLength; // Length of alg. keys in bits.
} EFI_BIS_SIGNATURE_INFO;
//
// Currently defined values for EFI_BIS_SIGNATURE_INFO.AlgorithmID.
// The exact numeric values come from
// "Common Data Security Architecture (CDSA) Specification".
//
#define BIS_ALG_DSA (41) // CSSM_ALGID_DSA
#define BIS_ALG_RSA_MD5 (42) // CSSM_ALGID_MD5_WITH_RSA
// Currently defined values for EFI_BIS_SIGNATURE_INFO.CertificateId.
//
#define BIS_CERT_ID_DSA BIS_ALG_DSA // CSSM_ALGID_DSA
#define BIS_CERT_ID_RSA_MD5 BIS_ALG_RSA_MD5 // CSSM_ALGID_MD5_WITH_RSA
// The following is a mask value that gets applied to the truncated hash of a
// platform Boot Object Authorization Certificate to create the certificateID.
// A certificateID must not have any bits set to the value 1 other than bits in
// this mask.
//
#define BIS_CERT_ID_MASK (0xFF7F7FFF)
//
// Macros for dealing with the EFI_BIS_DATA object obtained
// from BIS_GetSignatureInfo()
// BIS_GET_SIGINFO_COUNT - tells how many EFI_BIS_SIGNATURE_INFO
// elements are contained in a EFI_BIS_DATA struct pointed to
// by the provided EFI_BIS_DATA*.
//
#define BIS_GET_SIGINFO_COUNT(BisDataPtr) ((BisDataPtr)->Length / sizeof (EFI_BIS_SIGNATURE_INFO))
//
// BIS_GET_SIGINFO_ARRAY - produces a EFI_BIS_SIGNATURE_INFO*
// from a given EFI_BIS_DATA*.
//
#define BIS_GET_SIGINFO_ARRAY(BisDataPtr) ((EFI_BIS_SIGNATURE_INFO *) (BisDataPtr)->Data)
//
// Binary Value of "X-Intel-BIS-ParameterSet" Attribute.
// (Value is Base64 encoded in actual signed manifest).
// {EDD35E31-07B9-11d2-83A3-00A0C91FADCF}
//
#define BOOT_OBJECT_AUTHORIZATION_PARMSET_GUIDVALUE \
{ \
0xedd35e31, 0x7b9, 0x11d2, \
{ \
0x83, 0xa3, 0x0, 0xa0, 0xc9, 0x1f, 0xad, 0xcf \
} \
}
//
// -----------------------------------//
// EFI_BIS_PROTOCOL
// -----------------------------------//
//
#define EFI_BIS_PROTOCOL_GUID \
{ \
0x0b64aab0, 0x5429, 0x11d4, 0x98, 0x16, 0x00, 0xa0, 0xc9, 0x1f, 0xad, 0xcf \
}
typedef struct _EFI_BIS_PROTOCOL EFI_BIS_PROTOCOL;
typedef
EFI_STATUS
(EFIAPI *EFI_BIS_INITIALIZE) (
IN EFI_BIS_PROTOCOL * This, // this
OUT BIS_APPLICATION_HANDLE * AppHandle, // Application handle.
IN OUT EFI_BIS_VERSION * InterfaceVersion, // ver needed/available.
IN EFI_BIS_DATA * TargetAddress // Address of BIS platform.
);
typedef
EFI_STATUS
(EFIAPI *EFI_BIS_FREE) (
IN BIS_APPLICATION_HANDLE AppHandle, // From Initialize( ).
IN EFI_BIS_DATA * ToFree // EFI_BIS_DATA being freed.
);
typedef
EFI_STATUS
(EFIAPI *EFI_BIS_SHUTDOWN) (
IN BIS_APPLICATION_HANDLE AppHandle // From Initialize( ).
);
typedef
EFI_STATUS
(EFIAPI *EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CERTIFICATE) (
IN BIS_APPLICATION_HANDLE AppHandle, // From Initialize( ).
OUT EFI_BIS_DATA **Certificate // Pointer to certificate.
);
typedef
EFI_STATUS
(EFIAPI *EFI_BIS_VERIFY_BOOT_OBJECT) (
IN BIS_APPLICATION_HANDLE AppHandle, // From Initialize( ).
IN EFI_BIS_DATA * Credentials, // Verification signed manifest.
IN EFI_BIS_DATA * DataObject, // Boot object to verify.
OUT BOOLEAN *IsVerified // Result of verifcation.
);
typedef
EFI_STATUS
(EFIAPI *EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CHECKFLAG) (
IN BIS_APPLICATION_HANDLE AppHandle, // From Initialize( ).
OUT BOOLEAN *CheckIsRequired // Value of check flag.
);
typedef
EFI_STATUS
(EFIAPI *EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_UPDATE_TOKEN) (
IN BIS_APPLICATION_HANDLE AppHandle, // From Initialize( ).
OUT EFI_BIS_DATA **UpdateToken // Value of update token.
);
typedef
EFI_STATUS
(EFIAPI *EFI_BIS_UPDATE_BOOT_OBJECT_AUTHORIZATION) (
IN BIS_APPLICATION_HANDLE AppHandle, // From Initialize( ).
IN EFI_BIS_DATA * RequestCredential, // Update Request Manifest.
OUT EFI_BIS_DATA **NewUpdateToken // Next update token.
);
typedef
EFI_STATUS
(EFIAPI *EFI_BIS_VERIFY_OBJECT_WITH_CREDENTIAL) (
IN BIS_APPLICATION_HANDLE AppHandle, // From Initialize( ).
IN EFI_BIS_DATA * Credentials, // Verification signed manifest.
IN EFI_BIS_DATA * DataObject, // Boot object to verify.
IN EFI_BIS_DATA * SectionName, // Name of credential section to use.
IN EFI_BIS_DATA * AuthorityCertificate, // Certificate for credentials.
OUT BOOLEAN *IsVerified // Result of verifcation.
);
typedef
EFI_STATUS
(EFIAPI *EFI_BIS_GET_SIGNATURE_INFO) (
IN BIS_APPLICATION_HANDLE AppHandle, // From Initialize( ).
OUT EFI_BIS_DATA **SignatureInfo // Signature info struct.
);
#define EFI_BIS_PROTOCOL_REVISION 0x00010000
typedef struct _EFI_BIS_PROTOCOL {
//
// member vars
//
UINT64 Revision;
//
// methods
//
EFI_BIS_INITIALIZE Initialize;
EFI_BIS_SHUTDOWN Shutdown;
EFI_BIS_FREE Free;
EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CERTIFICATE GetBootObjectAuthorizationCertificate;
EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CHECKFLAG GetBootObjectAuthorizationCheckFlag;
EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_UPDATE_TOKEN GetBootObjectAuthorizationUpdateToken;
EFI_BIS_GET_SIGNATURE_INFO GetSignatureInfo;
EFI_BIS_UPDATE_BOOT_OBJECT_AUTHORIZATION UpdateBootObjectAuthorization;
EFI_BIS_VERIFY_BOOT_OBJECT VerifyBootObject;
EFI_BIS_VERIFY_OBJECT_WITH_CREDENTIAL VerifyObjectWithCredential;
} EFI_BIS_PROTOCOL;
extern EFI_GUID gEfiBisProtocolGuid;
#endif

View File

@@ -0,0 +1,31 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
BlockIo.c
Abstract:
Block IO protocol as defined in the EFI 1.0 specification.
The Block IO protocol is used to abstract block devices like hard drives,
DVD-ROMs and floppy drives.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (BlockIo)
EFI_GUID gEfiBlockIoProtocolGuid = EFI_BLOCK_IO_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiBlockIoProtocolGuid, "BlockIo Protocol", "EFI 1.0 Block IO protocol");

View File

@@ -0,0 +1,206 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
BlockIo.h
Abstract:
Block IO protocol as defined in the EFI 1.0 specification.
The Block IO protocol is used to abstract block devices like hard drives,
DVD-ROMs and floppy drives.
--*/
#ifndef __BLOCK_IO_H__
#define __BLOCK_IO_H__
#define EFI_BLOCK_IO_PROTOCOL_GUID \
{ \
0x964e5b21, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b \
}
//
// Forward reference for pure ANSI compatability
//
EFI_FORWARD_DECLARATION (EFI_BLOCK_IO_PROTOCOL);
typedef
EFI_STATUS
(EFIAPI *EFI_BLOCK_RESET) (
IN EFI_BLOCK_IO_PROTOCOL * This,
IN BOOLEAN ExtendedVerification
)
/*++
Routine Description:
Reset the Block Device.
Arguments:
This - Protocol instance pointer.
ExtendedVerification - Driver may perform diagnostics on reset.
Returns:
EFI_SUCCESS - The device was reset.
EFI_DEVICE_ERROR - The device is not functioning properly and could
not be reset.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_BLOCK_READ) (
IN EFI_BLOCK_IO_PROTOCOL * This,
IN UINT32 MediaId,
IN EFI_LBA Lba,
IN UINTN BufferSize,
OUT VOID *Buffer
)
/*++
Routine Description:
Read BufferSize bytes from Lba into Buffer.
Arguments:
This - Protocol instance pointer.
MediaId - Id of the media, changes every time the media is replaced.
Lba - The starting Logical Block Address to read from
BufferSize - Size of Buffer, must be a multiple of device block size.
Buffer - Buffer containing read data
Returns:
EFI_SUCCESS - The data was read correctly from the device.
EFI_DEVICE_ERROR - The device reported an error while performing the read.
EFI_NO_MEDIA - There is no media in the device.
EFI_MEDIA_CHANGED - The MediaId does not matched the current device.
EFI_BAD_BUFFER_SIZE - The Buffer was not a multiple of the block size of the
device.
EFI_INVALID_PARAMETER - The read request contains device addresses that are not
valid for the device.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_BLOCK_WRITE) (
IN EFI_BLOCK_IO_PROTOCOL * This,
IN UINT32 MediaId,
IN EFI_LBA Lba,
IN UINTN BufferSize,
IN VOID *Buffer
)
/*++
Routine Description:
Write BufferSize bytes from Lba into Buffer.
Arguments:
This - Protocol instance pointer.
MediaId - Id of the media, changes every time the media is replaced.
Lba - The starting Logical Block Address to read from
BufferSize - Size of Buffer, must be a multiple of device block size.
Buffer - Buffer containing read data
Returns:
EFI_SUCCESS - The data was written correctly to the device.
EFI_WRITE_PROTECTED - The device can not be written to.
EFI_DEVICE_ERROR - The device reported an error while performing the write.
EFI_NO_MEDIA - There is no media in the device.
EFI_MEDIA_CHNAGED - The MediaId does not matched the current device.
EFI_BAD_BUFFER_SIZE - The Buffer was not a multiple of the block size of the
device.
EFI_INVALID_PARAMETER - The write request contains a LBA that is not
valid for the device.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_BLOCK_FLUSH) (
IN EFI_BLOCK_IO_PROTOCOL * This
)
/*++
Routine Description:
Flush the Block Device.
Arguments:
This - Protocol instance pointer.
Returns:
EFI_SUCCESS - All outstanding data was written to the device
EFI_DEVICE_ERROR - The device reported an error while writting back the data
EFI_NO_MEDIA - There is no media in the device.
--*/
;
/*++
Block IO read only mode data and updated only via members of BlockIO
MediaId - The curent media Id. If the media changes, this value is changed.
RemovableMedia - TRUE if the media is removable; otherwise, FALSE.
MediaPresent - TRUE if there is a media currently present in the device;
othersise, FALSE. THis field shows the media present status
as of the most recent ReadBlocks() or WriteBlocks() call.
LogicalPartition - TRUE if LBA 0 is the first block of a partition; otherwise
FALSE. For media with only one partition this would be TRUE.
ReadOnly - TRUE if the media is marked read-only otherwise, FALSE. This
field shows the read-only status as of the most recent
WriteBlocks () call.
WriteCaching - TRUE if the WriteBlock () function caches write data.
BlockSize - The intrinsic block size of the device. If the media changes, then
this field is updated.
IoAlign - Supplies the alignment requirement for any buffer to read or write
block(s).
LastBlock - The last logical block address on the device. If the media changes,
then this field is updated.
--*/
typedef struct {
UINT32 MediaId;
BOOLEAN RemovableMedia;
BOOLEAN MediaPresent;
BOOLEAN LogicalPartition;
BOOLEAN ReadOnly;
BOOLEAN WriteCaching;
UINT32 BlockSize;
UINT32 IoAlign;
EFI_LBA LastBlock;
} EFI_BLOCK_IO_MEDIA;
#define EFI_BLOCK_IO_PROTOCOL_REVISION 0x00010000
typedef struct _EFI_BLOCK_IO_PROTOCOL {
UINT64 Revision;
EFI_BLOCK_IO_MEDIA *Media;
EFI_BLOCK_RESET Reset;
EFI_BLOCK_READ ReadBlocks;
EFI_BLOCK_WRITE WriteBlocks;
EFI_BLOCK_FLUSH FlushBlocks;
} EFI_BLOCK_IO_PROTOCOL;
extern EFI_GUID gEfiBlockIoProtocolGuid;
#endif

View File

@@ -0,0 +1,31 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
BusSpecificDriverOverride.c
Abstract:
Bus Specific Driver Override protocol as defined in the EFI 1.1 specification.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (BusSpecificDriverOverride)
EFI_GUID gEfiBusSpecificDriverOverrideProtocolGuid = EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID;
EFI_GUID_STRING
(
&gEfiBusSpecificDriverOverrideProtocolGuid, "Bus Specific Driver Override Protocol",
"EFI 1.1 Bus Specific Driver Override Protocol"
);

View File

@@ -0,0 +1,54 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
BusSpecificDriverOverride.h
Abstract:
Bus Specific Driver Override protocol as defined in the EFI 1.1 specification.
--*/
#ifndef _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_H_
#define _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_H_
//
// Global ID for the Bus Specific Driver Override Protocol
//
#define EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID \
{ \
0x3bc1b285, 0x8a15, 0x4a82, 0xaa, 0xbf, 0x4d, 0x7d, 0x13, 0xfb, 0x32, 0x65 \
}
EFI_FORWARD_DECLARATION (EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL);
//
// Prototypes for the Bus Specific Driver Override Protocol
//
typedef
EFI_STATUS
(EFIAPI *EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER) (
IN EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL * This,
IN OUT EFI_HANDLE * DriverImageHandle
);
//
// Interface structure for the Bus Specific Driver Override Protocol
//
typedef struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL {
EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER GetDriver;
} EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL;
extern EFI_GUID gEfiBusSpecificDriverOverrideProtocolGuid;
#endif

View File

@@ -0,0 +1,29 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
ComponentName.c
Abstract:
EFI Component Name Protocol
Revision History
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (ComponentName)
EFI_GUID gEfiComponentNameProtocolGuid = EFI_COMPONENT_NAME_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiComponentNameProtocolGuid, "Component Name Protocol", "EFI 1.1 Component Name Protocol");

View File

@@ -0,0 +1,137 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
ComponentName.h
Abstract:
EFI Component Name Protocol
Revision History
--*/
#ifndef _EFI_COMPONENT_NAME_H_
#define _EFI_COMPONENT_NAME_H_
//
// Global ID for the Component Name Protocol
//
#define EFI_COMPONENT_NAME_PROTOCOL_GUID \
{ \
0x107a772c, 0xd5e1, 0x11d4, 0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d \
}
EFI_FORWARD_DECLARATION (EFI_COMPONENT_NAME_PROTOCOL);
typedef
EFI_STATUS
(EFIAPI *EFI_COMPONENT_NAME_GET_DRIVER_NAME) (
IN EFI_COMPONENT_NAME_PROTOCOL * This,
IN CHAR8 *Language,
OUT CHAR16 **DriverName
);
/*++
Routine Description:
Retrieves a Unicode string that is the user readable name of the EFI Driver.
Arguments:
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
Language - A pointer to a three character ISO 639-2 language identifier.
This is the language of the driver name that that the caller
is requesting, and it must match one of the languages specified
in SupportedLanguages. The number of languages supported by a
driver is up to the driver writer.
DriverName - A pointer to the Unicode string to return. This Unicode string
is the name of the driver specified by This in the language
specified by Language.
Returns:
EFI_SUCCESS - The Unicode string for the Driver specified by This
and the language specified by Language was returned
in DriverName.
EFI_INVALID_PARAMETER - Language is NULL.
EFI_INVALID_PARAMETER - DriverName is NULL.
EFI_UNSUPPORTED - The driver specified by This does not support the
language specified by Language.
--*/
typedef
EFI_STATUS
(EFIAPI *EFI_COMPONENT_NAME_GET_CONTROLLER_NAME) (
IN EFI_COMPONENT_NAME_PROTOCOL * This,
IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE ChildHandle OPTIONAL,
IN CHAR8 *Language,
OUT CHAR16 **ControllerName
);
/*++
Routine Description:
Retrieves a Unicode string that is the user readable name of the controller
that is being managed by an EFI Driver.
Arguments:
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
ControllerHandle - The handle of a controller that the driver specified by
This is managing. This handle specifies the controller
whose name is to be returned.
ChildHandle - The handle of the child controller to retrieve the name
of. This is an optional parameter that may be NULL. It
will be NULL for device drivers. It will also be NULL
for a bus drivers that wish to retrieve the name of the
bus controller. It will not be NULL for a bus driver
that wishes to retrieve the name of a child controller.
Language - A pointer to a three character ISO 639-2 language
identifier. This is the language of the controller name
that that the caller is requesting, and it must match one
of the languages specified in SupportedLanguages. The
number of languages supported by a driver is up to the
driver writer.
ControllerName - A pointer to the Unicode string to return. This Unicode
string is the name of the controller specified by
ControllerHandle and ChildHandle in the language specified
by Language from the point of view of the driver specified
by This.
Returns:
EFI_SUCCESS - The Unicode string for the user readable name in the
language specified by Language for the driver
specified by This was returned in DriverName.
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETER - Language is NULL.
EFI_INVALID_PARAMETER - ControllerName is NULL.
EFI_UNSUPPORTED - The driver specified by This is not currently managing
the controller specified by ControllerHandle and
ChildHandle.
EFI_UNSUPPORTED - The driver specified by This does not support the
language specified by Language.
--*/
//
// Interface structure for the Component Name Protocol
//
typedef struct _EFI_COMPONENT_NAME_PROTOCOL {
EFI_COMPONENT_NAME_GET_DRIVER_NAME GetDriverName;
EFI_COMPONENT_NAME_GET_CONTROLLER_NAME GetControllerName;
CHAR8 *SupportedLanguages;
} EFI_COMPONENT_NAME_PROTOCOL;
extern EFI_GUID gEfiComponentNameProtocolGuid;
#endif

View File

@@ -0,0 +1,29 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
ComponentName.c
Abstract:
EFI Component Name Protocol
Revision History
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (ComponentName2)
EFI_GUID gEfiComponentName2ProtocolGuid = EFI_COMPONENT_NAME2_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiComponentName2ProtocolGuid, "Component Name2 Protocol", "EFI 2.0 Component Name2 Protocol");

View File

@@ -0,0 +1,136 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
ComponentName.h
Abstract:
EFI Component Name Protocol
Revision History
--*/
#ifndef _EFI_COMPONENT_NAME2_H_
#define _EFI_COMPONENT_NAME2_H_
//
// Global ID for the Component Name Protocol
//
#define EFI_COMPONENT_NAME2_PROTOCOL_GUID \
{ \
0x6a7a5cff, 0xe8d9, 0x4f70, 0xba, 0xda, 0x75, 0xab, 0x30, 0x25, 0xce, 0x14 \
}
EFI_FORWARD_DECLARATION (EFI_COMPONENT_NAME2_PROTOCOL);
typedef
EFI_STATUS
(EFIAPI *EFI_COMPONENT_NAME2_GET_DRIVER_NAME) (
IN EFI_COMPONENT_NAME2_PROTOCOL * This,
IN CHAR8 *Language,
OUT CHAR16 **DriverName
);
/*++
Routine Description:
Retrieves a Unicode string that is the user readable name of the EFI Driver.
Arguments:
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
Language - A pointer to a three character ISO 639-2 language identifier.
This is the language of the driver name that that the caller
is requesting, and it must match one of the languages specified
in SupportedLanguages. The number of languages supported by a
driver is up to the driver writer.
DriverName - A pointer to the Unicode string to return. This Unicode string
is the name of the driver specified by This in the language
specified by Language.
Returns:
EFI_SUCCESS - The Unicode string for the Driver specified by This
and the language specified by Language was returned
in DriverName.
EFI_INVALID_PARAMETER - Language is NULL or DriverName is NULL.
EFI_UNSUPPORTED - The driver specified by This does not support the
language specified by Language.
--*/
typedef
EFI_STATUS
(EFIAPI *EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) (
IN EFI_COMPONENT_NAME2_PROTOCOL * This,
IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE ChildHandle OPTIONAL,
IN CHAR8 *Language,
OUT CHAR16 **ControllerName
);
/*++
Routine Description:
Retrieves a Unicode string that is the user readable name of the controller
that is being managed by an EFI Driver.
Arguments:
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
ControllerHandle - The handle of a controller that the driver specified by
This is managing. This handle specifies the controller
whose name is to be returned.
ChildHandle - The handle of the child controller to retrieve the name
of. This is an optional parameter that may be NULL. It
will be NULL for device drivers. It will also be NULL
for a bus drivers that wish to retrieve the name of the
bus controller. It will not be NULL for a bus driver
that wishes to retrieve the name of a child controller.
Language - A pointer to a three character ISO 639-2 language
identifier. This is the language of the controller name
that that the caller is requesting, and it must match one
of the languages specified in SupportedLanguages. The
number of languages supported by a driver is up to the
driver writer.
ControllerName - A pointer to the Unicode string to return. This Unicode
string is the name of the controller specified by
ControllerHandle and ChildHandle in the language specified
by Language from the point of view of the driver specified
by This.
Returns:
EFI_SUCCESS - The Unicode string for the user readable name in the
language specified by Language for the driver
specified by This was returned in DriverName.
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE; ChildHandle
is not NULL and it is not a valid EFI_HANDLE;Language
is NULL;ControllerName is NULL.
EFI_UNSUPPORTED - The driver specified by This is not currently managing
the controller specified by ControllerHandle and
ChildHandle;The driver specified by This does not support the
language specified by Language.
--*/
//
// Interface structure for the Component Name Protocol
//
typedef struct _EFI_COMPONENT_NAME2_PROTOCOL {
EFI_COMPONENT_NAME2_GET_DRIVER_NAME GetDriverName;
EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME GetControllerName;
CHAR8 *SupportedLanguages;
} EFI_COMPONENT_NAME2_PROTOCOL;
extern EFI_GUID gEfiComponentName2ProtocolGuid;
#endif

View File

@@ -0,0 +1,27 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DebugPort.c
Abstract:
DebugPort protocol as defined in the EFI 1.1 specification.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (DebugPort)
EFI_GUID gEfiDebugPortProtocolGuid = EFI_DEBUGPORT_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiDebugPortProtocolGuid, "DebugPort Protocol", "EFI 1.1 DebugPort Protocol");

View File

@@ -0,0 +1,98 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DebugPort.h
Abstract:
--*/
#ifndef _DEBUG_PORT_H_
#define _DEBUG_PORT_H_
#include "EfiApi.h"
//
// DebugPortIo protocol {EBA4E8D2-3858-41EC-A281-2647BA9660D0}
//
#define EFI_DEBUGPORT_PROTOCOL_GUID \
{ \
0xEBA4E8D2, 0x3858, 0x41EC, 0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 \
}
extern EFI_GUID gEfiDebugPortProtocolGuid;
EFI_FORWARD_DECLARATION (EFI_DEBUGPORT_PROTOCOL);
//
// DebugPort member functions
//
typedef
EFI_STATUS
(EFIAPI *EFI_DEBUGPORT_RESET) (
IN EFI_DEBUGPORT_PROTOCOL * This
);
typedef
EFI_STATUS
(EFIAPI *EFI_DEBUGPORT_WRITE) (
IN EFI_DEBUGPORT_PROTOCOL * This,
IN UINT32 Timeout,
IN OUT UINTN *BufferSize,
IN VOID *Buffer
);
typedef
EFI_STATUS
(EFIAPI *EFI_DEBUGPORT_READ) (
IN EFI_DEBUGPORT_PROTOCOL * This,
IN UINT32 Timeout,
IN OUT UINTN *BufferSize,
OUT VOID *Buffer
);
typedef
EFI_STATUS
(EFIAPI *EFI_DEBUGPORT_POLL) (
IN EFI_DEBUGPORT_PROTOCOL * This
);
//
// DebugPort protocol definition
//
typedef struct _EFI_DEBUGPORT_PROTOCOL {
EFI_DEBUGPORT_RESET Reset;
EFI_DEBUGPORT_WRITE Write;
EFI_DEBUGPORT_READ Read;
EFI_DEBUGPORT_POLL Poll;
} EFI_DEBUGPORT_PROTOCOL;
//
// DEBUGPORT variable definitions...
//
#define EFI_DEBUGPORT_VARIABLE_NAME L"DEBUGPORT"
#define EFI_DEBUGPORT_VARIABLE_GUID EFI_DEBUGPORT_PROTOCOL_GUID
#define gEfiDebugPortVariableGuid gEfiDebugPortProtocolGuid
//
// DebugPort device path definitions...
//
#define DEVICE_PATH_MESSAGING_DEBUGPORT EFI_DEBUGPORT_PROTOCOL_GUID
#define gEfiDebugPortDevicePathGuid gEfiDebugPortProtocolGuid
typedef struct {
EFI_DEVICE_PATH_PROTOCOL Header;
EFI_GUID Guid;
} DEBUGPORT_DEVICE_PATH;
#endif /* _DEBUG_PORT_H_ */

View File

@@ -0,0 +1,27 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DebugSupport.c
Abstract:
DebugSupport protocol as defined in the EFI 1.1 specification.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (DebugSupport)
EFI_GUID gEfiDebugSupportProtocolGuid = EFI_DEBUG_SUPPORT_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiDebugSupportProtocolGuid, "DebugSupport Protocol", "EFI 1.1 DebugSupport Protocol");

View File

@@ -0,0 +1,594 @@
/*++
Copyright (c) 2004 - 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DebugSupport.h
Abstract:
DebugSupport protocol and supporting definitions as defined in the EFI 1.1
specification.
The DebugSupport protocol is used by source level debuggers to abstract the
processor and handle context save and restore operations.
--*/
#ifndef _DEBUG_SUPPORT_H_
#define _DEBUG_SUPPORT_H_
#include "EfiApi.h"
#include "EfiImage.h"
//
// Debug Support protocol {2755590C-6F3C-42FA-9EA4-A3BA543CDA25}
//
#define EFI_DEBUG_SUPPORT_PROTOCOL_GUID \
{ \
0x2755590C, 0x6F3C, 0x42FA, 0x9E, 0xA4, 0xA3, 0xBA, 0x54, 0x3C, 0xDA, 0x25 \
}
//
// Debug Support definitions
//
typedef INTN EFI_EXCEPTION_TYPE;
//
// IA-32 processor exception types
//
#define EXCEPT_IA32_DIVIDE_ERROR 0
#define EXCEPT_IA32_DEBUG 1
#define EXCEPT_IA32_NMI 2
#define EXCEPT_IA32_BREAKPOINT 3
#define EXCEPT_IA32_OVERFLOW 4
#define EXCEPT_IA32_BOUND 5
#define EXCEPT_IA32_INVALID_OPCODE 6
#define EXCEPT_IA32_DOUBLE_FAULT 8
#define EXCEPT_IA32_INVALID_TSS 10
#define EXCEPT_IA32_SEG_NOT_PRESENT 11
#define EXCEPT_IA32_STACK_FAULT 12
#define EXCEPT_IA32_GP_FAULT 13
#define EXCEPT_IA32_PAGE_FAULT 14
#define EXCEPT_IA32_FP_ERROR 16
#define EXCEPT_IA32_ALIGNMENT_CHECK 17
#define EXCEPT_IA32_MACHINE_CHECK 18
#define EXCEPT_IA32_SIMD 19
//
// IA-32 processor context definition
//
//
// FXSAVE_STATE
// FP / MMX / XMM registers (see fxrstor instruction definition)
//
typedef struct {
UINT16 Fcw;
UINT16 Fsw;
UINT16 Ftw;
UINT16 Opcode;
UINT32 Eip;
UINT16 Cs;
UINT16 Reserved1;
UINT32 DataOffset;
UINT16 Ds;
UINT8 Reserved2[10];
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
UINT8 St0Mm0[10], Reserved3[6];
UINT8 St1Mm1[10], Reserved4[6];
UINT8 St2Mm2[10], Reserved5[6];
UINT8 St3Mm3[10], Reserved6[6];
UINT8 St4Mm4[10], Reserved7[6];
UINT8 St5Mm5[10], Reserved8[6];
UINT8 St6Mm6[10], Reserved9[6];
UINT8 St7Mm7[10], Reserved10[6];
UINT8 Xmm0[16];
UINT8 Xmm1[16];
UINT8 Xmm2[16];
UINT8 Xmm3[16];
UINT8 Xmm4[16];
UINT8 Xmm5[16];
UINT8 Xmm6[16];
UINT8 Xmm7[16];
UINT8 Reserved11[14 * 16];
} EFI_FX_SAVE_STATE_IA32;
#else
UINT8 St0Mm0[10], Reserved3[6];
UINT8 St0Mm1[10], Reserved4[6];
UINT8 St0Mm2[10], Reserved5[6];
UINT8 St0Mm3[10], Reserved6[6];
UINT8 St0Mm4[10], Reserved7[6];
UINT8 St0Mm5[10], Reserved8[6];
UINT8 St0Mm6[10], Reserved9[6];
UINT8 St0Mm7[10], Reserved10[6];
UINT8 Reserved11[22 * 16];
} EFI_FX_SAVE_STATE;
#endif
typedef struct {
UINT32 ExceptionData;
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
EFI_FX_SAVE_STATE_IA32 FxSaveState;
#else
EFI_FX_SAVE_STATE FxSaveState;
#endif
UINT32 Dr0;
UINT32 Dr1;
UINT32 Dr2;
UINT32 Dr3;
UINT32 Dr6;
UINT32 Dr7;
UINT32 Cr0;
UINT32 Cr1; /* Reserved */
UINT32 Cr2;
UINT32 Cr3;
UINT32 Cr4;
UINT32 Eflags;
UINT32 Ldtr;
UINT32 Tr;
UINT32 Gdtr[2];
UINT32 Idtr[2];
UINT32 Eip;
UINT32 Gs;
UINT32 Fs;
UINT32 Es;
UINT32 Ds;
UINT32 Cs;
UINT32 Ss;
UINT32 Edi;
UINT32 Esi;
UINT32 Ebp;
UINT32 Esp;
UINT32 Ebx;
UINT32 Edx;
UINT32 Ecx;
UINT32 Eax;
} EFI_SYSTEM_CONTEXT_IA32;
//
// X64 processor exception types
//
#define EXCEPT_X64_DIVIDE_ERROR 0
#define EXCEPT_X64_DEBUG 1
#define EXCEPT_X64_NMI 2
#define EXCEPT_X64_BREAKPOINT 3
#define EXCEPT_X64_OVERFLOW 4
#define EXCEPT_X64_BOUND 5
#define EXCEPT_X64_INVALID_OPCODE 6
#define EXCEPT_X64_DOUBLE_FAULT 8
#define EXCEPT_X64_INVALID_TSS 10
#define EXCEPT_X64_SEG_NOT_PRESENT 11
#define EXCEPT_X64_STACK_FAULT 12
#define EXCEPT_X64_GP_FAULT 13
#define EXCEPT_X64_PAGE_FAULT 14
#define EXCEPT_X64_FP_ERROR 16
#define EXCEPT_X64_ALIGNMENT_CHECK 17
#define EXCEPT_X64_MACHINE_CHECK 18
#define EXCEPT_X64_SIMD 19
//
// X64 processor context definition
//
// FXSAVE_STATE
// FP / MMX / XMM registers (see fxrstor instruction definition)
//
typedef struct {
UINT16 Fcw;
UINT16 Fsw;
UINT16 Ftw;
UINT16 Opcode;
UINT64 Rip;
UINT64 DataOffset;
UINT8 Reserved1[8];
UINT8 St0Mm0[10], Reserved2[6];
UINT8 St1Mm1[10], Reserved3[6];
UINT8 St2Mm2[10], Reserved4[6];
UINT8 St3Mm3[10], Reserved5[6];
UINT8 St4Mm4[10], Reserved6[6];
UINT8 St5Mm5[10], Reserved7[6];
UINT8 St6Mm6[10], Reserved8[6];
UINT8 St7Mm7[10], Reserved9[6];
UINT8 Xmm0[16];
UINT8 Xmm1[16];
UINT8 Xmm2[16];
UINT8 Xmm3[16];
UINT8 Xmm4[16];
UINT8 Xmm5[16];
UINT8 Xmm6[16];
UINT8 Xmm7[16];
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
//
// NOTE: UEFI 2.0 spec definition as follows. It should be updated
// after spec update.
//
UINT8 Reserved11[14 * 16];
#else
UINT8 Xmm8[16];
UINT8 Xmm9[16];
UINT8 Xmm10[16];
UINT8 Xmm11[16];
UINT8 Xmm12[16];
UINT8 Xmm13[16];
UINT8 Xmm14[16];
UINT8 Xmm15[16];
UINT8 Reserved10[6 * 16];
#endif
} EFI_FX_SAVE_STATE_X64;
typedef struct {
UINT64 ExceptionData;
EFI_FX_SAVE_STATE_X64 FxSaveState;
UINT64 Dr0;
UINT64 Dr1;
UINT64 Dr2;
UINT64 Dr3;
UINT64 Dr6;
UINT64 Dr7;
UINT64 Cr0;
UINT64 Cr1; /* Reserved */
UINT64 Cr2;
UINT64 Cr3;
UINT64 Cr4;
UINT64 Cr8;
UINT64 Rflags;
UINT64 Ldtr;
UINT64 Tr;
UINT64 Gdtr[2];
UINT64 Idtr[2];
UINT64 Rip;
UINT64 Gs;
UINT64 Fs;
UINT64 Es;
UINT64 Ds;
UINT64 Cs;
UINT64 Ss;
UINT64 Rdi;
UINT64 Rsi;
UINT64 Rbp;
UINT64 Rsp;
UINT64 Rbx;
UINT64 Rdx;
UINT64 Rcx;
UINT64 Rax;
UINT64 R8;
UINT64 R9;
UINT64 R10;
UINT64 R11;
UINT64 R12;
UINT64 R13;
UINT64 R14;
UINT64 R15;
} EFI_SYSTEM_CONTEXT_X64;
//
// IPF processor exception types
//
#define EXCEPT_IPF_VHTP_TRANSLATION 0
#define EXCEPT_IPF_INSTRUCTION_TLB 1
#define EXCEPT_IPF_DATA_TLB 2
#define EXCEPT_IPF_ALT_INSTRUCTION_TLB 3
#define EXCEPT_IPF_ALT_DATA_TLB 4
#define EXCEPT_IPF_DATA_NESTED_TLB 5
#define EXCEPT_IPF_INSTRUCTION_KEY_MISSED 6
#define EXCEPT_IPF_DATA_KEY_MISSED 7
#define EXCEPT_IPF_DIRTY_BIT 8
#define EXCEPT_IPF_INSTRUCTION_ACCESS_BIT 9
#define EXCEPT_IPF_DATA_ACCESS_BIT 10
#define EXCEPT_IPF_BREAKPOINT 11
#define EXCEPT_IPF_EXTERNAL_INTERRUPT 12
//
// 13 - 19 reserved
//
#define EXCEPT_IPF_PAGE_NOT_PRESENT 20
#define EXCEPT_IPF_KEY_PERMISSION 21
#define EXCEPT_IPF_INSTRUCTION_ACCESS_RIGHTS 22
#define EXCEPT_IPF_DATA_ACCESS_RIGHTS 23
#define EXCEPT_IPF_GENERAL_EXCEPTION 24
#define EXCEPT_IPF_DISABLED_FP_REGISTER 25
#define EXCEPT_IPF_NAT_CONSUMPTION 26
#define EXCEPT_IPF_SPECULATION 27
//
// 28 reserved
//
#define EXCEPT_IPF_DEBUG 29
#define EXCEPT_IPF_UNALIGNED_REFERENCE 30
#define EXCEPT_IPF_UNSUPPORTED_DATA_REFERENCE 31
#define EXCEPT_IPF_FP_FAULT 32
#define EXCEPT_IPF_FP_TRAP 33
#define EXCEPT_IPF_LOWER_PRIVILEGE_TRANSFER_TRAP 34
#define EXCEPT_IPF_TAKEN_BRANCH 35
#define EXCEPT_IPF_SINGLE_STEP 36
//
// 37 - 44 reserved
//
#define EXCEPT_IPF_IA32_EXCEPTION 45
#define EXCEPT_IPF_IA32_INTERCEPT 46
#define EXCEPT_IPF_IA32_INTERRUPT 47
//
// IPF processor context definition
//
typedef struct {
//
// The first reserved field is necessary to preserve alignment for the correct
// bits in UNAT and to insure F2 is 16 byte aligned..
//
UINT64 Reserved;
UINT64 R1;
UINT64 R2;
UINT64 R3;
UINT64 R4;
UINT64 R5;
UINT64 R6;
UINT64 R7;
UINT64 R8;
UINT64 R9;
UINT64 R10;
UINT64 R11;
UINT64 R12;
UINT64 R13;
UINT64 R14;
UINT64 R15;
UINT64 R16;
UINT64 R17;
UINT64 R18;
UINT64 R19;
UINT64 R20;
UINT64 R21;
UINT64 R22;
UINT64 R23;
UINT64 R24;
UINT64 R25;
UINT64 R26;
UINT64 R27;
UINT64 R28;
UINT64 R29;
UINT64 R30;
UINT64 R31;
UINT64 F2[2];
UINT64 F3[2];
UINT64 F4[2];
UINT64 F5[2];
UINT64 F6[2];
UINT64 F7[2];
UINT64 F8[2];
UINT64 F9[2];
UINT64 F10[2];
UINT64 F11[2];
UINT64 F12[2];
UINT64 F13[2];
UINT64 F14[2];
UINT64 F15[2];
UINT64 F16[2];
UINT64 F17[2];
UINT64 F18[2];
UINT64 F19[2];
UINT64 F20[2];
UINT64 F21[2];
UINT64 F22[2];
UINT64 F23[2];
UINT64 F24[2];
UINT64 F25[2];
UINT64 F26[2];
UINT64 F27[2];
UINT64 F28[2];
UINT64 F29[2];
UINT64 F30[2];
UINT64 F31[2];
UINT64 Pr;
UINT64 B0;
UINT64 B1;
UINT64 B2;
UINT64 B3;
UINT64 B4;
UINT64 B5;
UINT64 B6;
UINT64 B7;
//
// application registers
//
UINT64 ArRsc;
UINT64 ArBsp;
UINT64 ArBspstore;
UINT64 ArRnat;
UINT64 ArFcr;
UINT64 ArEflag;
UINT64 ArCsd;
UINT64 ArSsd;
UINT64 ArCflg;
UINT64 ArFsr;
UINT64 ArFir;
UINT64 ArFdr;
UINT64 ArCcv;
UINT64 ArUnat;
UINT64 ArFpsr;
UINT64 ArPfs;
UINT64 ArLc;
UINT64 ArEc;
//
// control registers
//
UINT64 CrDcr;
UINT64 CrItm;
UINT64 CrIva;
UINT64 CrPta;
UINT64 CrIpsr;
UINT64 CrIsr;
UINT64 CrIip;
UINT64 CrIfa;
UINT64 CrItir;
UINT64 CrIipa;
UINT64 CrIfs;
UINT64 CrIim;
UINT64 CrIha;
//
// debug registers
//
UINT64 Dbr0;
UINT64 Dbr1;
UINT64 Dbr2;
UINT64 Dbr3;
UINT64 Dbr4;
UINT64 Dbr5;
UINT64 Dbr6;
UINT64 Dbr7;
UINT64 Ibr0;
UINT64 Ibr1;
UINT64 Ibr2;
UINT64 Ibr3;
UINT64 Ibr4;
UINT64 Ibr5;
UINT64 Ibr6;
UINT64 Ibr7;
//
// virtual registers - nat bits for R1-R31
//
UINT64 IntNat;
} EFI_SYSTEM_CONTEXT_IPF;
//
// EBC processor exception types
//
#define EXCEPT_EBC_UNDEFINED 0
#define EXCEPT_EBC_DIVIDE_ERROR 1
#define EXCEPT_EBC_DEBUG 2
#define EXCEPT_EBC_BREAKPOINT 3
#define EXCEPT_EBC_OVERFLOW 4
#define EXCEPT_EBC_INVALID_OPCODE 5 // opcode out of range
#define EXCEPT_EBC_STACK_FAULT 6
#define EXCEPT_EBC_ALIGNMENT_CHECK 7
#define EXCEPT_EBC_INSTRUCTION_ENCODING 8 // malformed instruction
#define EXCEPT_EBC_BAD_BREAK 9 // BREAK 0 or undefined BREAK
#define EXCEPT_EBC_STEP 10 // to support debug stepping
//
// For coding convenience, define the maximum valid EBC exception.
//
#define MAX_EBC_EXCEPTION EXCEPT_EBC_STEP
//
// EBC processor context definition
//
typedef struct {
UINT64 R0;
UINT64 R1;
UINT64 R2;
UINT64 R3;
UINT64 R4;
UINT64 R5;
UINT64 R6;
UINT64 R7;
UINT64 Flags;
UINT64 ControlFlags;
UINT64 Ip;
} EFI_SYSTEM_CONTEXT_EBC;
//
// Universal EFI_SYSTEM_CONTEXT definition
//
typedef union {
EFI_SYSTEM_CONTEXT_EBC *SystemContextEbc;
EFI_SYSTEM_CONTEXT_IA32 *SystemContextIa32;
EFI_SYSTEM_CONTEXT_X64 *SystemContextX64;
EFI_SYSTEM_CONTEXT_IPF *SystemContextIpf;
} EFI_SYSTEM_CONTEXT;
//
// DebugSupport callback function prototypes
//
typedef
VOID
(*EFI_EXCEPTION_CALLBACK) (
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
);
typedef
VOID
(*EFI_PERIODIC_CALLBACK) (
IN OUT EFI_SYSTEM_CONTEXT SystemContext
);
//
// Machine type definition
//
typedef enum {
IsaIa32 = EFI_IMAGE_MACHINE_IA32,
IsaX64 = EFI_IMAGE_MACHINE_X64,
IsaIpf = EFI_IMAGE_MACHINE_IA64,
IsaEbc = EFI_IMAGE_MACHINE_EBC
} EFI_INSTRUCTION_SET_ARCHITECTURE;
EFI_FORWARD_DECLARATION (EFI_DEBUG_SUPPORT_PROTOCOL);
//
// DebugSupport member function definitions
//
typedef
EFI_STATUS
(EFIAPI *EFI_GET_MAXIMUM_PROCESSOR_INDEX) (
IN EFI_DEBUG_SUPPORT_PROTOCOL * This,
OUT UINTN *MaxProcessorIndex
);
typedef
EFI_STATUS
(EFIAPI *EFI_REGISTER_PERIODIC_CALLBACK) (
IN EFI_DEBUG_SUPPORT_PROTOCOL * This,
IN UINTN ProcessorIndex,
IN EFI_PERIODIC_CALLBACK PeriodicCallback
);
typedef
EFI_STATUS
(EFIAPI *EFI_REGISTER_EXCEPTION_CALLBACK) (
IN EFI_DEBUG_SUPPORT_PROTOCOL * This,
IN UINTN ProcessorIndex,
IN EFI_EXCEPTION_CALLBACK ExceptionCallback,
IN EFI_EXCEPTION_TYPE ExceptionType
);
typedef
EFI_STATUS
(EFIAPI *EFI_INVALIDATE_INSTRUCTION_CACHE) (
IN EFI_DEBUG_SUPPORT_PROTOCOL * This,
IN UINTN ProcessorIndex,
IN VOID *Start,
IN UINT64 Length
);
//
// DebugSupport protocol definition
//
typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL {
EFI_INSTRUCTION_SET_ARCHITECTURE Isa;
EFI_GET_MAXIMUM_PROCESSOR_INDEX GetMaximumProcessorIndex;
EFI_REGISTER_PERIODIC_CALLBACK RegisterPeriodicCallback;
EFI_REGISTER_EXCEPTION_CALLBACK RegisterExceptionCallback;
EFI_INVALIDATE_INSTRUCTION_CACHE InvalidateInstructionCache;
} EFI_DEBUG_SUPPORT_PROTOCOL;
extern EFI_GUID gEfiDebugSupportProtocolGuid;
#endif /* _DEBUG_SUPPORT_H_ */

View File

@@ -0,0 +1,27 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Decompress.c
Abstract:
The GUID for the EFI Decompress Protocol
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (Decompress)
EFI_GUID gEfiDecompressProtocolGuid = EFI_DECOMPRESS_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiDecompressProtocolGuid, "Decompress", "Decompression Protocol");

View File

@@ -0,0 +1,140 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Decompress.h
Abstract:
The Decompress Protocol Interface
--*/
#ifndef _DECOMPRESS_H_
#define _DECOMPRESS_H_
#define EFI_DECOMPRESS_PROTOCOL_GUID \
{ \
0xd8117cfe, 0x94a6, 0x11d4, 0x9a, 0x3a, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d \
}
EFI_FORWARD_DECLARATION (EFI_DECOMPRESS_PROTOCOL);
typedef
EFI_STATUS
(EFIAPI *EFI_DECOMPRESS_GET_INFO) (
IN EFI_DECOMPRESS_PROTOCOL * This,
IN VOID *Source,
IN UINT32 SourceSize,
OUT UINT32 *DestinationSize,
OUT UINT32 *ScratchSize
);
/*++
Routine Description:
The GetInfo() function retrieves the size of the uncompressed buffer
and the temporary scratch buffer required to decompress the buffer
specified by Source and SourceSize. If the size of the uncompressed
buffer or the size of the scratch buffer cannot be determined from
the compressed data specified by Source and SourceData, then
EFI_INVALID_PARAMETER is returned. Otherwise, the size of the uncompressed
buffer is returned in DestinationSize, the size of the scratch buffer is
returned in ScratchSize, and EFI_SUCCESS is returned.
The GetInfo() function does not have scratch buffer available to perform
a thorough checking of the validity of the source data. It just retrieves
the 'Original Size' field from the beginning bytes of the source data and
output it as DestinationSize. And ScratchSize is specific to the decompression
implementation.
Arguments:
This - The protocol instance pointer
Source - The source buffer containing the compressed data.
SourceSize - The size, in bytes, of source buffer.
DestinationSize - A pointer to the size, in bytes, of the uncompressed buffer
that will be generated when the compressed buffer specified
by Source and SourceSize is decompressed.
ScratchSize - A pointer to the size, in bytes, of the scratch buffer that
is required to decompress the compressed buffer specified by
Source and SourceSize.
Returns:
EFI_SUCCESS - The size of the uncompressed data was returned in DestinationSize
and the size of the scratch buffer was returned in ScratchSize.
EFI_INVALID_PARAMETER - The size of the uncompressed data or the size of the scratch
buffer cannot be determined from the compressed data specified by
Source and SourceData.
--*/
typedef
EFI_STATUS
(EFIAPI *EFI_DECOMPRESS_DECOMPRESS) (
IN EFI_DECOMPRESS_PROTOCOL * This,
IN VOID *Source,
IN UINT32 SourceSize,
IN OUT VOID *Destination,
IN UINT32 DestinationSize,
IN OUT VOID *Scratch,
IN UINT32 ScratchSize
);
/*++
Routine Description:
The Decompress() function extracts decompressed data to its original form.
This protocol is designed so that the decompression algorithm can be
implemented without using any memory services. As a result, the
Decompress() function is not allowed to call AllocatePool() or
AllocatePages() in its implementation. It is the caller's responsibility
to allocate and free the Destination and Scratch buffers.
If the compressed source data specified by Source and SourceSize is
sucessfully decompressed into Destination, then EFI_SUCCESS is returned.
If the compressed source data specified by Source and SourceSize is not in
a valid compressed data format, then EFI_INVALID_PARAMETER is returned.
Arguments:
This - The protocol instance pointer
Source - The source buffer containing the compressed data.
SourceSize - The size of source data.
Destination - On output, the destination buffer that contains
the uncompressed data.
DestinationSize - The size of destination buffer. The size of destination
buffer needed is obtained from GetInfo().
Scratch - A temporary scratch buffer that is used to perform the
decompression.
ScratchSize - The size of scratch buffer. The size of scratch buffer needed
is obtained from GetInfo().
Returns:
EFI_SUCCESS - Decompression completed successfully, and the uncompressed
buffer is returned in Destination.
EFI_INVALID_PARAMETER
- The source buffer specified by Source and SourceSize is
corrupted (not in a valid compressed format).
--*/
typedef struct _EFI_DECOMPRESS_PROTOCOL {
EFI_DECOMPRESS_GET_INFO GetInfo;
EFI_DECOMPRESS_DECOMPRESS Decompress;
} EFI_DECOMPRESS_PROTOCOL;
extern EFI_GUID gEfiDecompressProtocolGuid;
#endif

View File

@@ -0,0 +1,31 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DeviceIo.c
Abstract:
Device IO protocol as defined in the EFI 1.0 specification.
Device IO is used to abstract hardware access to devices. It includes
memory mapped IO, IO, PCI Config space, and DMA.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (DeviceIo)
EFI_GUID gEfiDeviceIoProtocolGuid = EFI_DEVICE_IO_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiDeviceIoProtocolGuid, "DeviceIo Protocol", "EFI 1.0 Device IO Protocol");

View File

@@ -0,0 +1,132 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DeviceIo.h
Abstract:
Device IO protocol as defined in the EFI 1.0 specification.
Device IO is used to abstract hardware access to devices. It includes
memory mapped IO, IO, PCI Config space, and DMA.
--*/
#ifndef _DEVICE_IO_H_
#define _DEVICE_IO_H_
#define EFI_DEVICE_IO_PROTOCOL_GUID \
{ \
0xaf6ac311, 0x84c3, 0x11d2, 0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b \
}
EFI_FORWARD_DECLARATION (EFI_DEVICE_IO_PROTOCOL);
typedef enum {
IO_UINT8,
IO_UINT16,
IO_UINT32,
IO_UINT64,
MMIO_COPY_UINT8,
MMIO_COPY_UINT16,
MMIO_COPY_UINT32,
MMIO_COPY_UINT64
} EFI_IO_WIDTH;
typedef
EFI_STATUS
(EFIAPI *EFI_DEVICE_IO) (
IN EFI_DEVICE_IO_PROTOCOL * This,
IN EFI_IO_WIDTH Width,
IN UINT64 Address,
IN UINTN Count,
IN OUT VOID *Buffer
);
typedef struct {
EFI_DEVICE_IO Read;
EFI_DEVICE_IO Write;
} EFI_IO_ACCESS;
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_DEVICE_PATH) (
IN EFI_DEVICE_IO_PROTOCOL * This,
IN UINT64 Address,
IN OUT EFI_DEVICE_PATH_PROTOCOL **PciDevicePath
);
typedef enum {
EfiBusMasterRead,
EfiBusMasterWrite,
EfiBusMasterCommonBuffer
} EFI_IO_OPERATION_TYPE;
typedef
EFI_STATUS
(EFIAPI *EFI_IO_MAP) (
IN EFI_DEVICE_IO_PROTOCOL * This,
IN EFI_IO_OPERATION_TYPE Operation,
IN EFI_PHYSICAL_ADDRESS * HostAddress,
IN OUT UINTN *NumberOfBytes,
OUT EFI_PHYSICAL_ADDRESS * DeviceAddress,
OUT VOID **Mapping
);
typedef
EFI_STATUS
(EFIAPI *EFI_IO_UNMAP) (
IN EFI_DEVICE_IO_PROTOCOL * This,
IN VOID *Mapping
);
typedef
EFI_STATUS
(EFIAPI *EFI_IO_ALLOCATE_BUFFER) (
IN EFI_DEVICE_IO_PROTOCOL * This,
IN EFI_ALLOCATE_TYPE Type,
IN EFI_MEMORY_TYPE MemoryType,
IN UINTN Pages,
IN OUT EFI_PHYSICAL_ADDRESS * HostAddress
);
typedef
EFI_STATUS
(EFIAPI *EFI_IO_FLUSH) (
IN EFI_DEVICE_IO_PROTOCOL * This
);
typedef
EFI_STATUS
(EFIAPI *EFI_IO_FREE_BUFFER) (
IN EFI_DEVICE_IO_PROTOCOL * This,
IN UINTN Pages,
IN EFI_PHYSICAL_ADDRESS HostAddress
);
typedef struct _EFI_DEVICE_IO_PROTOCOL {
EFI_IO_ACCESS Mem;
EFI_IO_ACCESS Io;
EFI_IO_ACCESS Pci;
EFI_IO_MAP Map;
EFI_PCI_DEVICE_PATH PciDevicePath;
EFI_IO_UNMAP Unmap;
EFI_IO_ALLOCATE_BUFFER AllocateBuffer;
EFI_IO_FLUSH Flush;
EFI_IO_FREE_BUFFER FreeBuffer;
} EFI_DEVICE_IO_PROTOCOL;
extern EFI_GUID gEfiDeviceIoProtocolGuid;
#endif

View File

@@ -0,0 +1,32 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DevicePath.c
Abstract:
The device path protocol as defined in EFI 1.0.
The device path represents a programatic path to a device. It's the view
from a software point of view. It also must persist from boot to boot, so
it can not contain things like PCI bus numbers that change from boot to boot.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (DevicePath)
EFI_GUID gEfiDevicePathProtocolGuid = EFI_DEVICE_PATH_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiDevicePathProtocolGuid, "Device Path Protocol", "EFI 1.0 Device Path protocol");

View File

@@ -0,0 +1,67 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DevicePath.h
Abstract:
The device path protocol as defined in EFI 1.0.
The device path represents a programatic path to a device. It's the view
from a software point of view. It also must persist from boot to boot, so
it can not contain things like PCI bus numbers that change from boot to boot.
--*/
#ifndef _DEVICE_PATH_H_
#define _DEVICE_PATH_H_
//
// Device Path protocol
//
#define EFI_DEVICE_PATH_PROTOCOL_GUID \
{ \
0x9576e91, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b \
}
#pragma pack(push, 1)
typedef struct {
UINT8 Type;
UINT8 SubType;
UINT8 Length[2];
} EFI_DEVICE_PATH_PROTOCOL;
#pragma pack(pop)
#define EFI_END_ENTIRE_DEVICE_PATH 0xff
#define EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE 0xff
#define EFI_END_INSTANCE_DEVICE_PATH 0x01
#define EFI_END_DEVICE_PATH_LENGTH (sizeof (EFI_DEVICE_PATH_PROTOCOL))
#define EfiDevicePathNodeLength(a) (((a)->Length[0]) | ((a)->Length[1] << 8))
#define EfiNextDevicePathNode(a) ((EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *) (a)) + EfiDevicePathNodeLength (a)))
#define EfiDevicePathType(a) (((a)->Type) & 0x7f)
#define EfiIsDevicePathEndType(a) (EfiDevicePathType (a) == 0x7f)
#define EfiIsDevicePathEndSubType(a) ((a)->SubType == EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE)
#define EfiIsDevicePathEndInstanceSubType(a) ((a)->SubType == EFI_END_INSTANCE_DEVICE_PATH)
#define EfiIsDevicePathEnd(a) (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndSubType (a))
#define EfiIsDevicePathEndInstance(a) (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndInstanceSubType (a))
extern EFI_GUID gEfiDevicePathProtocolGuid;
#endif

View File

@@ -0,0 +1,27 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DevicePathFromText.c
Abstract:
DevicePathFromText protocol as defined in the UEFI 2.0 specification.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (DevicePathFromText)
EFI_GUID gEfiDevicePathFromTextProtocolGuid = EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiDevicePathFromTextProtocolGuid, "Device Path From Text Protocol", "UEFI 2.0 Device Path From Text Protocol");

View File

@@ -0,0 +1,82 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DevicePathFromText.h
Abstract:
--*/
#ifndef _DEVICE_PATH_FROM_TEXT_PROTOCOL_H_
#define _DEVICE_PATH_FROM_TEXT_PROTOCOL_H_
//
// Device Path From Text protocol
//
#define EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID \
{ \
0x5c99a21, 0xc70f, 0x4ad2, 0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e \
}
typedef
EFI_DEVICE_PATH_PROTOCOL*
(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_NODE) (
IN CONST CHAR16 *TextDeviceNode
)
/*++
Routine Description:
Convert text to the binary representation of a device node.
Arguments:
TextDeviceNode - TextDeviceNode points to the text representation of a device
node. Conversion starts with the first character and continues
until the first non-device node character.
Returns:
A pointer - Pointer to the EFI device node.
NULL - if TextDeviceNode is NULL or there was insufficient memory.
--*/
;
typedef
EFI_DEVICE_PATH_PROTOCOL*
(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_PATH) (
IN CONST CHAR16 *TextDevicePath
)
/*++
Routine Description:
Convert text to the binary representation of a device path.
Arguments:
TextDevicePath - TextDevicePath points to the text representation of a device
path. Conversion starts with the first character and continues
until the first non-device node character.
Returns:
A pointer - Pointer to the allocated device path.
NULL - if TextDeviceNode is NULL or there was insufficient memory.
--*/
;
typedef struct {
EFI_DEVICE_PATH_FROM_TEXT_NODE ConvertTextToDeviceNode;
EFI_DEVICE_PATH_FROM_TEXT_PATH ConvertTextToDevicePath;
} EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL;
extern EFI_GUID gEfiDevicePathFromTextProtocolGuid;
#endif

View File

@@ -0,0 +1,27 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DevicePathToText.c
Abstract:
DevicePathToText protocol as defined in the UEFI 2.0 specification.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (DevicePathToText)
EFI_GUID gEfiDevicePathToTextProtocolGuid = EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiDevicePathToTextProtocolGuid, "Device Path To Text Protocol", "UEFI 2.0 Device Path To Text protocol");

View File

@@ -0,0 +1,95 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DevicePathToText.h
Abstract:
--*/
#ifndef _DEVICE_PATH_TO_TEXT_PROTOCOL_H_
#define _DEVICE_PATH_TO_TEXT_PROTOCOL_H_
//
// Device Path To Text protocol
//
#define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \
{ \
0x8b843e20, 0x8132, 0x4852, 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c \
}
typedef
CHAR16*
(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE) (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode,
IN BOOLEAN DisplayOnly,
IN BOOLEAN AllowShortcuts
)
/*++
Routine Description:
Convert a device node to its text representation.
Arguments:
DeviceNode - Points to the device node to be converted.
DisplayOnly - If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
is FALSE, then the longer text representation of the display node
is used.
AllowShortcuts - If AllowShortcuts is TRUE, then the shortcut forms of text
representation for a device node can be used, where applicable.
Returns:
A pointer - a pointer to the allocated text representation of the device node.
NULL - if DeviceNode is NULL or there was insufficient memory.
--*/
;
typedef
CHAR16*
(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_PATH) (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
IN BOOLEAN DisplayOnly,
IN BOOLEAN AllowShortcuts
)
/*++
Routine Description:
Convert a device path to its text representation.
Arguments:
DeviceNode - Points to the device path to be converted.
DisplayOnly - If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
is FALSE, then the longer text representation of the display node
is used.
AllowShortcuts - If AllowShortcuts is TRUE, then the shortcut forms of text
representation for a device node can be used, where applicable.
Returns:
A pointer - a pointer to the allocated text representation of the device path.
NULL - if DeviceNode is NULL or there was insufficient memory.
--*/
;
typedef struct {
EFI_DEVICE_PATH_TO_TEXT_NODE ConvertDeviceNodeToText;
EFI_DEVICE_PATH_TO_TEXT_PATH ConvertDevicePathToText;
} EFI_DEVICE_PATH_TO_TEXT_PROTOCOL;
extern EFI_GUID gEfiDevicePathToTextProtocolGuid;
#endif

View File

@@ -0,0 +1,27 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DevicePathUtilities.c
Abstract:
DevicePathUtilities protocol as defined in the UEFI 2.0 specification.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (DevicePathUtilities)
EFI_GUID gEfiDevicePathUtilitiesProtocolGuid = EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiDevicePathUtilitiesProtocolGuid, "Device Path Utilities Protocol", "UEFI 2.0 Device Path Utilities protocol");

View File

@@ -0,0 +1,225 @@
/*++
Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DevicePathUtilities.h
Abstract:
--*/
#ifndef _DEVICE_PATH_UTILITIES_PROTOCOL_H_
#define _DEVICE_PATH_UTILITIES_PROTOCOL_H_
//
// Device Path Utilities protocol
//
#define EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID \
{ \
0x379be4e, 0xd706, 0x437d, 0xb0, 0x37, 0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4 \
}
typedef
UINTN
(EFIAPI *EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE) (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
/*++
Routine Description:
Returns the size of the device path, in bytes.
Arguments:
DevicePath - Points to the start of the EFI device path.
Returns:
Size - Size of the specified device path, in bytes, including the end-of-path tag.
--*/
;
typedef
EFI_DEVICE_PATH_PROTOCOL*
(EFIAPI *EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH) (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
/*++
Routine Description:
Create a duplicate of the specified path.
Arguments:
DevicePath - Points to the source EFI device path.
Returns:
Pointer - A pointer to the duplicate device path.
NULL - Insufficient memory.
--*/
;
typedef
EFI_DEVICE_PATH_PROTOCOL*
(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_PATH) (
IN CONST EFI_DEVICE_PATH_PROTOCOL *Src1,
IN CONST EFI_DEVICE_PATH_PROTOCOL *Src2
)
/*++
Routine Description:
Create a new path by appending the second device path to the first.
Arguments:
Src1 - Points to the first device path. If NULL, then it is ignored.
Src2 - Points to the second device path. If NULL, then it is ignored.
Returns:
Pointer - A pointer to the newly created device path.
NULL - Memory could not be allocated
or either DevicePath or DeviceNode is NULL.
--*/
;
typedef
EFI_DEVICE_PATH_PROTOCOL*
(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_NODE) (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode
)
/*++
Routine Description:
Creates a new path by appending the device node to the device path.
Arguments:
DevicePath - Points to the device path.
DeviceNode - Points to the device node.
Returns:
Pointer - A pointer to the allocated device node.
NULL - Memory could not be allocated
or either DevicePath or DeviceNode is NULL.
--*/
;
typedef
EFI_DEVICE_PATH_PROTOCOL*
(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE) (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance
)
/*++
Routine Description:
Creates a new path by appending the specified device path instance to the specified device path.
Arguments:
DevicePath - Points to the device path. If NULL, then ignored.
DevicePathInstance - Points to the device path instance.
Returns:
Pointer - A pointer to the newly created device path
NULL - Memory could not be allocated or DevicePathInstance is NULL.
--*/
;
typedef
EFI_DEVICE_PATH_PROTOCOL*
(EFIAPI *EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE) (
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathInstance,
OUT UINTN *DevicePathInstanceSize
)
/*++
Routine Description:
Creates a copy of the current device path instance and returns a pointer to the next device path instance.
Arguments:
DevicePathInstance - On input, this holds the pointer to the current device path
instance. On output, this holds the pointer to the next
device path instance or NULL if there are no more device
path instances in the device path.
DevicePathInstanceSize - On output, this holds the size of the device path instance,
in bytes or zero, if DevicePathInstance is zero.
Returns:
Pointer - A pointer to the copy of the current device path instance.
NULL - DevicePathInstace was NULL on entry or there was insufficient memory.
--*/
;
typedef
BOOLEAN
(EFIAPI *EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE) (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
/*++
Routine Description:
Returns whether a device path is multi-instance.
Arguments:
DevicePath - Points to the device path. If NULL, then ignored.
Returns:
TRUE - The device path has more than one instance
FALSE - The device path is empty or contains only a single instance.
--*/
;
typedef
EFI_DEVICE_PATH_PROTOCOL*
(EFIAPI *EFI_DEVICE_PATH_UTILS_CREATE_NODE) (
IN UINT8 NodeType,
IN UINT8 NodeSubType,
IN UINT16 NodeLength
)
/*++
Routine Description:
Creates a device node
Arguments:
NodeType - NodeType is the device node type (EFI_DEVICE_PATH.Type) for
the new device node.
NodeSubType - NodeSubType is the device node sub-type
EFI_DEVICE_PATH.SubType) for the new device node.
NodeLength - NodeLength is the length of the device node
(EFI_DEVICE_PATH.Length) for the new device node.
Returns:
Pointer - A pointer to the newly created device node.
NULL - NodeLength is less than
the size of the header or there was insufficient memory.
--*/
;
typedef struct {
EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE GetDevicePathSize;
EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH DuplicateDevicePath;
EFI_DEVICE_PATH_UTILS_APPEND_PATH AppendDevicePath;
EFI_DEVICE_PATH_UTILS_APPEND_NODE AppendDeviceNode;
EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE AppendDevicePathInstance;
EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE GetNextDevicePathInstance;
EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE IsDevicePathMultiInstance;
EFI_DEVICE_PATH_UTILS_CREATE_NODE CreateDeviceNode;
} EFI_DEVICE_PATH_UTILITIES_PROTOCOL;
extern EFI_GUID gEfiDevicePathUtilitiesProtocolGuid;
#endif

View File

@@ -0,0 +1,41 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Dhcp4.c
Abstract:
UEFI Dynamic Host Configuration Protocol 4.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (Dhcp4)
EFI_GUID gEfiDhcp4ServiceBindingProtocolGuid
= EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID;
EFI_GUID gEfiDhcp4ProtocolGuid
= EFI_DHCP4_PROTOCOL_GUID;
EFI_GUID_STRING (
&gEfiDhcp4ServiceBindingProtocolGuid,
"DHCP4 Service Binding Protocol",
"DHCP4 Service Binding Protocol"
);
EFI_GUID_STRING (
&gEfiDhcp4ProtocolGuid,
"DHCP4 Protocol",
"DHCP4 Protocol"
);

View File

@@ -0,0 +1,237 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Dhcp4.h
Abstract:
UEFI Dynamic Host Configuration Protocol 4 Definition
--*/
#ifndef _DHCP4_H_
#define _DHCP4_H_
#include EFI_PROTOCOL_DEFINITION (ServiceBinding)
#include EFI_PROTOCOL_DEFINITION (Udp4)
//GUID definitions
#define EFI_DHCP4_PROTOCOL_GUID \
{0x8a219718, 0x4ef5, 0x4761, 0x91, 0xc8, 0xc0, 0xf0, 0x4b, 0xda, 0x9e, 0x56}
#define EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID \
{0x9d9a39d8, 0xbd42, 0x4a73, 0xa4, 0xd5, 0x8e, 0xe9, 0x4b, 0xe1, 0x13, 0x80}
extern EFI_GUID gEfiDhcp4ProtocolGuid;
extern EFI_GUID gEfiDhcp4ServiceBindingProtocolGuid;
EFI_FORWARD_DECLARATION (EFI_DHCP4_PROTOCOL);
#pragma pack(1)
typedef struct {
UINT8 OpCode;
UINT8 Length;
UINT8 Data[1];
} EFI_DHCP4_PACKET_OPTION;
typedef struct{
UINT8 OpCode;
UINT8 HwType;
UINT8 HwAddrLen;
UINT8 Hops;
UINT32 Xid;
UINT16 Seconds;
UINT16 Reserved;
EFI_IPv4_ADDRESS ClientAddr;
EFI_IPv4_ADDRESS YourAddr;
EFI_IPv4_ADDRESS ServerAddr;
EFI_IPv4_ADDRESS GwAddr;
UINT8 ClientHwAddr[16];
CHAR8 ServerName[64];
CHAR8 BootFileName[128];
}EFI_DHCP4_HEADER;
typedef struct {
UINT32 Size;
UINT32 Length;
struct {
EFI_DHCP4_HEADER Header;
UINT32 Magik;
UINT8 Option[1];
} Dhcp4;
} EFI_DHCP4_PACKET;
#pragma pack()
typedef enum {
Dhcp4Stopped = 0x0,
Dhcp4Init = 0x1,
Dhcp4Selecting = 0x2,
Dhcp4Requesting = 0x3,
Dhcp4Bound = 0x4,
Dhcp4Renewing = 0x5,
Dhcp4Rebinding = 0x6,
Dhcp4InitReboot = 0x7,
Dhcp4Rebooting = 0x8
} EFI_DHCP4_STATE;
typedef enum{
Dhcp4SendDiscover = 0x01,
Dhcp4RcvdOffer = 0x02,
Dhcp4SelectOffer = 0x03,
Dhcp4SendRequest = 0x05,
Dhcp4RcvdAck = 0x06,
Dhcp4RcvdNak = 0x07,
Dhcp4SendDecline = 0x08,
Dhcp4BoundCompleted = 0x09,
Dhcp4EnterRenewing = 0x0a,
Dhcp4EnterRebinding = 0x0b,
Dhcp4AddressLost = 0x0c,
Dhcp4Fail = 0x0d
} EFI_DHCP4_EVENT;
typedef EFI_STATUS (*EFI_DHCP4_CALLBACK)(
IN EFI_DHCP4_PROTOCOL *This,
IN VOID *Context,
IN EFI_DHCP4_STATE CurrentState,
IN EFI_DHCP4_EVENT Dhcp4Event,
IN EFI_DHCP4_PACKET *Packet OPTIONAL,
OUT EFI_DHCP4_PACKET **NewPacket OPTIONAL
);
typedef struct {
UINT32 DiscoverTryCount;
UINT32 *DiscoverTimeout;
UINT32 RequestTryCount;
UINT32 *RequestTimeout;
EFI_IPv4_ADDRESS ClientAddress;
EFI_DHCP4_CALLBACK Dhcp4Callback;
VOID *CallbackContext;
UINT32 OptionCount;
EFI_DHCP4_PACKET_OPTION **OptionList;
}EFI_DHCP4_CONFIG_DATA;
typedef struct {
EFI_DHCP4_STATE State;
EFI_DHCP4_CONFIG_DATA ConfigData;
EFI_IPv4_ADDRESS ClientAddress;
EFI_MAC_ADDRESS ClientMacAddress;
EFI_IPv4_ADDRESS ServerAddress;
EFI_IPv4_ADDRESS RouterAddress;
EFI_IPv4_ADDRESS SubnetMask;
UINT32 LeaseTime;
EFI_DHCP4_PACKET *ReplyPacket;
} EFI_DHCP4_MODE_DATA;
typedef struct {
EFI_IPv4_ADDRESS ListenAddress;
EFI_IPv4_ADDRESS SubnetMask;
UINT16 ListenPort;
} EFI_DHCP4_LISTEN_POINT;
typedef struct {
OUT EFI_STATUS Status;
IN EFI_EVENT CompletionEvent;
IN EFI_IPv4_ADDRESS RemoteAddress;
IN UINT16 RemotePort;
IN EFI_IPv4_ADDRESS GatewayAddress;
IN UINT32 ListenPointCount;
IN EFI_DHCP4_LISTEN_POINT *ListenPoints;
IN UINT32 TimeoutValue;
IN EFI_DHCP4_PACKET *Packet;
OUT UINT32 ResponseCount;
OUT EFI_DHCP4_PACKET *ResponseList;
}EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN;
typedef
EFI_STATUS
(EFIAPI *EFI_DHCP4_GET_MODE_DATA)(
IN EFI_DHCP4_PROTOCOL *This,
OUT EFI_DHCP4_MODE_DATA *Dhcp4ModeData
);
typedef
EFI_STATUS
(EFIAPI *EFI_DHCP4_CONFIGURE) (
IN EFI_DHCP4_PROTOCOL *This,
IN EFI_DHCP4_CONFIG_DATA *Dhcp4CfgData OPTIONAL
);
typedef EFI_STATUS
(EFIAPI *EFI_DHCP4_START) (
IN EFI_DHCP4_PROTOCOL *This,
IN EFI_EVENT CompletionEvent OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_DHCP4_RENEW) (
IN EFI_DHCP4_PROTOCOL *This,
IN BOOLEAN RebindRequest,
IN EFI_EVENT CompletionEvent OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_DHCP4_RELEASE) (
IN EFI_DHCP4_PROTOCOL *This
);
typedef EFI_STATUS
(EFIAPI *EFI_DHCP4_STOP) (
IN EFI_DHCP4_PROTOCOL *This
);
typedef
EFI_STATUS
(EFIAPI *EFI_DHCP4_BUILD) (
IN EFI_DHCP4_PROTOCOL *This,
IN EFI_DHCP4_PACKET *SeedPacket,
IN UINT32 DeleteCount,
IN UINT8 *DeleteList OPTIONAL,
IN UINT32 AppendCount,
IN EFI_DHCP4_PACKET_OPTION *AppendList[] OPTIONAL,
OUT EFI_DHCP4_PACKET **NewPacket
);
typedef
EFI_STATUS
(EFIAPI *EFI_DHCP4_TRANSMIT_RECEIVE) (
IN EFI_DHCP4_PROTOCOL *This,
IN EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN *Token
);
typedef
EFI_STATUS
(EFIAPI *EFI_DHCP4_PARSE) (
IN EFI_DHCP4_PROTOCOL *This,
IN EFI_DHCP4_PACKET *Packet,
IN OUT UINT32 *OptionCount,
OUT EFI_DHCP4_PACKET_OPTION *PacketOptionList[] OPTIONAL
);
typedef struct _EFI_DHCP4_PROTOCOL {
EFI_DHCP4_GET_MODE_DATA GetModeData;
EFI_DHCP4_CONFIGURE Configure;
EFI_DHCP4_START Start;
EFI_DHCP4_RENEW RenewRebind;
EFI_DHCP4_RELEASE Release;
EFI_DHCP4_STOP Stop;
EFI_DHCP4_BUILD Build;
EFI_DHCP4_TRANSMIT_RECEIVE TransmitReceive;
EFI_DHCP4_PARSE Parse;
} EFI_DHCP4_PROTOCOL;
#endif

View File

@@ -0,0 +1,31 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DiskIo.c
Abstract:
Disk IO protocol as defined in the EFI 1.0 specification.
The Disk IO protocol is used to convert block oriented devices into byte
oriented devices. The Disk IO protocol is intended to layer on top of the
Block IO protocol.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (DiskIo)
EFI_GUID gEfiDiskIoProtocolGuid = EFI_DISK_IO_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiDiskIoProtocolGuid, "DiskIo Protocol", "EFI 1.0 Disk IO Protocol");

View File

@@ -0,0 +1,111 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DiskIo.h
Abstract:
Disk IO protocol as defined in the EFI 1.0 specification.
The Disk IO protocol is used to convert block oriented devices into byte
oriented devices. The Disk IO protocol is intended to layer on top of the
Block IO protocol.
--*/
#ifndef __DISK_IO_H__
#define __DISK_IO_H__
#define EFI_DISK_IO_PROTOCOL_GUID \
{ \
0xce345171, 0xba0b, 0x11d2, 0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b \
}
EFI_FORWARD_DECLARATION (EFI_DISK_IO_PROTOCOL);
typedef
EFI_STATUS
(EFIAPI *EFI_DISK_READ) (
IN EFI_DISK_IO_PROTOCOL * This,
IN UINT32 MediaId,
IN UINT64 Offset,
IN UINTN BufferSize,
OUT VOID *Buffer
)
/*++
Routine Description:
Read BufferSize bytes from Offset into Buffer.
Arguments:
This - Protocol instance pointer.
MediaId - Id of the media, changes every time the media is replaced.
Offset - The starting byte offset to read from
BufferSize - Size of Buffer
Buffer - Buffer containing read data
Returns:
EFI_SUCCESS - The data was read correctly from the device.
EFI_DEVICE_ERROR - The device reported an error while performing the read.
EFI_NO_MEDIA - There is no media in the device.
EFI_MEDIA_CHNAGED - The MediaId does not matched the current device.
EFI_INVALID_PARAMETER - The read request contains device addresses that are not
valid for the device.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_DISK_WRITE) (
IN EFI_DISK_IO_PROTOCOL * This,
IN UINT32 MediaId,
IN UINT64 Offset,
IN UINTN BufferSize,
IN VOID *Buffer
)
/*++
Routine Description:
Read BufferSize bytes from Offset into Buffer.
Arguments:
This - Protocol instance pointer.
MediaId - Id of the media, changes every time the media is replaced.
Offset - The starting byte offset to read from
BufferSize - Size of Buffer
Buffer - Buffer containing read data
Returns:
EFI_SUCCESS - The data was written correctly to the device.
EFI_WRITE_PROTECTED - The device can not be written to.
EFI_DEVICE_ERROR - The device reported an error while performing the write.
EFI_NO_MEDIA - There is no media in the device.
EFI_MEDIA_CHNAGED - The MediaId does not matched the current device.
EFI_INVALID_PARAMETER - The write request contains device addresses that are not
valid for the device.
--*/
;
#define EFI_DISK_IO_PROTOCOL_REVISION 0x00010000
typedef struct _EFI_DISK_IO_PROTOCOL {
UINT64 Revision;
EFI_DISK_READ ReadDisk;
EFI_DISK_WRITE WriteDisk;
} EFI_DISK_IO_PROTOCOL;
extern EFI_GUID gEfiDiskIoProtocolGuid;
#endif

View File

@@ -0,0 +1,29 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DriverBinding.c
Abstract:
EFI Controller Driver Protocol
Revision History
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (DriverBinding)
EFI_GUID gEfiDriverBindingProtocolGuid = EFI_DRIVER_BINDING_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiDriverBindingProtocolGuid, "Controller Driver Protocol", "EFI 1.1 Controller Driver Protocol");

View File

@@ -0,0 +1,130 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DriverBinding.h
Abstract:
EFI ControllerHandle Driver Protocol
Revision History
--*/
#ifndef _EFI_DRIVER_BINDING_H_
#define _EFI_DRIVER_BINDING_H_
//
// Global ID for the ControllerHandle Driver Protocol
//
#define EFI_DRIVER_BINDING_PROTOCOL_GUID \
{ \
0x18a031ab, 0xb443, 0x4d1a, 0xa5, 0xc0, 0xc, 0x9, 0x26, 0x1e, 0x9f, 0x71 \
}
EFI_FORWARD_DECLARATION (EFI_DRIVER_BINDING_PROTOCOL);
typedef
EFI_STATUS
(EFIAPI *EFI_DRIVER_BINDING_SUPPORTED) (
IN EFI_DRIVER_BINDING_PROTOCOL * This,
IN EFI_HANDLE ControllerHandle,
IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
)
/*++
Routine Description:
Test to see if this driver supports ControllerHandle.
Arguments:
This - Protocol instance pointer.
ControllerHandle - Handle of device to test
RemainingDevicePath - Optional parameter use to pick a specific child
device to start.
Returns:
EFI_SUCCESS - This driver supports this device
EFI_ALREADY_STARTED - This driver is already running on this device
other - This driver does not support this device
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_DRIVER_BINDING_START) (
IN EFI_DRIVER_BINDING_PROTOCOL * This,
IN EFI_HANDLE ControllerHandle,
IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
)
/*++
Routine Description:
Start this driver on ControllerHandle.
Arguments:
This - Protocol instance pointer.
ControllerHandle - Handle of device to bind driver to
RemainingDevicePath - Optional parameter use to pick a specific child
device to start.
Returns:
EFI_SUCCESS - This driver is added to ControllerHandle
EFI_ALREADY_STARTED - This driver is already running on ControllerHandle
other - This driver does not support this device
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_DRIVER_BINDING_STOP) (
IN EFI_DRIVER_BINDING_PROTOCOL * This,
IN EFI_HANDLE ControllerHandle,
IN UINTN NumberOfChildren,
IN EFI_HANDLE * ChildHandleBuffer
)
/*++
Routine Description:
Stop this driver on ControllerHandle.
Arguments:
This - Protocol instance pointer.
ControllerHandle - Handle of device to stop driver on
NumberOfChildren - Number of Handles in ChildHandleBuffer. If number of
children is zero stop the entire bus driver.
ChildHandleBuffer - List of Child Handles to Stop.
Returns:
EFI_SUCCESS - This driver is removed ControllerHandle
other - This driver was not removed from this device
--*/
;
//
// Interface structure for the ControllerHandle Driver Protocol
//
typedef struct _EFI_DRIVER_BINDING_PROTOCOL {
EFI_DRIVER_BINDING_SUPPORTED Supported;
EFI_DRIVER_BINDING_START Start;
EFI_DRIVER_BINDING_STOP Stop;
UINT32 Version;
EFI_HANDLE ImageHandle;
EFI_HANDLE DriverBindingHandle;
} EFI_DRIVER_BINDING_PROTOCOL;
extern EFI_GUID gEfiDriverBindingProtocolGuid;
#endif

View File

@@ -0,0 +1,30 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DriverConfiguration.c
Abstract:
EFI Driver Configuration Protocol
Revision History
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (DriverConfiguration)
EFI_GUID gEfiDriverConfigurationProtocolGuid = EFI_DRIVER_CONFIGURATION_PROTOCOL_GUID;
EFI_GUID_STRING
(&gEfiDriverConfigurationProtocolGuid, "Driver Configuration Protocol", "EFI 1.1 Driver Configuration Protocol");

View File

@@ -0,0 +1,211 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DriverConfiguration.h
Abstract:
EFI Driver Configuration Protocol
Revision History
--*/
#ifndef _EFI_DRIVER_CONFIGURATION_H_
#define _EFI_DRIVER_CONFIGURATION_H_
//
// Global ID for the Driver Configuration Protocol
//
#define EFI_DRIVER_CONFIGURATION_PROTOCOL_GUID \
{ \
0x107a772b, 0xd5e1, 0x11d4, 0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d \
}
EFI_FORWARD_DECLARATION (EFI_DRIVER_CONFIGURATION_PROTOCOL);
typedef enum {
EfiDriverConfigurationActionNone = 0,
EfiDriverConfigurationActionStopController = 1,
EfiDriverConfigurationActionRestartController = 2,
EfiDriverConfigurationActionRestartPlatform = 3,
EfiDriverConfigurationActionMaximum
} EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED;
#define EFI_DRIVER_CONFIGURATION_SAFE_DEFAULTS 0x00000000
#define EFI_DRIVER_CONFIGURATION_MANUFACTURING_DEFAULTS 0x00000001
#define EFI_DRIVER_CONFIGURATION_CUSTOM_DEFAULTS 0x00000002
#define EFI_DRIVER_CONFIGURATION_PERORMANCE_DEFAULTS 0x00000003
typedef
EFI_STATUS
(EFIAPI *EFI_DRIVER_CONFIGURATION_SET_OPTIONS) (
IN EFI_DRIVER_CONFIGURATION_PROTOCOL * This,
IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE ChildHandle OPTIONAL,
IN CHAR8 *Language,
OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED * ActionRequired
);
/*++
Routine Description:
Allows the user to set controller specific options for a controller that a
driver is currently managing.
Arguments:
This - A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL instance.
ControllerHandle - The handle of the controller to set options on.
ChildHandle - The handle of the child controller to set options on. This
is an optional parameter that may be NULL. It will be NULL
for device drivers, and for a bus drivers that wish to set
options for the bus controller. It will not be NULL for a
bus driver that wishes to set options for one of its child
controllers.
Language - A pointer to a three character ISO 639-2 language identifier.
This is the language of the user interface that should be
presented to the user, and it must match one of the languages
specified in SupportedLanguages. The number of languages
supported by a driver is up to the driver writer.
ActionRequired - A pointer to the action that the calling agent is required
to perform when this function returns. See "Related
Definitions" for a list of the actions that the calling
agent is required to perform prior to accessing
ControllerHandle again.
Returns:
EFI_SUCCESS - The driver specified by This successfully set the
configuration options for the controller specified
by ControllerHandle..
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETER - ActionRequired is NULL.
EFI_UNSUPPORTED - The driver specified by This does not support setting
configuration options for the controller specified by
ControllerHandle and ChildHandle.
EFI_UNSUPPORTED - The driver specified by This does not support the
language specified by Language.
EFI_DEVICE_ERROR - A device error occurred while attempt to set the
configuration options for the controller specified
by ControllerHandle and ChildHandle.
EFI_OUT_RESOURCES - There are not enough resources available to set the
configuration options for the controller specified
by ControllerHandle and ChildHandle.
--*/
typedef
EFI_STATUS
(EFIAPI *EFI_DRIVER_CONFIGURATION_OPTIONS_VALID) (
IN EFI_DRIVER_CONFIGURATION_PROTOCOL * This,
IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE ChildHandle OPTIONAL
);
/*++
Routine Description:
Tests to see if a controller's current configuration options are valid.
Arguments:
This - A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL instance.
ControllerHandle - The handle of the controller to test if it's current
configuration options are valid.
ChildHandle - The handle of the child controller to test if it's current
configuration options are valid. This is an optional
parameter that may be NULL. It will be NULL for device
drivers. It will also be NULL for a bus drivers that wish
to test the configuration options for the bus controller.
It will not be NULL for a bus driver that wishes to test
configuration options for one of its child controllers.
Returns:
EFI_SUCCESS - The controller specified by ControllerHandle and
ChildHandle that is being managed by the driver
specified by This has a valid set of configuration
options.
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.
EFI_UNSUPPORTED - The driver specified by This is not currently
managing the controller specified by ControllerHandle
and ChildHandle.
EFI_DEVICE_ERROR - The controller specified by ControllerHandle and
ChildHandle that is being managed by the driver
specified by This has an invalid set of configuration
options.
--*/
typedef
EFI_STATUS
(EFIAPI *EFI_DRIVER_CONFIGURATION_FORCE_DEFAULTS) (
IN EFI_DRIVER_CONFIGURATION_PROTOCOL * This,
IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE ChildHandle OPTIONAL,
IN UINT32 DefaultType,
OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED * ActionRequired
);
/*++
Routine Description:
Forces a driver to set the default configuration options for a controller.
Arguments:
This - A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL instance.
ControllerHandle - The handle of the controller to force default configuration options on.
ChildHandle - The handle of the child controller to force default configuration options on This is an optional parameter that may be NULL. It will be NULL for device drivers. It will also be NULL for a bus drivers that wish to force default configuration options for the bus controller. It will not be NULL for a bus driver that wishes to force default configuration options for one of its child controllers.
DefaultType - The type of default configuration options to force on the controller specified by ControllerHandle and ChildHandle. See Table 9-1 for legal values. A DefaultType of 0x00000000 must be supported by this protocol.
ActionRequired - A pointer to the action that the calling agent is required to perform when this function returns. See "Related Definitions" in Section 9.1for a list of the actions that the calling agent is required to perform prior to accessing ControllerHandle again.
Returns:
EFI_SUCCESS - The driver specified by This successfully forced the default configuration options on the controller specified by ControllerHandle and ChildHandle.
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETER - ActionRequired is NULL.
EFI_UNSUPPORTED - The driver specified by This does not support forcing the default configuration options on the controller specified by ControllerHandle and ChildHandle.
EFI_UNSUPPORTED - The driver specified by This does not support the configuration type specified by DefaultType.
EFI_DEVICE_ERROR - A device error occurred while attempt to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.
EFI_OUT_RESOURCES - There are not enough resources available to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.
--*/
//
// Interface structure for the Driver Configuration Protocol
//
typedef struct _EFI_DRIVER_CONFIGURATION_PROTOCOL {
EFI_DRIVER_CONFIGURATION_SET_OPTIONS SetOptions;
EFI_DRIVER_CONFIGURATION_OPTIONS_VALID OptionsValid;
EFI_DRIVER_CONFIGURATION_FORCE_DEFAULTS ForceDefaults;
CHAR8 *SupportedLanguages;
} EFI_DRIVER_CONFIGURATION_PROTOCOL;
/*++
Protocol Description:
Used to set configuration options for a controller that an EFI Driver is managing.
Parameters:
SetOptions - Allows the use to set drivers specific configuration
options for a controller that the driver is currently
managing.
OptionsValid - Tests to see if a controller's current configuration
options are valid.
ForceDefaults - Forces a driver to set the default configuration options
for a controller.
SupportedLanguages - A Null-terminated ASCII string that contains one or more
ISO 639-2 language codes. This is the list of language
codes that this protocol supports.
--*/
extern EFI_GUID gEfiDriverConfigurationProtocolGuid;
#endif

View File

@@ -0,0 +1,30 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DriverDiagnostics.c
Abstract:
EFI Driver Diagnostics Protocol
Revision History
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (DriverDiagnostics)
EFI_GUID gEfiDriverDiagnosticsProtocolGuid = EFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID;
EFI_GUID_STRING
(&gEfiDriverDiagnosticsProtocolGuid, "Driver Diagnostics Protocol", "EFI 1.1 Driver Diagnostics Protocol");

View File

@@ -0,0 +1,138 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
DriverDiagnostics.h
Abstract:
EFI Driver Diagnostics Protocol
Revision History
--*/
#ifndef _EFI_DRIVER_DIAGNOSTICS_H_
#define _EFI_DRIVER_DIAGNOSTICS_H_
//
// Global ID for the Driver Diagnostics Protocol
//
#define EFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID \
{ \
0x0784924f, 0xe296, 0x11d4, 0x9a, 0x49, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d \
}
EFI_FORWARD_DECLARATION (EFI_DRIVER_DIAGNOSTICS_PROTOCOL);
typedef enum {
EfiDriverDiagnosticTypeStandard = 0,
EfiDriverDiagnosticTypeExtended = 1,
EfiDriverDiagnosticTypeManufacturing= 2,
EfiDriverDiagnosticTypeMaximum
} EFI_DRIVER_DIAGNOSTIC_TYPE;
typedef
EFI_STATUS
(EFIAPI *EFI_DRIVER_DIAGNOSTICS_RUN_DIAGNOSTICS) (
IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL * This,
IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE ChildHandle OPTIONAL,
IN EFI_DRIVER_DIAGNOSTIC_TYPE DiagnosticType,
IN CHAR8 *Language,
OUT EFI_GUID **ErrorType,
OUT UINTN *BufferSize,
OUT CHAR16 **Buffer
);
/*++
Routine Description:
Runs diagnostics on a controller.
Arguments:
This - A pointer to the EFI_DRIVER_DIAGNOSTICS_PROTOCOL instance.
ControllerHandle - The handle of the controller to run diagnostics on.
ChildHandle - The handle of the child controller to run diagnostics on
This is an optional parameter that may be NULL. It will
be NULL for device drivers. It will also be NULL for a
bus drivers that wish to run diagnostics on the bus
controller. It will not be NULL for a bus driver that
wishes to run diagnostics on one of its child controllers.
DiagnosticType - Indicates type of diagnostics to perform on the controller
specified by ControllerHandle and ChildHandle. See
"Related Definitions" for the list of supported types.
Language - A pointer to a three character ISO 639-2 language
identifier. This is the language in which the optional
error message should be returned in Buffer, and it must
match one of the languages specified in SupportedLanguages.
The number of languages supported by a driver is up to
the driver writer.
ErrorType - A GUID that defines the format of the data returned in
Buffer.
BufferSize - The size, in bytes, of the data returned in Buffer.
Buffer - A buffer that contains a Null-terminated Unicode string
plus some additional data whose format is defined by
ErrorType. Buffer is allocated by this function with
AllocatePool(), and it is the caller's responsibility
to free it with a call to FreePool().
Returns:
EFI_SUCCESS - The controller specified by ControllerHandle and
ChildHandle passed the diagnostic.
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid
EFI_HANDLE.
EFI_INVALID_PARAMETER - Language is NULL.
EFI_INVALID_PARAMETER - ErrorType is NULL.
EFI_INVALID_PARAMETER - BufferType is NULL.
EFI_INVALID_PARAMETER - Buffer is NULL.
EFI_UNSUPPORTED - The driver specified by This does not support
running diagnostics for the controller specified
by ControllerHandle and ChildHandle.
EFI_UNSUPPORTED - The driver specified by This does not support the
type of diagnostic specified by DiagnosticType.
EFI_UNSUPPORTED - The driver specified by This does not support the
language specified by Language.
EFI_OUT_OF_RESOURCES - There are not enough resources available to complete
the diagnostics.
EFI_OUT_OF_RESOURCES - There are not enough resources available to return
the status information in ErrorType, BufferSize,
and Buffer.
EFI_DEVICE_ERROR - The controller specified by ControllerHandle and
ChildHandle did not pass the diagnostic.
--*/
//
// Interface structure for the Driver Diagnostics Protocol
//
typedef struct _EFI_DRIVER_DIAGNOSTICS_PROTOCOL {
EFI_DRIVER_DIAGNOSTICS_RUN_DIAGNOSTICS RunDiagnostics;
CHAR8 *SupportedLanguages;
} EFI_DRIVER_DIAGNOSTICS_PROTOCOL;
/*++
Protocol Description:
Used to perform diagnostics on a controller that an EFI Driver is managing.
Parameters:
RunDiagnostics - Runs diagnostics on a controller.
SupportedLanguages - A Null-terminated ASCII string that contains one or more
ISO 639-2 language codes. This is the list of language
codes that this protocol supports.
--*/
extern EFI_GUID gEfiDriverDiagnosticsProtocolGuid;
#endif

View File

@@ -0,0 +1,28 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Ebc.c
Abstract:
EBC protocol as defined in the EFI 1.1 specification.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (Ebc)
EFI_GUID gEfiEbcProtocolGuid = EFI_EBC_INTERPRETER_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiEbcProtocolGuid, "EBC Protocol", "EFI 1.1 EBC protocol");

View File

@@ -0,0 +1,183 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Ebc.h
Abstract:
Describes the protocol interface to the EBC interpreter.
--*/
#ifndef _EBC_H_
#define _EBC_H_
#define EFI_EBC_INTERPRETER_PROTOCOL_GUID \
{ \
0x13AC6DD1, 0x73D0, 0x11D4, 0xB0, 0x6B, 0x00, 0xAA, 0x00, 0xBD, 0x6D, 0xE7 \
}
//
// Define for forward reference.
//
EFI_FORWARD_DECLARATION (EFI_EBC_PROTOCOL);
/*++
Routine Description:
Create a thunk for an image entry point. In short, given the physical address
of the entry point for a loaded image, create a thunk that does some
fixup of arguments (and perform any other necessary overhead) and then
calls the original entry point. The caller can then use the returned pointer
to the created thunk as the new entry point to image.
Arguments:
This - protocol instance pointer
ImageHandle - handle to the image. The EBC interpreter may use this to keep
track of any resource allocations performed in loading and
executing the image.
EbcEntryPoint - the entry point for the image (as defined in the file header)
Thunk - pointer to thunk pointer where the address of the created
thunk is returned.
Returns:
Standard EFI_STATUS
--*/
typedef
EFI_STATUS
(EFIAPI *EFI_EBC_CREATE_THUNK) (
IN EFI_EBC_PROTOCOL * This,
IN EFI_HANDLE ImageHandle,
IN VOID *EbcEntryPoint,
OUT VOID **Thunk
);
/*++
Routine Description:
Perform any cleanup necessary when an image is unloaded. Basically it gives
the EBC interpreter the chance to free up any resources allocated during
load and execution of an EBC image.
Arguments:
This - protocol instance pointer
ImageHandle - the handle of the image being unloaded.
Returns:
Standard EFI_STATUS.
--*/
typedef
EFI_STATUS
(EFIAPI *EFI_EBC_UNLOAD_IMAGE) (
IN EFI_EBC_PROTOCOL * This,
IN EFI_HANDLE ImageHandle
);
/*++
Routine Description:
The I-Cache-flush registration service takes a pointer to a function to
call to flush the I-Cache. Here's the prototype for that function pointer.
Arguments:
Start - physical start address of CPU instruction cache to flush.
Length - how many bytes to flush of the instruction cache.
Returns:
Standard EFI_STATUS.
--*/
typedef
EFI_STATUS
(EFIAPI *EBC_ICACHE_FLUSH) (
IN EFI_PHYSICAL_ADDRESS Start,
IN UINT64 Length
);
/*++
Routine Description:
This routine is called by the core firmware to provide the EBC driver with
a function to call to flush the CPU's instruction cache following creation
of a thunk. It is not required.
Arguments:
This - protocol instance pointer
Flush - pointer to the function to call to flush the CPU instruction
cache.
Returns:
Standard EFI_STATUS.
--*/
typedef
EFI_STATUS
(EFIAPI *EFI_EBC_REGISTER_ICACHE_FLUSH) (
IN EFI_EBC_PROTOCOL * This,
IN EBC_ICACHE_FLUSH Flush
);
/*++
Routine Description:
This routine can be called to get the VM revision. It returns the same
value as the EBC BREAK 1 instruction returns.
Arguments:
This - protocol instance pointer
Version - pointer to where to return the VM version
Returns:
Standard EFI_STATUS.
--*/
typedef
EFI_STATUS
(EFIAPI *EFI_EBC_GET_VERSION) (
IN EFI_EBC_PROTOCOL * This,
IN OUT UINT64 *Version
);
//
// Prototype for the actual EBC protocol interface
//
typedef struct _EFI_EBC_PROTOCOL {
EFI_EBC_CREATE_THUNK CreateThunk;
EFI_EBC_UNLOAD_IMAGE UnloadImage;
EFI_EBC_REGISTER_ICACHE_FLUSH RegisterICacheFlush;
EFI_EBC_GET_VERSION GetVersion;
} EFI_EBC_PROTOCOL;
//
// Extern the global EBC protocol GUID
//
extern EFI_GUID gEfiEbcProtocolGuid;
#endif

View File

@@ -0,0 +1,29 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdidActive.c
Abstract:
EDID Active Protocol from the UEFI 2.0 specification.
Placed on the video output device child handle that are actively displaying output.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (EdidActive)
EFI_GUID gEfiEdidActiveProtocolGuid = EFI_EDID_ACTIVE_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiEdidActiveProtocolGuid, "EFI EDID Active Protocol", "UEFI EDID Active Protocol");

View File

@@ -0,0 +1,39 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdidActive.h
Abstract:
EDID Active Protocol from the UEFI 2.0 specification.
Placed on the video output device child handle that are actively displaying output.
--*/
#ifndef __EDID_ACTIVE_H__
#define __EDID_ACTIVE_H__
#define EFI_EDID_ACTIVE_PROTOCOL_GUID \
{ \
0xbd8c1056, 0x9f36, 0x44ec, 0x92, 0xa8, 0xa6, 0x33, 0x7f, 0x81, 0x79, 0x86 \
}
typedef struct {
UINT32 SizeOfEdid;
UINT8 *Edid;
} EFI_EDID_ACTIVE_PROTOCOL;
extern EFI_GUID gEfiEdidActiveProtocolGuid;
#endif

View File

@@ -0,0 +1,30 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdidDiscovered.c
Abstract:
EDID Discovered Protocol from the UEFI 2.0 specification.
This protocol is placed on the video output device child handle and it represents
the EDID information being used for output device represented by the child handle.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (EdidDiscovered)
EFI_GUID gEfiEdidDiscoveredProtocolGuid = EFI_EDID_DISCOVERED_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiEdidDiscoveredProtocolGuid, "EFI EDID Discovered Protocol", "UEFI EDID Discovered Protocol");

View File

@@ -0,0 +1,40 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdidDiscovered.h
Abstract:
EDID Discovered Protocol from the UEFI 2.0 specification.
This protocol is placed on the video output device child handle and it represents
the EDID information being used for output device represented by the child handle.
--*/
#ifndef __EDID_DISCOVERED_H__
#define __EDID_DISCOVERED_H__
#define EFI_EDID_DISCOVERED_PROTOCOL_GUID \
{ \
0x1c0c34f6, 0xd380, 0x41fa, 0xa0, 0x49, 0x8a, 0xd0, 0x6c,0x1a, 0x66, 0xaa \
}
typedef struct {
UINT32 SizeOfEdid;
UINT8 *Edid;
} EFI_EDID_DISCOVERED_PROTOCOL;
extern EFI_GUID gEfiEdidDiscoveredProtocolGuid;
#endif

View File

@@ -0,0 +1,30 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdidOverride.c
Abstract:
EDID Override Protocol from the UEFI 2.0 specification.
Allow platform to provide EDID information to producer of the Graphics Output
protocol.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (EdidOverride)
EFI_GUID gEfiEdidOverrideProtocolGuid = EFI_EDID_OVERRIDE_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiEdidOverrideProtocolGuid, "EFI EDID Override Protocol", "UEFI EDID Override Protocol");

View File

@@ -0,0 +1,78 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdidOverride.h
Abstract:
EDID Override Protocol from the UEFI 2.0 specification.
Allow platform to provide EDID information to producer of the Graphics Output
protocol.
--*/
#ifndef __EDID_OVERRIDE_H__
#define __EDID_OVERRIDE_H__
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (EdidDiscovered)
#define EFI_EDID_OVERRIDE_PROTOCOL_GUID \
{ \
0x48ecb431, 0xfb72, 0x45c0, 0xa9, 0x22, 0xf4, 0x58, 0xfe, 0x4, 0xb, 0xd5 \
}
typedef struct _EFI_EDID_OVERRIDE_PROTOCOL EFI_EDID_OVERRIDE_PROTOCOL;
#define EFI_EDID_OVERRIDE_DONT_OVERRIDE 0x01
#define EFI_EDID_OVERRIDE_ENABLE_HOT_PLUG 0x02
typedef
EFI_STATUS
(EFIAPI *EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID) (
IN EFI_EDID_OVERRIDE_PROTOCOL *This,
IN EFI_HANDLE *ChildHandle,
OUT UINT32 *Attributes,
IN OUT UINTN *EdidSize,
IN OUT UINT8 **Edid
)
/*++
Routine Description:
Return the current video mode information.
Arguments:
This - Protocol instance pointer.
ChildHandle - A child handle produced by the Graphics Output EFI
driver that represents a video output device.
Attributes - The attributes associated with ChildHandle video output device.
EdidSize - A pointer to the size, in bytes, of the Edid buffer.
Edid - A pointer to callee allocated buffer that contains the EDID that
should be used for ChildHandle. A value of NULL
represents no EDID override for ChildHandle.
Returns:
EFI_SUCCESS - Valid overrides returned for ChildHandle.
EFI_UNSUPPORTED - ChildHandle has no overrides.
--*/
;
typedef struct _EFI_EDID_OVERRIDE_PROTOCOL {
EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID GetEdid;
} EFI_EDID_OVERRIDE_PROTOCOL;
extern EFI_GUID gEfiEdidOverrideProtocolGuid;
#endif

View File

@@ -0,0 +1,40 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EfiNetworkInterfaceIdentifier.c
Abstract:
Revision History
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (EfiNetworkInterfaceIdentifier)
EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid = EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID;
EFI_GUID_STRING
(
&gEfiNetworkInterfaceIdentifierProtocolGuid, "Network Interface Identifier Protocol",
"EFI Network Interface Identifier Protocol"
);
EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid_31 = EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID_31;
EFI_GUID_STRING
(
&gEfiNetworkInterfaceIdentifierProtocolGuid_31, "Network Interface Identifier Protocol_31",
"EFI1.1 Network Interface Identifier Protocol"
);

View File

@@ -0,0 +1,102 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module name:
EfiNetworkInterfaceIdentifier.h
Abstract:
Revision history:
2000-Feb-18 M(f)J GUID updated.
Structure order changed for machine word alignment.
Added StringId[4] to structure.
2000-Feb-14 M(f)J Genesis.
--*/
#ifndef _EFI_NETWORKINTERFACEIDENTIFER_H
#define _EFI_NETWORKINTERFACEIDENTIFER_H
#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID \
{ \
0xE18541CD, 0xF755, 0x4f73, 0x92, 0x8D, 0x64, 0x3C, 0x8A, 0x79, 0xB2, 0x29 \
}
#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID_31 \
{ \
0x1ACED566, 0x76ED, 0x4218, 0xBC, 0x81, 0x76, 0x7F, 0x1F, 0x97, 0x7A, 0x89 \
}
#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION 0x00010000
#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION_31 0x00010001
//
// Forward reference for pure ANSI compatability
//
EFI_FORWARD_DECLARATION (EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL);
typedef enum {
EfiNetworkInterfaceUndi = 1
} EFI_NETWORK_PROTOCOL_TYPE;
typedef struct _EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL {
UINT64 Revision;
//
// Revision of the network interface identifier protocol interface.
//
UINT64 ID;
//
// Address of the first byte of the identifying structure for this
// network interface. This is set to zero if there is no structure.
//
// For PXE/UNDI this is the first byte of the !PXE structure.
//
UINT64 ImageAddr;
//
// Address of the UNrelocated driver/ROM image. This is set
// to zero if there is no driver/ROM image.
//
// For 16-bit UNDI, this is the first byte of the option ROM in
// upper memory.
//
// For 32/64-bit S/W UNDI, this is the first byte of the EFI ROM
// image.
//
// For H/W UNDI, this is set to zero.
//
UINT32 ImageSize;
//
// Size of the UNrelocated driver/ROM image of this network interface.
// This is set to zero if there is no driver/ROM image.
//
CHAR8 StringId[4];
//
// 4 char ASCII string to go in class identifier (option 60) in DHCP
// and Boot Server discover packets.
// For EfiNetworkInterfaceUndi this field is "UNDI".
// For EfiNetworkInterfaceSnp this field is "SNPN".
//
UINT8 Type;
UINT8 MajorVer;
UINT8 MinorVer;
//
// Information to be placed into the PXE DHCP and Discover packets.
// This is the network interface type and version number that will
// be placed into DHCP option 94 (client network interface identifier).
//
BOOLEAN Ipv6Supported;
UINT8 IfNum; // interface number to be used with pxeid structure
} EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL;
extern EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid;
extern EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid_31;
#endif // _EFI_NII_H

View File

@@ -0,0 +1,158 @@
#/*++
#
# Copyright (c) 2004 - 2007, Intel Corporation
# All rights reserved. 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
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
# Module Name:
#
# EfiProtocolLib.inf
#
# Abstract:
#
# Component description file.
#
#--*/
[defines]
BASE_NAME= EfiProtocolLib
COMPONENT_TYPE= LIBRARY
[includes.common]
$(EDK_SOURCE)\Foundation\Efi
$(EDK_SOURCE)\Foundation\Include
$(EDK_SOURCE)\Foundation\Efi\Include
$(EDK_SOURCE)\Foundation\Framework\Include
$(EDK_SOURCE)\Foundation\Include\IndustryStandard
$(EDK_SOURCE)\Foundation\Include\Pei
$(EDK_SOURCE)\Foundation\Library\Pei\Include
$(EDK_SOURCE)\Foundation\Core\Dxe
$(EDK_SOURCE)\Foundation\Library\Dxe\Include
[nmake.common]
[sources.common]
AcpiTable\AcpiTable.h
AcpiTable\AcpiTable.c
Arp\Arp.h
Arp\Arp.c
Bis\Bis.h
Bis\Bis.c
BlockIo\BlockIo.h
BlockIo\BlockIo.c
BusSpecificDriverOverride\BusSpecificDriverOverride.h
BusSpecificDriverOverride\BusSpecificDriverOverride.c
ComponentName\ComponentName.h
ComponentName\ComponentName.c
ComponentName2\ComponentName2.h
ComponentName2\ComponentName2.c
DebugPort\DebugPort.h
DebugPort\DebugPort.c
DebugSupport\DebugSupport.h
DebugSupport\DebugSupport.c
Decompress\Decompress.h
Decompress\Decompress.c
DeviceIo\DeviceIo.h
DeviceIo\DeviceIo.c
DevicePath\DevicePath.h
DevicePath\DevicePath.c
DevicePathFromText\DevicePathFromText.h
DevicePathFromText\DevicePathFromText.c
DevicePathToText\DevicePathToText.h
DevicePathToText\DevicePathToText.c
DevicePathUtilities\DevicePathUtilities.h
DevicePathUtilities\DevicePathUtilities.c
Dhcp4\Dhcp4.h
Dhcp4\Dhcp4.c
DiskIo\DiskIo.h
DiskIo\DiskIo.c
DriverBinding\DriverBinding.h
DriverBinding\DriverBinding.c
DriverConfiguration\DriverConfiguration.h
DriverConfiguration\DriverConfiguration.c
DriverDiagnostics\DriverDiagnostics.h
DriverDiagnostics\DriverDiagnostics.c
Ebc\Ebc.h
Ebc\Ebc.c
EdidActive\EdidActive.h
EdidActive\EdidActive.c
EdidDiscovered\EdidDiscovered.h
EdidDiscovered\EdidDiscovered.c
EdidOverride\EdidOverride.h
EdidOverride\EdidOverride.c
EfiNetworkInterfaceIdentifier\EfiNetworkInterfaceIdentifier.h
EfiNetworkInterfaceIdentifier\EfiNetworkInterfaceIdentifier.c
FileInfo\FileInfo.h
FileInfo\FileInfo.c
FileSystemInfo\FileSystemInfo.h
FileSystemInfo\FileSystemInfo.c
FileSystemVolumeLabelInfo\FileSystemVolumeLabelInfo.h
FileSystemVolumeLabelInfo\FileSystemVolumeLabelInfo.c
GraphicsOutput\GraphicsOutput.h
GraphicsOutput\GraphicsOutput.c
Ip4\Ip4.h
Ip4\Ip4.c
Ip4Config\Ip4Config.h
Ip4Config\Ip4Config.c
LoadedImage\LoadedImage.h
LoadedImage\LoadedImage.c
LoadFile\LoadFile.h
LoadFile\LoadFile.c
ManagedNetwork\ManagedNetwork.h
ManagedNetwork\ManagedNetwork.c
Mtftp4\Mtftp4.h
Mtftp4\Mtftp4.c
PciIo\PciIo.h
PciIo\PciIo.c
PciRootBridgeIo\PciRootBridgeIo.h
PciRootBridgeIo\PciRootBridgeIo.c
PlatformDriverOverride\PlatformDriverOverride.h
PlatformDriverOverride\PlatformDriverOverride.c
PxeBaseCode\PxeBaseCode.h
PxeBaseCode\PxeBaseCode.c
PxeBaseCodeCallBack\PxeBaseCodeCallBack.h
PxeBaseCodeCallBack\PxeBaseCodeCallBack.c
ScsiPassThru\ScsiPassThru.h
ScsiPassThru\ScsiPassThru.c
SerialIo\SerialIo.h
SerialIo\SerialIo.c
SimpleFileSystem\SimpleFileSystem.h
SimpleFileSystem\SimpleFileSystem.c
SimpleNetwork\SimpleNetwork.h
SimpleNetwork\SimpleNetwork.c
SimplePointer\SimplePointer.h
SimplePointer\SimplePointer.c
SimpleTextIn\SimpleTextIn.h
SimpleTextIn\SimpleTextIn.c
SimpleTextOut\SimpleTextOut.h
SimpleTextOut\SimpleTextOut.c
Udp4\Udp4.h
Udp4\Udp4.c
UgaDraw\UgaDraw.h
UgaDraw\UgaDraw.c
UgaIo\UgaIo.h
UgaIo\UgaIo.c
UnicodeCollation\UnicodeCollation.h
UnicodeCollation\UnicodeCollation.c
UsbHostController\UsbHostController.h
UsbHostController\UsbHostController.c
UsbIo\UsbIo.h
UsbIo\UsbIo.c
Hash\Hash.h
Hash\Hash.c
ServiceBinding\ServiceBinding.h
ScsiPassThruExt\ScsiPassThruExt.h
ScsiPassThruExt\ScsiPassThruExt.c
ScsiIo\ScsiIo.h
ScsiIo\ScsiIo.c
TapeIo\TapeIo.h
TapeIo\TapeIo.c
Tcp4\Tcp4.h
Tcp4\Tcp4.c
IScsiInitiatorName\IScsiInitiatorName.h
IScsiInitiatorName\IScsiInitiatorName.c

View File

@@ -0,0 +1,27 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
FileInfo.c
Abstract:
FileInfo protocol as defined in the EFI 1.0 specification.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (FileInfo)
EFI_GUID gEfiFileInfoGuid = EFI_FILE_INFO_ID;
EFI_GUID_STRING(&gEfiFileInfoGuid, "File System Info", "EFI File System Info GUID");

View File

@@ -0,0 +1,58 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
FileInfo.c
Abstract:
SimpleFileSystem protocol as defined in the EFI 1.0 specification.
The SimpleFileSystem protocol is the programatic access to the FAT (12,16,32)
file system specified in EFI 1.0. It can also be used to abstract any
file system other than FAT.
EFI 1.0 can boot from any valid EFI image contained in a SimpleFileSystem
--*/
#ifndef _FILE_INFO_H_
#define _FILE_INFO_H_
#define EFI_FILE_INFO_ID \
{ \
0x9576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b \
}
typedef struct {
UINT64 Size;
UINT64 FileSize;
UINT64 PhysicalSize;
EFI_TIME CreateTime;
EFI_TIME LastAccessTime;
EFI_TIME ModificationTime;
UINT64 Attribute;
CHAR16 FileName[1];
} EFI_FILE_INFO;
//
// The FileName field of the EFI_FILE_INFO data structure is variable length.
// Whenever code needs to know the size of the EFI_FILE_INFO data structure, it needs to
// be the size of the data structure without the FileName field. The following macro
// computes this size correctly no matter how big the FileName array is declared.
// This is required to make the EFI_FILE_INFO data structure ANSI compilant.
//
#define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET (EFI_FILE_INFO, FileName)
extern EFI_GUID gEfiFileInfoGuid;
#endif

View File

@@ -0,0 +1,27 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
FileSystemInfo.c
Abstract:
FileSystemInfo protocol as defined in the EFI 1.0 specification.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (FileSystemInfo)
EFI_GUID gEfiFileSystemInfoGuid = EFI_FILE_SYSTEM_INFO_ID_GUID;
EFI_GUID_STRING(&gEfiFileSystemInfoGuid, "File System Info ID", "EFI File System Info ID GUID");

View File

@@ -0,0 +1,51 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
FileSystemInfo.h
Abstract:
FileSystemInfo protocol as defined in the EFI 1.0 specification.
--*/
#ifndef _FILE_SYSTEM_INFO_H_
#define _FILE_SYSTEM_INFO_H_
#define EFI_FILE_SYSTEM_INFO_ID_GUID \
{ \
0x9576e93, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b \
}
typedef struct {
UINT64 Size;
BOOLEAN ReadOnly;
UINT64 VolumeSize;
UINT64 FreeSpace;
UINT32 BlockSize;
CHAR16 VolumeLabel[1];
} EFI_FILE_SYSTEM_INFO;
//
// The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is variable length.
// Whenever code needs to know the size of the EFI_FILE_SYSTEM_INFO data structure, it needs
// to be the size of the data structure without the VolumeLable field. The following macro
// computes this size correctly no matter how big the VolumeLable array is declared.
// This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant.
//
#define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET (EFI_FILE_SYSTEM_INFO, VolumeLabel)
extern EFI_GUID gEfiFileSystemInfoGuid;
#endif

View File

@@ -0,0 +1,34 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
FileSystemVolumeLabelInfo.c
Abstract:
SimpleFileSystem protocol as defined in the EFI 1.0 specification.
The SimpleFileSystem protocol is the programatic access to the FAT (12,16,32)
file system specified in EFI 1.0. It can also be used to abstract any
file system other than FAT.
EFI 1.0 can boot from any valid EFI image contained in a SimpleFileSystem
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (FileSystemVolumeLabelInfo)
EFI_GUID gEfiFileSystemVolumeLabelInfoIdGuid = EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID_GUID;
EFI_GUID_STRING
(&gEfiFileSystemVolumeLabelInfoIdGuid, "File System Vol Label ID", "EFI File System Volume Label Info ID GUID");

View File

@@ -0,0 +1,38 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
FileSystemVolumeLabelInfo.h
Abstract:
FileSystemVolumeLabelInfo protocol as defined in the EFI 1.0 specification.
--*/
#ifndef _FILE_SYSTEM_VOLUME_LABEL_INFO_H_
#define _FILE_SYSTEM_VOLUME_LABEL_INFO_H_
#define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID_GUID \
{ \
0xDB47D7D3, 0xFE81, 0x11d3, 0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D \
}
typedef struct {
CHAR16 VolumeLabel[1];
} EFI_FILE_SYSTEM_VOLUME_LABEL_INFO;
#define SIZE_OF_EFI_FILE_SYSTEM_VOLUME_LABEL_INFO EFI_FIELD_OFFSET (EFI_FILE_SYSTEM_VOLUME_LABEL_INFO, VolumeLabel)
extern EFI_GUID gEfiFileSystemVolumeLabelInfoIdGuid;
#endif

View File

@@ -0,0 +1,29 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
GraphicsOutput.c
Abstract:
Graphics Output Protocol from the UEFI 2.0 specification.
Abstraction of a very simple graphics device.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (GraphicsOutput)
EFI_GUID gEfiGraphicsOutputProtocolGuid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiGraphicsOutputProtocolGuid, "EFI Graphics Output Protocol", "UEFI Graphics Output Protocol");

View File

@@ -0,0 +1,206 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
GraphicsOutput.h
Abstract:
Graphics Output Protocol from the UEFI 2.0 specification.
Abstraction of a very simple graphics device.
--*/
#ifndef __GRAPHICS_OUTPUT_H__
#define __GRAPHICS_OUTPUT_H__
#include EFI_PROTOCOL_DEFINITION (UgaDraw)
#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \
{ \
0x9042a9de, 0x23dc, 0x4a38, 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a \
}
typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL;
typedef struct {
UINT32 RedMask;
UINT32 GreenMask;
UINT32 BlueMask;
UINT32 ReservedMask;
} EFI_PIXEL_BITMASK;
typedef enum {
PixelRedGreenBlueReserved8BitPerColor,
PixelBlueGreenRedReserved8BitPerColor,
PixelBitMask,
PixelBltOnly,
PixelFormatMax
} EFI_GRAPHICS_PIXEL_FORMAT;
typedef struct {
UINT32 Version;
UINT32 HorizontalResolution;
UINT32 VerticalResolution;
EFI_GRAPHICS_PIXEL_FORMAT PixelFormat;
EFI_PIXEL_BITMASK PixelInformation;
UINT32 PixelsPerScanLine;
} EFI_GRAPHICS_OUTPUT_MODE_INFORMATION;
typedef
EFI_STATUS
(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE) (
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
IN UINT32 ModeNumber,
OUT UINTN *SizeOfInfo,
OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info
)
/*++
Routine Description:
Return the current video mode information.
Arguments:
This - Protocol instance pointer.
ModeNumber - The mode number to return information on.
SizeOfInfo - A pointer to the size, in bytes, of the Info buffer.
Info - A pointer to callee allocated buffer that returns information about ModeNumber.
Returns:
EFI_SUCCESS - Mode information returned.
EFI_DEVICE_ERROR - A hardware error occurred trying to retrieve the video mode.
EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()
EFI_INVALID_PARAMETER - One of the input args was NULL.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE) (
IN EFI_GRAPHICS_OUTPUT_PROTOCOL * This,
IN UINT32 ModeNumber
)
/*++
Routine Description:
Return the current video mode information.
Arguments:
This - Protocol instance pointer.
ModeNumber - The mode number to be set.
Returns:
EFI_SUCCESS - Graphics mode was changed.
EFI_DEVICE_ERROR - The device had an error and could not complete the request.
EFI_UNSUPPORTED - ModeNumber is not supported by this device.
--*/
;
typedef EFI_UGA_PIXEL EFI_GRAPHICS_OUTPUT_BLT_PIXEL;
typedef union {
EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel;
UINT32 Raw;
} EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION;
typedef enum {
EfiBltVideoFill,
EfiBltVideoToBltBuffer,
EfiBltBufferToVideo,
EfiBltVideoToVideo,
EfiGraphicsOutputBltOperationMax
} EFI_GRAPHICS_OUTPUT_BLT_OPERATION;
typedef
EFI_STATUS
(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT) (
IN EFI_GRAPHICS_OUTPUT_PROTOCOL * This,
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL * BltBuffer, OPTIONAL
IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
IN UINTN SourceX,
IN UINTN SourceY,
IN UINTN DestinationX,
IN UINTN DestinationY,
IN UINTN Width,
IN UINTN Height,
IN UINTN Delta OPTIONAL
);
/*++
Routine Description:
The following table defines actions for BltOperations:
EfiBltVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY)
directly to every pixel of the video display rectangle
(DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
Only one pixel will be used from the BltBuffer. Delta is NOT used.
EfiBltVideoToBltBuffer - Read data from the video display rectangle
(SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
the BltBuffer rectangle (DestinationX, DestinationY )
(DestinationX + Width, DestinationY + Height). If DestinationX or
DestinationY is not zero then Delta must be set to the length in bytes
of a row in the BltBuffer.
EfiBltBufferToVideo - Write data from the BltBuffer rectangle
(SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
video display rectangle (DestinationX, DestinationY)
(DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
not zero then Delta must be set to the length in bytes of a row in the
BltBuffer.
EfiBltVideoToVideo - Copy from the video display rectangle (SourceX, SourceY)
(SourceX + Width, SourceY + Height) .to the video display rectangle
(DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
The BltBuffer and Delta are not used in this mode.
Arguments:
This - Protocol instance pointer.
BltBuffer - Buffer containing data to blit into video buffer. This
buffer has a size of Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
BltOperation - Operation to perform on BlitBuffer and video memory
SourceX - X coordinate of source for the BltBuffer.
SourceY - Y coordinate of source for the BltBuffer.
DestinationX - X coordinate of destination for the BltBuffer.
DestinationY - Y coordinate of destination for the BltBuffer.
Width - Width of rectangle in BltBuffer in pixels.
Height - Hight of rectangle in BltBuffer in pixels.
Delta -
Returns:
EFI_SUCCESS - The Blt operation completed.
EFI_INVALID_PARAMETER - BltOperation is not valid.
EFI_DEVICE_ERROR - A hardware error occured writting to the video
buffer.
--*/
;
typedef struct {
UINT32 MaxMode;
UINT32 Mode;
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
UINTN SizeOfInfo;
EFI_PHYSICAL_ADDRESS FrameBufferBase;
UINTN FrameBufferSize;
} EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE;
typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL {
EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode;
EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE SetMode;
EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT Blt;
EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode;
} EFI_GRAPHICS_OUTPUT_PROTOCOL;
extern EFI_GUID gEfiGraphicsOutputProtocolGuid;
#endif

View File

@@ -0,0 +1,40 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Hash.c
Abstract:
EFI_HASH_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0.
EFI_HASH_PROTOCOL as defined in UEFI 2.0.
The EFI Hash Service Binding Protocol is used to locate hashing services support
provided by a driver and create and destroy instances of the EFI Hash Protocol
so that a multiple drivers can use the underlying hashing services.
The EFI Service Binding Protocol defines the generic Service Binding Protocol functions.
Revision History
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (Hash)
EFI_GUID gEfiHashServiceBindingProtocolGuid = EFI_HASH_SERVICE_BINDING_PROTOCOL;
EFI_GUID gEfiHashProtocolGuid = EFI_HASH_PROTOCOL_GUID;
EFI_GUID gEfiHashAlgorithmSha1Guid = EFI_HASH_ALGORITHM_SHA1_GUID;
EFI_GUID gEfiHashAlgorithmSha224Guid = EFI_HASH_ALGORITHM_SHA224_GUID;
EFI_GUID gEfiHashAlgorithmSha256Guid = EFI_HASH_ALGORITHM_SHA256_GUID;
EFI_GUID gEfiHashAlgorithmSha384Guid = EFI_HASH_ALGORITHM_SHA384_GUID;
EFI_GUID gEfiHashAlgorithmSha512Guid = EFI_HASH_ALGORITHM_SHA512_GUID;
EFI_GUID gEfiHashAlgorithmMD5Guid = EFI_HASH_ALGORTIHM_MD5_GUID;
EFI_GUID_STRING(&gEfiHashProtocolGuid, "Hash protoco", "UEFI 2.0 Hash protocol");
EFI_GUID_STRING(&gEfiHashServiceBindingProtocolGuid, "Hash service binding protoco", "UEFI 2.0 Hash service binding protocol");

View File

@@ -0,0 +1,161 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Hash.h
Abstract:
EFI_HASH_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0.
EFI_HASH_PROTOCOL as defined in UEFI 2.0.
The EFI Hash Service Binding Protocol is used to locate hashing services support
provided by a driver and create and destroy instances of the EFI Hash Protocol
so that a multiple drivers can use the underlying hashing services.
The EFI Service Binding Protocol defines the generic Service Binding Protocol functions.
Revision History
--*/
#ifndef __EFI_HASH_PROTOCOL_H__
#define __EFI_HASH_PROTOCOL_H__
#define EFI_HASH_SERVICE_BINDING_PROTOCOL \
{ \
0x42881c98, 0xa4f3, 0x44b0, {0xa3, 0x9d, 0xdf, 0xa1, 0x86, 0x67, 0xd8, 0xcd } \
}
#define EFI_HASH_PROTOCOL_GUID \
{ \
0xc5184932, 0xdba5, 0x46db, {0xa5, 0xba, 0xcc, 0x0b, 0xda, 0x9c, 0x14, 0x35 } \
}
#define EFI_HASH_ALGORITHM_SHA1_GUID \
{ \
0x2ae9d80f, 0x3fb2, 0x4095, {0xb7, 0xb1, 0xe9, 0x31, 0x57, 0xb9, 0x46, 0xb6 } \
}
#define EFI_HASH_ALGORITHM_SHA224_GUID \
{ \
0x8df01a06, 0x9bd5, 0x4bf7, {0xb0, 0x21, 0xdb, 0x4f, 0xd9, 0xcc, 0xf4, 0x5b } \
}
#define EFI_HASH_ALGORITHM_SHA256_GUID \
{ \
0x51aa59de, 0xfdf2, 0x4ea3, {0xbc, 0x63, 0x87, 0x5f, 0xb7, 0x84, 0x2e, 0xe9 } \
}
#define EFI_HASH_ALGORITHM_SHA384_GUID \
{ \
0xefa96432, 0xde33, 0x4dd2, {0xae, 0xe6, 0x32, 0x8c, 0x33, 0xdf, 0x77, 0x7a } \
}
#define EFI_HASH_ALGORITHM_SHA512_GUID \
{ \
0xcaa4381e, 0x750c, 0x4770, {0xb8, 0x70, 0x7a, 0x23, 0xb4, 0xe4, 0x21, 0x30 } \
}
#define EFI_HASH_ALGORTIHM_MD5_GUID \
{ \
0xaf7c79c, 0x65b5, 0x4319, {0xb0, 0xae, 0x44, 0xec, 0x48, 0x4e, 0x4a, 0xd7 } \
}
typedef struct _EFI_HASH_PROTOCOL EFI_HASH_PROTOCOL;
typedef UINT8 EFI_MD5_HASH[16];
typedef UINT8 EFI_SHA1_HASH[20];
typedef UINT8 EFI_SHA224_HASH[28];
typedef UINT8 EFI_SHA256_HASH[32];
typedef UINT8 EFI_SHA384_HASH[48];
typedef UINT8 EFI_SHA512_HASH[64];
typedef union {
EFI_MD5_HASH *Md5Hash;
EFI_SHA1_HASH *Sha1Hash;
EFI_SHA224_HASH *Sha224Hash;
EFI_SHA256_HASH *Sha256Hash;
EFI_SHA384_HASH *Sha384Hash;
EFI_SHA512_HASH *Sha512Hash;
} EFI_HASH_OUTPUT;
typedef
EFI_STATUS
(EFIAPI *EFI_HASH_GET_HASH_SIZE) (
IN CONST EFI_HASH_PROTOCOL *This,
IN CONST EFI_GUID *HashAlgorithm,
OUT UINTN *HashSize
)
/*++
Routine Description:
Returns the size of the hash which results from a specific algorithm.
Arguments:
This - Points to this instance of EFI_HASH_PROTOCOL.
HashAlgorithm - Points to the EFI_GUID which identifies the algorithm to use.
HashSize - Holds the returned size of the algorithm<68><6D>s hash.
Returns:
EFI_SUCCESS - Hash size returned successfully.
EFI_INVALID_PARAMETER - HashSize is NULL
EFI_UNSUPPORTED - The algorithm specified by HashAlgorithm is not supported
by this driver.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_HASH_HASH) (
IN CONST EFI_HASH_PROTOCOL *This,
IN CONST EFI_GUID *HashAlgorithm,
IN BOOLEAN Extend,
IN CONST UINT8 *Message,
IN UINT64 MessageSize,
IN OUT EFI_HASH_OUTPUT *Hash
)
/*++
Routine Description:
Returns the size of the hash which results from a specific algorithm.
Arguments:
This - Points to this instance of EFI_HASH_PROTOCOL.
HashAlgorithm - Points to the EFI_GUID which identifies the algorithm to use.
Extend - Specifies whether to create a new hash (FALSE) or extend the specified
existing hash (TRUE).
Message - Points to the start of the message.
MessageSize - The size of Message, in bytes.
Hash - On input, if Extend is TRUE, then this holds the hash to extend. On
output, holds the resulting hash computed from the message.
Returns:
EFI_SUCCESS - Hash returned successfully.
EFI_INVALID_PARAMETER - Message or Hash is NULL
EFI_UNSUPPORTED - The algorithm specified by HashAlgorithm is not supported by this
driver. Or extend is TRUE and the algorithm doesn<73><6E>t support extending the hash.
--*/
;
struct _EFI_HASH_PROTOCOL {
EFI_HASH_GET_HASH_SIZE GetHashSize;
EFI_HASH_HASH Hash;
};
extern EFI_GUID gEfiHashServiceBindingProtocolGuid;
extern EFI_GUID gEfiHashProtocolGuid;
extern EFI_GUID gEfiHashAlgorithmSha1Guid;
extern EFI_GUID gEfiHashAlgorithmSha224Guid;
extern EFI_GUID gEfiHashAlgorithmSha256Guid;
extern EFI_GUID gEfiHashAlgorithmSha384Guid;
extern EFI_GUID gEfiHashAlgorithmSha512Guid;
extern EFI_GUID gEfiHashAlgorithmMD5Guid;
#endif

View File

@@ -0,0 +1,27 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
IScsiInitatorName.c
Abstract:
EFI_ISCSI_INITIATOR_NAME_PROTOCOL as defined in UEFI 2.0.
It rovides the ability to get and set the iSCSI Initiator Name.
Revision History
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (IScsiInitiatorName)
EFI_GUID gEfiIScsiInitiatorNameProtocolGuid = EFI_ISCSI_INITIATOR_NAME_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiIScsiInitiatorNameProtocolGuid, "ISCSI Initiator Name Protocol", "UEFI 2.0 ISCSI Initiator Name Protocol");

View File

@@ -0,0 +1,98 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
IScsiInitatorName.h
Abstract:
EFI_ISCSI_INITIATOR_NAME_PROTOCOL as defined in UEFI 2.0.
It rovides the ability to get and set the iSCSI Initiator Name.
Revision History
--*/
#ifndef __ISCSI_INITIATOR_NAME_H__
#define __ISCSI_INITIATOR_NAME_H__
#define EFI_ISCSI_INITIATOR_NAME_PROTOCOL_GUID \
{ \
0x59324945, 0xec44, 0x4c0d, {0xb1, 0xcd, 0x9d, 0xb1, 0x39, 0xdf, 0x7, 0xc } \
}
typedef struct _EFI_ISCSI_INITIATOR_NAME_PROTOCOL EFI_ISCSI_INITIATOR_NAME_PROTOCOL;
typedef
EFI_STATUS
(EFIAPI *EFI_ISCSI_INITIATOR_NAME_GET) (
IN EFI_ISCSI_INITIATOR_NAME_PROTOCOL *This,
IN OUT UINTN *BufferSize,
OUT VOID *Buffer
)
/*++
Routine Description:
Retrieves the current set value of iSCSI Initiator Name.
Arguments:
This - Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL instance.
BufferSize - Size of the buffer in bytes pointed to by Buffer / Actual size of the
variable data buffer.
Buffer - Pointer to the buffer for data to be read.
Returns:
EFI_SUCCESS - Data was successfully retrieved into the provided buffer and the
BufferSize was sufficient to handle the iSCSI initiator name
EFI_BUFFER_TOO_SMALL - BufferSize is too small for the result.
EFI_INVALID_PARAMETER - BufferSize or Buffer is NULL.
EFI_DEVICE_ERROR - The iSCSI initiator name could not be retrieved due to a hardware error.
--*/
;
typedef EFI_STATUS
(EFIAPI *EFI_ISCSI_INITIATOR_NAME_SET) (
IN EFI_ISCSI_INITIATOR_NAME_PROTOCOL *This,
IN OUT UINTN *BufferSize,
IN VOID *Buffer
)
/*++
Routine Description:
Sets the iSCSI Initiator Name.
Arguments:
This - Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL instance.
BufferSize - Size of the buffer in bytes pointed to by Buffer.
Buffer - Pointer to the buffer for data to be written.
Returns:
EFI_SUCCESS - Data was successfully stored by the protocol.
EFI_UNSUPPORTED - Platform policies do not allow for data to be written.
EFI_INVALID_PARAMETER - BufferSize or Buffer is NULL, or BufferSize exceeds the maximum allowed limit.
EFI_DEVICE_ERROR - The data could not be stored due to a hardware error.
EFI_OUT_OF_RESOURCES - Not enough storage is available to hold the data.
EFI_PROTOCOL_ERROR - Input iSCSI initiator name does not adhere to RFC 3720
(and other related protocols)
--*/
;
struct _EFI_ISCSI_INITIATOR_NAME_PROTOCOL {
EFI_ISCSI_INITIATOR_NAME_GET Get;
EFI_ISCSI_INITIATOR_NAME_SET Set;
};
extern EFI_GUID gEfiIScsiInitiatorNameProtocolGuid;
#endif

View File

@@ -0,0 +1,41 @@
/*++
Copyright (c) 2005 - 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Ip4.c
Abstract:
UEFI IPv4 protocol.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (Ip4)
EFI_GUID gEfiIp4ServiceBindingProtocolGuid
= EFI_IP4_SERVICE_BINDING_PROTOCOL_GUID;
EFI_GUID gEfiIp4ProtocolGuid = EFI_IP4_PROTOCOL_GUID;
EFI_GUID_STRING (
&gEfiIp4ServiceBindingProtocolGuid,
"IP4 Service Binding Protocol",
"IP4 Service Binding Protocol"
);
EFI_GUID_STRING (
&gEfiIp4ProtocolGuid,
"IP4 Protocol",
"IP4 Protocol"
);

View File

@@ -0,0 +1,241 @@
/*++
Copyright (c) 2005 - 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Ip4.h
Abstract:
UEFI IPv4 protocol.
--*/
#ifndef _IP4_H_
#define _IP4_H_
#include EFI_PROTOCOL_DEFINITION (ManagedNetwork)
#include EFI_PROTOCOL_DEFINITION (ServiceBinding)
//
//GUID definitions
//
#define EFI_IP4_SERVICE_BINDING_PROTOCOL_GUID \
{0xc51711e7, 0xb4bf, 0x404a, 0xbf, 0xb8, 0x0a, 0x04, 0x8e, 0xf1, 0xff, 0xe4}
#define EFI_IP4_PROTOCOL_GUID \
{0x41d94cd2, 0x35b6, 0x455a, 0x82, 0x58, 0xd4, 0xe5, 0x13, 0x34, 0xaa, 0xdd}
EFI_FORWARD_DECLARATION (EFI_IP4_PROTOCOL);
typedef struct {
EFI_HANDLE InstanceHandle;
EFI_IPv4_ADDRESS Ip4Address;
EFI_IPv4_ADDRESS SubnetMask;
} EFI_IP4_ADDRESS_PAIR;
typedef struct {
EFI_HANDLE DriverHandle;
UINT32 AddressCount;
EFI_IP4_ADDRESS_PAIR AddressPairs[1];
} EFI_IP4_VARIABLE_DATA;
typedef struct {
UINT8 DefaultProtocol;
BOOLEAN AcceptAnyProtocol;
BOOLEAN AcceptIcmpErrors;
BOOLEAN AcceptBroadcast;
BOOLEAN AcceptPromiscuous;
BOOLEAN UseDefaultAddress;
EFI_IPv4_ADDRESS StationAddress;
EFI_IPv4_ADDRESS SubnetMask;
UINT8 TypeOfService;
UINT8 TimeToLive;
BOOLEAN DoNotFragment;
BOOLEAN RawData;
UINT32 ReceiveTimeout;
UINT32 TransmitTimeout;
} EFI_IP4_CONFIG_DATA;
typedef struct _EFI_IP4_ROUTE_TABLE {
EFI_IPv4_ADDRESS SubnetAddress;
EFI_IPv4_ADDRESS SubnetMask;
EFI_IPv4_ADDRESS GatewayAddress;
} EFI_IP4_ROUTE_TABLE;
typedef struct _EFI_IP4_ICMP_TYPE {
UINT8 Type;
UINT8 Code;
} EFI_IP4_ICMP_TYPE;
typedef struct {
BOOLEAN IsStarted;
EFI_IP4_CONFIG_DATA ConfigData;
BOOLEAN IsConfigured;
UINT32 GroupCount;
EFI_IPv4_ADDRESS *GroupTable;
UINT32 RouteCount;
EFI_IP4_ROUTE_TABLE *RouteTable;
UINT32 IcmpTypeCount;
EFI_IP4_ICMP_TYPE *IcmpTypeList;
} EFI_IP4_MODE_DATA;
#pragma pack(1)
typedef struct _EFI_IP4_HEADER {
UINT8 HeaderLength:4;
UINT8 Version:4;
UINT8 TypeOfService;
UINT16 TotalLength;
UINT16 Identification;
UINT16 Fragmentation;
UINT8 TimeToLive;
UINT8 Protocol;
UINT16 Checksum;
EFI_IPv4_ADDRESS SourceAddress;
EFI_IPv4_ADDRESS DestinationAddress;
} EFI_IP4_HEADER;
#pragma pack()
typedef struct _EFI_IP4_FRAGMENT_DATA {
UINT32 FragmentLength;
VOID *FragmentBuffer;
} EFI_IP4_FRAGMENT_DATA;
typedef struct _EFI_IP4_OVERRIDE_DATA {
EFI_IPv4_ADDRESS SourceAddress;
EFI_IPv4_ADDRESS GatewayAddress;
UINT8 Protocol;
UINT8 TypeOfService;
UINT8 TimeToLive;
BOOLEAN DoNotFragment;
} EFI_IP4_OVERRIDE_DATA;
typedef struct _EFI_IP4_TRANSMIT_DATA {
EFI_IPv4_ADDRESS DestinationAddress;
EFI_IP4_OVERRIDE_DATA *OverrideData;
UINT32 OptionsLength;
VOID *OptionsBuffer;
UINT32 TotalDataLength;
UINT32 FragmentCount;
EFI_IP4_FRAGMENT_DATA FragmentTable[1];
} EFI_IP4_TRANSMIT_DATA;
typedef struct _EFI_IP4_RECEIVE_DATA {
EFI_TIME TimeStamp;
EFI_EVENT RecycleSignal;
UINT32 HeaderLength;
EFI_IP4_HEADER *Header;
UINT32 OptionsLength;
VOID *Options;
UINT32 DataLength;
UINT32 FragmentCount;
EFI_IP4_FRAGMENT_DATA FragmentTable[1];
} EFI_IP4_RECEIVE_DATA;
typedef struct _EFI_IP4_COMPLETION_TOKEN {
EFI_EVENT Event;
EFI_STATUS Status;
union {
EFI_IP4_RECEIVE_DATA *RxData;
EFI_IP4_TRANSMIT_DATA *TxData;
} Packet;
} EFI_IP4_COMPLETION_TOKEN;
typedef
EFI_STATUS
(EFIAPI *EFI_IP4_GET_MODE_DATA) (
IN EFI_IP4_PROTOCOL *This,
OUT EFI_IP4_MODE_DATA *Ip4ModeData OPTIONAL,
OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_IP4_CONFIGURE) (
IN EFI_IP4_PROTOCOL *This,
IN EFI_IP4_CONFIG_DATA *IpConfigData OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_IP4_GROUPS) (
IN EFI_IP4_PROTOCOL *This,
IN BOOLEAN JoinFlag,
IN EFI_IPv4_ADDRESS *GroupAddress OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_IP4_ROUTES) (
IN EFI_IP4_PROTOCOL *This,
IN BOOLEAN DeleteRoute,
IN EFI_IPv4_ADDRESS *SubnetAddress,
IN EFI_IPv4_ADDRESS *SubnetMask,
IN EFI_IPv4_ADDRESS *GatewayAddress
);
typedef
EFI_STATUS
(EFIAPI *EFI_IP4_TRANSMIT) (
IN EFI_IP4_PROTOCOL *This,
IN EFI_IP4_COMPLETION_TOKEN *Token
);
typedef
EFI_STATUS
(EFIAPI *EFI_IP4_RECEIVE) (
IN EFI_IP4_PROTOCOL *This,
IN EFI_IP4_COMPLETION_TOKEN *Token
);
typedef
EFI_STATUS
(EFIAPI *EFI_IP4_CANCEL) (
IN EFI_IP4_PROTOCOL *This,
IN EFI_IP4_COMPLETION_TOKEN *Token OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_IP4_POLL) (
IN EFI_IP4_PROTOCOL *This
);
typedef struct _EFI_IP4_PROTOCOL {
EFI_IP4_GET_MODE_DATA GetModeData;
EFI_IP4_CONFIGURE Configure;
EFI_IP4_GROUPS Groups;
EFI_IP4_ROUTES Routes;
EFI_IP4_TRANSMIT Transmit;
EFI_IP4_RECEIVE Receive;
EFI_IP4_CANCEL Cancel;
EFI_IP4_POLL Poll;
} EFI_IP4_PROTOCOL;
extern EFI_GUID gEfiIp4ServiceBindingProtocolGuid;
extern EFI_GUID gEfiIp4RegistryDataGuid;
extern EFI_GUID gEfiIp4ProtocolGuid;
#endif

View File

@@ -0,0 +1,29 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Ip4Config.c
Abstract:
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (Ip4Config)
EFI_GUID gEfiIp4ConfigProtocolGuid = EFI_IP4_CONFIG_PROTOCOL_GUID;
EFI_GUID_STRING (
&gEfiIp4ConfigProtocolGuid,
"Ip4Config Protocol",
"Ip4Config Protocol"
);

View File

@@ -0,0 +1,73 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Ip4Config.h
Abstract:
--*/
#ifndef _IP4CONFIG_H_
#define _IP4CONFIG_H_
#include EFI_PROTOCOL_DEFINITION (Ip4)
#define EFI_IP4_CONFIG_PROTOCOL_GUID \
{0x25c98279, 0x3d9c, 0x43f2, 0xa7, 0x0e, 0xe1, 0xea, 0x4e, 0x0d, 0xed, 0x1b}
EFI_FORWARD_DECLARATION (EFI_IP4_CONFIG_PROTOCOL);
#define IP4_CONFIG_VARIABLE_ATTRIBUTES (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS )
typedef struct {
EFI_IPv4_ADDRESS StationAddress;
EFI_IPv4_ADDRESS SubnetMask;
UINT32 RouteTableSize;
EFI_IP4_ROUTE_TABLE RouteTable[1];
} EFI_IP4_IPCONFIG_DATA;
typedef
EFI_STATUS
(EFIAPI *EFI_IP4_CONFIG_START) (
IN EFI_IP4_CONFIG_PROTOCOL *This,
IN EFI_EVENT DoneEvent,
IN EFI_EVENT ReconfigEvent
);
typedef
EFI_STATUS
(EFIAPI *EFI_IP4_CONFIG_STOP) (
IN EFI_IP4_CONFIG_PROTOCOL *This
);
typedef
EFI_STATUS
(EFIAPI *EFI_IP4_CONFIG_GET_DATA) (
IN EFI_IP4_CONFIG_PROTOCOL *This,
IN OUT UINTN *ConfigDataSize,
OUT EFI_IP4_IPCONFIG_DATA *ConfigData OPTIONAL
);
typedef struct _EFI_IP4_CONFIG_PROTOCOL {
EFI_IP4_CONFIG_START Start;
EFI_IP4_CONFIG_STOP Stop;
EFI_IP4_CONFIG_GET_DATA GetData;
} EFI_IP4_CONFIG_PROTOCOL;
extern EFI_GUID gEfiIp4ConfigProtocolGuid;
#endif

View File

@@ -0,0 +1,33 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
LoadFile.c
Abstract:
Load File protocol as defined in the EFI 1.0 specification.
Load file protocol exists to supports the addition of new boot devices,
and to support booting from devices that do not map well to file system.
Network boot is done via a LoadFile protocol.
EFI 1.0 can boot from any device that produces a LoadFile protocol.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (LoadFile)
EFI_GUID gEfiLoadFileProtocolGuid = LOAD_FILE_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiLoadFileProtocolGuid, "LoadFile Protocol", "EFI 1.0 Load File Protocol");

View File

@@ -0,0 +1,87 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
LoadFile.h
Abstract:
Load File protocol as defined in the EFI 1.0 specification.
Load file protocol exists to supports the addition of new boot devices,
and to support booting from devices that do not map well to file system.
Network boot is done via a LoadFile protocol.
EFI 1.0 can boot from any device that produces a LoadFile protocol.
--*/
#ifndef _LOAD_FILE_H_
#define _LOAD_FILE_H_
#define LOAD_FILE_PROTOCOL_GUID \
{ \
0x56EC3091, 0x954C, 0x11d2, 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B \
}
EFI_FORWARD_DECLARATION (EFI_LOAD_FILE_PROTOCOL);
typedef
EFI_STATUS
(EFIAPI *EFI_LOAD_FILE) (
IN EFI_LOAD_FILE_PROTOCOL * This,
IN EFI_DEVICE_PATH_PROTOCOL * FilePath,
IN BOOLEAN BootPolicy,
IN OUT UINTN *BufferSize,
IN VOID *Buffer OPTIONAL
)
/*++
Routine Description:
Causes the driver to load a specified file.
Arguments:
This - Protocol instance pointer.
FilePath - The device specific path of the file to load.
BootPolicy - If TRUE, indicates that the request originates from the
boot manager is attempting to load FilePath as a boot
selection. If FALSE, then FilePath must match as exact file
to be loaded.
BufferSize - On input the size of Buffer in bytes. On output with a return
code of EFI_SUCCESS, the amount of data transferred to
Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL,
the size of Buffer required to retrieve the requested file.
Buffer - The memory buffer to transfer the file to. IF Buffer is NULL,
then no the size of the requested file is returned in
BufferSize.
Returns:
EFI_SUCCESS - The file was loaded.
EFI_UNSUPPORTED - The device does not support the provided BootPolicy
EFI_INVALID_PARAMETER - FilePath is not a valid device path, or
BufferSize is NULL.
EFI_NO_MEDIA - No medium was present to load the file.
EFI_DEVICE_ERROR - The file was not loaded due to a device error.
EFI_NO_RESPONSE - The remote system did not respond.
EFI_NOT_FOUND - The file was not found
EFI_ABORTED - The file load process was manually cancelled.
--*/
;
typedef struct _EFI_LOAD_FILE_PROTOCOL {
EFI_LOAD_FILE LoadFile;
} EFI_LOAD_FILE_PROTOCOL;
extern EFI_GUID gEfiLoadFileProtocolGuid;
#endif

View File

@@ -0,0 +1,30 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
LoadedImage.c
Abstract:
EFI 1.0 Loaded Image Protocol definition.
Every EFI driver and application is passed an image handle when it is loaded.
This image handle will contain a Loaded Image Protocol.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (LoadedImage)
EFI_GUID gEfiLoadedImageProtocolGuid = EFI_LOADED_IMAGE_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiLoadedImageProtocolGuid, "LoadedImage Protocol", "EFI 1.0 Loaded Image Protocol");

View File

@@ -0,0 +1,73 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
LoadedImage.h
Abstract:
EFI 1.0 Loaded image protocol definition.
Every EFI driver and application is passed an image handle when it is loaded.
This image handle will contain a Loaded Image Protocol.
--*/
#ifndef _LOADED_IMAGE_H_
#define _LOADED_IMAGE_H_
#define EFI_LOADED_IMAGE_PROTOCOL_GUID \
{ \
0x5B1B31A1, 0x9562, 0x11d2, 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B \
}
//
// EFI_SYSTEM_TABLE & EFI_IMAGE_UNLOAD are defined in EfiApi.h
//
#define EFI_LOADED_IMAGE_INFORMATION_REVISION 0x1000
typedef struct {
UINT32 Revision;
EFI_HANDLE ParentHandle;
EFI_SYSTEM_TABLE *SystemTable;
//
// Source location of image
//
EFI_HANDLE DeviceHandle;
EFI_DEVICE_PATH_PROTOCOL *FilePath;
VOID *Reserved;
//
// Images load options
//
UINT32 LoadOptionsSize;
VOID *LoadOptions;
//
// Location of where image was loaded
//
VOID *ImageBase;
UINT64 ImageSize;
EFI_MEMORY_TYPE ImageCodeType;
EFI_MEMORY_TYPE ImageDataType;
//
// If the driver image supports a dynamic unload request
//
EFI_IMAGE_UNLOAD Unload;
} EFI_LOADED_IMAGE_PROTOCOL;
extern EFI_GUID gEfiLoadedImageProtocolGuid;
#endif

View File

@@ -0,0 +1,29 @@
/*++
Copyright (c) 2005 - 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
ManagedNetwork.c
Abstract:
UEFI Managed Network protocol.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (ManagedNetwork)
EFI_GUID gEfiManagedNetworkServiceBindingProtocolGuid = EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL_GUID;
EFI_GUID gEfiManagedNetworkProtocolGuid = EFI_MANAGED_NETWORK_PROTOCOL_GUID;
EFI_GUID_STRING (&gEfiManagedNetworkServiceBindingProtocolGuid, "Managed Network Service Binding Protocol", "Managed Network Service Binding Protocol");
EFI_GUID_STRING (&gEfiManagedNetworkProtocolGuid, "Managed Network Protocol", "Managed Network Protocol");

View File

@@ -0,0 +1,164 @@
/*++
Copyright (c) 2005 - 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
ManagedNetwork.h
Abstract:
UEFI Managed Network protocol definition.
--*/
#ifndef _MANAGED_NETWORK_H_
#define _MANAGED_NETWORK_H_
#include EFI_PROTOCOL_DEFINITION (SimpleNetwork)
#include EFI_PROTOCOL_DEFINITION (ServiceBinding)
#define EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL_GUID \
{0xf36ff770, 0xa7e1, 0x42cf, 0x9e, 0xd2, 0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c}
#define EFI_MANAGED_NETWORK_PROTOCOL_GUID \
{ 0x3b95aa31, 0x3793, 0x434b, 0x86, 0x67, 0xc8, 0x7, 0x8, 0x92, 0xe0, 0x5e }
EFI_FORWARD_DECLARATION (EFI_MANAGED_NETWORK_PROTOCOL);
typedef struct {
UINT32 ReceivedQueueTimeoutValue;
UINT32 TransmitQueueTimeoutValue;
UINT16 ProtocolTypeFilter;
BOOLEAN EnableUnicastReceive;
BOOLEAN EnableMulticastReceive;
BOOLEAN EnableBroadcastReceive;
BOOLEAN EnablePromiscuousReceive;
BOOLEAN FlushQueuesOnReset;
BOOLEAN EnableReceiveTimestamps;
BOOLEAN DisableBackgroundPolling;
} EFI_MANAGED_NETWORK_CONFIG_DATA;
typedef struct {
EFI_TIME Timestamp;
EFI_EVENT RecycleEvent;
UINT32 PacketLength;
UINT32 HeaderLength;
UINT32 AddressLength;
UINT32 DataLength;
BOOLEAN BroadcastFlag;
BOOLEAN MulticastFlag;
BOOLEAN PromiscuousFlag;
UINT16 ProtocolType;
VOID *DestinationAddress;
VOID *SourceAddress;
VOID *MediaHeader;
VOID *PacketData;
} EFI_MANAGED_NETWORK_RECEIVE_DATA;
typedef struct {
UINT32 FragmentLength;
VOID *FragmentBuffer;
} EFI_MANAGED_NETWORK_FRAGMENT_DATA;
typedef struct {
EFI_MAC_ADDRESS *DestinationAddress;
EFI_MAC_ADDRESS *SourceAddress;
UINT16 ProtocolType;
UINT32 DataLength;
UINT16 HeaderLength;
UINT16 FragmentCount;
EFI_MANAGED_NETWORK_FRAGMENT_DATA FragmentTable[1];
} EFI_MANAGED_NETWORK_TRANSMIT_DATA;
typedef struct {
EFI_EVENT Event;
EFI_STATUS Status;
union {
EFI_MANAGED_NETWORK_RECEIVE_DATA *RxData;
EFI_MANAGED_NETWORK_TRANSMIT_DATA *TxData;
} Packet;
} EFI_MANAGED_NETWORK_COMPLETION_TOKEN;
typedef
EFI_STATUS
(EFIAPI *EFI_MANAGED_NETWORK_GET_MODE_DATA) (
IN EFI_MANAGED_NETWORK_PROTOCOL *This,
OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_MANAGED_NETWORK_CONFIGURE) (
IN EFI_MANAGED_NETWORK_PROTOCOL *This,
IN EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC) (
IN EFI_MANAGED_NETWORK_PROTOCOL *This,
IN BOOLEAN Ipv6Flag,
IN EFI_IP_ADDRESS *IpAddress,
OUT EFI_MAC_ADDRESS *MacAddress
);
typedef
EFI_STATUS
(EFIAPI *EFI_MANAGED_NETWORK_GROUPS) (
IN EFI_MANAGED_NETWORK_PROTOCOL *This,
IN BOOLEAN JoinFlag,
IN EFI_MAC_ADDRESS *MacAddress OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_MANAGED_NETWORK_TRANSMIT) (
IN EFI_MANAGED_NETWORK_PROTOCOL *This,
IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token
);
typedef
EFI_STATUS
(EFIAPI *EFI_MANAGED_NETWORK_RECEIVE) (
IN EFI_MANAGED_NETWORK_PROTOCOL *This,
IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token
);
typedef
EFI_STATUS
(EFIAPI *EFI_MANAGED_NETWORK_CANCEL) (
IN EFI_MANAGED_NETWORK_PROTOCOL *This,
IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_MANAGED_NETWORK_POLL) (
IN EFI_MANAGED_NETWORK_PROTOCOL *This
);
typedef struct _EFI_MANAGED_NETWORK_PROTOCOL {
EFI_MANAGED_NETWORK_GET_MODE_DATA GetModeData;
EFI_MANAGED_NETWORK_CONFIGURE Configure;
EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC McastIpToMac;
EFI_MANAGED_NETWORK_GROUPS Groups;
EFI_MANAGED_NETWORK_TRANSMIT Transmit;
EFI_MANAGED_NETWORK_RECEIVE Receive;
EFI_MANAGED_NETWORK_CANCEL Cancel;
EFI_MANAGED_NETWORK_POLL Poll;
} EFI_MANAGED_NETWORK_PROTOCOL;
extern EFI_GUID gEfiManagedNetworkServiceBindingProtocolGuid;
extern EFI_GUID gEfiManagedNetworkProtocolGuid;
#endif

View File

@@ -0,0 +1,39 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Mtftp4.c
Abstract:
UEFI Multicast Trivial File Transfer Protocol GUID Declaration.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (Mtftp4)
EFI_GUID gEfiMtftp4ServiceBindingProtocolGuid = EFI_MTFTP4_SERVICE_BINDING_PROTOCOL_GUID;
EFI_GUID gEfiMtftp4ProtocolGuid = EFI_MTFTP4_PROTOCOL_GUID;
EFI_GUID_STRING (
&gEfiMtftp4ServiceBindingProtocolGuid,
"MTFTP4 Service Binding Protocol",
"MTFTP4 Service Binding Protocol"
);
EFI_GUID_STRING (
&gEfiMtftp4ProtocolGuid,
"MTFTP4 Protocol",
"MTFTP4 Protocol"
);

View File

@@ -0,0 +1,308 @@
/*++
Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Mtftp4.h
Abstract:
UEFI Multicast Trivial File Tranfer Protocol Definition
--*/
#ifndef __EFI_MTFTP4_H__
#define __EFI_MTFTP4_H__
#include EFI_PROTOCOL_DEFINITION(ServiceBinding)
#define EFI_MTFTP4_SERVICE_BINDING_PROTOCOL_GUID \
{ 0x2FE800BE, 0x8F01, 0x4aa6, 0x94, 0x6B, 0xD7, 0x13, 0x88, 0xE1, 0x83, 0x3F }
#define EFI_MTFTP4_PROTOCOL_GUID \
{ 0x78247c57, 0x63db, 0x4708, 0x99, 0xc2, 0xa8, 0xb4, 0xa9, 0xa6, 0x1f, 0x6b }
EFI_FORWARD_DECLARATION (EFI_MTFTP4_PROTOCOL);
EFI_FORWARD_DECLARATION (EFI_MTFTP4_TOKEN);
extern EFI_GUID gEfiMtftp4ServiceBindingProtocolGuid;
extern EFI_GUID gEfiMtftp4ProtocolGuid;
//
//MTFTP4 packet opcode definition
//
#define EFI_MTFTP4_OPCODE_RRQ 1
#define EFI_MTFTP4_OPCODE_WRQ 2
#define EFI_MTFTP4_OPCODE_DATA 3
#define EFI_MTFTP4_OPCODE_ACK 4
#define EFI_MTFTP4_OPCODE_ERROR 5
#define EFI_MTFTP4_OPCODE_OACK 6
#define EFI_MTFTP4_OPCODE_DIR 7
#define EFI_MTFTP4_OPCODE_DATA8 8
#define EFI_MTFTP4_OPCODE_ACK8 9
//
//MTFTP4 error code definition
//
#define EFI_MTFTP4_ERRORCODE_NOT_DEFINED 0
#define EFI_MTFTP4_ERRORCODE_FILE_NOT_FOUND 1
#define EFI_MTFTP4_ERRORCODE_ACCESS_VIOLATION 2
#define EFI_MTFTP4_ERRORCODE_DISK_FULL 3
#define EFI_MTFTP4_ERRORCODE_ILLEGAL_OPERATION 4
#define EFI_MTFTP4_ERRORCODE_UNKNOWN_TRANSFER_ID 5
#define EFI_MTFTP4_ERRORCODE_FILE_ALREADY_EXISTS 6
#define EFI_MTFTP4_ERRORCODE_NO_SUCH_USER 7
#define EFI_MTFTP4_ERRORCODE_REQUEST_DENIED 8
//
//MTFTP4 pacekt definition
//
#pragma pack(1)
typedef struct {
UINT16 OpCode;
UINT8 Filename[1];
} EFI_MTFTP4_REQ_HEADER;
typedef struct {
UINT16 OpCode;
UINT8 Data[1];
} EFI_MTFTP4_OACK_HEADER;
typedef struct {
UINT16 OpCode;
UINT16 Block;
UINT8 Data[1];
} EFI_MTFTP4_DATA_HEADER;
typedef struct {
UINT16 OpCode;
UINT16 Block[1];
} EFI_MTFTP4_ACK_HEADER;
typedef struct {
UINT16 OpCode;
UINT64 Block;
UINT8 Data[1];
} EFI_MTFTP4_DATA8_HEADER;
typedef struct {
UINT16 OpCode;
UINT64 Block[1];
} EFI_MTFTP4_ACK8_HEADER;
typedef struct {
UINT16 OpCode;
UINT16 ErrorCode;
UINT8 ErrorMessage[1];
} EFI_MTFTP4_ERROR_HEADER;
typedef union {
UINT16 OpCode;
EFI_MTFTP4_REQ_HEADER Rrq;
EFI_MTFTP4_REQ_HEADER Wrq;
EFI_MTFTP4_OACK_HEADER Oack;
EFI_MTFTP4_DATA_HEADER Data;
EFI_MTFTP4_ACK_HEADER Ack;
EFI_MTFTP4_DATA8_HEADER Data8;
EFI_MTFTP4_ACK8_HEADER Ack8;
EFI_MTFTP4_ERROR_HEADER Error;
} EFI_MTFTP4_PACKET;
#pragma pack()
//
//MTFTP4 option definition
//
typedef struct {
UINT8 *OptionStr;
UINT8 *ValueStr;
} EFI_MTFTP4_OPTION;
//
//MTFTP4 config data
//
typedef struct {
BOOLEAN UseDefaultSetting;
EFI_IPv4_ADDRESS StationIp;
EFI_IPv4_ADDRESS SubnetMask;
UINT16 LocalPort;
EFI_IPv4_ADDRESS GatewayIp;
EFI_IPv4_ADDRESS ServerIp;
UINT16 InitialServerPort;
UINT16 TryCount;
UINT16 TimeoutValue;
} EFI_MTFTP4_CONFIG_DATA;
//
//MTFTP4 Mode data
//
typedef struct {
EFI_MTFTP4_CONFIG_DATA ConfigData;
UINT8 SupportedOptionCount;
UINT8 **SupportedOptoins;
UINT8 UnsupportedOptionCount;
UINT8 **UnsupportedOptoins;
} EFI_MTFTP4_MODE_DATA;
//
//MTFTP4 override data
//
typedef struct {
EFI_IPv4_ADDRESS GatewayIp;
EFI_IPv4_ADDRESS ServerIp;
UINT16 ServerPort;
UINT16 TryCount;
UINT16 TimeoutValue;
} EFI_MTFTP4_OVERRIDE_DATA;
//
//Packet checking function
//
typedef
EFI_STATUS
(EFIAPI *EFI_MTFTP4_CHECK_PACKET)(
IN EFI_MTFTP4_PROTOCOL *This,
IN EFI_MTFTP4_TOKEN *Token,
IN UINT16 PacketLen,
IN EFI_MTFTP4_PACKET *Paket
);
//
//Timeout callback funtion
//
typedef
EFI_STATUS
(EFIAPI *EFI_MTFTP4_TIMEOUT_CALLBACK) (
IN EFI_MTFTP4_PROTOCOL *This,
IN EFI_MTFTP4_TOKEN *Token
);
//
//Packet needed function
//
typedef
EFI_STATUS
(EFIAPI *EFI_MTFTP4_PACKET_NEEDED) (
IN EFI_MTFTP4_PROTOCOL *This,
IN EFI_MTFTP4_TOKEN *Token,
IN OUT UINT16 *Length,
OUT VOID **Buffer
);
typedef
EFI_STATUS
(EFIAPI *EFI_MTFTP4_GET_MODE_DATA) (
IN EFI_MTFTP4_PROTOCOL *This,
OUT EFI_MTFTP4_MODE_DATA *ModeData
);
typedef
EFI_STATUS
(EFIAPI *EFI_MTFTP4_CONFIGURE) (
IN EFI_MTFTP4_PROTOCOL *This,
IN EFI_MTFTP4_CONFIG_DATA *MtftpConfigData OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_MTFTP4_GET_INFO) (
IN EFI_MTFTP4_PROTOCOL *This,
IN EFI_MTFTP4_OVERRIDE_DATA *OverrideData OPTIONAL,
IN UINT8 *Filename,
IN UINT8 *ModeStr OPTIONAL,
IN UINT8 OptionCount,
IN EFI_MTFTP4_OPTION *OptionList,
OUT UINT32 *PacketLength,
OUT EFI_MTFTP4_PACKET **Packet OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_MTFTP4_PARSE_OPTIONS) (
IN EFI_MTFTP4_PROTOCOL *This,
IN UINT32 PacketLen,
IN EFI_MTFTP4_PACKET *Packet,
OUT UINT32 *OptionCount,
OUT EFI_MTFTP4_OPTION **OptionList OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_MTFTP4_READ_FILE) (
IN EFI_MTFTP4_PROTOCOL *This,
IN EFI_MTFTP4_TOKEN *Token
);
typedef
EFI_STATUS
(EFIAPI *EFI_MTFTP4_WRITE_FILE) (
IN EFI_MTFTP4_PROTOCOL *This,
IN EFI_MTFTP4_TOKEN *Token
);
typedef
EFI_STATUS
(EFIAPI *EFI_MTFTP4_READ_DIRECTORY) (
IN EFI_MTFTP4_PROTOCOL *This,
IN EFI_MTFTP4_TOKEN *Token
);
typedef
EFI_STATUS
(EFIAPI *EFI_MTFTP4_POLL) (
IN EFI_MTFTP4_PROTOCOL *This
);
typedef struct _EFI_MTFTP4_PROTOCOL {
EFI_MTFTP4_GET_MODE_DATA GetModeData;
EFI_MTFTP4_CONFIGURE Configure;
EFI_MTFTP4_GET_INFO GetInfo;
EFI_MTFTP4_PARSE_OPTIONS ParseOptions;
EFI_MTFTP4_READ_FILE ReadFile;
EFI_MTFTP4_WRITE_FILE WriteFile;
EFI_MTFTP4_READ_DIRECTORY ReadDirectory;
EFI_MTFTP4_POLL Poll;
} EFI_MTFTP4_PROTOCOL;
//
//MTFTP4 token data
//
typedef struct _EFI_MTFTP4_TOKEN{
IN OUT EFI_STATUS Status;
IN EFI_EVENT Event;
IN EFI_MTFTP4_OVERRIDE_DATA *OverrideData;
IN UINT8 *Filename;
IN UINT8 *ModeStr;
IN UINT32 OptionCount;
IN EFI_MTFTP4_OPTION *OptionList;
IN OUT UINT64 BufferSize;
IN OUT VOID *Buffer;
IN VOID *Context;
IN EFI_MTFTP4_CHECK_PACKET CheckPacket;
IN EFI_MTFTP4_TIMEOUT_CALLBACK TimeoutCallback;
IN EFI_MTFTP4_PACKET_NEEDED PacketNeeded;
} EFI_MTFTP4_TOKEN;
#endif

View File

@@ -0,0 +1,30 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PciIo.c
Abstract:
EFI PCI I/O Protocol
Revision History
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (PciIo)
EFI_GUID gEfiPciIoProtocolGuid = EFI_PCI_IO_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiPciIoProtocolGuid, "PCI IO Protocol", "EFI 1.1 PCI IO Protocol");

View File

@@ -0,0 +1,275 @@
/*++
Copyright (c) 2004 - 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PciIo.h
Abstract:
EFI PCI I/O Protocol
Revision History
--*/
#ifndef _EFI_PCI_IO_H
#define _EFI_PCI_IO_H
//
// Global ID for the PCI I/O Protocol
//
#define EFI_PCI_IO_PROTOCOL_GUID \
{ \
0x4cf5b200, 0x68b8, 0x4ca5, 0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a \
}
EFI_FORWARD_DECLARATION (EFI_PCI_IO_PROTOCOL);
//
// Prototypes for the PCI I/O Protocol
//
typedef enum {
EfiPciIoWidthUint8 = 0,
EfiPciIoWidthUint16,
EfiPciIoWidthUint32,
EfiPciIoWidthUint64,
EfiPciIoWidthFifoUint8,
EfiPciIoWidthFifoUint16,
EfiPciIoWidthFifoUint32,
EfiPciIoWidthFifoUint64,
EfiPciIoWidthFillUint8,
EfiPciIoWidthFillUint16,
EfiPciIoWidthFillUint32,
EfiPciIoWidthFillUint64,
EfiPciIoWidthMaximum
} EFI_PCI_IO_PROTOCOL_WIDTH;
//
// Complete PCI address generater
//
#define EFI_PCI_IO_PASS_THROUGH_BAR 0xff // Special BAR that passes a memory or I/O cycle through unchanged
#define EFI_PCI_IO_ATTRIBUTE_MASK 0x077f // All the following I/O and Memory cycles
#define EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO 0x0001 // I/O cycles 0x0000-0x00FF (10 bit decode)
#define EFI_PCI_IO_ATTRIBUTE_ISA_IO 0x0002 // I/O cycles 0x0000-0x03FF (10 bit decode)
#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO 0x0004 // I/O cycles 0x3C6, 0x3C8, 0x3C9 (10 bit decode)
#define EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY 0x0008 // MEM cycles 0xA0000-0xBFFFF (24 bit decode)
#define EFI_PCI_IO_ATTRIBUTE_VGA_IO 0x0010 // I/O cycles 0x3B0-0x3BB and 0x3C0-0x3DF (10 bit decode)
#define EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO 0x0020 // I/O cycles 0x1F0-0x1F7, 0x3F6, 0x3F7 (10 bit decode)
#define EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO 0x0040 // I/O cycles 0x170-0x177, 0x376, 0x377 (10 bit decode)
#define EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080 // Map a memory range so write are combined
#define EFI_PCI_IO_ATTRIBUTE_IO 0x0100 // Enable the I/O decode bit in the PCI Config Header
#define EFI_PCI_IO_ATTRIBUTE_MEMORY 0x0200 // Enable the Memory decode bit in the PCI Config Header
#define EFI_PCI_IO_ATTRIBUTE_BUS_MASTER 0x0400 // Enable the DMA bit in the PCI Config Header
#define EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED 0x0800 // Map a memory range so all r/w accesses are cached
#define EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000 // Disable a memory range
#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE 0x2000 // Clear for an add-in PCI Device
#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM 0x4000 // Clear for a physical PCI Option ROM accessed through ROM BAR
#define EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000 // Clear for PCI controllers that can not genrate a DAC
//
// The following definition is added in EFI1.1 spec update and UEFI2.0 spec.
//
#define EFI_PCI_IO_ATTRIBUTE_ISA_IO_16 0x10000 // I/O cycles 0x0100-0x03FF (16 bit decode)
#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000 // I/O cycles 0x3C6, 0x3C8, 0x3C9 (16 bit decode)
#define EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 0x40000 // I/O cycles 0x3B0-0x3BB and 0x3C0-0x3DF (16 bit decode)
#define EFI_PCI_DEVICE_ENABLE (EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY | EFI_PCI_IO_ATTRIBUTE_BUS_MASTER)
#define EFI_VGA_DEVICE_ENABLE (EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO | EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY | EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_IO)
//
// *******************************************************
// EFI_PCI_IO_PROTOCOL_OPERATION
// *******************************************************
//
typedef enum {
EfiPciIoOperationBusMasterRead,
EfiPciIoOperationBusMasterWrite,
EfiPciIoOperationBusMasterCommonBuffer,
EfiPciIoOperationMaximum
} EFI_PCI_IO_PROTOCOL_OPERATION;
//
// *******************************************************
// EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION
// *******************************************************
//
typedef enum {
EfiPciIoAttributeOperationGet,
EfiPciIoAttributeOperationSet,
EfiPciIoAttributeOperationEnable,
EfiPciIoAttributeOperationDisable,
EfiPciIoAttributeOperationSupported,
EfiPciIoAttributeOperationMaximum
} EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION;
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_IO_PROTOCOL_POLL_IO_MEM) (
IN EFI_PCI_IO_PROTOCOL * This,
IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
IN UINT8 BarIndex,
IN UINT64 Offset,
IN UINT64 Mask,
IN UINT64 Value,
IN UINT64 Delay,
OUT UINT64 *Result
);
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_IO_PROTOCOL_IO_MEM) (
IN EFI_PCI_IO_PROTOCOL * This,
IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
IN UINT8 BarIndex,
IN UINT64 Offset,
IN UINTN Count,
IN OUT VOID *Buffer
);
typedef struct {
EFI_PCI_IO_PROTOCOL_IO_MEM Read;
EFI_PCI_IO_PROTOCOL_IO_MEM Write;
} EFI_PCI_IO_PROTOCOL_ACCESS;
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_IO_PROTOCOL_CONFIG) (
IN EFI_PCI_IO_PROTOCOL * This,
IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
IN UINT32 Offset,
IN UINTN Count,
IN OUT VOID *Buffer
);
typedef struct {
EFI_PCI_IO_PROTOCOL_CONFIG Read;
EFI_PCI_IO_PROTOCOL_CONFIG Write;
} EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS;
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_IO_PROTOCOL_COPY_MEM) (
IN EFI_PCI_IO_PROTOCOL * This,
IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
IN UINT8 DestBarIndex,
IN UINT64 DestOffset,
IN UINT8 SrcBarIndex,
IN UINT64 SrcOffset,
IN UINTN Count
);
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_IO_PROTOCOL_MAP) (
IN EFI_PCI_IO_PROTOCOL * This,
IN EFI_PCI_IO_PROTOCOL_OPERATION Operation,
IN VOID *HostAddress,
IN OUT UINTN *NumberOfBytes,
OUT EFI_PHYSICAL_ADDRESS * DeviceAddress,
OUT VOID **Mapping
);
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_IO_PROTOCOL_UNMAP) (
IN EFI_PCI_IO_PROTOCOL * This,
IN VOID *Mapping
);
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER) (
IN EFI_PCI_IO_PROTOCOL * This,
IN EFI_ALLOCATE_TYPE Type,
IN EFI_MEMORY_TYPE MemoryType,
IN UINTN Pages,
OUT VOID **HostAddress,
IN UINT64 Attributes
);
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_IO_PROTOCOL_FREE_BUFFER) (
IN EFI_PCI_IO_PROTOCOL * This,
IN UINTN Pages,
IN VOID *HostAddress
);
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_IO_PROTOCOL_FLUSH) (
IN EFI_PCI_IO_PROTOCOL * This
);
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_IO_PROTOCOL_GET_LOCATION) (
IN EFI_PCI_IO_PROTOCOL * This,
OUT UINTN *SegmentNumber,
OUT UINTN *BusNumber,
OUT UINTN *DeviceNumber,
OUT UINTN *FunctionNumber
);
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_IO_PROTOCOL_ATTRIBUTES) (
IN EFI_PCI_IO_PROTOCOL * This,
IN EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION Operation,
IN UINT64 Attributes,
OUT UINT64 *Result OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES) (
IN EFI_PCI_IO_PROTOCOL * This,
IN UINT8 BarIndex,
OUT UINT64 *Supports, OPTIONAL
OUT VOID **Resources OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES) (
IN EFI_PCI_IO_PROTOCOL * This,
IN UINT64 Attributes,
IN UINT8 BarIndex,
IN OUT UINT64 *Offset,
IN OUT UINT64 *Length
);
//
// Interface structure for the PCI I/O Protocol
//
typedef struct _EFI_PCI_IO_PROTOCOL {
EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollMem;
EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollIo;
EFI_PCI_IO_PROTOCOL_ACCESS Mem;
EFI_PCI_IO_PROTOCOL_ACCESS Io;
EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS Pci;
EFI_PCI_IO_PROTOCOL_COPY_MEM CopyMem;
EFI_PCI_IO_PROTOCOL_MAP Map;
EFI_PCI_IO_PROTOCOL_UNMAP Unmap;
EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer;
EFI_PCI_IO_PROTOCOL_FREE_BUFFER FreeBuffer;
EFI_PCI_IO_PROTOCOL_FLUSH Flush;
EFI_PCI_IO_PROTOCOL_GET_LOCATION GetLocation;
EFI_PCI_IO_PROTOCOL_ATTRIBUTES Attributes;
EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES GetBarAttributes;
EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES SetBarAttributes;
UINT64 RomSize;
VOID *RomImage;
} EFI_PCI_IO_PROTOCOL;
extern EFI_GUID gEfiPciIoProtocolGuid;
#endif

View File

@@ -0,0 +1,32 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PciRootBridgeIo.c
Abstract:
PCI Root Bridge I/O protocol as defined in the EFI 1.1 specification.
PCI Root Bridge I/O protocol is used by PCI Bus Driver to perform PCI Memory, PCI I/O,
and PCI Configuration cycles on a PCI Root Bridge. It also provides services to perform
defferent types of bus mastering DMA
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (PciRootBridgeIo)
EFI_GUID gEfiPciRootBridgeIoProtocolGuid = EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiPciRootBridgeIoProtocolGuid, "PciRootBridgeIo Protocol", "EFI 1.1 Pci Root Bridge IO Protocol");

View File

@@ -0,0 +1,220 @@
/*++
Copyright (c) 2004 - 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PciRootBridgeIo.h
Abstract:
PCI Root Bridge I/O protocol as defined in the EFI 1.1 specification.
PCI Root Bridge I/O protocol is used by PCI Bus Driver to perform PCI Memory, PCI I/O,
and PCI Configuration cycles on a PCI Root Bridge. It also provides services to perform
defferent types of bus mastering DMA
--*/
#ifndef _PCI_ROOT_BRIDGE_IO_H_
#define _PCI_ROOT_BRIDGE_IO_H_
#define EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID \
{ \
0x2f707ebb, 0x4a1a, 0x11d4, 0x9a, 0x38, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d \
}
EFI_FORWARD_DECLARATION (EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL);
typedef enum {
EfiPciWidthUint8,
EfiPciWidthUint16,
EfiPciWidthUint32,
EfiPciWidthUint64,
EfiPciWidthFifoUint8,
EfiPciWidthFifoUint16,
EfiPciWidthFifoUint32,
EfiPciWidthFifoUint64,
EfiPciWidthFillUint8,
EfiPciWidthFillUint16,
EfiPciWidthFillUint32,
EfiPciWidthFillUint64,
EfiPciWidthMaximum
} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH;
typedef enum {
EfiPciOperationBusMasterRead,
EfiPciOperationBusMasterWrite,
EfiPciOperationBusMasterCommonBuffer,
EfiPciOperationBusMasterRead64,
EfiPciOperationBusMasterWrite64,
EfiPciOperationBusMasterCommonBuffer64,
EfiPciOperationMaximum
} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION;
#define EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO 0x0001
#define EFI_PCI_ATTRIBUTE_ISA_IO 0x0002
#define EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO 0x0004
#define EFI_PCI_ATTRIBUTE_VGA_MEMORY 0x0008
#define EFI_PCI_ATTRIBUTE_VGA_IO 0x0010
#define EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO 0x0020
#define EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO 0x0040
#define EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080
#define EFI_PCI_ATTRIBUTE_MEMORY_CACHED 0x0800
#define EFI_PCI_ATTRIBUTE_MEMORY_DISABLE 0x1000
#define EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000
//
// The following definition is added in EFI1.1 spec update and UEFI2.0 spec.
//
#define EFI_PCI_ATTRIBUTE_ISA_IO_16 0x10000
#define EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000
#define EFI_PCI_ATTRIBUTE_VGA_IO_16 0x40000
#define EFI_PCI_ATTRIBUTE_VALID_FOR_ALLOCATE_BUFFER (EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE | EFI_PCI_ATTRIBUTE_MEMORY_CACHED | EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE)
#define EFI_PCI_ATTRIBUTE_INVALID_FOR_ALLOCATE_BUFFER (~EFI_PCI_ATTRIBUTE_VALID_FOR_ALLOCATE_BUFFER)
#define EFI_PCI_ADDRESS(bus, dev, func, reg) \
((UINT64) ((((UINTN) bus) << 24) + (((UINTN) dev) << 16) + (((UINTN) func) << 8) + ((UINTN) reg)))
typedef struct {
UINT8 Register;
UINT8 Function;
UINT8 Device;
UINT8 Bus;
UINT32 ExtendedRegister;
} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS;
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM) (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
IN UINT64 Address,
IN UINT64 Mask,
IN UINT64 Value,
IN UINT64 Delay,
OUT UINT64 *Result
);
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM) (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
IN UINT64 Address,
IN UINTN Count,
IN OUT VOID *Buffer
);
typedef struct {
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM Read;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM Write;
} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS;
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_COPY_MEM) (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
IN UINT64 DestAddress,
IN UINT64 SrcAddress,
IN UINTN Count
);
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_MAP) (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION Operation,
IN VOID *HostAddress,
IN OUT UINTN *NumberOfBytes,
OUT EFI_PHYSICAL_ADDRESS * DeviceAddress,
OUT VOID **Mapping
);
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_UNMAP) (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This,
IN VOID *Mapping
);
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ALLOCATE_BUFFER) (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This,
IN EFI_ALLOCATE_TYPE Type,
IN EFI_MEMORY_TYPE MemoryType,
IN UINTN Pages,
IN OUT VOID **HostAddress,
IN UINT64 Attributes
);
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FREE_BUFFER) (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This,
IN UINTN Pages,
IN VOID *HostAddress
);
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FLUSH) (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This
);
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GET_ATTRIBUTES) (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This,
OUT UINT64 *Supports,
OUT UINT64 *Attributes
);
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_SET_ATTRIBUTES) (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This,
IN UINT64 Attributes,
IN OUT UINT64 *ResourceBase,
IN OUT UINT64 *ResourceLength
);
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_CONFIGURATION) (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This,
OUT VOID **Resources
);
typedef struct _EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL {
EFI_HANDLE ParentHandle;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM PollMem;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM PollIo;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS Mem;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS Io;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS Pci;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_COPY_MEM CopyMem;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_MAP Map;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_UNMAP Unmap;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FREE_BUFFER FreeBuffer;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FLUSH Flush;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GET_ATTRIBUTES GetAttributes;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_SET_ATTRIBUTES SetAttributes;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_CONFIGURATION Configuration;
UINT32 SegmentNumber;
} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL;
extern EFI_GUID gEfiPciRootBridgeIoProtocolGuid;
#endif

View File

@@ -0,0 +1,31 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PlatformDriverOverride.c
Abstract:
Platform Driver Override protocol as defined in the EFI 1.1 specification.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (PlatformDriverOverride)
EFI_GUID gEfiPlatformDriverOverrideProtocolGuid = EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_GUID;
EFI_GUID_STRING
(
&gEfiPlatformDriverOverrideProtocolGuid, "Platform Driver Override Protocol",
"EFI 1.1 Platform Driver Override Protocol"
);

View File

@@ -0,0 +1,74 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PlatformDriverOverride.h
Abstract:
Platform Driver Override protocol as defined in the EFI 1.1 specification.
--*/
#ifndef _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_H_
#define _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_H_
//
// Global ID for the Platform Driver Override Protocol
//
#define EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_GUID \
{ \
0x6b30c738, 0xa391, 0x11d4, 0x9a, 0x3b, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d \
}
EFI_FORWARD_DECLARATION (EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL);
//
// Prototypes for the Platform Driver Override Protocol
//
typedef
EFI_STATUS
(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER) (
IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL * This,
IN EFI_HANDLE ControllerHandle,
IN OUT EFI_HANDLE * DriverImageHandle
);
typedef
EFI_STATUS
(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH) (
IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL * This,
IN EFI_HANDLE ControllerHandle,
IN OUT EFI_DEVICE_PATH_PROTOCOL **DriverImagePath
);
typedef
EFI_STATUS
(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED) (
IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL * This,
IN EFI_HANDLE ControllerHandle,
IN EFI_DEVICE_PATH_PROTOCOL * DriverImagePath,
IN EFI_HANDLE DriverImageHandle
);
//
// Interface structure for the Platform Driver Override Protocol
//
typedef struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL {
EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER GetDriver;
EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH GetDriverPath;
EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED DriverLoaded;
} EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL;
extern EFI_GUID gEfiPlatformDriverOverrideProtocolGuid;
#endif

View File

@@ -0,0 +1,27 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PxeBaseCode.c
Abstract:
PxeBaseCode GUID declaration.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (PxeBaseCode)
EFI_GUID gEfiPxeBaseCodeProtocolGuid = EFI_PXE_BASE_CODE_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiPxeBaseCodeProtocolGuid, "PXE Base Code Protocol", "EFI PXE Base Code Protocol");
/* EOF - PxeBaseCode.c */

View File

@@ -0,0 +1,386 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PxeBaseCode.h
Abstract:
EFI PXE Base Code Protocol definitions.
--*/
#ifndef _EFIPXEBC_H
#define _EFIPXEBC_H
#include "Pxe.h"
//
// PXE Base Code protocol
//
#define EFI_PXE_BASE_CODE_PROTOCOL_GUID \
{ \
0x03c4e603, 0xac28, 0x11d3, 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d \
}
EFI_FORWARD_DECLARATION (EFI_PXE_BASE_CODE_PROTOCOL);
//
// Default IP TTL and ToS.
//
#define DEFAULT_TTL 16
#define DEFAULT_ToS 0
//
// ICMP error format
//
typedef struct {
UINT8 Type;
UINT8 Code;
UINT16 Checksum;
union {
UINT32 reserved;
UINT32 Mtu;
UINT32 Pointer;
struct {
UINT16 Identifier;
UINT16 Sequence;
} Echo;
} u;
UINT8 Data[494];
} EFI_PXE_BASE_CODE_ICMP_ERROR;
//
// TFTP error format
//
typedef struct {
UINT8 ErrorCode;
CHAR8 ErrorString[127];
} EFI_PXE_BASE_CODE_TFTP_ERROR;
//
// IP Receive Filter definitions
//
#define EFI_PXE_BASE_CODE_MAX_IPCNT 8
typedef struct {
UINT8 Filters;
UINT8 IpCnt;
UINT16 reserved;
EFI_IP_ADDRESS IpList[EFI_PXE_BASE_CODE_MAX_IPCNT];
} EFI_PXE_BASE_CODE_IP_FILTER;
#define EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP 0x0001
#define EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST 0x0002
#define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS 0x0004
#define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST 0x0008
//
// ARP Cache definitions
//
typedef struct {
EFI_IP_ADDRESS IpAddr;
EFI_MAC_ADDRESS MacAddr;
} EFI_PXE_BASE_CODE_ARP_ENTRY;
typedef struct {
EFI_IP_ADDRESS IpAddr;
EFI_IP_ADDRESS SubnetMask;
EFI_IP_ADDRESS GwAddr;
} EFI_PXE_BASE_CODE_ROUTE_ENTRY;
//
// UDP definitions
//
typedef UINT16 EFI_PXE_BASE_CODE_UDP_PORT;
#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP 0x0001
#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT 0x0002
#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_IP 0x0004
#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT 0x0008
#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_USE_FILTER 0x0010
#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_MAY_FRAGMENT 0x0020
//
// Discover() definitions
//
#define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP 0
#define EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS 1
#define EFI_PXE_BASE_CODE_BOOT_TYPE_INTEL_LCM 2
#define EFI_PXE_BASE_CODE_BOOT_TYPE_DOSUNDI 3
#define EFI_PXE_BASE_CODE_BOOT_TYPE_NEC_ESMPRO 4
#define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_WSoD 5
#define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_LCCM 6
#define EFI_PXE_BASE_CODE_BOOT_TYPE_CA_UNICENTER_TNG 7
#define EFI_PXE_BASE_CODE_BOOT_TYPE_HP_OPENVIEW 8
#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_9 9
#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_10 10
#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_11 11
#define EFI_PXE_BASE_CODE_BOOT_TYPE_NOT_USED_12 12
#define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_INSTALL 13
#define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_BOOT 14
#define EFI_PXE_BASE_CODE_BOOT_TYPE_REMBO 15
#define EFI_PXE_BASE_CODE_BOOT_TYPE_BEOBOOT 16
//
// 17 through 32767 are reserved
// 32768 through 65279 are for vendor use
// 65280 through 65534 are reserved
//
#define EFI_PXE_BASE_CODE_BOOT_TYPE_PXETEST 65535
#define EFI_PXE_BASE_CODE_BOOT_LAYER_MASK 0x7FFF
#define EFI_PXE_BASE_CODE_BOOT_LAYER_INITIAL 0x0000
//
// Discover() server list structure.
//
typedef struct {
UINT16 Type;
BOOLEAN AcceptAnyResponse;
UINT8 Reserved;
EFI_IP_ADDRESS IpAddr;
} EFI_PXE_BASE_CODE_SRVLIST;
//
// Discover() information override structure.
//
typedef struct {
BOOLEAN UseMCast;
BOOLEAN UseBCast;
BOOLEAN UseUCast;
BOOLEAN MustUseList;
EFI_IP_ADDRESS ServerMCastIp;
UINT16 IpCnt;
EFI_PXE_BASE_CODE_SRVLIST SrvList[1];
} EFI_PXE_BASE_CODE_DISCOVER_INFO;
//
// Mtftp() definitions
//
typedef enum {
EFI_PXE_BASE_CODE_TFTP_FIRST,
EFI_PXE_BASE_CODE_TFTP_GET_FILE_SIZE,
EFI_PXE_BASE_CODE_TFTP_READ_FILE,
EFI_PXE_BASE_CODE_TFTP_WRITE_FILE,
EFI_PXE_BASE_CODE_TFTP_READ_DIRECTORY,
EFI_PXE_BASE_CODE_MTFTP_GET_FILE_SIZE,
EFI_PXE_BASE_CODE_MTFTP_READ_FILE,
EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY,
EFI_PXE_BASE_CODE_MTFTP_LAST
} EFI_PXE_BASE_CODE_TFTP_OPCODE;
typedef struct {
EFI_IP_ADDRESS MCastIp;
EFI_PXE_BASE_CODE_UDP_PORT CPort;
EFI_PXE_BASE_CODE_UDP_PORT SPort;
UINT16 ListenTimeout;
UINT16 TransmitTimeout;
} EFI_PXE_BASE_CODE_MTFTP_INFO;
//
// PXE Base Code Mode structure
//
#define EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES 8
#define EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES 8
typedef struct {
BOOLEAN Started;
BOOLEAN Ipv6Available;
BOOLEAN Ipv6Supported;
BOOLEAN UsingIpv6;
BOOLEAN BisSupported;
BOOLEAN BisDetected;
BOOLEAN AutoArp;
BOOLEAN SendGUID;
BOOLEAN DhcpDiscoverValid;
BOOLEAN DhcpAckReceived;
BOOLEAN ProxyOfferReceived;
BOOLEAN PxeDiscoverValid;
BOOLEAN PxeReplyReceived;
BOOLEAN PxeBisReplyReceived;
BOOLEAN IcmpErrorReceived;
BOOLEAN TftpErrorReceived;
BOOLEAN MakeCallbacks;
UINT8 TTL;
UINT8 ToS;
EFI_IP_ADDRESS StationIp;
EFI_IP_ADDRESS SubnetMask;
EFI_PXE_BASE_CODE_PACKET DhcpDiscover;
EFI_PXE_BASE_CODE_PACKET DhcpAck;
EFI_PXE_BASE_CODE_PACKET ProxyOffer;
EFI_PXE_BASE_CODE_PACKET PxeDiscover;
EFI_PXE_BASE_CODE_PACKET PxeReply;
EFI_PXE_BASE_CODE_PACKET PxeBisReply;
EFI_PXE_BASE_CODE_IP_FILTER IpFilter;
UINT32 ArpCacheEntries;
EFI_PXE_BASE_CODE_ARP_ENTRY ArpCache[EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES];
UINT32 RouteTableEntries;
EFI_PXE_BASE_CODE_ROUTE_ENTRY RouteTable[EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES];
EFI_PXE_BASE_CODE_ICMP_ERROR IcmpError;
EFI_PXE_BASE_CODE_TFTP_ERROR TftpError;
} EFI_PXE_BASE_CODE_MODE;
//
// PXE Base Code Interface Function definitions
//
typedef
EFI_STATUS
(EFIAPI *EFI_PXE_BASE_CODE_START) (
IN EFI_PXE_BASE_CODE_PROTOCOL * This,
IN BOOLEAN UseIpv6
);
typedef
EFI_STATUS
(EFIAPI *EFI_PXE_BASE_CODE_STOP) (
IN EFI_PXE_BASE_CODE_PROTOCOL * This
);
typedef
EFI_STATUS
(EFIAPI *EFI_PXE_BASE_CODE_DHCP) (
IN EFI_PXE_BASE_CODE_PROTOCOL * This,
IN BOOLEAN SortOffers
);
typedef
EFI_STATUS
(EFIAPI *EFI_PXE_BASE_CODE_DISCOVER) (
IN EFI_PXE_BASE_CODE_PROTOCOL * This,
IN UINT16 Type,
IN UINT16 *Layer,
IN BOOLEAN UseBis,
IN OUT EFI_PXE_BASE_CODE_DISCOVER_INFO * Info OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_PXE_BASE_CODE_MTFTP) (
IN EFI_PXE_BASE_CODE_PROTOCOL * This,
IN EFI_PXE_BASE_CODE_TFTP_OPCODE Operation,
IN OUT VOID *BufferPtr OPTIONAL,
IN BOOLEAN Overwrite,
IN OUT UINT64 *BufferSize,
IN UINTN *BlockSize OPTIONAL,
IN EFI_IP_ADDRESS * ServerIp,
IN UINT8 *Filename,
IN EFI_PXE_BASE_CODE_MTFTP_INFO * Info OPTIONAL,
IN BOOLEAN DontUseBuffer
);
typedef
EFI_STATUS
(EFIAPI *EFI_PXE_BASE_CODE_UDP_WRITE) (
IN EFI_PXE_BASE_CODE_PROTOCOL * This,
IN UINT16 OpFlags,
IN EFI_IP_ADDRESS * DestIp,
IN EFI_PXE_BASE_CODE_UDP_PORT * DestPort,
IN EFI_IP_ADDRESS * GatewayIp, OPTIONAL
IN EFI_IP_ADDRESS * SrcIp, OPTIONAL
IN OUT EFI_PXE_BASE_CODE_UDP_PORT * SrcPort, OPTIONAL
IN UINTN *HeaderSize, OPTIONAL
IN VOID *HeaderPtr, OPTIONAL
IN UINTN *BufferSize,
IN VOID *BufferPtr
);
typedef
EFI_STATUS
(EFIAPI *EFI_PXE_BASE_CODE_UDP_READ) (
IN EFI_PXE_BASE_CODE_PROTOCOL * This,
IN UINT16 OpFlags,
IN OUT EFI_IP_ADDRESS * DestIp, OPTIONAL
IN OUT EFI_PXE_BASE_CODE_UDP_PORT * DestPort, OPTIONAL
IN OUT EFI_IP_ADDRESS * SrcIp, OPTIONAL
IN OUT EFI_PXE_BASE_CODE_UDP_PORT * SrcPort, OPTIONAL
IN UINTN *HeaderSize, OPTIONAL
IN VOID *HeaderPtr, OPTIONAL
IN OUT UINTN *BufferSize,
IN VOID *BufferPtr
);
typedef
EFI_STATUS
(EFIAPI *EFI_PXE_BASE_CODE_SET_IP_FILTER) (
IN EFI_PXE_BASE_CODE_PROTOCOL * This,
IN EFI_PXE_BASE_CODE_IP_FILTER * NewFilter
);
typedef
EFI_STATUS
(EFIAPI *EFI_PXE_BASE_CODE_ARP) (
IN EFI_PXE_BASE_CODE_PROTOCOL * This,
IN EFI_IP_ADDRESS * IpAddr,
IN EFI_MAC_ADDRESS * MacAddr OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_PXE_BASE_CODE_SET_PARAMETERS) (
IN EFI_PXE_BASE_CODE_PROTOCOL * This,
IN BOOLEAN *NewAutoArp, OPTIONAL
IN BOOLEAN *NewSendGUID, OPTIONAL
IN UINT8 *NewTTL, OPTIONAL
IN UINT8 *NewToS, OPTIONAL
IN BOOLEAN *NewMakeCallback OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_PXE_BASE_CODE_SET_STATION_IP) (
IN EFI_PXE_BASE_CODE_PROTOCOL * This,
IN EFI_IP_ADDRESS * NewStationIp, OPTIONAL
IN EFI_IP_ADDRESS * NewSubnetMask OPTIONAL
);
typedef
EFI_STATUS
(EFIAPI *EFI_PXE_BASE_CODE_SET_PACKETS) (
IN EFI_PXE_BASE_CODE_PROTOCOL * This,
BOOLEAN *NewDhcpDiscoverValid, OPTIONAL
BOOLEAN *NewDhcpAckReceived, OPTIONAL
BOOLEAN *NewProxyOfferReceived, OPTIONAL
BOOLEAN *NewPxeDiscoverValid, OPTIONAL
BOOLEAN *NewPxeReplyReceived, OPTIONAL
BOOLEAN *NewPxeBisReplyReceived, OPTIONAL
IN EFI_PXE_BASE_CODE_PACKET * NewDhcpDiscover, OPTIONAL
IN EFI_PXE_BASE_CODE_PACKET * NewDhcpAck, OPTIONAL
IN EFI_PXE_BASE_CODE_PACKET * NewProxyOffer, OPTIONAL
IN EFI_PXE_BASE_CODE_PACKET * NewPxeDiscover, OPTIONAL
IN EFI_PXE_BASE_CODE_PACKET * NewPxeReply, OPTIONAL
IN EFI_PXE_BASE_CODE_PACKET * NewPxeBisReply OPTIONAL
);
//
// PXE Base Code Protocol structure
//
#define EFI_PXE_BASE_CODE_INTERFACE_REVISION 0x00010000
typedef struct _EFI_PXE_BASE_CODE_PROTOCOL {
UINT64 Revision;
EFI_PXE_BASE_CODE_START Start;
EFI_PXE_BASE_CODE_STOP Stop;
EFI_PXE_BASE_CODE_DHCP Dhcp;
EFI_PXE_BASE_CODE_DISCOVER Discover;
EFI_PXE_BASE_CODE_MTFTP Mtftp;
EFI_PXE_BASE_CODE_UDP_WRITE UdpWrite;
EFI_PXE_BASE_CODE_UDP_READ UdpRead;
EFI_PXE_BASE_CODE_SET_IP_FILTER SetIpFilter;
EFI_PXE_BASE_CODE_ARP Arp;
EFI_PXE_BASE_CODE_SET_PARAMETERS SetParameters;
EFI_PXE_BASE_CODE_SET_STATION_IP SetStationIp;
EFI_PXE_BASE_CODE_SET_PACKETS SetPackets;
EFI_PXE_BASE_CODE_MODE *Mode;
} EFI_PXE_BASE_CODE_PROTOCOL;
extern EFI_GUID gEfiPxeBaseCodeProtocolGuid;
#endif /* _EFIPXEBC_H */
/* EOF - PxeBaseCode.h */

View File

@@ -0,0 +1,29 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PxeBaseCodeCallBack.c
Abstract:
PXE BaseCode Callback GUID declaration.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (PxeBaseCodeCallBack)
EFI_GUID gEfiPxeBaseCodeCallbackProtocolGuid = EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_GUID;
EFI_GUID_STRING
(&gEfiPxeBaseCodeCallbackProtocolGuid, "PXE Base Code Callback Protocol", "EFI PXE Base Code Callback Protocol");
/* EOF - PxeBaseCodeCallBack.c */

View File

@@ -0,0 +1,82 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PxeBaseCodeCallBack.h
Abstract:
EFI PXE Base Code CallBack Protocol
--*/
#ifndef _PXE_BASE_CODE_CALLBACK_H_
#define _PXE_BASE_CODE_CALLBACK_H_
#include "Pxe.h"
//
// Call Back Definitions
//
#define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_GUID \
{ \
0x245dca21, 0xfb7b, 0x11d3, 0x8f, 0x01, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b \
}
//
// Revision Number
//
#define EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION 0x00010000
//
// Protocol definition
//
EFI_FORWARD_DECLARATION (EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL);
typedef enum {
EFI_PXE_BASE_CODE_FUNCTION_FIRST,
EFI_PXE_BASE_CODE_FUNCTION_DHCP,
EFI_PXE_BASE_CODE_FUNCTION_DISCOVER,
EFI_PXE_BASE_CODE_FUNCTION_MTFTP,
EFI_PXE_BASE_CODE_FUNCTION_UDP_WRITE,
EFI_PXE_BASE_CODE_FUNCTION_UDP_READ,
EFI_PXE_BASE_CODE_FUNCTION_ARP,
EFI_PXE_BASE_CODE_FUNCTION_IGMP,
EFI_PXE_BASE_CODE_FUNCTION_TCP_WRITE,
EFI_PXE_BASE_CODE_FUNCTION_TCP_READ,
EFI_PXE_BASE_CODE_PXE_FUNCTION_LAST
} EFI_PXE_BASE_CODE_FUNCTION;
typedef enum {
EFI_PXE_BASE_CODE_CALLBACK_STATUS_FIRST,
EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,
EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT,
EFI_PXE_BASE_CODE_CALLBACK_STATUS_LAST
} EFI_PXE_BASE_CODE_CALLBACK_STATUS;
typedef EFI_PXE_BASE_CODE_CALLBACK_STATUS (EFIAPI *EFI_PXE_CALLBACK)
(
IN EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL * This,
IN EFI_PXE_BASE_CODE_FUNCTION Function,
IN BOOLEAN Received,
IN UINT32 PacketLen,
IN EFI_PXE_BASE_CODE_PACKET * Packet OPTIONAL
);
typedef struct _EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL {
UINT64 Revision;
EFI_PXE_CALLBACK Callback;
} EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL;
extern EFI_GUID gEfiPxeBaseCodeCallbackProtocolGuid;
#endif /* _EFIPXEBC_H */
/* EOF - PxeBaseCodeCallBack.h */

View File

@@ -0,0 +1,26 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
ScsiIo.c
Abstract:
EFI_SCSI_IO_PROTOCOL as defined in UEFI 2.0.
Revision History
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (ScsiIo)
EFI_GUID gEfiScsiIoProtocolGuid = EFI_SCSI_IO_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiScsiIoProtocolGuid, "SCSI IO protoco", "UEFI 2.0 SCSI IO protocol");

View File

@@ -0,0 +1,256 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
ScsiIo.h
Abstract:
EFI_SCSI_IO_PROTOCOL as defined in UEFI 2.0.
Revision History
--*/
#ifndef __EFI_SCSI_IO_PROTOCOL_H__
#define __EFI_SCSI_IO_PROTOCOL_H__
#define EFI_SCSI_IO_PROTOCOL_GUID \
{ \
0x932f47e6, 0x2362, 0x4002, {0x80, 0x3e, 0x3c, 0xd5, 0x4b, 0x13, 0x8f, 0x85 } \
}
//
// Forward reference for pure ANSI compatability
//
typedef struct _EFI_SCSI_IO_PROTOCOL EFI_SCSI_IO_PROTOCOL;
//
// SCSI Data Direction definition
//
#define EFI_SCSI_IO_DATA_DIRECTION_READ 0
#define EFI_SCSI_IO_DATA_DIRECTION_WRITE 1
#define EFI_SCSI_IO_DATA_DIRECTION_BIDIRECTIONAL 2
//
// SCSI Host Adapter Status definition
//
#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_OK 0x00
#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_TIMEOUT_COMMAND 0x09 // timeout when processing the command
#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_TIMEOUT 0x0b // timeout when waiting for the command processing
#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_MESSAGE_REJECT 0x0d // a message reject was received when processing command
#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_BUS_RESET 0x0e // a bus reset was detected
#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_PARITY_ERROR 0x0f
#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_REQUEST_SENSE_FAILED 0x10 // the adapter failed in issuing request sense command
#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_SELECTION_TIMEOUT 0x11 // selection timeout
#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN 0x12 // data overrun or data underrun
#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_BUS_FREE 0x13 // Unexepected bus free
#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_PHASE_ERROR 0x14 // Target bus phase sequence failure
#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_OTHER 0x7f
//
// SCSI Target Status definition
//
#define EFI_SCSI_IO_STATUS_TARGET_GOOD 0x00
#define EFI_SCSI_IO_STATUS_TARGET_CHECK_CONDITION 0x02 // check condition
#define EFI_SCSI_IO_STATUS_TARGET_CONDITION_MET 0x04 // condition met
#define EFI_SCSI_IO_STATUS_TARGET_BUSY 0x08 // busy
#define EFI_SCSI_IO_STATUS_TARGET_INTERMEDIATE 0x10 // intermediate
#define EFI_SCSI_IO_STATUS_TARGET_INTERMEDIATE_CONDITION_MET 0x14 // intermediate-condition met
#define EFI_SCSI_IO_STATUS_TARGET_RESERVATION_CONFLICT 0x18 // reservation conflict
#define EFI_SCSI_IO_STATUS_TARGET_COMMOND_TERMINATED 0x22 // command terminated
#define EFI_SCSI_IO_STATUS_TARGET_QUEUE_FULL 0x28 // queue full
typedef struct {
UINT64 Timeout;
VOID *InDataBuffer;
VOID *OutDataBuffer;
VOID *SenseData;
VOID *Cdb;
UINT32 InTransferLength;
UINT32 OutTransferLength;
UINT8 CdbLength;
UINT8 DataDirection;
UINT8 HostAdapterStatus;
UINT8 TargetStatus;
UINT8 SenseDataLength;
} EFI_SCSI_IO_SCSI_REQUEST_PACKET;
typedef
EFI_STATUS
(EFIAPI *EFI_SCSI_IO_PROTOCOL_GET_DEVICE_TYPE) (
IN EFI_SCSI_IO_PROTOCOL *This,
OUT UINT8 *DeviceType
)
/*++
Routine Description:
Retrieves the device type information of the SCSI Controller.
Arguments:
This - Protocol instance pointer.
DeviceType - A pointer to the device type information
retrieved from the SCSI Controller.
Returns:
EFI_SUCCESS - Retrieves the device type information successfully.
EFI_INVALID_PARAMETER - The DeviceType is NULL.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SCSI_IO_PROTOCOL_GET_DEVICE_LOCATION) (
IN EFI_SCSI_IO_PROTOCOL *This,
IN OUT UINT8 **Target,
OUT UINT64 *Lun
)
/*++
Routine Description:
Retrieves the device location in the SCSI channel.
Arguments:
This - Protocol instance pointer.
Target - A pointer to the Target Array which represents ID of a SCSI device
on the SCSI channel.
Lun - A pointer to the LUN of the SCSI device on
the SCSI channel.
Returns:
EFI_SUCCESS - Retrieves the device location successfully.
EFI_INVALID_PARAMETER - The Target or Lun is NULL.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SCSI_IO_PROTOCOL_RESET_BUS) (
IN EFI_SCSI_IO_PROTOCOL *This
)
/*++
Routine Description:
Resets the SCSI Bus that the SCSI Controller is attached to.
Arguments:
This - This Protocol instance pointer.
Returns:
EFI_SUCCESS - The SCSI bus is reset successfully.
EFI_DEVICE_ERROR - Errors encountered when resetting the SCSI bus.
EFI_UNSUPPORTED - The bus reset operation is not supported by the
SCSI Host Controller.
EFI_TIMEOUT - A timeout occurred while attempting to reset
the SCSI bus.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SCSI_IO_PROTOCOL_RESET_DEVICE) (
IN EFI_SCSI_IO_PROTOCOL *This
)
/*++
Routine Description:
Resets the SCSI Controller that the device handle specifies.
Arguments:
This - Protocol instance pointer.
Returns:
EFI_SUCCESS - Reset the SCSI controller successfully.
EFI_DEVICE_ERROR - Errors are encountered when resetting the
SCSI Controller.
EFI_UNSUPPORTED - The SCSI bus does not support a device
reset operation.
EFI_TIMEOUT - A timeout occurred while attempting to
reset the SCSI Controller.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SCSI_IO_PROTOCOL_EXEC_SCSI_COMMAND) (
IN EFI_SCSI_IO_PROTOCOL *This,
IN OUT EFI_SCSI_IO_SCSI_REQUEST_PACKET *Packet,
IN EFI_EVENT Event OPTIONAL
)
/*++
Routine Description:
Sends a SCSI Request Packet to the SCSI Controller for execution.
Arguments:
This - Protocol instance pointer.
Packet - The SCSI request packet to send to the SCSI
Controller specified by the device handle.
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.
If Event is NULL, then blocking I/O is performed.
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.
Returns:
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.
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
that order for additional status information.
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.
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.
EFI_INVALID_PARAMETER - The contents of CommandPacket are invalid.
The SCSI Request Packet was not sent, so no
additional status information is available.
EFI_UNSUPPORTED - The command described by the SCSI Request Packet
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
available.
EFI_TIMEOUT - A timeout occurred while waiting for the SCSI
Request Packet to execute. See HostAdapterStatus,
TargetStatus, SenseDataLength, and SenseData in
that order for additional status information.
--*/
;
struct _EFI_SCSI_IO_PROTOCOL {
EFI_SCSI_IO_PROTOCOL_GET_DEVICE_TYPE GetDeviceType;
EFI_SCSI_IO_PROTOCOL_GET_DEVICE_LOCATION GetDeviceLocation;
EFI_SCSI_IO_PROTOCOL_RESET_BUS ResetBus;
EFI_SCSI_IO_PROTOCOL_RESET_DEVICE ResetDevice;
EFI_SCSI_IO_PROTOCOL_EXEC_SCSI_COMMAND ExecuteScsiCommand;
UINT32 IoAlign;
};
extern EFI_GUID gEfiScsiIoProtocolGuid;
#endif

View File

@@ -0,0 +1,27 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
ScsiPassThru.c
Abstract:
SCSI Pass Through protocol.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (ScsiPassThru)
EFI_GUID gEfiScsiPassThruProtocolGuid = EFI_SCSI_PASS_THRU_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiScsiPassThruProtocolGuid, "SCSI Pass Through Protocol", "EFI 1.0 SCSI Pass Through protocol");

View File

@@ -0,0 +1,332 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
ScsiPassThru.h
Abstract:
SCSI Pass Through protocol.
--*/
#ifndef __SCSI_PT_H__
#define __SCSI_PT_H__
#define EFI_SCSI_PASS_THRU_PROTOCOL_GUID \
{ \
0xa59e8fcf, 0xbda0, 0x43bb, 0x90, 0xb1, 0xd3, 0x73, 0x2e, 0xca, 0xa8, 0x77 \
}
//
// Forward reference for pure ANSI compatability
//
EFI_FORWARD_DECLARATION (EFI_SCSI_PASS_THRU_PROTOCOL);
#define EFI_SCSI_PASS_THRU_ATTRIBUTES_PHYSICAL 0x0001
#define EFI_SCSI_PASS_THRU_ATTRIBUTES_LOGICAL 0x0002
#define EFI_SCSI_PASS_THRU_ATTRIBUTES_NONBLOCKIO 0x0004
//
// SCSI Host Adapter Status definition
//
#define EFI_SCSI_STATUS_HOST_ADAPTER_OK 0x00
#define EFI_SCSI_STATUS_HOST_ADAPTER_TIMEOUT_COMMAND 0x09 // timeout when processing the command
#define EFI_SCSI_STATUS_HOST_ADAPTER_TIMEOUT 0x0b // timeout when waiting for the command processing
#define EFI_SCSI_STATUS_HOST_ADAPTER_MESSAGE_REJECT 0x0d // a message reject was received when processing command
#define EFI_SCSI_STATUS_HOST_ADAPTER_BUS_RESET 0x0e // a bus reset was detected
#define EFI_SCSI_STATUS_HOST_ADAPTER_PARITY_ERROR 0x0f
#define EFI_SCSI_STATUS_HOST_ADAPTER_REQUEST_SENSE_FAILED 0x10 // the adapter failed in issuing request sense command
#define EFI_SCSI_STATUS_HOST_ADAPTER_SELECTION_TIMEOUT 0x11 // selection timeout
#define EFI_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN 0x12 // data overrun or data underrun
#define EFI_SCSI_STATUS_HOST_ADAPTER_BUS_FREE 0x13 // Unexepected bus free
#define EFI_SCSI_STATUS_HOST_ADAPTER_PHASE_ERROR 0x14 // Target bus phase sequence failure
#define EFI_SCSI_STATUS_HOST_ADAPTER_OTHER 0x7f
//
// SCSI Target Status definition
//
#define EFI_SCSI_STATUS_TARGET_GOOD 0x00
#define EFI_SCSI_STATUS_TARGET_CHECK_CONDITION 0x02 // check condition
#define EFI_SCSI_STATUS_TARGET_CONDITION_MET 0x04 // condition met
#define EFI_SCSI_STATUS_TARGET_BUSY 0x08 // busy
#define EFI_SCSI_STATUS_TARGET_INTERMEDIATE 0x10 // intermediate
#define EFI_SCSI_STATUS_TARGET_INTERMEDIATE_CONDITION_MET 0x14 // intermediate-condition met
#define EFI_SCSI_STATUS_TARGET_RESERVATION_CONFLICT 0x18 // reservation conflict
#define EFI_SCSI_STATUS_TARGET_COMMOND_TERMINATED 0x22 // command terminated
#define EFI_SCSI_STATUS_TARGET_QUEUE_FULL 0x28 // queue full
typedef struct {
UINT64 Timeout;
VOID *DataBuffer;
VOID *SenseData;
VOID *Cdb;
UINT32 TransferLength;
UINT8 CdbLength;
UINT8 DataDirection;
UINT8 HostAdapterStatus;
UINT8 TargetStatus;
UINT8 SenseDataLength;
} EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET;
typedef struct {
CHAR16 *ControllerName;
CHAR16 *ChannelName;
UINT32 AdapterId;
UINT32 Attributes;
UINT32 IoAlign;
} EFI_SCSI_PASS_THRU_MODE;
typedef
EFI_STATUS
(EFIAPI *EFI_SCSI_PASS_THRU_PASSTHRU) (
IN EFI_SCSI_PASS_THRU_PROTOCOL * This,
IN UINT32 Target,
IN UINT64 Lun,
IN OUT EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET * Packet,
IN EFI_EVENT Event OPTIONAL
)
/*++
Routine Description:
Sends a SCSI Request Packet to a SCSI device that is attached to
the SCSI channel. This function supports both blocking I/O and
non-blocking I/O. The blocking I/O functionality is required,
and the non-blocking I/O functionality is optional.
Arguments:
This - Protocol instance pointer.
Target - The Target ID of the SCSI device to
send the SCSI Request Packet.
Lun - The LUN of the SCSI device to send the
SCSI Request Packet.
Packet - A pointer to the SCSI Request Packet to send
to the SCSI device specified by Target and Lun.
Event - If non-blocking I/O is not supported 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
supported, then non-blocking I/O is performed,
and Event will be signaled when the SCSI Request
Packet completes
Returns:
EFI_SUCCESSThe - SCSI Request Packet was sent by the host, and
TransferLength bytes were transferred to/from
DataBuffer.See HostAdapterStatus, TargetStatus,
SenseDataLength,and SenseData in that order
for additional status information.
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
that order for additional status information.
EFI_NOT_READY - The SCSI Request Packet could not be sent because
there are too many SCSI Request Packets already
queued. The caller may retry again later.
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.
EFI_INVALID_PARAMETER - Target, Lun, or the contents of ScsiRequestPacket
are invalid. The SCSI Request Packet was not sent,
so no additional status information is available.
EFI_UNSUPPORTED - The command described by the SCSI Request Packet
is not supported by the host adapter. The SCSI
Request Packet was not sent, so no additional
status information is available.
EFI_TIMEOUT - A timeout occurred while waiting for the SCSI
Request Packet to execute. See HostAdapterStatus,
TargetStatus, SenseDataLength, and SenseData in
that order for additional status information.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SCSI_PASS_THRU_GET_NEXT_DEVICE) (
IN EFI_SCSI_PASS_THRU_PROTOCOL * This,
IN OUT UINT32 *Target,
IN OUT UINT64 *Lun
)
/*++
Routine Description:
Used to retrieve the list of legal Target IDs for SCSI devices
on a SCSI channel.
Arguments:
This - Protocol instance pointer.
Target - On input, a pointer to the Target ID of a
SCSI device present on the SCSI channel.
On output, a pointer to the Target ID of
the next SCSI device present on a SCSI channel.
An input value of 0xFFFFFFFF retrieves the
Target ID of the first SCSI device present on
a SCSI channel.
Lun - On input, a pointer to the LUN of a SCSI device
present on the SCSI channel.On output, a pointer
to the LUN of the next SCSI device present on a
SCSI channel.
Returns:
EFI_SUCCESS - The Target ID of the next SCSI device on the SCSI
channel was returned in Target and Lun.
EFI_NOT_FOUND - There are no more SCSI devices on this SCSI channel.
EFI_INVALID_PARAMETER - Target is not 0xFFFFFFFF, and Target and Lun were
not returned on a previous call to GetNextDevice().
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SCSI_PASS_THRU_BUILD_DEVICE_PATH) (
IN EFI_SCSI_PASS_THRU_PROTOCOL * This,
IN UINT32 Target,
IN UINT64 Lun,
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
)
/*++
Routine Description:
Used to allocate and build a device path node for a SCSI device
on a SCSI channel.
Arguments:
This - Protocol instance pointer.
Target - The Target ID of the SCSI device for which
a device path node is to be allocated and built.
Lun - The LUN of the SCSI device for which a device
path node is to be allocated and built.
DevicePath - A pointer to a single device path node that
describes the SCSI device specified by
Target and Lun. This function is responsible
for allocating the buffer DevicePath with the boot
service AllocatePool(). It is the caller's
responsibility to free DevicePath when the caller
is finished with DevicePath.
Returns:
EFI_SUCCESS - The device path node that describes the SCSI device
specified by Target and Lun was allocated and
returned in DevicePath.
EFI_NOT_FOUND - The SCSI devices specified by Target and Lun does
not exist on the SCSI channel.
EFI_INVALID_PARAMETER - DevicePath is NULL.
EFI_OUT_OF_RESOURCES - There are not enough resources to allocate
DevicePath.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SCSI_PASS_THRU_GET_TARGET_LUN) (
IN EFI_SCSI_PASS_THRU_PROTOCOL * This,
IN EFI_DEVICE_PATH_PROTOCOL * DevicePath,
OUT UINT32 *Target,
OUT UINT64 *Lun
)
/*++
Routine Description:
Used to translate a device path node to a Target ID and LUN.
Arguments:
This - Protocol instance pointer.
DevicePath - A pointer to the device path node that
describes a SCSI device on the SCSI channel.
Target - A pointer to the Target ID of a SCSI device
on the SCSI channel.
Lun - A pointer to the LUN of a SCSI device on
the SCSI channel.
Returns:
EFI_SUCCESS - DevicePath was successfully translated to a
Target ID and LUN, and they were returned
in Target and Lun.
EFI_INVALID_PARAMETER - DevicePath is NULL.
EFI_INVALID_PARAMETER - Target is NULL.
EFI_INVALID_PARAMETER - Lun is NULL.
EFI_UNSUPPORTED - This driver does not support the device path
node type in DevicePath.
EFI_NOT_FOUND - A valid translation from DevicePath to a
Target ID and LUN does not exist.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SCSI_PASS_THRU_RESET_CHANNEL) (
IN EFI_SCSI_PASS_THRU_PROTOCOL * This
)
/*++
Routine Description:
Resets a SCSI channel.This operation resets all the
SCSI devices connected to the SCSI channel.
Arguments:
This - Protocol instance pointer.
Returns:
EFI_SUCCESS - The SCSI channel was reset.
EFI_UNSUPPORTED - The SCSI channel does not support
a channel reset operation.
EFI_DEVICE_ERROR - A device error occurred while
attempting to reset the SCSI channel.
EFI_TIMEOUT - A timeout occurred while attempting
to reset the SCSI channel.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SCSI_PASS_THRU_RESET_TARGET) (
IN EFI_SCSI_PASS_THRU_PROTOCOL * This,
IN UINT32 Target,
IN UINT64 Lun
)
/*++
Routine Description:
Resets a SCSI device that is connected to a SCSI channel.
Arguments:
This - Protocol instance pointer.
Target - The Target ID of the SCSI device to reset.
Lun - The LUN of the SCSI device to reset.
Returns:
EFI_SUCCESS - The SCSI device specified by Target and
Lun was reset.
EFI_UNSUPPORTED - The SCSI channel does not support a target
reset operation.
EFI_INVALID_PARAMETER - Target or Lun are invalid.
EFI_DEVICE_ERROR - A device error occurred while attempting
to reset the SCSI device specified by Target
and Lun.
EFI_TIMEOUT - A timeout occurred while attempting to reset
the SCSI device specified by Target and Lun.
--*/
;
typedef struct _EFI_SCSI_PASS_THRU_PROTOCOL {
EFI_SCSI_PASS_THRU_MODE *Mode;
EFI_SCSI_PASS_THRU_PASSTHRU PassThru;
EFI_SCSI_PASS_THRU_GET_NEXT_DEVICE GetNextDevice;
EFI_SCSI_PASS_THRU_BUILD_DEVICE_PATH BuildDevicePath;
EFI_SCSI_PASS_THRU_GET_TARGET_LUN GetTargetLun;
EFI_SCSI_PASS_THRU_RESET_CHANNEL ResetChannel;
EFI_SCSI_PASS_THRU_RESET_TARGET ResetTarget;
} EFI_SCSI_PASS_THRU_PROTOCOL;
extern EFI_GUID gEfiScsiPassThruProtocolGuid;
#endif

View File

@@ -0,0 +1,28 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
ScsiPassThruExt.c
Abstract:
EFI_EXT_SCSI_PASS_THRU_PROTOCOL as defined in UEFI 2.0.
Revision History
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (ScsiPassThruExt)
EFI_GUID gEfiExtScsiPassThruProtocolGuid = EFI_EXT_SCSI_PASS_THRU_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiExtScsiPassThruProtocolGuid, "Extended Scsi Pass Thru", "UEFI 2.0 Extended SCSI Pass Thru protocol");

View File

@@ -0,0 +1,365 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
ScsiPassThruExt.h
Abstract:
EFI_EXT_SCSI_PASS_THRU_PROTOCOL as defined in UEFI 2.0.
Revision History
--*/
#ifndef __EXT_SCSI_PASS_THROUGH_PROTOCOL_H__
#define __EXT_SCSI_PASS_THROUGH_PROTOCOL_H__
#define EFI_EXT_SCSI_PASS_THRU_PROTOCOL_GUID \
{ \
0x143b7632, 0xb81b, 0x4cb7, {0xab, 0xd3, 0xb6, 0x25, 0xa5, 0xb9, 0xbf, 0xfe } \
}
typedef struct _EFI_EXT_SCSI_PASS_THRU_PROTOCOL EFI_EXT_SCSI_PASS_THRU_PROTOCOL;
#define TARGET_MAX_BYTES 0x10
#define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_PHYSICAL 0x0001
#define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_LOGICAL 0x0002
#define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_NONBLOCKIO 0x0004
//
// DataDirection
//
#define EFI_EXT_SCSI_DATA_DIRECTION_READ 0
#define EFI_EXT_SCSI_DATA_DIRECTION_WRITE 1
#define EFI_EXT_SCSI_DATA_DIRECTION_BIDIRECTIONAL 2
//
// HostAdapterStatus
//
#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_OK 0x00
#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_TIMEOUT_COMMAND 0x09
#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_TIMEOUT 0x0b
#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_MESSAGE_REJECT 0x0d
#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_BUS_RESET 0x0e
#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_PARITY_ERROR 0x0f
#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_REQUEST_SENSE_FAILED 0x10
#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_SELECTION_TIMEOUT 0x11
#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN 0x12
#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_BUS_FREE 0x13
#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_PHASE_ERROR 0x14
#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_OTHER 0x7f
//
// TargetStatus
//
#define EFI_EXT_SCSI_STATUS_TARGET_GOOD 0x00
#define EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION 0x02
#define EFI_EXT_SCSI_STATUS_TARGET_CONDITION_MET 0x04
#define EFI_EXT_SCSI_STATUS_TARGET_BUSY 0x08
#define EFI_EXT_SCSI_STATUS_TARGET_INTERMEDIATE 0x10
#define EFI_EXT_SCSI_STATUS_TARGET_INTERMEDIATE_CONDITION_MET 0x14
#define EFI_EXT_SCSI_STATUS_TARGET_RESERVATION_CONFLICT 0x18
#define EFI_EXT_SCSI_STATUS_TARGET_TASK_SET_FULL 0x28
#define EFI_EXT_SCSI_STATUS_TARGET_ACA_ACTIVE 0x30
#define EFI_EXT_SCSI_STATUS_TARGET_TASK_ABORTED 0x40
typedef struct {
UINT32 AdapterId;
UINT32 Attributes;
UINT32 IoAlign;
} EFI_EXT_SCSI_PASS_THRU_MODE;
typedef struct {
UINT64 Timeout;
VOID *InDataBuffer;
VOID *OutDataBuffer;
VOID *SenseData;
VOID *Cdb;
UINT32 InTransferLength;
UINT32 OutTransferLength;
UINT8 CdbLength;
UINT8 DataDirection;
UINT8 HostAdapterStatus;
UINT8 TargetStatus;
UINT8 SenseDataLength;
} EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET;
typedef
EFI_STATUS
(EFIAPI *EFI_EXT_SCSI_PASS_THRU_PASSTHRU) (
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
)
/*++
Routine Description:
Sends a SCSI Request Packet to a SCSI device that is attached to the SCSI channel. This function
supports both blocking I/O and nonblocking I/O. The blocking I/O functionality is required, and the
nonblocking I/O functionality is optional.
Arguments:
This - A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
Target - The Target is an array of size TARGET_MAX_BYTES and it represents
the id of the SCSI device to send the SCSI Request Packet. Each
transport driver may chose to utilize a subset of this size to suit the needs
of transport target representation. For example, a Fibre Channel driver
may use only 8 bytes (WWN) to represent an FC target.
Lun - The LUN of the SCSI device to send the SCSI Request Packet.
Packet - A pointer to the SCSI Request Packet to send to the SCSI device
specified by Target and Lun.
Event - If nonblocking I/O is not supported 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 supported, then
nonblocking I/O is performed, and Event will be signaled when the
SCSI Request Packet completes.
Returns:
EFI_SUCCESS - The SCSI Request Packet was sent by the host. For bi-directional
commands, InTransferLength bytes were transferred from
InDataBuffer. For write and bi-directional commands,
OutTransferLength bytes were transferred by
OutDataBuffer.
EFI_BAD_BUFFER_SIZE - The SCSI Request Packet was not executed. The number of bytes that
could be transferred is returned in InTransferLength. For write
and bi-directional commands, OutTransferLength bytes were
transferred by OutDataBuffer.
EFI_NOT_READY - The SCSI Request Packet could not be sent because there are too many
SCSI Request Packets already queued. The caller may retry again later.
EFI_DEVICE_ERROR - A device error occurred while attempting to send the SCSI Request
Packet.
EFI_INVALID_PARAMETER- Target, Lun, or the contents of ScsiRequestPacket are invalid.
EFI_UNSUPPORTED - The command described by the SCSI Request Packet is not supported
by the host adapter. This includes the case of Bi-directional SCSI
commands not supported by the implementation. The SCSI Request
Packet was not sent, so no additional status information is available.
EFI_TIMEOUT - A timeout occurred while waiting for the SCSI Request Packet to execute.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET_LUN) (
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
IN OUT UINT8 **Target,
IN OUT UINT64 *Lun
)
/*++
Routine Description:
Used to retrieve the list of legal Target IDs and LUNs for SCSI devices on a SCSI channel. These
can either be the list SCSI devices that are actually present on the SCSI channel, or the list of legal
Target Ids and LUNs for the SCSI channel. Regardless, the caller of this function must probe the
Target ID and LUN returned to see if a SCSI device is actually present at that location on the SCSI
channel.
Arguments:
This - A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance
Target - On input, a pointer to the Target ID (an array of size
TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel.
On output, a pointer to the Target ID (an array of
TARGET_MAX_BYTES) of the next SCSI device present on a SCSI
channel. An input value of 0xF(all bytes in the array are 0xF) in the
Target array retrieves the Target ID of the first SCSI device present on
a SCSI channel.
Lun - On input, a pointer to the LUN of a SCSI device present on the SCSI
channel. On output, a pointer to the LUN of the next SCSI device present
on a SCSI channel.
Returns:
EFI_SUCCESS - The Target ID and LUN of the next SCSI device on the SCSI
channel was returned in Target and Lun.
EFI_INVALID_PARAMETER - Target array is not all 0xF, and Target and Lun were
not returned on a previous call to GetNextTargetLun().
EFI_NOT_FOUND - There are no more SCSI devices on this SCSI channel.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_EXT_SCSI_PASS_THRU_BUILD_DEVICE_PATH) (
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
IN UINT8 *Target,
IN UINT64 Lun,
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
)
/*++
Routine Description:
Used to allocate and build a device path node for a SCSI device on a SCSI channel.
Arguments:
This - A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
Target - The Target is an array of size TARGET_MAX_BYTES and it specifies the
Target ID of the SCSI device for which a device path node is to be
allocated and built. Transport drivers may chose to utilize a subset of
this size to suit the representation of targets. For example, a Fibre
Channel driver may use only 8 bytes (WWN) in the array to represent a
FC target.
Lun - The LUN of the SCSI device for which a device path node is to be
allocated and built.
DevicePath - A pointer to a single device path node that describes the SCSI device
specified by Target and Lun. This function is responsible for
allocating the buffer DevicePath with the boot service
AllocatePool(). It is the caller's responsibility to free
DevicePath when the caller is finished with DevicePath.
Returns:
EFI_SUCCESS - The device path node that describes the SCSI device specified by
Target and Lun was allocated and returned in
DevicePath.
EFI_INVALID_PARAMETER - DevicePath is NULL.
EFI_NOT_FOUND - The SCSI devices specified by Target and Lun does not exist
on the SCSI channel.
EFI_OUT_OF_RESOURCES - There are not enough resources to allocate DevicePath.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_EXT_SCSI_PASS_THRU_GET_TARGET_LUN) (
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
OUT UINT8 **Target,
OUT UINT64 *Lun
)
/*++
Routine Description:
Used to translate a device path node to a Target ID and LUN.
Arguments:
This - A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
DevicePath - A pointer to a single device path node that describes the SCSI device
on the SCSI channel.
Target - A pointer to the Target Array which represents the ID of a SCSI device
on the SCSI channel.
Lun - A pointer to the LUN of a SCSI device on the SCSI channel.
Returns:
EFI_SUCCESS - DevicePath was successfully translated to a Target ID and
LUN, and they were returned in Target and Lun.
EFI_INVALID_PARAMETER - DevicePath or Target or Lun is NULL.
EFI_NOT_FOUND - A valid translation from DevicePath to a Target ID and LUN
does not exist.
EFI_UNSUPPORTED - This driver does not support the device path node type in
DevicePath.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_EXT_SCSI_PASS_THRU_RESET_CHANNEL) (
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This
)
/*++
Routine Description:
Resets a SCSI channel. This operation resets all the SCSI devices connected to the SCSI channel.
Arguments:
This - A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
Returns:
EFI_SUCCESS - The SCSI channel was reset.
EFI_DEVICE_ERROR - A device error occurred while attempting to reset the SCSI channel.
EFI_TIMEOUT - A timeout occurred while attempting to reset the SCSI channel.
EFI_UNSUPPORTED - The SCSI channel does not support a channel reset operation.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_EXT_SCSI_PASS_THRU_RESET_TARGET_LUN) (
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
IN UINT8 *Target,
IN UINT64 Lun
)
/*++
Routine Description:
Resets a SCSI logical unit that is connected to a SCSI channel.
Arguments:
This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
Target The Target is an array of size TARGET_MAX_BYTE and it represents the
target port ID of the SCSI device containing the SCSI logical unit to
reset. Transport drivers may chose to utilize a subset of this array to suit
the representation of their targets.
Lun The LUN of the SCSI device to reset.
Returns:
EFI_SUCCESS - The SCSI device specified by Target and Lun was reset.
EFI_INVALID_PARAMETER - Target or Lun is NULL.
EFI_TIMEOUT - A timeout occurred while attempting to reset the SCSI device
specified by Target and Lun.
EFI_UNSUPPORTED - The SCSI channel does not support a target reset operation.
EFI_DEVICE_ERROR - A device error occurred while attempting to reset the SCSI device
specified by Target and Lun.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET) (
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
IN OUT UINT8 **Target
)
/*++
Routine Description:
Used to retrieve the list of legal Target IDs for SCSI devices on a SCSI channel. These can either
be the list SCSI devices that are actually present on the SCSI channel, or the list of legal Target IDs
for the SCSI channel. Regardless, the caller of this function must probe the Target ID returned to
see if a SCSI device is actually present at that location on the SCSI channel.
Arguments:
This - A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
Target - (TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel.
On output, a pointer to the Target ID (an array of
TARGET_MAX_BYTES) of the next SCSI device present on a SCSI
channel. An input value of 0xF(all bytes in the array are 0xF) in the
Target array retrieves the Target ID of the first SCSI device present on a
SCSI channel.
Returns:
EFI_SUCCESS - The Target ID of the next SCSI device on the SCSI
channel was returned in Target.
EFI_INVALID_PARAMETER - Target or Lun is NULL.
EFI_TIMEOUT - Target array is not all 0xF, and Target were not
returned on a previous call to GetNextTarget().
EFI_NOT_FOUND - There are no more SCSI devices on this SCSI channel.
--*/
;
struct _EFI_EXT_SCSI_PASS_THRU_PROTOCOL {
EFI_EXT_SCSI_PASS_THRU_MODE *Mode;
EFI_EXT_SCSI_PASS_THRU_PASSTHRU PassThru;
EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET_LUN GetNextTargetLun;
EFI_EXT_SCSI_PASS_THRU_BUILD_DEVICE_PATH BuildDevicePath;
EFI_EXT_SCSI_PASS_THRU_GET_TARGET_LUN GetTargetLun;
EFI_EXT_SCSI_PASS_THRU_RESET_CHANNEL ResetChannel;
EFI_EXT_SCSI_PASS_THRU_RESET_TARGET_LUN ResetTargetLun;
EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET GetNextTarget;
};
extern EFI_GUID gEfiExtScsiPassThruProtocolGuid;
#endif

View File

@@ -0,0 +1,30 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
SerialIo.c
Abstract:
Serial IO protocol as defined in the EFI 1.0 specification.
Abstraction of a basic serial device. Targeted at 16550 UART, but
could be much more generic.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (SerialIo)
EFI_GUID gEfiSerialIoProtocolGuid = EFI_SERIAL_IO_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiSerialIoProtocolGuid, "SerialIo Protocol", "EFI 1.0 Serial IO Protocol");

View File

@@ -0,0 +1,296 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
SerialIo.h
Abstract:
Serial IO protocol as defined in the EFI 1.0 specification.
Abstraction of a basic serial device. Targeted at 16550 UART, but
could be much more generic.
--*/
#ifndef _SERIAL_IO_H_
#define _SERIAL_IO_H_
#define EFI_SERIAL_IO_PROTOCOL_GUID \
{ \
0xBB25CF6F, 0xF1D4, 0x11D2, 0x9A, 0x0C, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0xFD \
}
EFI_FORWARD_DECLARATION (EFI_SERIAL_IO_PROTOCOL);
//
// Serial IO Data structures
//
typedef enum {
DefaultParity,
NoParity,
EvenParity,
OddParity,
MarkParity,
SpaceParity
} EFI_PARITY_TYPE;
typedef enum {
DefaultStopBits,
OneStopBit,
OneFiveStopBits,
TwoStopBits
} EFI_STOP_BITS_TYPE;
//
// define for Control bits, grouped by read only, write only, and read write
//
//
// Read Only
//
#define EFI_SERIAL_CLEAR_TO_SEND 0x00000010
#define EFI_SERIAL_DATA_SET_READY 0x00000020
#define EFI_SERIAL_RING_INDICATE 0x00000040
#define EFI_SERIAL_CARRIER_DETECT 0x00000080
#define EFI_SERIAL_INPUT_BUFFER_EMPTY 0x00000100
#define EFI_SERIAL_OUTPUT_BUFFER_EMPTY 0x00000200
//
// Write Only
//
#define EFI_SERIAL_REQUEST_TO_SEND 0x00000002
#define EFI_SERIAL_DATA_TERMINAL_READY 0x00000001
//
// Read Write
//
#define EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE 0x00001000
#define EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE 0x00002000
#define EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE 0x00004000
//
// Serial IO Member Functions
//
typedef
EFI_STATUS
(EFIAPI *EFI_SERIAL_RESET) (
IN EFI_SERIAL_IO_PROTOCOL * This
)
/*++
Routine Description:
Reset the serial device.
Arguments:
This - Protocol instance pointer.
Returns:
EFI_SUCCESS - The device was reset.
EFI_DEVICE_ERROR - The serial device could not be reset.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SERIAL_SET_ATTRIBUTES) (
IN EFI_SERIAL_IO_PROTOCOL * This,
IN UINT64 BaudRate,
IN UINT32 ReceiveFifoDepth,
IN UINT32 Timeout,
IN EFI_PARITY_TYPE Parity,
IN UINT8 DataBits,
IN EFI_STOP_BITS_TYPE StopBits
)
/*++
Routine Description:
Sets the baud rate, receive FIFO depth, transmit/receice time out, parity,
data buts, and stop bits on a serial device.
Arguments:
This - Protocol instance pointer.
BaudRate - The requested baud rate. A BaudRate value of 0 will use the the
device's default interface speed.
ReveiveFifoDepth - The requested depth of the FIFO on the receive side of the
serial interface. A ReceiveFifoDepth value of 0 will use
the device's dfault FIFO depth.
Timeout - The requested time out for a single character in microseconds.
This timeout applies to both the transmit and receive side of the
interface. A Timeout value of 0 will use the device's default time
out value.
Parity - The type of parity to use on this serial device. A Parity value of
DefaultParity will use the device's default parity value.
DataBits - The number of data bits to use on the serial device. A DataBits
vaule of 0 will use the device's default data bit setting.
StopBits - The number of stop bits to use on this serial device. A StopBits
value of DefaultStopBits will use the device's default number of
stop bits.
Returns:
EFI_SUCCESS - The device was reset.
EFI_DEVICE_ERROR - The serial device could not be reset.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SERIAL_SET_CONTROL_BITS) (
IN EFI_SERIAL_IO_PROTOCOL * This,
IN UINT32 Control
)
/*++
Routine Description:
Set the control bits on a serial device
Arguments:
This - Protocol instance pointer.
Control - Set the bits of Control that are settable.
Returns:
EFI_SUCCESS - The new control bits were set on the serial device.
EFI_UNSUPPORTED - The serial device does not support this operation.
EFI_DEVICE_ERROR - The serial device is not functioning correctly.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SERIAL_GET_CONTROL_BITS) (
IN EFI_SERIAL_IO_PROTOCOL * This,
OUT UINT32 *Control
)
/*++
Routine Description:
Retrieves the status of thecontrol bits on a serial device
Arguments:
This - Protocol instance pointer.
Control - A pointer to return the current Control signals from the serial
device.
Returns:
EFI_SUCCESS - The control bits were read from the serial device.
EFI_DEVICE_ERROR - The serial device is not functioning correctly.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SERIAL_WRITE) (
IN EFI_SERIAL_IO_PROTOCOL * This,
IN OUT UINTN *BufferSize,
IN VOID *Buffer
)
/*++
Routine Description:
Writes data to a serial device.
Arguments:
This - Protocol instance pointer.
BufferSize - On input, the size of the Buffer. On output, the amount of
data actually written.
Buffer - The buffer of data to write
Returns:
EFI_SUCCESS - The data was written.
EFI_DEVICE_ERROR - The device reported an error.
EFI_TIMEOUT - The data write was stopped due to a timeout.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SERIAL_READ) (
IN EFI_SERIAL_IO_PROTOCOL * This,
IN OUT UINTN *BufferSize,
OUT VOID *Buffer
)
/*++
Routine Description:
Writes data to a serial device.
Arguments:
This - Protocol instance pointer.
BufferSize - On input, the size of the Buffer. On output, the amount of
data returned in Buffer.
Buffer - The buffer to return the data into.
Returns:
EFI_SUCCESS - The data was read.
EFI_DEVICE_ERROR - The device reported an error.
EFI_TIMEOUT - The data write was stopped due to a timeout.
--*/
;
/*++
The data values in SERIAL_IO_MODE are read-only and are updated by the code
that produces the SERIAL_IO_PROTOCOL member functions.
ControlMask - A mask fo the Control bits that the device supports. The device
must always support the Input Buffer Empty control bit.
TimeOut - If applicable, the number of microseconds to wait before timing out
a Read or Write operation.
BaudRate - If applicable, the current baud rate setting of the device; otherwise,
baud rate has the value of zero to indicate that device runs at the
device's designed speed.
ReceiveFifoDepth - The number of characters the device will buffer on input
DataBits - The number of characters the device will buffer on input
Parity - If applicable, this is the EFI_PARITY_TYPE that is computed or
checked as each character is transmitted or reveived. If the device
does not support parity the value is the default parity value.
StopBits - If applicable, the EFI_STOP_BITS_TYPE number of stop bits per
character. If the device does not support stop bits the value is
the default stop bit values.
--*/
typedef struct {
UINT32 ControlMask;
//
// current Attributes
//
UINT32 Timeout;
UINT64 BaudRate;
UINT32 ReceiveFifoDepth;
UINT32 DataBits;
UINT32 Parity;
UINT32 StopBits;
} EFI_SERIAL_IO_MODE;
#define SERIAL_IO_INTERFACE_REVISION 0x00010000
typedef struct _EFI_SERIAL_IO_PROTOCOL {
UINT32 Revision;
EFI_SERIAL_RESET Reset;
EFI_SERIAL_SET_ATTRIBUTES SetAttributes;
EFI_SERIAL_SET_CONTROL_BITS SetControl;
EFI_SERIAL_GET_CONTROL_BITS GetControl;
EFI_SERIAL_WRITE Write;
EFI_SERIAL_READ Read;
EFI_SERIAL_IO_MODE *Mode;
} EFI_SERIAL_IO_PROTOCOL;
extern EFI_GUID gEfiSerialIoProtocolGuid;
#endif

View File

@@ -0,0 +1,88 @@
/*++
Copyright (c) 2005, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
ServiceBinding.h
Abstract:
UEFI Service Binding protocol definition.
--*/
#ifndef _EFI_SERVICE_BINDING_H_
#define _EFI_SERVICE_BINDING_H_
//
// Forward reference for pure ANSI compatability
//
EFI_FORWARD_DECLARATION (EFI_SERVICE_BINDING_PROTOCOL);
typedef
EFI_STATUS
(EFIAPI *EFI_SERVICE_BINDING_CREATE_CHILD) (
IN EFI_SERVICE_BINDING_PROTOCOL *This,
IN OUT EFI_HANDLE *ChildHandle
)
/*++
Routine Description:
Creates a child handle with a set of I/O services.
Arguments:
This - Protocol instance pointer.
ChildHandle - Pointer to the handle of the child to create. If it is NULL,
then a new handle is created. If it is not NULL, then the
I/O services are added to the existing child handle.
Returns:
EFI_SUCCES - The child handle was created with the I/O services.
EFI_OUT_OF_RESOURCES - There are not enough resources availabe to create
the child.
other - The child handle was not created.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SERVICE_BINDING_DESTROY_CHILD) (
IN struct _EFI_SERVICE_BINDING_PROTOCOL *This,
IN EFI_HANDLE ChildHandle
)
/*++
Routine Description:
Destroys a child handle with a set of I/O services.
Arguments:
This - Protocol instance pointer.
ChildHandle - Handle of the child to destroy.
Returns:
EFI_SUCCES - The I/O services were removed from the child handle.
EFI_UNSUPPORTED - The child handle does not support the I/O services
that are being removed.
EFI_INVALID_PARAMETER - Child handle is not a valid EFI Handle.
EFI_ACCESS_DENIED - The child handle could not be destroyed because its
I/O services are being used.
other - The child handle was not destroyed.
--*/
;
typedef struct _EFI_SERVICE_BINDING_PROTOCOL {
EFI_SERVICE_BINDING_CREATE_CHILD CreateChild;
EFI_SERVICE_BINDING_DESTROY_CHILD DestroyChild;
} EFI_SERVICE_BINDING_PROTOCOL;
#endif

View File

@@ -0,0 +1,33 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
SimpleFileSystem.c
Abstract:
SimpleFileSystem protocol as defined in the EFI 1.0 specification.
The SimpleFileSystem protocol is the programatic access to the FAT (12,16,32)
file system specified in EFI 1.0. It can also be used to abstract any
file system other than FAT.
EFI 1.0 can boot from any valid EFI image contained in a SimpleFileSystem
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (SimpleFileSystem)
EFI_GUID gEfiSimpleFileSystemProtocolGuid = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiSimpleFileSystemProtocolGuid, "Filesystem Protocol", "EFI 1.0 Simple FileSystem Protocol");

View File

@@ -0,0 +1,376 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
SimpleFileSystem.h
Abstract:
SimpleFileSystem protocol as defined in the EFI 1.0 specification.
The SimpleFileSystem protocol is the programatic access to the FAT (12,16,32)
file system specified in EFI 1.0. It can also be used to abstract a file
system other than FAT.
EFI 1.0 can boot from any valid EFI image contained in a SimpleFileSystem
--*/
#ifndef _SIMPLE_FILE_SYSTEM_H_
#define _SIMPLE_FILE_SYSTEM_H_
#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \
{ \
0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b \
}
EFI_FORWARD_DECLARATION (EFI_SIMPLE_FILE_SYSTEM_PROTOCOL);
EFI_FORWARD_DECLARATION (EFI_FILE);
typedef
EFI_STATUS
(EFIAPI *EFI_VOLUME_OPEN) (
IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL * This,
OUT EFI_FILE **Root
)
/*++
Routine Description:
Open the root directory on a volume.
Arguments:
This - Protocol instance pointer.
Root - Returns an Open file handle for the root directory
Returns:
EFI_SUCCESS - The device was opened.
EFI_UNSUPPORTED - This volume does not suppor the file system.
EFI_NO_MEDIA - The device has no media.
EFI_DEVICE_ERROR - The device reported an error.
EFI_VOLUME_CORRUPTED - The file system structures are corrupted
EFI_ACCESS_DENIED - The service denied access to the file
EFI_OUT_OF_RESOURCES - The volume was not opened due to lack of resources
--*/
;
#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION 0x00010000
typedef struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL {
UINT64 Revision;
EFI_VOLUME_OPEN OpenVolume;
} EFI_SIMPLE_FILE_SYSTEM_PROTOCOL;
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_OPEN) (
IN EFI_FILE * File,
OUT EFI_FILE **NewHandle,
IN CHAR16 *FileName,
IN UINT64 OpenMode,
IN UINT64 Attributes
)
/*++
Routine Description:
Open the root directory on a volume.
Arguments:
File - Protocol instance pointer.
NewHandle - Returns File Handle for FileName
FileName - Null terminated string. "\", ".", and ".." are supported
OpenMode - Open mode for file.
Attributes - Only used for EFI_FILE_MODE_CREATE
Returns:
EFI_SUCCESS - The device was opened.
EFI_NOT_FOUND - The specified file could not be found on the device
EFI_NO_MEDIA - The device has no media.
EFI_MEDIA_CHANGED - The media has changed
EFI_DEVICE_ERROR - The device reported an error.
EFI_VOLUME_CORRUPTED - The file system structures are corrupted
EFI_ACCESS_DENIED - The service denied access to the file
EFI_OUT_OF_RESOURCES - The volume was not opened due to lack of resources
EFI_VOLUME_FULL - The volume is full.
--*/
;
//
// Open modes
//
#define EFI_FILE_MODE_READ 0x0000000000000001
#define EFI_FILE_MODE_WRITE 0x0000000000000002
#define EFI_FILE_MODE_CREATE 0x8000000000000000
//
// File attributes
//
#define EFI_FILE_READ_ONLY 0x0000000000000001
#define EFI_FILE_HIDDEN 0x0000000000000002
#define EFI_FILE_SYSTEM 0x0000000000000004
#define EFI_FILE_RESERVED 0x0000000000000008
#define EFI_FILE_DIRECTORY 0x0000000000000010
#define EFI_FILE_ARCHIVE 0x0000000000000020
#define EFI_FILE_VALID_ATTR 0x0000000000000037
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_CLOSE) (
IN EFI_FILE * File
)
/*++
Routine Description:
Close the file handle
Arguments:
File - Protocol instance pointer.
Returns:
EFI_SUCCESS- The device was opened.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_DELETE) (
IN EFI_FILE * File
)
/*++
Routine Description:
Close and delete the file handle
Arguments:
File - Protocol instance pointer.
Returns:
EFI_SUCCESS - The device was opened.
EFI_WARN_DELETE_FAILURE - The handle was closed but the file was not
deleted
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_READ) (
IN EFI_FILE * File,
IN OUT UINTN *BufferSize,
OUT VOID *Buffer
)
/*++
Routine Description:
Read data from the file.
Arguments:
File - Protocol instance pointer.
BufferSize - On input size of buffer, on output amount of data in
buffer.
Buffer - The buffer in which data is read.
Returns:
EFI_SUCCESS - Data was read.
EFI_NO_MEDIA - The device has no media
EFI_DEVICE_ERROR - The device reported an error
EFI_VOLUME_CORRUPTED - The file system structures are corrupted
EFI_BUFFER_TO_SMALL - BufferSize is too small. BufferSize contains
required size
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_WRITE) (
IN EFI_FILE * File,
IN OUT UINTN *BufferSize,
IN VOID *Buffer
)
/*++
Routine Description:
Write data from to the file.
Arguments:
File - Protocol instance pointer.
BufferSize - On input size of buffer, on output amount of data in buffer.
Buffer - The buffer in which data to write.
Returns:
EFI_SUCCESS - Data was written.
EFI_UNSUPPORT - Writes to Open directory are not supported
EFI_NO_MEDIA - The device has no media
EFI_DEVICE_ERROR - The device reported an error
EFI_VOLUME_CORRUPTED - The file system structures are corrupted
EFI_WRITE_PROTECTED - The device is write protected
EFI_ACCESS_DENIED - The file was open for read only
EFI_VOLUME_FULL - The volume is full
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_SET_POSITION) (
IN EFI_FILE * File,
IN UINT64 Position
)
/*++
Routine Description:
Set a files current position
Arguments:
File - Protocol instance pointer.
Position - Byte possition from the start of the file
Returns:
EFI_SUCCESS - Data was written.
EFI_UNSUPPORTED - Seek request for non-zero is not valid on open.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_GET_POSITION) (
IN EFI_FILE * File,
OUT UINT64 *Position
)
/*++
Routine Description:
Get a files current position
Arguments:
File - Protocol instance pointer.
Position - Byte possition from the start of the file
Returns:
EFI_SUCCESS - Data was written.
EFI_UNSUPPORTED - Seek request for non-zero is not valid on open.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_GET_INFO) (
IN EFI_FILE * File,
IN EFI_GUID * InformationType,
IN OUT UINTN *BufferSize,
OUT VOID *Buffer
)
/*++
Routine Description:
Get information about a file
Arguments:
File - Protocol instance pointer.
InformationType - Type of info to return in Buffer
BufferSize - On input size of buffer, on output amount of data in
buffer.
Buffer - The buffer to return data.
Returns:
EFI_SUCCESS - Data was returned.
EFI_UNSUPPORT - InformationType is not supported
EFI_NO_MEDIA - The device has no media
EFI_DEVICE_ERROR - The device reported an error
EFI_VOLUME_CORRUPTED - The file system structures are corrupted
EFI_WRITE_PROTECTED - The device is write protected
EFI_ACCESS_DENIED - The file was open for read only
EFI_BUFFER_TOO_SMALL - Buffer was too small, required size returned in
BufferSize
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_SET_INFO) (
IN EFI_FILE * File,
IN EFI_GUID * InformationType,
IN UINTN BufferSize,
IN VOID *Buffer
)
/*++
Routine Description:
Set information about a file
Arguments:
File - Protocol instance pointer.
InformationType - Type of info in Buffer
BufferSize - Size of buffer.
Buffer - The data to write.
Returns:
EFI_SUCCESS - Data was returned.
EFI_UNSUPPORT - InformationType is not supported
EFI_NO_MEDIA - The device has no media
EFI_DEVICE_ERROR - The device reported an error
EFI_VOLUME_CORRUPTED - The file system structures are corrupted
EFI_WRITE_PROTECTED - The device is write protected
EFI_ACCESS_DENIED - The file was open for read only
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_FLUSH) (
IN EFI_FILE * File
)
/*++
Routine Description:
Flush data back for the file handle
Arguments:
File - Protocol instance pointer.
Returns:
EFI_SUCCESS - Data was written.
EFI_UNSUPPORT - Writes to Open directory are not supported
EFI_NO_MEDIA - The device has no media
EFI_DEVICE_ERROR - The device reported an error
EFI_VOLUME_CORRUPTED - The file system structures are corrupted
EFI_WRITE_PROTECTED - The device is write protected
EFI_ACCESS_DENIED - The file was open for read only
EFI_VOLUME_FULL - The volume is full
--*/
;
#define EFI_FILE_HANDLE_REVISION 0x00010000
typedef struct _EFI_FILE {
UINT64 Revision;
EFI_FILE_OPEN Open;
EFI_FILE_CLOSE Close;
EFI_FILE_DELETE Delete;
EFI_FILE_READ Read;
EFI_FILE_WRITE Write;
EFI_FILE_GET_POSITION GetPosition;
EFI_FILE_SET_POSITION SetPosition;
EFI_FILE_GET_INFO GetInfo;
EFI_FILE_SET_INFO SetInfo;
EFI_FILE_FLUSH Flush;
}
EFI_FILE, *EFI_FILE_HANDLE;
extern EFI_GUID gEfiSimpleFileSystemProtocolGuid;
#endif

View File

@@ -0,0 +1,34 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
SimpleNetwork.c
Abstract:
Simple Network protocol as defined in the EFI 1.0 specification.
Basic network device abstraction.
Rx - Received
Tx - Transmit
MCast - MultiCast
...
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (SimpleNetwork)
EFI_GUID gEfiSimpleNetworkProtocolGuid = EFI_SIMPLE_NETWORK_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiSimpleNetworkProtocolGuid, "Simple Network Protocol", "EFI 1.0 Simple Network Protocol");

View File

@@ -0,0 +1,639 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
SimpleNetwork.h
Abstract:
Simple Network protocol as defined in the EFI 1.0 specification.
Basic network device abstraction.
Rx - Received
Tx - Transmit
MCast - MultiCast
...
--*/
#ifndef _SIMPLE_NETWORK_H_
#define _SIMPLE_NETWORK_H_
#define EFI_SIMPLE_NETWORK_PROTOCOL_GUID \
{ \
0xA19832B9, 0xAC25, 0x11D3, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D \
}
EFI_FORWARD_DECLARATION (EFI_SIMPLE_NETWORK_PROTOCOL);
//
// Simple Network Protocol data structures
//
typedef struct {
//
// Total number of frames received. Includes frames with errors and
// dropped frames.
//
UINT64 RxTotalFrames;
//
// Number of valid frames received and copied into receive buffers.
//
UINT64 RxGoodFrames;
//
// Number of frames below the minimum length for the media.
// This would be <64 for ethernet.
//
UINT64 RxUndersizeFrames;
//
// Number of frames longer than the maxminum length for the
// media. This would be >1500 for ethernet.
//
UINT64 RxOversizeFrames;
//
// Valid frames that were dropped because receive buffers were full.
//
UINT64 RxDroppedFrames;
//
// Number of valid unicast frames received and not dropped.
//
UINT64 RxUnicastFrames;
//
// Number of valid broadcast frames received and not dropped.
//
UINT64 RxBroadcastFrames;
//
// Number of valid mutlicast frames received and not dropped.
//
UINT64 RxMulticastFrames;
//
// Number of frames w/ CRC or alignment errors.
//
UINT64 RxCrcErrorFrames;
//
// Total number of bytes received. Includes frames with errors
// and dropped frames.
//
UINT64 RxTotalBytes;
//
// Transmit statistics.
//
UINT64 TxTotalFrames;
UINT64 TxGoodFrames;
UINT64 TxUndersizeFrames;
UINT64 TxOversizeFrames;
UINT64 TxDroppedFrames;
UINT64 TxUnicastFrames;
UINT64 TxBroadcastFrames;
UINT64 TxMulticastFrames;
UINT64 TxCrcErrorFrames;
UINT64 TxTotalBytes;
//
// Number of collisions detection on this subnet.
//
UINT64 Collisions;
//
// Number of frames destined for unsupported protocol.
//
UINT64 UnsupportedProtocol;
} EFI_NETWORK_STATISTICS;
typedef enum {
EfiSimpleNetworkStopped,
EfiSimpleNetworkStarted,
EfiSimpleNetworkInitialized,
EfiSimpleNetworkMaxState
} EFI_SIMPLE_NETWORK_STATE;
#define EFI_SIMPLE_NETWORK_RECEIVE_UNICAST 0x01
#define EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST 0x02
#define EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST 0x04
#define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS 0x08
#define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST 0x10
#define EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT 0x01
#define EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT 0x02
#define EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT 0x04
#define EFI_SIMPLE_NETWORK_SOFTWARE_INTERRUPT 0x08
#define MAX_MCAST_FILTER_CNT 16
typedef struct {
UINT32 State;
UINT32 HwAddressSize;
UINT32 MediaHeaderSize;
UINT32 MaxPacketSize;
UINT32 NvRamSize;
UINT32 NvRamAccessSize;
UINT32 ReceiveFilterMask;
UINT32 ReceiveFilterSetting;
UINT32 MaxMCastFilterCount;
UINT32 MCastFilterCount;
EFI_MAC_ADDRESS MCastFilter[MAX_MCAST_FILTER_CNT];
EFI_MAC_ADDRESS CurrentAddress;
EFI_MAC_ADDRESS BroadcastAddress;
EFI_MAC_ADDRESS PermanentAddress;
UINT8 IfType;
BOOLEAN MacAddressChangeable;
BOOLEAN MultipleTxSupported;
BOOLEAN MediaPresentSupported;
BOOLEAN MediaPresent;
} EFI_SIMPLE_NETWORK_MODE;
//
// Protocol Member Functions
//
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_START) (
IN EFI_SIMPLE_NETWORK_PROTOCOL * This
)
/*++
Routine Description:
Changes the state of a network interface from "stopped" to "started".
Arguments:
This - Protocol instance pointer.
Returns:
EFI_SUCCESS - The network interface was started.
EFI_ALREADY_STARTED - The network interface is already in the started state.
EFI_INVALID_PARAMETER - One or more of the parameters has an unsupported value.
EFI_DEVICE_ERROR - The command could not be sent to the network interface.
EFI_UNSUPPORTED - This function is not supported by the network interface.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_STOP) (
IN EFI_SIMPLE_NETWORK_PROTOCOL * This
)
/*++
Routine Description:
Changes the state of a network interface from "started" to "stopped".
Arguments:
This - Protocol instance pointer.
Returns:
EFI_SUCCESS - The network interface was stopped.
EFI_ALREADY_STARTED - The network interface is already in the stopped state.
EFI_INVALID_PARAMETER - One or more of the parameters has an unsupported value.
EFI_DEVICE_ERROR - The command could not be sent to the network interface.
EFI_UNSUPPORTED - This function is not supported by the network interface.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_INITIALIZE) (
IN EFI_SIMPLE_NETWORK_PROTOCOL * This,
IN UINTN ExtraRxBufferSize OPTIONAL,
IN UINTN ExtraTxBufferSize OPTIONAL
)
/*++
Routine Description:
Resets a network adapter and allocates the transmit and receive buffers
required by the network interface; optionally, also requests allocation
of additional transmit and receive buffers.
Arguments:
This - Protocol instance pointer.
ExtraRxBufferSize - The size, in bytes, of the extra receive buffer space
that the driver should allocate for the network interface.
Some network interfaces will not be able to use the extra
buffer, and the caller will not know if it is actually
being used.
ExtraTxBufferSize - The size, in bytes, of the extra transmit buffer space
that the driver should allocate for the network interface.
Some network interfaces will not be able to use the extra
buffer, and the caller will not know if it is actually
being used.
Returns:
EFI_SUCCESS - The network interface was initialized.
EFI_NOT_STARTED - The network interface has not been started
EFI_OUT_OF_RESOURCES - There was not enough memory for the transmit and
receive buffers. .
EFI_INVALID_PARAMETER - One or more of the parameters has an unsupported value.
EFI_DEVICE_ERROR - The command could not be sent to the network interface.
EFI_UNSUPPORTED - This function is not supported by the network interface.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_RESET) (
IN EFI_SIMPLE_NETWORK_PROTOCOL * This,
IN BOOLEAN ExtendedVerification
)
/*++
Routine Description:
Resets a network adapter and re-initializes it with the parameters that were
provided in the previous call to Initialize().
Arguments:
This - Protocol instance pointer.
ExtendedVerification - Indicates that the driver may perform a more
exhaustive verification operation of the device
during reset.
Returns:
EFI_SUCCESS - The network interface was reset.
EFI_NOT_STARTED - The network interface has not been started
EFI_INVALID_PARAMETER - One or more of the parameters has an unsupported value.
EFI_DEVICE_ERROR - The command could not be sent to the network interface.
EFI_UNSUPPORTED - This function is not supported by the network interface.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_SHUTDOWN) (
IN EFI_SIMPLE_NETWORK_PROTOCOL * This
)
/*++
Routine Description:
Resets a network adapter and leaves it in a state that is safe for
another driver to initialize.
Arguments:
This - Protocol instance pointer.
Returns:
EFI_SUCCESS - The network interface was shutdown.
EFI_NOT_STARTED - The network interface has not been started
EFI_INVALID_PARAMETER - One or more of the parameters has an unsupported value.
EFI_DEVICE_ERROR - The command could not be sent to the network interface.
EFI_UNSUPPORTED - This function is not supported by the network interface.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE_FILTERS) (
IN EFI_SIMPLE_NETWORK_PROTOCOL * This,
IN UINT32 Enable,
IN UINT32 Disable,
IN BOOLEAN ResetMCastFilter,
IN UINTN MCastFilterCnt OPTIONAL,
IN EFI_MAC_ADDRESS * MCastFilter OPTIONAL
)
/*++
Routine Description:
Manages the multicast receive filters of a network interface.
Arguments:
This - Protocol instance pointer.
Enable - A bit mask of receive filters to enable on the network interface.
Disable - A bit mask of receive filters to disable on the network interface.
ResetMCastFilter - Set to TRUE to reset the contents of the multicast receive
filters on the network interface to their default values.
McastFilterCnt - Number of multicast HW MAC addresses in the new
MCastFilter list. This value must be less than or equal to
the MCastFilterCnt field of EFI_SIMPLE_NETWORK_MODE. This
field is optional if ResetMCastFilter is TRUE.
MCastFilter - A pointer to a list of new multicast receive filter HW MAC
addresses. This list will replace any existing multicast
HW MAC address list. This field is optional if
ResetMCastFilter is TRUE.
Returns:
EFI_SUCCESS - The multicast receive filter list was updated.
EFI_NOT_STARTED - The network interface has not been started
EFI_INVALID_PARAMETER - One or more of the parameters has an unsupported value.
EFI_DEVICE_ERROR - The command could not be sent to the network interface.
EFI_UNSUPPORTED - This function is not supported by the network interface.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_STATION_ADDRESS) (
IN EFI_SIMPLE_NETWORK_PROTOCOL * This,
IN BOOLEAN Reset,
IN EFI_MAC_ADDRESS * New OPTIONAL
)
/*++
Routine Description:
Modifies or resets the current station address, if supported.
Arguments:
This - Protocol instance pointer.
Reset - Flag used to reset the station address to the network interfaces
permanent address.
New - New station address to be used for the network interface.
Returns:
EFI_SUCCESS - The network interfaces station address was updated.
EFI_NOT_STARTED - The network interface has not been started
EFI_INVALID_PARAMETER - One or more of the parameters has an unsupported value.
EFI_DEVICE_ERROR - The command could not be sent to the network interface.
EFI_UNSUPPORTED - This function is not supported by the network interface.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_STATISTICS) (
IN EFI_SIMPLE_NETWORK_PROTOCOL * This,
IN BOOLEAN Reset,
IN OUT UINTN *StatisticsSize OPTIONAL,
OUT EFI_NETWORK_STATISTICS * StatisticsTable OPTIONAL
)
/*++
Routine Description:
Resets or collects the statistics on a network interface.
Arguments:
This - Protocol instance pointer.
Reset - Set to TRUE to reset the statistics for the network interface.
StatisticsSize - On input the size, in bytes, of StatisticsTable. On
output the size, in bytes, of the resulting table of
statistics.
StatisticsTable - A pointer to the EFI_NETWORK_STATISTICS structure that
contains the statistics.
Returns:
EFI_SUCCESS - The statistics were collected from the network interface.
EFI_NOT_STARTED - The network interface has not been started.
EFI_BUFFER_TOO_SMALL - The Statistics buffer was too small. The current buffer
size needed to hold the statistics is returned in
StatisticsSize.
EFI_INVALID_PARAMETER - One or more of the parameters has an unsupported value.
EFI_DEVICE_ERROR - The command could not be sent to the network interface.
EFI_UNSUPPORTED - This function is not supported by the network interface.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC) (
IN EFI_SIMPLE_NETWORK_PROTOCOL * This,
IN BOOLEAN IPv6,
IN EFI_IP_ADDRESS * IP,
OUT EFI_MAC_ADDRESS * MAC
)
/*++
Routine Description:
Converts a multicast IP address to a multicast HW MAC address.
Arguments:
This - Protocol instance pointer.
IPv6 - Set to TRUE if the multicast IP address is IPv6 [RFC 2460]. Set
to FALSE if the multicast IP address is IPv4 [RFC 791].
IP - The multicast IP address that is to be converted to a multicast
HW MAC address.
MAC - The multicast HW MAC address that is to be generated from IP.
Returns:
EFI_SUCCESS - The multicast IP address was mapped to the multicast
HW MAC address.
EFI_NOT_STARTED - The network interface has not been started.
EFI_BUFFER_TOO_SMALL - The Statistics buffer was too small. The current buffer
size needed to hold the statistics is returned in
StatisticsSize.
EFI_INVALID_PARAMETER - One or more of the parameters has an unsupported value.
EFI_DEVICE_ERROR - The command could not be sent to the network interface.
EFI_UNSUPPORTED - This function is not supported by the network interface.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_NVDATA) (
IN EFI_SIMPLE_NETWORK_PROTOCOL * This,
IN BOOLEAN ReadWrite,
IN UINTN Offset,
IN UINTN BufferSize,
IN OUT VOID *Buffer
)
/*++
Routine Description:
Performs read and write operations on the NVRAM device attached to a
network interface.
Arguments:
This - Protocol instance pointer.
ReadWrite - TRUE for read operations, FALSE for write operations.
Offset - Byte offset in the NVRAM device at which to start the read or
write operation. This must be a multiple of NvRamAccessSize and
less than NvRamSize.
BufferSize - The number of bytes to read or write from the NVRAM device.
This must also be a multiple of NvramAccessSize.
Buffer - A pointer to the data buffer.
Returns:
EFI_SUCCESS - The NVRAM access was performed.
EFI_NOT_STARTED - The network interface has not been started.
EFI_INVALID_PARAMETER - One or more of the parameters has an unsupported value.
EFI_DEVICE_ERROR - The command could not be sent to the network interface.
EFI_UNSUPPORTED - This function is not supported by the network interface.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_GET_STATUS) (
IN EFI_SIMPLE_NETWORK_PROTOCOL * This,
OUT UINT32 *InterruptStatus OPTIONAL,
OUT VOID **TxBuf OPTIONAL
)
/*++
Routine Description:
Reads the current interrupt status and recycled transmit buffer status from
a network interface.
Arguments:
This - Protocol instance pointer.
InterruptStatus - A pointer to the bit mask of the currently active interrupts
If this is NULL, the interrupt status will not be read from
the device. If this is not NULL, the interrupt status will
be read from the device. When the interrupt status is read,
it will also be cleared. Clearing the transmit interrupt
does not empty the recycled transmit buffer array.
TxBuf - Recycled transmit buffer address. The network interface will
not transmit if its internal recycled transmit buffer array
is full. Reading the transmit buffer does not clear the
transmit interrupt. If this is NULL, then the transmit buffer
status will not be read. If there are no transmit buffers to
recycle and TxBuf is not NULL, * TxBuf will be set to NULL.
Returns:
EFI_SUCCESS - The status of the network interface was retrieved.
EFI_NOT_STARTED - The network interface has not been started.
EFI_INVALID_PARAMETER - One or more of the parameters has an unsupported value.
EFI_DEVICE_ERROR - The command could not be sent to the network interface.
EFI_UNSUPPORTED - This function is not supported by the network interface.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_TRANSMIT) (
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
)
/*++
Routine Description:
Places a packet in the transmit queue of a network interface.
Arguments:
This - Protocol instance pointer.
HeaderSize - The size, in bytes, of the media header to be filled in by
the Transmit() function. If HeaderSize is non-zero, then it
must be equal to This->Mode->MediaHeaderSize and the DestAddr
and Protocol parameters must not be NULL.
BufferSize - The size, in bytes, of the entire packet (media header and
data) to be transmitted through the network interface.
Buffer - A pointer to the packet (media header followed by data) to be
transmitted. This parameter cannot be NULL. If HeaderSize is zero,
then the media header in Buffer must already be filled in by the
caller. If HeaderSize is non-zero, then the media header will be
filled in by the Transmit() function.
SrcAddr - The source HW MAC address. If HeaderSize is zero, then this parameter
is ignored. If HeaderSize is non-zero and SrcAddr is NULL, then
This->Mode->CurrentAddress is used for the source HW MAC address.
DsetAddr - The destination HW MAC address. If HeaderSize is zero, then this
parameter is ignored.
Protocol - The type of header to build. If HeaderSize is zero, then this
parameter is ignored. See RFC 1700, section "Ether Types", for
examples.
Returns:
EFI_SUCCESS - The packet was placed on the transmit queue.
EFI_NOT_STARTED - The network interface has not been started.
EFI_NOT_READY - The network interface is too busy to accept this transmit
request.
EFI_BUFFER_TOO_SMALL - The BufferSize parameter is too small.
EFI_INVALID_PARAMETER - One or more of the parameters has an unsupported value.
EFI_DEVICE_ERROR - The command could not be sent to the network interface.
EFI_UNSUPPORTED - This function is not supported by the network interface.
--*/
;
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE) (
IN EFI_SIMPLE_NETWORK_PROTOCOL * This,
OUT UINTN *HeaderSize OPTIONAL,
IN OUT UINTN *BufferSize,
OUT VOID *Buffer,
OUT EFI_MAC_ADDRESS * SrcAddr OPTIONAL,
OUT EFI_MAC_ADDRESS * DestAddr OPTIONAL,
OUT UINT16 *Protocol OPTIONAL
)
/*++
Routine Description:
Receives a packet from a network interface.
Arguments:
This - Protocol instance pointer.
HeaderSize - The size, in bytes, of the media header received on the network
interface. If this parameter is NULL, then the media header size
will not be returned.
BufferSize - On entry, the size, in bytes, of Buffer. On exit, the size, in
bytes, of the packet that was received on the network interface.
Buffer - A pointer to the data buffer to receive both the media header and
the data.
SrcAddr - The source HW MAC address. If this parameter is NULL, the
HW MAC source address will not be extracted from the media
header.
DsetAddr - The destination HW MAC address. If this parameter is NULL,
the HW MAC destination address will not be extracted from the
media header.
Protocol - The media header type. If this parameter is NULL, then the
protocol will not be extracted from the media header. See
RFC 1700 section "Ether Types" for examples.
Returns:
EFI_SUCCESS - The received data was stored in Buffer, and BufferSize has
been updated to the number of bytes received.
EFI_NOT_STARTED - The network interface has not been started.
EFI_NOT_READY - The network interface is too busy to accept this transmit
request.
EFI_BUFFER_TOO_SMALL - The BufferSize parameter is too small.
EFI_INVALID_PARAMETER - One or more of the parameters has an unsupported value.
EFI_DEVICE_ERROR - The command could not be sent to the network interface.
EFI_UNSUPPORTED - This function is not supported by the network interface.
--*/
;
#define EFI_SIMPLE_NETWORK_PROTOCOL_REVISION 0x00010000
typedef struct _EFI_SIMPLE_NETWORK_PROTOCOL {
UINT64 Revision;
EFI_SIMPLE_NETWORK_START Start;
EFI_SIMPLE_NETWORK_STOP Stop;
EFI_SIMPLE_NETWORK_INITIALIZE Initialize;
EFI_SIMPLE_NETWORK_RESET Reset;
EFI_SIMPLE_NETWORK_SHUTDOWN Shutdown;
EFI_SIMPLE_NETWORK_RECEIVE_FILTERS ReceiveFilters;
EFI_SIMPLE_NETWORK_STATION_ADDRESS StationAddress;
EFI_SIMPLE_NETWORK_STATISTICS Statistics;
EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC MCastIpToMac;
EFI_SIMPLE_NETWORK_NVDATA NvData;
EFI_SIMPLE_NETWORK_GET_STATUS GetStatus;
EFI_SIMPLE_NETWORK_TRANSMIT Transmit;
EFI_SIMPLE_NETWORK_RECEIVE Receive;
EFI_EVENT WaitForPacket;
EFI_SIMPLE_NETWORK_MODE *Mode;
} EFI_SIMPLE_NETWORK_PROTOCOL;
extern EFI_GUID gEfiSimpleNetworkProtocolGuid;
#endif

View File

@@ -0,0 +1,29 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
SimplePointer.c
Abstract:
Simple Pointer protocol from the EFI 1.1 specification.
Abstraction of a very simple pointer device like a mice or trackballs.
--*/
#include "EfiSpec.h"
#include EFI_PROTOCOL_DEFINITION (SimplePointer)
EFI_GUID gEfiSimplePointerProtocolGuid = EFI_SIMPLE_POINTER_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiSimplePointerProtocolGuid, "Simple Pointer Protocol", "EFI 1.1 Simple Pointer Protocol");

View File

@@ -0,0 +1,76 @@
/*++
Copyright (c) 2004, Intel Corporation
All rights reserved. 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
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
SimplePointer.h
Abstract:
Simple Pointer protocol from the EFI 1.1 specification.
Abstraction of a very simple pointer device like a mice or tracekballs.
--*/
#ifndef _SIMPLE_POINTER_H_
#define _SIMPLE_POINTER_H_
#define EFI_SIMPLE_POINTER_PROTOCOL_GUID \
{ \
0x31878c87, 0xb75, 0x11d5, 0x9a, 0x4f, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d \
}
EFI_FORWARD_DECLARATION (EFI_SIMPLE_POINTER_PROTOCOL);
//
// Data structures
//
typedef struct {
INT32 RelativeMovementX;
INT32 RelativeMovementY;
INT32 RelativeMovementZ;
BOOLEAN LeftButton;
BOOLEAN RightButton;
} EFI_SIMPLE_POINTER_STATE;
typedef struct {
UINT64 ResolutionX;
UINT64 ResolutionY;
UINT64 ResolutionZ;
BOOLEAN LeftButton;
BOOLEAN RightButton;
} EFI_SIMPLE_POINTER_MODE;
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_POINTER_RESET) (
IN EFI_SIMPLE_POINTER_PROTOCOL * This,
IN BOOLEAN ExtendedVerification
);
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_POINTER_GET_STATE) (
IN EFI_SIMPLE_POINTER_PROTOCOL * This,
IN OUT EFI_SIMPLE_POINTER_STATE * State
);
typedef struct _EFI_SIMPLE_POINTER_PROTOCOL {
EFI_SIMPLE_POINTER_RESET Reset;
EFI_SIMPLE_POINTER_GET_STATE GetState;
EFI_EVENT WaitForInput;
EFI_SIMPLE_POINTER_MODE *Mode;
} EFI_SIMPLE_POINTER_PROTOCOL;
extern EFI_GUID gEfiSimplePointerProtocolGuid;
#endif

Some files were not shown because too many files have changed in this diff Show More