Remove the dependence to MdePkg

1. add Include folder which contain the *.h file which used by Tiano tools.
2. Change ${evn.WORKSPACE}/MdePkg to ${PACKAGE_DIR} in build.xml.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@509 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qouyang
2006-06-14 08:07:19 +00:00
parent 833b154119
commit 21b50a2779
190 changed files with 42773 additions and 142 deletions

View File

@ -0,0 +1,173 @@
/** @file
Definition of the ACPI Support protocol.
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: AcpiSupport.h
@par Revision Reference:
This is defined in the ACPI Specification 0.9.
**/
#ifndef _ACPI_SUPPORT_PROTOCOL_H_
#define _ACPI_SUPPORT_PROTOCOL_H_
typedef struct _EFI_ACPI_SUPPORT_PROTOCOL EFI_ACPI_SUPPORT_PROTOCOL;
//
// ACPI Support Protocol GUID
//
#define EFI_ACPI_SUPPORT_GUID \
{ \
0xdbff9d55, 0x89b7, 0x46da, {0xbd, 0xdf, 0x67, 0x7d, 0x3d, 0xc0, 0x24, 0x1d } \
}
//
// Protocol Data Definitions
//
//
// ACPI Version bitmap definition:
//
// EFI_ACPI_TABLE_VERSION_1_0B - ACPI Version 1.0b
// EFI_ACPI_TABLE_VERSION_2_0 - ACPI Version 2.0
// EFI_ACPI_TABLE_VERSION_3_0 - ACPI Version 3.0
// EFI_ACPI_TABLE_VERSION_NONE - No ACPI Versions. This might be used
// to create memory-based operation regions or other information
// that is not part of the ACPI "tree" but must still be found
// in ACPI memory space and/or managed by the core ACPI driver.
//
// Note that EFI provides discrete GUIDs for each version of ACPI
// that is supported. It is expected that each EFI GUIDed
// version of ACPI will also have a corresponding bitmap
// definition. This allows maintenance of separate ACPI trees
// for each distinctly different version of ACPI.
//
#define EFI_ACPI_TABLE_VERSION UINT32
#define EFI_ACPI_TABLE_VERSION_NONE (1 << 0)
#define EFI_ACPI_TABLE_VERSION_1_0B (1 << 1)
#define EFI_ACPI_TABLE_VERSION_2_0 (1 << 2)
#define EFI_ACPI_TABLE_VERSION_3_0 (1 << 3)
//
// Protocol Member Functions
//
/**
Returns a requested ACPI table.
@param This A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.
@param Index The zero-based index of the table to retrieve.
@param Table Pointer for returning the table buffer.
@param Version Updated with the ACPI versions to which this table belongs.
@param Handle Pointer for identifying the table.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_NOT_FOUND The requested index is too large and a table was not found.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_ACPI_GET_ACPI_TABLE) (
IN EFI_ACPI_SUPPORT_PROTOCOL *This,
IN INTN Index,
OUT VOID **Table,
OUT EFI_ACPI_TABLE_VERSION *Version,
OUT UINTN *Handle
);
/**
Used to add, remove, or update ACPI tables.
@param This A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.
@param Table Pointer to the new table to add or update.
@param Checksum If TRUE, indicates that the checksum should be
calculated for this table.
@param Version Indicates to which version(s) of ACPI the table should be added.
@param Pointer to the handle of the table to remove or update.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER *Handle was zero and Table was NULL.
@retval EFI_ABORTED Could not complete the desired action.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_ACPI_SET_ACPI_TABLE) (
IN EFI_ACPI_SUPPORT_PROTOCOL *This,
IN VOID *Table OPTIONAL,
IN BOOLEAN Checksum,
IN EFI_ACPI_TABLE_VERSION Version,
IN OUT UINTN *Handle
);
/**
Causes one or more versions of the ACPI tables to be published in
the EFI system configuration tables.
@param This A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.
@param Version Indicates to which version(s) of ACPI that the table should be published.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_ABORTED An error occurred and the function could not complete successfully.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_ACPI_PUBLISH_TABLES) (
IN EFI_ACPI_SUPPORT_PROTOCOL *This,
IN EFI_ACPI_TABLE_VERSION Version
);
//
// ACPI Support Protocol
//
/**
@par Protocol Description:
This protocol provides some basic services to support publishing ACPI system
tables. The services handle many of the more mundane tasks that are required
to publish a set of tables.
@param GetAcpiTable
Returns a table specified by an index if it exists.
@param SetAcpiTable
Adds, removes, or updates ACPI tables
@param PublishTables
Publishes the ACPI tables.
**/
struct _EFI_ACPI_SUPPORT_PROTOCOL {
EFI_ACPI_GET_ACPI_TABLE GetAcpiTable;
EFI_ACPI_SET_ACPI_TABLE SetAcpiTable;
EFI_ACPI_PUBLISH_TABLES PublishTables;
};
//
// Extern the GUID for protocol users.
//
extern EFI_GUID gEfiAcpiSupportProtocolGuid;
#endif

View File

@ -0,0 +1,259 @@
/** @file
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
**/
#ifndef __EFI_ARP_PROTOCOL_H__
#define __EFI_ARP_PROTOCOL_H__
#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 } \
}
typedef struct _EFI_ARP_PROTOCOL EFI_ARP_PROTOCOL;
typedef struct {
UINT32 Size;
BOOLEAN DenyFlag;
BOOLEAN StaticFlag;
UINT16 HwAddressType;
UINT16 SwAddressType;
UINT8 HwAddressLength;
UINT8 SwAddressLength;
} EFI_ARP_FIND_DATA;
typedef struct {
UINT16 SwAddressType; // Host byte order
UINT8 SwAddressLength;
VOID *StationAddress; // Network byte order
UINT32 EntryTimeOut;
UINT32 RetryCount;
UINT32 RetryTimeOut;
} EFI_ARP_CONFIG_DATA;
/**
Assigns a station address (protocol type and network address) to this instance of the ARP cache.
@param This A pointer to the EFI_ARP_PROTOCOL instance.
@param ConfigData A pointer to the EFI_ARP_CONFIG_DATA structure.Buffer
@retval EFI_SUCCESS The new station address was successfully registered.
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
@retval EFI_ACCESS_DENIED The SwAddressType, SwAddressLength, or
StationAddress is different from the one that is already
registered.
@retval EFI_OUT_OF_RESOURCES Storage for the new StationAddress could not be allocated.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_ARP_CONFIGURE) (
IN EFI_ARP_PROTOCOL *This,
IN EFI_ARP_CONFIG_DATA *ConfigData OPTIONAL
)
;
/**
Inserts an entry to the ARP cache.
@param This A pointer to the EFI_ARP_PROTOCOL instance.
@param DenyFlag Set to TRUE if this entry is a <20><>deny<6E><79> entry. Set to FALSE if this
entry is a <20><>normal<61><6C> entry.
@param TargetSwAddress Pointer to a protocol address to add (or deny). May be set to
NULL if DenyFlag is TRUE.
@param TargetHwAddress Pointer to a hardware address to add (or deny). May be set to
NULL if DenyFlag is TRUE.
@param TimeoutValue Time in 100-ns units that this entry will remain in the ARP
cache. A value of zero means that the entry is permanent. A
nonzero value will override the one given by Configure() if
the entry to be added is dynamic entry.
@param Overwrite If TRUE, the matching cache entry will be overwritten with the
supplied parameters. If FALSE, EFI_ACCESS_DENIED
@retval EFI_SUCCESS The entry has been added or updated.
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
@retval EFI_OUT_OF_RESOURCES The new ARP cache entry could not be allocated.
@retval EFI_ACCESS_DENIED The ARP cache entry already exists and Overwrite is not true.
@retval EFI_NOT_STARTED The ARP driver instance has not been configured.
**/
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
)
;
/**
Locates one or more entries in the ARP cache.
@param This A pointer to the EFI_ARP_PROTOCOL instance.
@param BySwAddress Set to TRUE to look for matching software protocol addresses.
Set to FALSE to look for matching hardware protocol addresses.
@param AddressBuffer Pointer to address buffer. Set to NULL to match all addresses.
@param EntryLength The size of an entry in the entries buffer. To keep the
EFI_ARP_FIND_DATA structure properly aligned, this field
may be longer than sizeof(EFI_ARP_FIND_DATA) plus
the length of the software and hardware addresses.
@param EntryCount The number of ARP cache entries that are found by the specified criteria.
@param Entries Pointer to the buffer that will receive the ARP cache entries.
@param Refresh Set to TRUE to refresh the timeout value of the matching ARP
cache entry.
@retval EFI_SUCCESS The requested ARP cache entries were copied into the buffer.
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
@retval EFI_NOT_FOUND No matching entries were found.
@retval EFI_NOT_STARTED The ARP driver instance has not been configured.
**/
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
)
;
/**
Removes entries from the ARP cache.
@param This A pointer to the EFI_ARP_PROTOCOL instance.
@param BySwAddress Set to TRUE to delete matching protocol addresses.
Set to FALSE to delete matching hardware addresses.
@param AddressBuffer Pointer to the address buffer that is used as a key to look for the
cache entry. Set to NULL to delete all entries.
@retval EFI_SUCCESS The entry was removed from the ARP cache.
@retval EFI_INVALID_PARAMETER This is NULL.
@retval EFI_NOT_FOUND The specified deletion key was not found.
@retval EFI_NOT_STARTED The ARP driver instance has not been configured.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_ARP_DELETE) (
IN EFI_ARP_PROTOCOL *This,
IN BOOLEAN BySwAddress,
IN VOID *AddressBuffer OPTIONAL
)
;
/**
Removes all dynamic ARP cache entries that were added by this interface.
@param This A pointer to the EFI_ARP_PROTOCOL instance.
@retval EFI_SUCCESS The cache has been flushed.
@retval EFI_INVALID_PARAMETER This is NULL.
@retval EFI_NOT_FOUND There are no matching dynamic cache entries.
@retval EFI_NOT_STARTED The ARP driver instance has not been configured.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_ARP_FLUSH) (
IN EFI_ARP_PROTOCOL *This
)
;
/**
Starts an ARP request session.
@param This A pointer to the EFI_ARP_PROTOCOL instance.
@param TargetSwAddress Pointer to the protocol address to resolve.
@param ResolvedEvent Pointer to the event that will be signaled when the address is
resolved or some error occurs.
@param TargetHwAddress Pointer to the buffer for the resolved hardware address in
network byte order. The buffer must be large enough to hold the
resulting hardware address. TargetHwAddress must not be
NULL.
@retval EFI_SUCCESS The data was copied from the ARP cache into the
TargetHwAddress buffer.
@retval EFI_INVALID_PARAMETER This or TargetHwAddress is NULL.
@retval EFI_ACCESS_DENIED The requested address is not present in the normal ARP cache but
is present in the deny address list. Outgoing traffic to that address is
forbidden.
@retval EFI_NOT_STARTED The ARP driver instance has not been configured.
@retval EFI_NOT_READY The request has been started and is not finished.
@retval EFI_UNSUPPORTED The requested conversion is not supported in this implementation or
configuration.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_ARP_REQUEST) (
IN EFI_ARP_PROTOCOL *This,
IN VOID *TargetSwAddress OPTIONAL,
IN EFI_EVENT ResolvedEvent OPTIONAL,
OUT VOID *TargetHwAddress
)
;
/**
Cancels an ARP request session.
@param This A pointer to the EFI_ARP_PROTOCOL instance.
@param TargetSwAddress Pointer to the protocol address in previous request session.
@param ResolvedEvent Pointer to the event that is used as the notification event in
previous request session.
@retval EFI_SUCCESS The pending request session(s) is/are aborted and corresponding
event(s) is/are signaled.
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
@retval EFI_NOT_STARTED The ARP driver instance has not been configured.
@retval EFI_NOT_FOUND The request is not issued by
EFI_ARP_PROTOCOL.Request().
**/
typedef
EFI_STATUS
(EFIAPI *EFI_ARP_CANCEL) (
IN EFI_ARP_PROTOCOL *This,
IN VOID *TargetSwAddress OPTIONAL,
IN EFI_EVENT ResolvedEvent OPTIONAL
)
;
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;
};
extern EFI_GUID gEfiArpServiceBindingProtocolGuid;
extern EFI_GUID gEfiArpProtocolGuid;
#endif

View File

@ -0,0 +1,125 @@
/** @file
EFI_AUTHENTICATION_INFO_PROTOCOL as defined in UEFI 2.0.
This protocol is used on any device handle to obtain authentication information
associated with the physical or logical device.
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: AuthenticationInfo.h
**/
#ifndef __AUTHENTICATION_INFO_H__
#define __AUTHENTICATION_INFO_H__
#define EFI_AUTHENTICATION_INFO_PROTOCOL_GUID \
{ \
0x7671d9d0, 0x53db, 0x4173, {0xaa, 0x69, 0x23, 0x27, 0xf2, 0x1f, 0x0b, 0xc7 } \
}
#define EFI_AUTHENTICATION_CHAP_RADIUS_GUID \
{ \
0xd6062b50, 0x15ca, 0x11da, {0x92, 0x19, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } \
}
#define EFI_AUTHENTICATION_CHAP_LOCAL_GUID \
{ \
0xc280c73e, 0x15ca, 0x11da, {0xb0, 0xca, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } \
}
typedef struct _EFI_AUTHENTICATION_INFO_PROTOCOL EFI_AUTHENTICATION_INFO_PROTOCOL;
typedef struct {
EFI_GUID Guid;
UINT16 Length;
} AUTH_NODE_HEADER;
typedef struct {
AUTH_NODE_HEADER Header;
EFI_IPv6_ADDRESS RadiusIpAddr; // IPv4 or IPv6 address
UINT16 Reserved;
EFI_IPv6_ADDRESS NasIpAddr; // IPv4 or IPv6 address
UINT16 NasSecretLength;
UINT8 *NasSecret;
UINT16 ChapSecretLength;
UINT8 *ChapSecret;
UINT16 ChapNameLength;
UINT8 *ChapName;
} CHAP_RADIUS_AUTH_NODE;
typedef struct {
AUTH_NODE_HEADER Header;
UINT16 Reserved;
UINT16 UserSecretLength;
UINT8 *UserSecret;
UINT16 UserNameLength;
UINT8 *UserName;
UINT16 ChapSecretLength;
UINT8 *ChapSecret;
UINT16 ChapNameLength;
UINT8 *ChapName;
} CHAP_LOCAL_AUTH_NODE;
/**
Retrieves the Authentication information associated with a particular controller handle.
@param This Pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL
@param ControllerHandle Handle to the Controller
@param Buffer Pointer to the authentication information.
@retval EFI_SUCCESS Successfully retrieved Authentication information for the given ControllerHandle
@retval EFI_INVALID_PARAMETER No matching Authentication information found for the given ControllerHandle
@retval EFI_DEVICE_ERROR The authentication information could not be retrieved due to a
hardware error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_AUTHENTICATION_PROTOCOL_INFO_GET) (
IN EFI_AUTHENTICATION_INFO_PROTOCOL *This,
IN EFI_HANDLE *ControllerHandle,
OUT VOID *Buffer
)
;
/**
Set the Authentication information for a given controller handle.
@param This Pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL
@param ControllerHandle Handle to the Controller
@param Buffer Pointer to the authentication information.
@retval EFI_SUCCESS Successfully set Authentication information for the given ControllerHandle
@retval EFI_UNSUPPORTED If the platform policies do not allow setting of the Authentication
information.
@retval EFI_DEVICE_ERROR The authentication information could not be configured due to a
hardware error.
@retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the data.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_AUTHENTICATION_PROTOCOL_INFO_SET) (
IN EFI_AUTHENTICATION_INFO_PROTOCOL *This,
IN EFI_HANDLE *ControllerHandle,
IN VOID *Buffer
)
;
struct _EFI_AUTHENTICATION_INFO_PROTOCOL {
EFI_AUTHENTICATION_PROTOCOL_INFO_GET Get;
EFI_AUTHENTICATION_PROTOCOL_INFO_SET Set;
};
extern EFI_GUID gEfiAuthenticationInfoProtocolGuid;
extern EFI_GUID gEfiAuthenticationChapRadiusGuid;
extern EFI_GUID gEfiAuthenticationChapLocalGuid;
#endif

View File

@ -0,0 +1,418 @@
/** @file
This file defines the BIS protocol.
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: Bis.h
**/
#ifndef __BIS_H__
#define __BIS_H__
#define EFI_BIS_PROTOCOL_GUID \
{ \
0x0b64aab0, 0x5429, 0x11d4, {0x98, 0x16, 0x00, 0xa0, 0xc9, 0x1f, 0xad, 0xcf } \
}
typedef struct _EFI_BIS_PROTOCOL EFI_BIS_PROTOCOL;
//
// 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 {
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 {
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 {
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_GUID \
{ \
0xedd35e31, 0x7b9, 0x11d2, \
{ \
0x83, 0xa3, 0x0, 0xa0, 0xc9, 0x1f, 0xad, 0xcf \
} \
}
//
// Support old name for backward compatible
//
#define BOOT_OBJECT_AUTHORIZATION_PARMSET_GUIDVALUE \
BOOT_OBJECT_AUTHORIZATION_PARMSET_GUID
/**
Initializes the BIS service, checking that it is compatible with the version requested by the caller.
After this call, other BIS functions may be invoked.
@param This A pointer to the EFI_BIS_PROTOCOL object.
@param AppHandle The function writes the new BIS_APPLICATION_HANDLE if
successful, otherwise it writes NULL. The caller must eventually
destroy this handle by calling Shutdown().
@param InterfaceVersion On input, the caller supplies the major version number of the
interface version desired.
On output, both the major and minor
version numbers are updated with the major and minor version
numbers of the interface
@param TargetAddress Indicates a network or device address of the BIS platform to connect to.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_INCOMPATIBLE_VERSION The InterfaceVersion.Major requested by the
caller was not compatible with the interface version of the
@retval EFI_UNSUPPORTED This is a local-platform implementation and
TargetAddress.Data was not NULL, or
TargetAddress.Data was any other value that was not
supported by the implementation.
@retval EFI_OUT_OF_RESOURCES The function failed due to lack of memory or other resources.
@retval EFI_DEVICE_ERROR The function encountered an unexpected internal failure.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_BIS_INITIALIZE) (
IN EFI_BIS_PROTOCOL *This,
OUT BIS_APPLICATION_HANDLE *AppHandle,
IN OUT EFI_BIS_VERSION *InterfaceVersion,
IN EFI_BIS_DATA *TargetAddress
);
/**
Frees memory structures allocated and returned by other functions in the EFI_BIS protocol.
@param AppHandle An opaque handle that identifies the caller<65><72>s instance of initialization
of the BIS service.
@param ToFree An EFI_BIS_DATA* and associated memory block to be freed.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_NO_MAPPING The AppHandle parameter is not or is no longer a valid
application instance handle associated with the EFI_BIS protocol.
@retval EFI_OUT_OF_RESOURCES The function failed due to lack of memory or other resources.
@retval EFI_INVALID_PARAMETER The ToFree parameter is not or is no longer a memory resource
associated with this AppHandle.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_BIS_FREE) (
IN BIS_APPLICATION_HANDLE AppHandle,
IN EFI_BIS_DATA *ToFree
);
/**
Shuts down an application<6F><6E>s instance of the BIS service, invalidating the application handle. After
this call, other BIS functions may no longer be invoked using the application handle value.
@param AppHandle An opaque handle that identifies the caller<65><72>s instance of initialization
of the BIS service.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_NO_MAPPING The AppHandle parameter is not or is no longer a valid
application instance handle associated with the EFI_BIS protocol.
@retval EFI_OUT_OF_RESOURCES The function failed due to lack of memory or other resources.
@retval EFI_DEVICE_ERROR The function encountered an unexpected internal failure.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_BIS_SHUTDOWN) (
IN BIS_APPLICATION_HANDLE AppHandle
);
/**
Retrieves the certificate that has been configured as the identity of the organization designated as
the source of authorization for signatures of boot objects.
@param AppHandle An opaque handle that identifies the caller<65><72>s instance of initialization
of the BIS service.
@param Certificate The function writes an allocated EFI_BIS_DATA* containing the Boot
Object Authorization Certificate object.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_NO_MAPPING The AppHandle parameter is not or is no longer a valid
application instance handle associated with the EFI_BIS protocol.
@retval EFI_NOT_FOUND There is no Boot Object Authorization Certificate currently installed.
@retval EFI_OUT_OF_RESOURCES The function failed due to lack of memory or other resources.
@retval EFI_INVALID_PARAMETER The Certificate parameter supplied by the caller is NULL or
an invalid memory reference.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CERTIFICATE) (
IN BIS_APPLICATION_HANDLE AppHandle,
OUT EFI_BIS_DATA **Certificate
);
/**
Verifies the integrity and authorization of the indicated data object according to the
indicated credentials.
@param AppHandle An opaque handle that identifies the caller<65><72>s instance of initialization
of the BIS service.
@param Credentials A Signed Manifest containing verification information for the indicated
data object.
@param DataObject An in-memory copy of the raw data object to be verified.
@param IsVerified The function writes TRUE if the verification succeeded, otherwise
FALSE.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_NO_MAPPING The AppHandle parameter is not or is no longer a valid
application instance handle associated with the EFI_BIS protocol.
@retval EFI_OUT_OF_RESOURCES The function failed due to lack of memory or other resources.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_SECURITY_VIOLATION The signed manifest supplied as the Credentials parameter
was invalid (could not be parsed) or Platform-specific authorization failed, etc.
@retval EFI_DEVICE_ERROR An unexpected internal error occurred.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_BIS_VERIFY_BOOT_OBJECT) (
IN BIS_APPLICATION_HANDLE AppHandle,
IN EFI_BIS_DATA *Credentials,
IN EFI_BIS_DATA *DataObject,
OUT BOOLEAN *IsVerified
);
/**
Retrieves the current status of the Boot Authorization Check Flag.
@param AppHandle An opaque handle that identifies the caller<65><72>s instance of initialization
of the BIS service.
@param CheckIsRequired The function writes the value TRUE if a Boot Authorization Check is
currently required on this platform, otherwise the function writes
FALSE.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_NO_MAPPING The AppHandle parameter is not or is no longer a valid
application instance handle associated with the EFI_BIS protocol.
@retval EFI_OUT_OF_RESOURCES The function failed due to lack of memory or other resources.
@retval EFI_INVALID_PARAMETER The CheckIsRequired parameter supplied by the caller is
NULL or an invalid memory reference.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CHECKFLAG) (
IN BIS_APPLICATION_HANDLE AppHandle,
OUT BOOLEAN *CheckIsRequired
);
/**
Retrieves a unique token value to be included in the request credential for the next update of any
parameter in the Boot Object Authorization set
@param AppHandle An opaque handle that identifies the caller<65><72>s instance of initialization
of the BIS service.
@param UpdateToken The function writes an allocated EFI_BIS_DATA* containing the new
unique update token value.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_NO_MAPPING The AppHandle parameter is not or is no longer a valid
application instance handle associated with the EFI_BIS protocol.
@retval EFI_OUT_OF_RESOURCES The function failed due to lack of memory or other resources.
@retval EFI_INVALID_PARAMETER The UpdateToken parameter supplied by the caller is NULL or
an invalid memory reference.
@retval EFI_DEVICE_ERROR An unexpected internal error occurred.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_UPDATE_TOKEN) (
IN BIS_APPLICATION_HANDLE AppHandle,
OUT EFI_BIS_DATA **UpdateToken
);
/**
Updates one of the configurable parameters of the Boot Object Authorization set.
@param AppHandle An opaque handle that identifies the caller<65><72>s instance of initialization
of the BIS service.
@param RequestCredential This is a Signed Manifest with embedded attributes that carry the details
of the requested update.
@param NewUpdateToken The function writes an allocated EFI_BIS_DATA* containing the new
unique update token value.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_NO_MAPPING The AppHandle parameter is not or is no longer a valid
application instance handle associated with the EFI_BIS protocol.
@retval EFI_OUT_OF_RESOURCES The function failed due to lack of memory or other resources.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_SECURITY_VIOLATION The signed manifest supplied as the RequestCredential parameter
was invalid (could not be parsed) or Platform-specific authorization failed, etc.
@retval EFI_DEVICE_ERROR An unexpected internal error occurred.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_BIS_UPDATE_BOOT_OBJECT_AUTHORIZATION) (
IN BIS_APPLICATION_HANDLE AppHandle,
IN EFI_BIS_DATA *RequestCredential,
OUT EFI_BIS_DATA **NewUpdateToken
);
/**
Verifies the integrity and authorization of the indicated data object according to the indicated
credentials and authority certificate.
@param AppHandle An opaque handle that identifies the caller<65><72>s instance of initialization
of the BIS service.
@param Credentials A Signed Manifest containing verification information for the
indicated data object.
@param DataObject An in-memory copy of the raw data object to be verified.
@param SectionName An ASCII (not Unicode) string giving the section name in the
manifest holding the verification information (in other words,
hash value) that corresponds to DataObject.
@param AuthorityCertificate A digital certificate whose public key must match the signer<65><72>s
public key which is found in the credentials.
@param IsVerified The function writes TRUE if the verification was successful.
Otherwise, the function writes FALSE.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_NO_MAPPING The AppHandle parameter is not or is no longer a valid
application instance handle associated with the EFI_BIS protocol.
@retval EFI_OUT_OF_RESOURCES The function failed due to lack of memory or other resources.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_SECURITY_VIOLATION The Credentials.Data supplied by the caller is NULL,
or the AuthorityCertificate supplied by the caller was
invalid (could not be parsed),
or Platform-specific authorization failed, etc.
@retval EFI_DEVICE_ERROR An unexpected internal error occurred.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_BIS_VERIFY_OBJECT_WITH_CREDENTIAL) (
IN BIS_APPLICATION_HANDLE AppHandle,
IN EFI_BIS_DATA *Credentials,
IN EFI_BIS_DATA *DataObject,
IN EFI_BIS_DATA *SectionName,
IN EFI_BIS_DATA *AuthorityCertificate,
OUT BOOLEAN *IsVerified
);
/**
Retrieves a list of digital certificate identifier, digital signature algorithm, hash algorithm, and keylength
combinations that the platform supports.
@param AppHandle An opaque handle that identifies the caller<65><72>s instance of initialization
of the BIS service.
@param SignatureInfo The function writes an allocated EFI_BIS_DATA* containing the array
of EFI_BIS_SIGNATURE_INFO structures representing the supported
digital certificate identifier, algorithm, and key length combinations.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_NO_MAPPING The AppHandle parameter is not or is no longer a valid
application instance handle associated with the EFI_BIS protocol.
@retval EFI_OUT_OF_RESOURCES The function failed due to lack of memory or other resources.
@retval EFI_INVALID_PARAMETER The SignatureInfo parameter supplied by the caller is NULL
or an invalid memory reference.
@retval EFI_DEVICE_ERROR An unexpected internal error occurred.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_BIS_GET_SIGNATURE_INFO) (
IN BIS_APPLICATION_HANDLE AppHandle,
OUT EFI_BIS_DATA **SignatureInfo
);
struct _EFI_BIS_PROTOCOL {
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;
};
extern EFI_GUID gEfiBisProtocolGuid;
extern EFI_GUID gBootObjectAuthorizationParmsetGuid;
#endif

View File

@ -0,0 +1,173 @@
/** @file
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.
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: BlockIo.h
**/
#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
//
typedef struct _EFI_BLOCK_IO_PROTOCOL EFI_BLOCK_IO_PROTOCOL;
/**
Reset the Block Device.
@param This Protocol instance pointer.
@param ExtendedVerification Driver may perform diagnostics on reset.
@retval EFI_SUCCESS The device was reset.
@retval EFI_DEVICE_ERROR The device is not functioning properly and could
not be reset.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_BLOCK_RESET) (
IN EFI_BLOCK_IO_PROTOCOL *This,
IN BOOLEAN ExtendedVerification
)
;
/**
Read BufferSize bytes from Lba into Buffer.
@param This Protocol instance pointer.
@param MediaId Id of the media, changes every time the media is replaced.
@param Lba The starting Logical Block Address to read from
@param BufferSize Size of Buffer, must be a multiple of device block size.
@param Buffer Buffer containing read data
@retval EFI_SUCCESS The data was read correctly from the device.
@retval EFI_DEVICE_ERROR The device reported an error while performing the read.
@retval EFI_NO_MEDIA There is no media in the device.
@retval EFI_MEDIA_CHANGED The MediaId does not matched the current device.
@retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.
@retval EFI_INVALID_PARAMETER The read request contains device addresses that are not
valid for the device.
**/
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
)
;
/**
Write BufferSize bytes from Lba into Buffer.
@param This Protocol instance pointer.
@param MediaId Id of the media, changes every time the media is replaced.
@param Lba The starting Logical Block Address to read from
@param BufferSize Size of Buffer, must be a multiple of device block size.
@param Buffer Buffer containing read data
@retval EFI_SUCCESS The data was written correctly to the device.
@retval EFI_WRITE_PROTECTED The device can not be written to.
@retval EFI_DEVICE_ERROR The device reported an error while performing the write.
@retval EFI_NO_MEDIA There is no media in the device.
@retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.
@retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.
@retval EFI_INVALID_PARAMETER The write request contains a LBA that is 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
)
;
/**
Flush the Block Device.
@param This Protocol instance pointer.
@retval EFI_SUCCESS All outstanding data was written to the device
@retval EFI_DEVICE_ERROR The device reported an error while writting back the data
@retval EFI_NO_MEDIA There is no media in the device.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_BLOCK_FLUSH) (
IN EFI_BLOCK_IO_PROTOCOL *This
)
;
/**
Block IO read only mode data and updated only via members of BlockIO
**/
typedef struct {
UINT32 MediaId; ///< The curent media Id. If the media changes, this value is changed.
BOOLEAN RemovableMedia; ///< TRUE if the media is removable; otherwise, FALSE.
BOOLEAN 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.
**/
BOOLEAN LogicalPartition; /**< TRUE if LBA 0 is the first block of a partition; otherwise
FALSE. For media with only one partition this would be TRUE.
**/
BOOLEAN 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.
**/
BOOLEAN WriteCaching; ///< TRUE if the WriteBlock () function caches write data.
UINT32 BlockSize; /**< The intrinsic block size of the device. If the media changes, then
this field is updated.
**/
UINT32 IoAlign; ///< Supplies the alignment requirement for any buffer to read or write block(s).
EFI_LBA LastBlock; /**< The last logical block address on the device.
If the media changes, then this field is updated.
**/
} EFI_BLOCK_IO_MEDIA;
#define EFI_BLOCK_IO_PROTOCOL_REVISION 0x00010000
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;
};
extern EFI_GUID gEfiBlockIoProtocolGuid;
#endif

View File

@ -0,0 +1,110 @@
/** @file
Definition of the Boot Script Save protocol.
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: BootScriptSave.h
@par Revision Reference:
This protocol defined in the Boot Script Specification, Version 0.91.
**/
#ifndef _BOOT_SCRIPT_SAVE_PROTOCOL_H
#define _BOOT_SCRIPT_SAVE_PROTOCOL_H
//
// S3 Save Protocol GUID
//
#define EFI_BOOT_SCRIPT_SAVE_PROTOCOL_GUID \
{ \
0x470e1529, 0xb79e, 0x4e32, {0xa0, 0xfe, 0x6a, 0x15, 0x6d, 0x29, 0xf9, 0xb2 } \
}
typedef struct _EFI_BOOT_SCRIPT_SAVE_PROTOCOL EFI_BOOT_SCRIPT_SAVE_PROTOCOL;
//
// Protocol Member_Function
//
/**
Adds a record into a specified Framework boot script table.
@param This A pointer to the EFI_BOOT_SCRIPT_SAVE_PROTOCOL instance.
@param TableName Name of the script table.Currently, the only meaningful
value is EFI_ACPI_S3_RESUME_SCRIPT_TABLE.
@param OpCode The operation code (opcode) number.
@param ... Argument list that is specific to each opcode.
@retval EFI_SUCCESS The operation succeeded. A record was added into the specified script table.
@retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported.
@retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_BOOT_SCRIPT_WRITE) (
IN EFI_BOOT_SCRIPT_SAVE_PROTOCOL *This,
IN UINT16 TableName,
IN UINT16 OpCode,
...
);
/**
Closes the specified script table.
@param This A pointer to the EFI_BOOT_SCRIPT_SAVE_PROTOCOL instance.
@param TableName Name of the script table.
@param Address A pointer to the physical address where the table begins.
@retval EFI_SUCCESS The table was successfully returned.
@retval EFI_NOT_FOUND The specified table was not created previously.
@retval EFI_OUT_OF_RESOURCES Memory is insufficient to hold the reorganized boot script table.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_BOOT_SCRIPT_CLOSE_TABLE) (
IN EFI_BOOT_SCRIPT_SAVE_PROTOCOL *This,
IN UINT16 TableName,
OUT EFI_PHYSICAL_ADDRESS *Address
);
//
// S3 Save Protocol data structure
//
/**
@par Protocol Description:
The EFI_BOOT_SCRIPT_SAVE_PROTOCOL publishes the Framework boot script abstractions
to store or record various boot scripts into boot script tables.
@param Write
Writes various boot scripts to a boot script table.
@param CloseTable
Retrieves and closes a script table.
**/
struct _EFI_BOOT_SCRIPT_SAVE_PROTOCOL {
EFI_BOOT_SCRIPT_WRITE Write;
EFI_BOOT_SCRIPT_CLOSE_TABLE CloseTable;
};
extern EFI_GUID gEfiBootScriptSaveProtocolGuid;
#endif

View File

@ -0,0 +1,66 @@
/** @file
Bus Specific Driver Override protocol as defined in the EFI 1.1 specification.
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: BusSpecificDriverOverride.h
**/
#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 } \
}
typedef struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL;
//
// Prototypes for the Bus Specific Driver Override Protocol
//
/**
Uses a bus specific algorithm to retrieve a driver image handle for a controller.
@param This A pointer to the EFI_BUS_SPECIFIC_DRIVER_
OVERRIDE_PROTOCOL instance.
@param DriverImageHandle On input, a pointer to the previous driver image handle returned
by GetDriver(). On output, a pointer to the next driver
image handle. Passing in a NULL, will return the first driver
image handle.
@retval EFI_SUCCESS A bus specific override driver is returned in DriverImageHandle.
@retval EFI_NOT_FOUND The end of the list of override drivers was reached.
@retval EFI_INVALID_PARAMETER DriverImageHandle is not a handle that was returned on a
previous call to GetDriver().
**/
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
//
struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL {
EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER GetDriver;
};
extern EFI_GUID gEfiBusSpecificDriverOverrideProtocolGuid;
#endif

View File

@ -0,0 +1,123 @@
/** @file
EFI Component Name Protocol
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: ComponentName.h
**/
#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 } \
}
typedef struct _EFI_COMPONENT_NAME_PROTOCOL EFI_COMPONENT_NAME_PROTOCOL;
/**
Retrieves a Unicode string that is the user readable name of the EFI Driver.
@param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
@param 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.
@param 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.
@retval EFI_SUCCESS The Unicode string for the Driver specified by This
and the language specified by Language was returned
in DriverName.
@retval EFI_INVALID_PARAMETER Language is NULL.
@retval EFI_INVALID_PARAMETER DriverName is NULL.
@retval EFI_UNSUPPORTED The driver specified by This does not support the
language specified by Language.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_COMPONENT_NAME_GET_DRIVER_NAME) (
IN EFI_COMPONENT_NAME_PROTOCOL *This,
IN CHAR8 *Language,
OUT CHAR16 **DriverName
);
/**
Retrieves a Unicode string that is the user readable name of the controller
that is being managed by an EFI Driver.
@param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
@param 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.
@param 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.
@param 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.
@param 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.
@retval 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.
@retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
@retval EFI_INVALID_PARAMETER Language is NULL.
@retval EFI_INVALID_PARAMETER ControllerName is NULL.
@retval EFI_UNSUPPORTED The driver specified by This is not currently managing
the controller specified by ControllerHandle and
ChildHandle.
@retval 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
);
//
// Interface structure for the Component Name Protocol
//
struct _EFI_COMPONENT_NAME_PROTOCOL {
EFI_COMPONENT_NAME_GET_DRIVER_NAME GetDriverName;
EFI_COMPONENT_NAME_GET_CONTROLLER_NAME GetControllerName;
CHAR8 *SupportedLanguages;
};
extern EFI_GUID gEfiComponentNameProtocolGuid;
#endif

View File

@ -0,0 +1,131 @@
/** @file
This code abstracts the CPU IO Protocol
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: CpuIO.h
@par Revision Reference:
CPU IO Protocol is defined in Framework of EFI CPU IO Protocol Spec
Version 0.9
**/
#ifndef _CPUIO_H_
#define _CPUIO_H_
#define EFI_CPU_IO_PROTOCOL_GUID \
{ \
0xB0732526, 0x38C8, 0x4b40, {0x88, 0x77, 0x61, 0xC7, 0xB0, 0x6A, 0xAC, 0x45 } \
}
typedef struct _EFI_CPU_IO_PROTOCOL EFI_CPU_IO_PROTOCOL;
//
// *******************************************************
// EFI_CPU_IO_PROTOCOL_WIDTH
// *******************************************************
//
typedef enum {
EfiCpuIoWidthUint8,
EfiCpuIoWidthUint16,
EfiCpuIoWidthUint32,
EfiCpuIoWidthUint64,
EfiCpuIoWidthFifoUint8,
EfiCpuIoWidthFifoUint16,
EfiCpuIoWidthFifoUint32,
EfiCpuIoWidthFifoUint64,
EfiCpuIoWidthFillUint8,
EfiCpuIoWidthFillUint16,
EfiCpuIoWidthFillUint32,
EfiCpuIoWidthFillUint64,
EfiCpuIoWidthMaximum
} EFI_CPU_IO_PROTOCOL_WIDTH;
//
// *******************************************************
// EFI_CPU_IO_PROTOCOL_IO_MEM
// *******************************************************
//
/**
Enables a driver to access memory-mapped registers in the EFI system memory space.
Or, Enables a driver to access registers in the EFI CPU I/O space.
@param This A pointer to the EFI_CPU_IO_PROTOCOL instance.
@param Width Signifies the width of the I/O or Memory operation.
@param Address The base address of the I/O or Memoryoperation.
@param Count The number of I/O or Memory operations to perform.
The number of bytes moved is Width size * Count, starting at Address.
@param Buffer For read operations, the destination buffer to store the results.
For write operations, the source buffer from which to write data.
@retval EFI_SUCCESS The data was read from or written to the EFI system.
@retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.Or Buffer is NULL.
@retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width.
Or,The address range specified by Address, Width, and Count is not valid for this EFI system.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_CPU_IO_PROTOCOL_IO_MEM) (
IN EFI_CPU_IO_PROTOCOL *This,
IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
IN UINT64 Address,
IN UINTN Count,
IN OUT VOID *Buffer
);
//
// *******************************************************
// EFI_CPU_IO_PROTOCOL_ACCESS
// *******************************************************
//
typedef struct {
EFI_CPU_IO_PROTOCOL_IO_MEM Read;
EFI_CPU_IO_PROTOCOL_IO_MEM Write;
} EFI_CPU_IO_PROTOCOL_ACCESS;
//
// *******************************************************
// EFI_CPU_IO_PROTOCOL
// *******************************************************
//
/**
@par Protocol Description:
Provides the basic memory and I/O interfaces that are used to abstract
accesses to devices in a system.
@param Mem.Read
Allows reads from memory-mapped I/O space.
@param Mem.Write
Allows writes to memory-mapped I/O space.
@param Io.Read
Allows reads from I/O space.
@param Io.Write
Allows writes to I/O space.
**/
struct _EFI_CPU_IO_PROTOCOL {
EFI_CPU_IO_PROTOCOL_ACCESS Mem;
EFI_CPU_IO_PROTOCOL_ACCESS Io;
};
extern EFI_GUID gEfiCpuIoProtocolGuid;
#endif

View File

@ -0,0 +1,233 @@
/** @file
The data hub protocol is used both by agents wishing to log
data and those wishing to be made aware of all information that
has been logged.
For more information please look at Intel Platform Innovation
Framework for EFI Data Hub Specification.
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: DataHub.h
@par Revision Reference:
This protocol is defined in Framework for EFI Data Hub Specification.
Version 0.9.
**/
#ifndef __DATA_HUB_H__
#define __DATA_HUB_H__
#define EFI_DATA_HUB_PROTOCOL_GUID \
{ \
0xae80d021, 0x618e, 0x11d4, {0xbc, 0xd7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
}
//
// EFI generic Data Hub Header
//
// A Data Record is an EFI_DATA_RECORD_HEADER followed by RecordSize bytes of
// data. The format of the data is defined by the DataRecordGuid.
//
// If EFI_DATA_RECORD_HEADER is extended in the future the Version number must
// change and the HeaderSize will change if the definition of
// EFI_DATA_RECORD_HEADER is extended.
//
// The logger is responcible for initializing:
// Version, HeaderSize, RecordSize, DataRecordGuid, DataRecordClass
//
// The Data Hub driver is responcible for initializing:
// LogTime and LogMonotonicCount.
//
#define EFI_DATA_RECORD_HEADER_VERSION 0x0100
typedef struct {
UINT16 Version;
UINT16 HeaderSize;
UINT32 RecordSize;
EFI_GUID DataRecordGuid;
EFI_GUID ProducerName;
UINT64 DataRecordClass;
EFI_TIME LogTime;
UINT64 LogMonotonicCount;
} EFI_DATA_RECORD_HEADER;
//
// Definition of DataRecordClass. These are used to filter out class types
// at a very high level. The DataRecordGuid still defines the format of
// the data. See DateHub.doc for rules on what can and can not be a
// new DataRecordClass
//
#define EFI_DATA_RECORD_CLASS_DEBUG 0x0000000000000001
#define EFI_DATA_RECORD_CLASS_ERROR 0x0000000000000002
#define EFI_DATA_RECORD_CLASS_DATA 0x0000000000000004
#define EFI_DATA_RECORD_CLASS_PROGRESS_CODE 0x0000000000000008
//
// Forward reference for pure ANSI compatability
//
typedef struct _EFI_DATA_HUB_PROTOCOL EFI_DATA_HUB_PROTOCOL;
/**
Logs a data record to the system event log.
@param This The EFI_DATA_HUB_PROTOCOL instance.
@param description
@param DataRecordGuid A GUID that indicates the format of the data passed into RawData.
@param ProducerName A GUID that indicates the identity of the caller to this API.
@param DataRecordClass This class indicates the generic type of the data record.
@param RawData The DataRecordGuid-defined data to be logged.
@param RawDataSize The size in bytes of RawData.
@retval EFI_SUCCESS Data was logged.
@retval EFI_OUT_OF_RESOURCES Data was not logged due to lack of system resources.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_DATA_HUB_LOG_DATA) (
IN EFI_DATA_HUB_PROTOCOL *This,
IN EFI_GUID *DataRecordGuid,
IN EFI_GUID *ProducerName,
IN UINT64 DataRecordClass,
IN VOID *RawData,
IN UINT32 RawDataSize
);
/**
Allows the system data log to be searched.
@param This The EFI_DATA_HUB_PROTOCOL instance.
@param MonotonicCount On input, it specifies the Record to return.
An input of zero means to return the first record.
@param FilterDriver If FilterDriver is not passed in a MonotonicCount of zero,
it means to return the first data record. If FilterDriver is passed in,
then a MonotonicCount of zero means to return the first data not yet read
by FilterDriver.
@param Record Returns a dynamically allocated memory buffer with a data
record that matches MonotonicCount.
@retval EFI_SUCCESS Data was returned in Record.
@retval EFI_INVALID_PARAMETER FilterDriver was passed in but does not exist.
@retval EFI_NOT_FOUND MonotonicCount does not match any data record
in the system. If a MonotonicCount of zero was passed in, then no
data records exist in the system.
@retval EFI_OUT_OF_RESOURCES Record was not returned due to lack
of system resources.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_DATA_HUB_GET_NEXT_RECORD) (
IN EFI_DATA_HUB_PROTOCOL *This,
IN OUT UINT64 *MonotonicCount,
IN EFI_EVENT *FilterDriver OPTIONAL,
OUT EFI_DATA_RECORD_HEADER **Record
);
/**
Registers an event to be signaled every time a data record is logged in the system.
@param This The EFI_DATA_HUB_PROTOCOL instance.
@param FilterEvent The EFI_EVENT to signal whenever data that matches
FilterClass is logged in the system.
@param FilterTpl The maximum EFI_TPL at which FilterEvent can be signaled.
It is strongly recommended that you use the lowest EFI_TPL possible.
@param FilterClass FilterEvent will be signaled whenever a bit
in EFI_DATA_RECORD_HEADER.DataRecordClass is also set in FilterClass.
If FilterClass is zero, no class-based filtering will be performed.
@param FilterDataRecordGuid FilterEvent will be signaled whenever
FilterDataRecordGuid matches EFI_DATA_RECORD_HEADER.DataRecordGuid.
If FilterDataRecordGuid is NULL, then no GUID-based filtering will be performed.
@retval EFI_SUCCESS The filter driver event was registered
@retval EFI_ALREADY_STARTED FilterEvent was previously registered and cannot be registered again.
@retval EFI_OUT_OF_RESOURCES The filter driver event was not registered
due to lack of system resources.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_DATA_HUB_REGISTER_FILTER_DRIVER) (
IN EFI_DATA_HUB_PROTOCOL *This,
IN EFI_EVENT FilterEvent,
IN EFI_TPL FilterTpl,
IN UINT64 FilterClass,
IN EFI_GUID *FilterDataRecordGuid OPTIONAL
);
/**
Stops a filter driver from being notified when data records are logged.
@param This The EFI_DATA_HUB_PROTOCOL instance.
@param FilterEvent The EFI_EVENT to remove from the list of events to be
signaled every time errors are logged.
@retval EFI_SUCCESS The filter driver represented by FilterEvent was shut off.
@retval EFI_NOT_FOUND FilterEvent did not exist.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_DATA_HUB_UNREGISTER_FILTER_DRIVER) (
IN EFI_DATA_HUB_PROTOCOL *This,
IN EFI_EVENT FilterEvent
);
/**
@par Protocol Description:
This protocol is used to log information and register filter drivers
to receive data records.
@param LogData
Logs a data record.
@param GetNextDataRecord
Gets a data record. Used both to view the memory-based log and to
get information about which data records have been consumed by a filter driver.
@param RegisterFilterDriver
Allows the registration of an EFI event to act as a filter driver for all data records that are logged.
@param UnregisterFilterDriver
Used to remove a filter driver that was added with RegisterFilterDriver().
**/
struct _EFI_DATA_HUB_PROTOCOL {
EFI_DATA_HUB_LOG_DATA LogData;
EFI_DATA_HUB_GET_NEXT_RECORD GetNextRecord;
EFI_DATA_HUB_REGISTER_FILTER_DRIVER RegisterFilterDriver;
EFI_DATA_HUB_UNREGISTER_FILTER_DRIVER UnregisterFilterDriver;
};
extern EFI_GUID gEfiDataHubProtocolGuid;
#endif

View File

@ -0,0 +1,141 @@
/** @file
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: DebugPort.h
**/
#ifndef __DEBUG_PORT_H__
#define __DEBUG_PORT_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;
typedef struct _EFI_DEBUGPORT_PROTOCOL EFI_DEBUGPORT_PROTOCOL;
//
// DebugPort member functions
//
/**
Resets the debugport.
@param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
@retval EFI_SUCCESS The debugport device was reset and is in usable state.
@retval EFI_DEVICE_ERROR The debugport device could not be reset and is unusable.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_DEBUGPORT_RESET) (
IN EFI_DEBUGPORT_PROTOCOL *This
);
/**
Writes data to the debugport.
@param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
@param Timeout The number of microseconds to wait before timing out a write operation.
@param BufferSize On input, the requested number of bytes of data to write. On output, the
number of bytes of data actually written.
@param Buffer A pointer to a buffer containing the data to write.
@retval EFI_SUCCESS The data was written.
@retval EFI_DEVICE_ERROR The device reported an error.
@retval EFI_TIMEOUT The data write was stopped due to a timeout.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_DEBUGPORT_WRITE) (
IN EFI_DEBUGPORT_PROTOCOL *This,
IN UINT32 Timeout,
IN OUT UINTN *BufferSize,
IN VOID *Buffer
);
/**
Reads data from the debugport.
@param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
@param Timeout The number of microseconds to wait before timing out a read operation.
@param BufferSize On input, the requested number of bytes of data to read. On output, the
number of bytes of data actually number of bytes
of data read and returned in Buffer.
@param Buffer A pointer to a buffer into which the data read will be saved.
@retval EFI_SUCCESS The data was read.
@retval EFI_DEVICE_ERROR The device reported an error.
@retval EFI_TIMEOUT The operation was stopped due to a timeout or overrun.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_DEBUGPORT_READ) (
IN EFI_DEBUGPORT_PROTOCOL *This,
IN UINT32 Timeout,
IN OUT UINTN *BufferSize,
OUT VOID *Buffer
);
/**
Checks to see if any data is available to be read from the debugport device.
@param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
@retval EFI_SUCCESS At least one byte of data is available to be read.
@retval EFI_DEVICE_ERROR The debugport device is not functioning correctly.
@retval EFI_NOT_READY No data is available to be read.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_DEBUGPORT_POLL) (
IN EFI_DEBUGPORT_PROTOCOL *This
);
//
// DebugPort protocol definition
//
struct _EFI_DEBUGPORT_PROTOCOL {
EFI_DEBUGPORT_RESET Reset;
EFI_DEBUGPORT_WRITE Write;
EFI_DEBUGPORT_READ Read;
EFI_DEBUGPORT_POLL Poll;
};
//
// 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

View File

@ -0,0 +1,517 @@
/** @file
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.
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: DebugSupport.h
**/
#ifndef __DEBUG_SUPPORT_H__
#define __DEBUG_SUPPORT_H__
typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL EFI_DEBUG_SUPPORT_PROTOCOL;
//
// 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];
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_IA32;
typedef struct {
UINT32 ExceptionData;
EFI_FX_SAVE_STATE_IA32 FxSaveState;
UINT32 Dr0;
UINT32 Dr1;
UINT32 Dr2;
UINT32 Dr3;
UINT32 Dr6;
UINT32 Dr7;
UINT32 Cr0;
UINT32 Cr1;
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;
//
// 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_IPF *SystemContextIpf;
} EFI_SYSTEM_CONTEXT;
//
// DebugSupport callback function prototypes
//
/**
Registers and enables an exception callback function for the specified exception.
@param ExceptionType Exception types in EBC, IA-32, X64, or IPF
@param SystemContext Exception content.
**/
typedef
VOID
(*EFI_EXCEPTION_CALLBACK) (
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
);
/**
Registers and enables the on-target debug agent<6E><74>s periodic entry point.
@param SystemContext Exception content.
**/
typedef
VOID
(*EFI_PERIODIC_CALLBACK) (
IN OUT EFI_SYSTEM_CONTEXT SystemContext
);
//
// Machine type definition
//
typedef enum {
IsaIa32 = IMAGE_FILE_MACHINE_I386, // 0x014C
IsaX64 = IMAGE_FILE_MACHINE_X64, // 0x8664
IsaIpf = IMAGE_FILE_MACHINE_IA64, // 0x0200
IsaEbc = IMAGE_FILE_MACHINE_EBC // 0x0EBC
} EFI_INSTRUCTION_SET_ARCHITECTURE;
//
// DebugSupport member function definitions
//
/**
Returns the maximum value that may be used for the ProcessorIndex parameter in
RegisterPeriodicCallback() and RegisterExceptionCallback().
@param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.
@param MaxProcessorIndex Pointer to a caller-allocated UINTN in which the maximum supported
processor index is returned.
@retval EFI_SUCCESS The function completed successfully.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_GET_MAXIMUM_PROCESSOR_INDEX) (
IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
OUT UINTN *MaxProcessorIndex
);
/**
Registers a function to be called back periodically in interrupt context.
@param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.
@param ProcessorIndex Specifies which processor the callback function applies to.
@param PeriodicCallback A pointer to a function of type PERIODIC_CALLBACK that is the main
periodic entry point of the debug agent.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_ALREADY_STARTED Non-NULL PeriodicCallback parameter when a callback
function was previously registered.
@retval EFI_OUT_OF_RESOURCES System has insufficient memory resources to register new callback
function.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_REGISTER_PERIODIC_CALLBACK) (
IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
IN UINTN ProcessorIndex,
IN EFI_PERIODIC_CALLBACK PeriodicCallback
);
/**
Registers a function to be called when a given processor exception occurs.
@param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.
@param ProcessorIndex Specifies which processor the callback function applies to.
@param PeriodicCallback A pointer to a function of type EXCEPTION_CALLBACK that is called
when the processor exception specified by ExceptionType occurs.
@param ExceptionType Specifies which processor exception to hook.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_ALREADY_STARTED Non-NULL PeriodicCallback parameter when a callback
function was previously registered.
@retval EFI_OUT_OF_RESOURCES System has insufficient memory resources to register new callback
function.
**/
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
);
/**
Invalidates processor instruction cache for a memory range. Subsequent execution in this range
causes a fresh memory fetch to retrieve code to be executed.
@param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.
@param ProcessorIndex Specifies which processor<6F><72>s instruction cache is to be invalidated.
@param Start Specifies the physical base of the memory range to be invalidated.
@param Length Specifies the minimum number of bytes in the processor<6F><72>s instruction
cache to invalidate.
@retval EFI_SUCCESS The function completed successfully.
**/
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
//
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;
};
extern EFI_GUID gEfiDebugSupportProtocolGuid;
#endif

View File

@ -0,0 +1,121 @@
/** @file
The Decompress Protocol Interface
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: Decompress.h
**/
#ifndef __DECOMPRESS_H__
#define __DECOMPRESS_H__
#define EFI_DECOMPRESS_PROTOCOL_GUID \
{ \
0xd8117cfe, 0x94a6, 0x11d4, {0x9a, 0x3a, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}
typedef struct _EFI_DECOMPRESS_PROTOCOL EFI_DECOMPRESS_PROTOCOL;
/**
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.
@param This The protocol instance pointer
@param Source The source buffer containing the compressed data.
@param SourceSize The size, in bytes, of source buffer.
@param 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.
@param 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.
@retval EFI_SUCCESS The size of the uncompressed data was returned in DestinationSize
and the size of the scratch buffer was returned in ScratchSize.
@retval 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_GET_INFO) (
IN EFI_DECOMPRESS_PROTOCOL *This,
IN VOID *Source,
IN UINT32 SourceSize,
OUT UINT32 *DestinationSize,
OUT UINT32 *ScratchSize
);
/**
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.
@param This The protocol instance pointer
@param Source The source buffer containing the compressed data.
@param SourceSize The size of source data.
@param Destination On output, the destination buffer that contains
the uncompressed data.
@param DestinationSize The size of destination buffer. The size of destination
buffer needed is obtained from GetInfo().
@param Scratch A temporary scratch buffer that is used to perform the
decompression.
@param ScratchSize The size of scratch buffer. The size of scratch buffer needed
is obtained from GetInfo().
@retval EFI_SUCCESS Decompression completed successfully, and the uncompressed
buffer is returned in Destination.
@retval EFI_INVALID_PARAMETER The source buffer specified by Source and SourceSize is
corrupted (not in a valid compressed format).
**/
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
);
struct _EFI_DECOMPRESS_PROTOCOL {
EFI_DECOMPRESS_GET_INFO GetInfo;
EFI_DECOMPRESS_DECOMPRESS Decompress;
};
extern EFI_GUID gEfiDecompressProtocolGuid;
#endif

View File

@ -0,0 +1,94 @@
/** @file
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.
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: DevicePath.h
**/
#ifndef __EFI_DEVICE_PATH_PROTOCOL_H__
#define __EFI_DEVICE_PATH_PROTOCOL_H__
//
// Device Path protocol
//
#define EFI_DEVICE_PATH_PROTOCOL_GUID \
{ \
0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
}
#pragma pack(1)
typedef struct {
UINT8 Type;
UINT8 SubType;
UINT8 Length[2];
} EFI_DEVICE_PATH_PROTOCOL;
#pragma pack()
#define EFI_DP_TYPE_MASK 0x7F
#define EFI_DP_TYPE_UNPACKED 0x80
#define END_DEVICE_PATH_TYPE 0x7f
#define EFI_END_ENTIRE_DEVICE_PATH 0xff
#define EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE 0xff
#define EFI_END_INSTANCE_DEVICE_PATH 0x01
#define END_ENTIRE_DEVICE_PATH_SUBTYPE EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE
#define END_INSTANCE_DEVICE_PATH_SUBTYPE EFI_END_INSTANCE_DEVICE_PATH
#define EFI_END_DEVICE_PATH_LENGTH (sizeof (EFI_DEVICE_PATH_PROTOCOL))
#define END_DEVICE_PATH_LENGTH EFI_END_DEVICE_PATH_LENGTH
#define DP_IS_END_TYPE(a)
#define DP_IS_END_SUBTYPE(a) (((a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE)
#define DevicePathSubType(a) ((a)->SubType)
#define IsDevicePathUnpacked(a) ((a)->Type & EFI_DP_TYPE_UNPACKED)
#define EfiDevicePathNodeLength(a) (((a)->Length[0]) | ((a)->Length[1] << 8))
#define DevicePathNodeLength(a) (EfiDevicePathNodeLength(a))
#define EfiNextDevicePathNode(a) ((EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *) (a)) + EfiDevicePathNodeLength (a)))
#define NextDevicePathNode(a) (EfiNextDevicePathNode(a))
#define EfiDevicePathType(a) (((a)->Type) & EFI_DP_TYPE_MASK)
#define DevicePathType(a) (EfiDevicePathType(a))
#define EfiIsDevicePathEndType(a) (EfiDevicePathType (a) == END_DEVICE_PATH_TYPE)
#define IsDevicePathEndType(a) (EfiIsDevicePathEndType(a))
#define EfiIsDevicePathEndSubType(a) ((a)->SubType == EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE)
#define IsDevicePathEndSubType(a) (EfiIsDevicePathEndSubType(a))
#define EfiIsDevicePathEndInstanceSubType(a) ((a)->SubType == EFI_END_INSTANCE_DEVICE_PATH)
#define EfiIsDevicePathEnd(a) (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndSubType (a))
#define IsDevicePathEnd(a) (EfiIsDevicePathEnd(a))
#define EfiIsDevicePathEndInstance(a) (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndInstanceSubType (a))
#define SetDevicePathNodeLength(a,l) { \
(a)->Length[0] = (UINT8) (l); \
(a)->Length[1] = (UINT8) ((l) >> 8); \
}
#define SetDevicePathEndNode(a) { \
(a)->Type = END_DEVICE_PATH_TYPE; \
(a)->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE; \
(a)->Length[0] = sizeof(EFI_DEVICE_PATH_PROTOCOL); \
(a)->Length[1] = 0; \
}
extern EFI_GUID gEfiDevicePathProtocolGuid;
#endif

View File

@ -0,0 +1,73 @@
/** @file
EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL as defined in UEFI 2.0.
This protocol provides service to convert text to device paths and device nodes.
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
**/
#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 } \
}
/**
Convert text to the binary representation of a device node.
@param 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.
@retval a_pointer Pointer to the EFI device node.
@retval NULL if TextDeviceNode is NULL or there was insufficient memory.
**/
typedef
EFI_DEVICE_PATH_PROTOCOL*
(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_NODE) (
IN CONST CHAR16 *TextDeviceNode
)
;
/**
Convert text to the binary representation of a device node.
@param TextDeviceNode TextDevicePath points to the text representation of a device
path. Conversion starts with the first character and continues
until the first non-device path character.
@retval a_pointer Pointer to the allocated device path.
@retval 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
)
;
typedef struct {
EFI_DEVICE_PATH_FROM_TEXT_NODE ConvertDeviceNodeFromText;
EFI_DEVICE_PATH_FROM_TEXT_PATH ConvertDevicePathFromText;
} EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL;
extern EFI_GUID gEfiDevicePathFromTextProtocolGuid;
#endif

View File

@ -0,0 +1,86 @@
/** @file
EFI_DEVICE_PATH_TO_TEXT_PROTOCOL as defined in UEFI 2.0.
This protocol provides service to convert device nodes and paths to text.
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
**/
#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 } \
}
/**
Convert a device node to its text representation.
@param DeviceNode Points to the device node to be converted.
@param 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.
@param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
representation for a device node can be used, where applicable.
@retval a_pointer a pointer to the allocated text representation of the device node data
@retval NULL if DeviceNode is NULL or there was insufficient memory.
**/
typedef
CHAR16*
(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE) (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode,
IN BOOLEAN DisplayOnly,
IN BOOLEAN AllowShortcuts
)
;
/**
Convert a device path to its text representation.
@param DevicePath Points to the device path to be converted.
@param 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.
@param AllowShortcuts The AllowShortcuts is FALSE, then the shortcut forms of
text representation for a device node cannot be used.
@retval a_pointer a pointer to the allocated text representation of the device node.
@retval NULL if DevicePath 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
)
;
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,194 @@
/** @file
EFI_DEVICE_PATH_UTILITIES_PROTOCOL as defined in UEFI 2.0.
Use to create and manipulate device paths and device nodes.
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.h
**/
#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 } \
}
/**
Returns the size of the device path, in bytes.
@param DevicePath Points to the start of the EFI device path.
@revtal Size Size of the specified device path, in bytes, including the end-of-path tag.
**/
typedef
UINTN
(EFIAPI *EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE) (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
;
/**
Create a duplicate of the specified path.
@param DevicePath Points to the source EFI device path.
@retval Pointer A pointer to the duplicate device path.
@retval NULL insufficient memory
**/
typedef
EFI_DEVICE_PATH_PROTOCOL*
(EFIAPI *EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH) (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
;
/**
Create a new path by appending the second device path to the first.
@param Src1 Points to the first device path. If NULL, then it is ignored.
@param Src2 Points to the second device path. If NULL, then it is ignored.
@retval Pointer A pointer to the newly created device path.
@retval NULL Memory could not be allocated
or either DevicePath or DeviceNode is NULL.
**/
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
)
;
/**
Creates a new path by appending the device node to the device path.
@param DevicePath Points to the device path.
@param DeviceNode Points to the device node.
@retval Pointer A pointer to the allocated device node.
@retval 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
)
;
/**
Creates a new path by appending the specified device path instance to the specified device path.
@param DevicePath Points to the device path. If NULL, then ignored.
@param DevicePathInstance Points to the device path instance.
@retval Pointer A pointer to the newly created device path
@retval NULL Memory could not be allocated or DevicePathInstance 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
)
;
/**
Creates a copy of the current device path instance and returns a pointer to the next device path
instance.
@param 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.
@param DevicePathInstanceSize On output, this holds the size of the device path instance,
in bytes or zero, if DevicePathInstance is zero.
@retval Pointer A pointer to the copy of the current device path instance.
@retval NULL DevicePathInstace was NULL on entry or there was insufficient memory.
**/
typedef
EFI_DEVICE_PATH_PROTOCOL*
(EFIAPI *EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE) (
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathInstance,
OUT UINTN *DevicePathInstanceSize
)
;
/**
Creates a device node
@param NodeType NodeType is the device node type (EFI_DEVICE_PATH.Type) for
the new device node.
@param NodeSubType NodeSubType is the device node sub-type
EFI_DEVICE_PATH.SubType) for the new device node.
@param NodeLength NodeLength is the length of the device node
(EFI_DEVICE_PATH.Length) for the new device node.
@retval Pointer A pointer to the newly created device node.
@retval NULL NodeLength is less than
the size of the header or there was insufficient memory.
**/
typedef
EFI_DEVICE_PATH_PROTOCOL*
(EFIAPI *EFI_DEVICE_PATH_CREATE_NODE) (
IN UINT8 NodeType,
IN UINT8 NodeSubType,
IN UINT16 NodeLength
)
;
/**
Returns whether a device path is multi-instance.
@param DevicePath Points to the device path. If NULL, then ignored.
@retval TRUE The device path has more than one instance
@retval FALSE The device path is empty or contains only a single instance.
**/
typedef
BOOLEAN
(EFIAPI *EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE) (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
;
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_CREATE_NODE CreateDeviceNode;
} EFI_DEVICE_PATH_UTILITIES_PROTOCOL;
extern EFI_GUID gEfiDevicePathUtilitiesProtocolGuid;
#endif

View File

@ -0,0 +1,442 @@
/** @file
EFI_DHCP4_PROTOCOL as defined in UEFI 2.0.
EFI_DHCP4_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0.
These protocols are used to collect configuration information for the EFI IPv4 Protocol
drivers and to provide DHCPv4 server and PXE boot server discovery services.
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
**/
#ifndef __EFI_DHCP4_PROTOCOL_H__
#define __EFI_DHCP4_PROTOCOL_H__
#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 } \
}
typedef struct _EFI_DHCP4_PROTOCOL EFI_DHCP4_PROTOCOL;
#pragma pack(1)
typedef struct {
UINT8 OpCode;
UINT8 Length;
UINT8 Data[1];
} EFI_DHCP4_PACKET_OPTION;
#pragma pack()
#pragma pack(1)
typedef struct {
UINT8 OpCode;
UINT8 HwType;
UINT8 HwAddrLen;
UINT8 Hops;
UINT32 Xid;
UINT16 Seconds;
UINT16 Reserved;
EFI_IPv4_ADDRESS ClientAddr; //Client IP address from client
EFI_IPv4_ADDRESS YourAddr; //Client IP address from server
EFI_IPv4_ADDRESS ServerAddr; //IP address of next server in bootstrap
EFI_IPv4_ADDRESS GatewayAddr; //Relay agent IP address
UINT8 ClientHwAddr[16]; //Client hardware address
CHAR8 ServerName[64];
CHAR8 BootFileName[128];
}EFI_DHCP4_HEADER;
#pragma pack()
#pragma pack(1)
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 = 0x04,
Dhcp4RcvdAck = 0x05,
Dhcp4RcvdNak = 0x06,
Dhcp4SendDecline = 0x07,
Dhcp4BoundCompleted = 0x08,
Dhcp4EnterRenewing = 0x09,
Dhcp4EnterRebinding = 0x0a,
Dhcp4AddressLost = 0x0b,
Dhcp4Fail = 0x0c
} EFI_DHCP4_EVENT;
/**
Callback routine
@param This Pointer to the EFI DHCPv4 Protocol instance that is used to
configure this callback function.
@param Context Pointer to the context that is initialized by
EFI_DHCP4_PROTOCOL.Configure().
@param CurrentState The current operational state of the EFI DHCPv4 Protocol
driver.
@param Dhcp4Event The event that occurs in the current state, which usually means a
state transition.
@param Packet The DHCP packet that is going to be sent or already received.
@param NewPacket The packet that is used to replace the above Packet.
@retval EFI_SUCCESS Tells the EFI DHCPv4 Protocol driver to continue the DHCP process.
@retval EFI_NOT_READY Only used in the Dhcp4Selecting state. The EFI DHCPv4 Protocol
driver will continue to wait for more DHCPOFFER packets until the retry
timeout expires.
@retval EFI_ABORTED Tells the EFI DHCPv4 Protocol driver to abort the current process and
return to the Dhcp4Init or Dhcp4InitReboot state.
**/
typedef
EFI_STATUS
(EFIAPI *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;
/**
Returns the current operating mode and cached data packet for the EFI DHCPv4 Protocol driver.
@param This Pointer to the EFI_DHCP4_PROTOCOL instance.
@param Dhcp4ModeData Pointer to storage for the EFI_DHCP4_MODE_DATA structure.
@retval EFI_SUCCESS The mode data was returned.
@retval EFI_INVALID_PARAMETER This is NULL.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_DHCP4_GET_MODE_DATA)(
IN EFI_DHCP4_PROTOCOL *This,
OUT EFI_DHCP4_MODE_DATA *Dhcp4ModeData
)
;
/**
Initializes, changes, or resets the operational settings for the EFI DHCPv4 Protocol driver.
@param This Pointer to the EFI_DHCP4_PROTOCOL instance.
@param Dhcp4CfgData Pointer to the EFI_DHCP4_CONFIG_DATA.
@retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the Dhcp4Init or
Dhcp4InitReboot state, if the original state of this driver
was Dhcp4Stopped and the value of Dhcp4CfgData was
not NULL. Otherwise, the state was left unchanged.
@retval EFI_ACCESS_DENIED This instance of the EFI DHCPv4 Protocol driver was not in the
Dhcp4Stopped, Dhcp4Init, Dhcp4InitReboot, or Dhcp4Bound state;
Or onother instance of this EFI DHCPv4 Protocol driver is already
in a valid configured state.
@retval EFI_INVALID_PARAMETER Some parameter is NULL.
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_DHCP4_CONFIGURE) (
IN EFI_DHCP4_PROTOCOL *This,
IN EFI_DHCP4_CONFIG_DATA *Dhcp4CfgData OPTIONAL
)
;
/**
Starts the DHCP configuration process.
@param This Pointer to the EFI_DHCP4_PROTOCOL instance.
@param CompletionEvent If not NULL, indicates the event that will be signaled when the
EFI DHCPv4 Protocol driver is transferred into the
Dhcp4Bound state or when the DHCP process is aborted.
EFI_DHCP4_PROTOCOL.GetModeData() can be called to
check the completion status. If NULL,
EFI_DHCP4_PROTOCOL.Start() will wait until the driver
is transferred into the Dhcp4Bound state or the process fails.
@retval EFI_SUCCESS The DHCP configuration process has started, or it has completed
when CompletionEvent is NULL.
@retval EFI_NOT_STARTED The EFI DHCPv4 Protocol driver is in the Dhcp4Stopped
state. EFI_DHCP4_PROTOCOL. Configure() needs to be called.
@retval EFI_INVALID_PARAMETER This is NULL.
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
@retval EFI_TIMEOUT The DHCP configuration process failed because no response was
received from the server within the specified timeout value.
@retval EFI_ABORTED The user aborted the DHCP process.
@retval EFI_ALREADY_STARTED Some other EFI DHCPv4 Protocol instance already started the
DHCP process.
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_DHCP4_START) (
IN EFI_DHCP4_PROTOCOL *This,
IN EFI_EVENT CompletionEvent OPTIONAL
)
;
/**
Extends the lease time by sending a request packet.
@param This Pointer to the EFI_DHCP4_PROTOCOL instance.
@param RebindRequest If TRUE, this function broadcasts the request packets and enters
the Dhcp4Rebinding state. Otherwise, it sends a unicast
request packet and enters the Dhcp4Renewing state.
@param CompletionEvent If not NULL, this event is signaled when the renew/rebind phase
completes or some error occurs.
EFI_DHCP4_PROTOCOL.GetModeData() can be called to
check the completion status. If NULL,
EFI_DHCP4_PROTOCOL.RenewRebind() will busy-wait
until the DHCP process finishes.
@retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the
Dhcp4Renewing state or is back to the Dhcp4Bound state.
@retval EFI_NOT_STARTED The EFI DHCPv4 Protocol driver is in the Dhcp4Stopped
state. EFI_DHCP4_PROTOCOL.Configure() needs to
be called.
@retval EFI_INVALID_PARAMETER This is NULL.
@retval EFI_TIMEOUT There was no response from the server when the try count was
exceeded.
@retval EFI_ACCESS_DENIED The driver is not in the Dhcp4Bound state.
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_DHCP4_RENEW_REBIND) (
IN EFI_DHCP4_PROTOCOL *This,
IN BOOLEAN RebindRequest,
IN EFI_EVENT CompletionEvent OPTIONAL
)
;
/**
Releases the current address configuration.
@param This Pointer to the EFI_DHCP4_PROTOCOL instance.
@retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the Dhcp4Init phase.
@retval EFI_INVALID_PARAMETER This is NULL.
@retval EFI_ACCESS_DENIED The EFI DHCPv4 Protocol driver is not Dhcp4InitReboot state.
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_DHCP4_RELEASE) (
IN EFI_DHCP4_PROTOCOL *This
)
;
/**
Stops the current address configuration.
@param This Pointer to the EFI_DHCP4_PROTOCOL instance.
@retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the Dhcp4Stopped phase.
@retval EFI_INVALID_PARAMETER This is NULL.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_DHCP4_STOP) (
IN EFI_DHCP4_PROTOCOL *This
)
;
/**
Builds a DHCP packet, given the options to be appended or deleted or replaced.
@param This Pointer to the EFI_DHCP4_PROTOCOL instance.
@param SeedPacket Initial packet to be used as a base for building new packet.
@param DeleteCount Number of opcodes in the DeleteList.
@param DeleteList List of opcodes to be deleted from the seed packet.
Ignored if DeleteCount is zero.
@param AppendCount Number of entries in the OptionList.
@param AppendList Pointer to a DHCP option list to be appended to SeedPacket.
If SeedPacket also contains options in this list, they are
replaced by new options (except pad option). Ignored if
AppendCount is zero. Type EFI_DHCP4_PACKET_OPTION
@param NewPacket Pointer to storage for the pointer to the new allocated packet.
Use the EFI Boot Service FreePool() on the resulting pointer
when done with the packet.
@retval EFI_SUCCESS The new packet was built.
@retval EFI_OUT_OF_RESOURCES Storage for the new packet could not be allocated.
@retval EFI_INVALID_PARAMETER Some parameter is NULL.
**/
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
);
;
/**
Transmits a DHCP formatted packet and optionally waits for responses.
@param This Pointer to the EFI_DHCP4_PROTOCOL instance.
@param Token Pointer to the EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN structure.
@retval EFI_SUCCESS The packet was successfully queued for transmission.
@retval EFI_INVALID_PARAMETER Some parameter is NULL.
@retval EFI_NOT_READY The previous call to this function has not finished yet. Try to call
this function after collection process completes.
@retval EFI_NO_MAPPING The default station address is not available yet.
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
@retval Others Some other unexpected error occurred.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_DHCP4_TRANSMIT_RECEIVE) (
IN EFI_DHCP4_PROTOCOL *This,
IN EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN *Token
)
;
/**
Parses the packed DHCP option data.
@param This Pointer to the EFI_DHCP4_PROTOCOL instance.
@param Packet Pointer to packet to be parsed.
@param OptionCount On input, the number of entries in the PacketOptionList.
On output, the number of entries that were written into the
PacketOptionList.
@param PacketOptionList List of packet option entries to be filled in. End option or pad
options are not included.
@retval EFI_SUCCESS The packet was successfully parsed.
@retval EFI_INVALID_PARAMETER Some parameter is NULL.
@retval EFI_BUFFER_TOO_SMALL One or more of the following conditions is TRUE:
1) *OptionCount is smaller than the number of options that
were found in the Packet.
2) PacketOptionList is NULL.
**/
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
)
;
struct _EFI_DHCP4_PROTOCOL {
EFI_DHCP4_GET_MODE_DATA GetModeData;
EFI_DHCP4_CONFIGURE Configure;
EFI_DHCP4_START Start;
EFI_DHCP4_RENEW_REBIND RenewRebind;
EFI_DHCP4_RELEASE Release;
EFI_DHCP4_STOP Stop;
EFI_DHCP4_BUILD Build;
EFI_DHCP4_TRANSMIT_RECEIVE TransmitReceive;
EFI_DHCP4_PARSE Parse;
};
extern EFI_GUID gEfiDhcp4ProtocolGuid;
extern EFI_GUID gEfiDhcp4ServiceBindingProtocolGuid;
#endif

View File

@ -0,0 +1,98 @@
/** @file
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.
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: DiskIo.h
**/
#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 } \
}
typedef struct _EFI_DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL;
/**
Read BufferSize bytes from Offset into Buffer.
@param This Protocol instance pointer.
@param MediaId Id of the media, changes every time the media is replaced.
@param Offset The starting byte offset to read from
@param BufferSize Size of Buffer
@param Buffer Buffer containing read data
@retval EFI_SUCCESS The data was read correctly from the device.
@retval EFI_DEVICE_ERROR The device reported an error while performing the read.
@retval EFI_NO_MEDIA There is no media in the device.
@retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.
@retval EFI_INVALID_PARAMETER The read request contains device addresses that are not
valid for the device.
**/
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
)
;
/**
Read BufferSize bytes from Offset into Buffer.
@param This Protocol instance pointer.
@param MediaId Id of the media, changes every time the media is replaced.
@param Offset The starting byte offset to read from
@param BufferSize Size of Buffer
@param Buffer Buffer containing read data
@retval EFI_SUCCESS The data was written correctly to the device.
@retval EFI_WRITE_PROTECTED The device can not be written to.
@retval EFI_DEVICE_ERROR The device reported an error while performing the write.
@retval EFI_NO_MEDIA There is no media in the device.
@retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.
@retval EFI_INVALID_PARAMETER The write 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
)
;
#define EFI_DISK_IO_PROTOCOL_REVISION 0x00010000
struct _EFI_DISK_IO_PROTOCOL {
UINT64 Revision;
EFI_DISK_READ ReadDisk;
EFI_DISK_WRITE WriteDisk;
};
extern EFI_GUID gEfiDiskIoProtocolGuid;
#endif

View File

@ -0,0 +1,111 @@
/** @file
EFI ControllerHandle Driver Protocol
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: DriverBinding.h
**/
#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 } \
}
typedef struct _EFI_DRIVER_BINDING_PROTOCOL EFI_DRIVER_BINDING_PROTOCOL;
/**
Test to see if this driver supports ControllerHandle.
@param This Protocol instance pointer.
@param ControllerHandle Handle of device to test
@param RemainingDevicePath Optional parameter use to pick a specific child
device to start.
@retval EFI_SUCCESS This driver supports this device
@retval EFI_ALREADY_STARTED This driver is already running on this device
@retval other This driver does not support this device
**/
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
)
;
/**
Start this driver on ControllerHandle.
@param This Protocol instance pointer.
@param ControllerHandle Handle of device to bind driver to
@param RemainingDevicePath Optional parameter use to pick a specific child
device to start.
@retval EFI_SUCCESS This driver is added to ControllerHandle
@retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
@retval 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
)
;
/**
Stop this driver on ControllerHandle.
@param This Protocol instance pointer.
@param ControllerHandle Handle of device to stop driver on
@param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
children is zero stop the entire bus driver.
@param ChildHandleBuffer List of Child Handles to Stop.
@retval EFI_SUCCESS This driver is removed ControllerHandle
@retval other This driver was not removed from 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 OPTIONAL
)
;
//
// Interface structure for the ControllerHandle Driver Protocol
//
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;
};
extern EFI_GUID gEfiDriverBindingProtocolGuid;
#endif

View File

@ -0,0 +1,203 @@
/** @file
EFI Driver Configuration Protocol
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: DriverConfiguration.h
**/
#ifndef __EFI_DRIVER_CONFIGURATION_H__
#define __EFI_DRIVER_CONFIGURATION_H__
//
// Global ID for the Driver Configuration Protocol defined in EFI 1.10
//
#define EFI_DRIVER_CONFIGURATION_PROTOCOL_GUID \
{ \
0x107a772b, 0xd5e1, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}
//
// Global ID for the Driver Configuration Protocol defined in UEFI 2.0
//
#define UEFI_DRIVER_CONFIGURATION_PROTOCOL_GUID \
{ \
0xbfd7dc1d, 0x24f1, 0x40d9, {0x82, 0xe7, 0x2e, 0x09, 0xbb, 0x6b, 0x4e, 0xbe } \
}
typedef struct _EFI_DRIVER_CONFIGURATION_PROTOCOL 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
/**
Allows the user to set controller specific options for a controller that a
driver is currently managing.
@param This A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL instance.
@param ControllerHandle The handle of the controller to set options on.
@param 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.
@param 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.
@param 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.
@retval EFI_SUCCESS The driver specified by This successfully set the
configuration options for the controller specified
by ControllerHandle..
@retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
@retval EFI_INVALID_PARAMETER ActionRequired is NULL.
@retval EFI_UNSUPPORTED The driver specified by This does not support setting
configuration options for the controller specified by
ControllerHandle and ChildHandle.
@retval EFI_UNSUPPORTED The driver specified by This does not support the
language specified by Language.
@retval EFI_DEVICE_ERROR A device error occurred while attempt to set the
configuration options for the controller specified
by ControllerHandle and ChildHandle.
@retval 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_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
);
/**
Tests to see if a controller's current configuration options are valid.
@param This A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL instance.
@param ControllerHandle The handle of the controller to test if it's current
configuration options are valid.
@param 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.
@retval 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.
@retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
@retval EFI_UNSUPPORTED The driver specified by This is not currently
managing the controller specified by ControllerHandle
and ChildHandle.
@retval 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_OPTIONS_VALID) (
IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE ChildHandle OPTIONAL
);
/**
Forces a driver to set the default configuration options for a controller.
@param This A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL instance.
@param ControllerHandle The handle of the controller to force default configuration options on.
@param 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.
@param 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.
@param 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.
@retval EFI_SUCCESS The driver specified by This successfully forced the default configuration options on the controller specified by ControllerHandle and ChildHandle.
@retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
@retval EFI_INVALID_PARAMETER ActionRequired is NULL.
@retval EFI_UNSUPPORTED The driver specified by This does not support forcing the default configuration options on the controller specified by ControllerHandle and ChildHandle.
@retval EFI_UNSUPPORTED The driver specified by This does not support the configuration type specified by DefaultType.
@retval EFI_DEVICE_ERROR A device error occurred while attempt to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.
@retval EFI_OUT_RESOURCES There are not enough resources available to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.
**/
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
);
//
//
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;
};
/**
Interface structure for the Driver Configuration Protocol.
@par Protocol Description:
Used to set configuration options for a controller that an EFI Driver is managing.
@param SetOptions Allows the use to set drivers specific configuration
options for a controller that the driver is currently managing.
@param OptionsValid Tests to see if a controller's current configuration
options are valid.
@param ForceDefaults Forces a driver to set the default configuration options
for a controller.
@param 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;
extern EFI_GUID gUefiDriverConfigurationProtocolGuid;
#endif

View File

@ -0,0 +1,134 @@
/** @file
EFI Driver Diagnostics Protocol
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: DriverDiagnostics.h
**/
#ifndef __EFI_DRIVER_DIAGNOSTICS_H__
#define __EFI_DRIVER_DIAGNOSTICS_H__
//
// Global ID for the Driver Diagnostics Protocol as defined in EFI 1.10.
//
#define EFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID \
{ \
0x0784924f, 0xe296, 0x11d4, {0x9a, 0x49, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}
//
// Global ID for the Driver Diagnostics Protocol as defined in UEFI 2.0.
//
#define UEFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID \
{ \
0x4d330321, 0x025f, 0x4aac, {0x90, 0xd8, 0x5e, 0xd9, 0x00, 0x17, 0x3b, 0x63 } \
}
typedef struct _EFI_DRIVER_DIAGNOSTICS_PROTOCOL EFI_DRIVER_DIAGNOSTICS_PROTOCOL;
typedef enum {
EfiDriverDiagnosticTypeStandard = 0,
EfiDriverDiagnosticTypeExtended = 1,
EfiDriverDiagnosticTypeManufacturing= 2,
EfiDriverDiagnosticTypeMaximum
} EFI_DRIVER_DIAGNOSTIC_TYPE;
/**
Runs diagnostics on a controller.
@param This A pointer to the EFI_DRIVER_DIAGNOSTICS_PROTOCOL instance.
@param ControllerHandle The handle of the controller to run diagnostics on.
@param 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.
@param DiagnosticType Indicates type of diagnostics to perform on the controller
specified by ControllerHandle and ChildHandle. See
"Related Definitions" for the list of supported types.
@param 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.
@param ErrorType A GUID that defines the format of the data returned in Buffer.
@param BufferSize The size, in bytes, of the data returned in Buffer.
@param 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().
@retval EFI_SUCCESS The controller specified by ControllerHandle and
ChildHandle passed the diagnostic.
@retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
@retval EFI_INVALID_PARAMETER Language is NULL.
@retval EFI_INVALID_PARAMETER ErrorType is NULL.
@retval EFI_INVALID_PARAMETER BufferType is NULL.
@retval EFI_INVALID_PARAMETER Buffer is NULL.
@retval EFI_UNSUPPORTED The driver specified by This does not support
running diagnostics for the controller specified
by ControllerHandle and ChildHandle.
@retval EFI_UNSUPPORTED The driver specified by This does not support the
type of diagnostic specified by DiagnosticType.
@retval EFI_UNSUPPORTED The driver specified by This does not support the
language specified by Language.
@retval EFI_OUT_OF_RESOURCES There are not enough resources available to complete
the diagnostics.
@retval EFI_OUT_OF_RESOURCES There are not enough resources available to return
the status information in ErrorType, BufferSize,
and Buffer.
@retval EFI_DEVICE_ERROR The controller specified by ControllerHandle and
ChildHandle did not pass the diagnostic.
**/
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
);
//
//
/**
Interface structure for the Driver Diagnostics Protocol.
@par Protocol Description:
Used to perform diagnostics on a controller that an EFI Driver is managing.
@param RunDiagnostics Runs diagnostics on a controller.
@param 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.
**/
struct _EFI_DRIVER_DIAGNOSTICS_PROTOCOL {
EFI_DRIVER_DIAGNOSTICS_RUN_DIAGNOSTICS RunDiagnostics;
CHAR8 *SupportedLanguages;
};
extern EFI_GUID gEfiDriverDiagnosticsProtocolGuid;
extern EFI_GUID gUefiDriverDiagnosticsProtocolGuid;
#endif

View File

@ -0,0 +1,148 @@
/** @file
Describes the protocol interface to the EBC interpreter.
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: Ebc.h
**/
#ifndef __EFI_EBC_PROTOCOL_H__
#define __EFI_EBC_PROTOCOL_H__
#define EFI_EBC_INTERPRETER_PROTOCOL_GUID \
{ \
0x13AC6DD1, 0x73D0, 0x11D4, {0xB0, 0x6B, 0x00, 0xAA, 0x00, 0xBD, 0x6D, 0xE7 } \
}
//
// Protocol Guid Name defined in spec.
//
#define EFI_EBC_PROTOCOL_GUID EFI_EBC_INTERPRETER_PROTOCOL_GUID
//
// Define for forward reference.
//
typedef struct _EFI_EBC_PROTOCOL EFI_EBC_PROTOCOL;
/**
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.
@param This protocol instance pointer
@param 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.
@param EbcEntryPoint the entry point for the image (as defined in the file header)
@param Thunk pointer to thunk pointer where the address of the created
thunk is returned.
@return 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
);
/**
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.
@param This protocol instance pointer
@param ImageHandle the handle of the image being unloaded.
@return Standard EFI_STATUS.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_EBC_UNLOAD_IMAGE) (
IN EFI_EBC_PROTOCOL *This,
IN EFI_HANDLE ImageHandle
);
/**
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.
@param Start physical start address of CPU instruction cache to flush.
@param Length how many bytes to flush of the instruction cache.
@return Standard EFI_STATUS.
**/
typedef
EFI_STATUS
(EFIAPI *EBC_ICACHE_FLUSH) (
IN EFI_PHYSICAL_ADDRESS Start,
IN UINT64 Length
);
/**
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.
@param This protocol instance pointer
@param Flush pointer to the function to call to flush the CPU instruction
cache.
@return Standard EFI_STATUS.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_EBC_REGISTER_ICACHE_FLUSH) (
IN EFI_EBC_PROTOCOL *This,
IN EBC_ICACHE_FLUSH Flush
);
/**
This routine can be called to get the VM revision. It returns the same
value as the EBC BREAK 1 instruction returns.
@param This protocol instance pointer
@param Version pointer to where to return the VM version
@return 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
//
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;
};
//
// Extern the global EBC protocol GUID
//
extern EFI_GUID gEfiEbcProtocolGuid;
#endif

View File

@ -0,0 +1,34 @@
/** @file
EDID Active Protocol from the UEFI 2.0 specification.
Placed on the video output device child handle that are actively displaying output.
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
**/
#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,35 @@
/** @file
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.
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
**/
#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,66 @@
/** @file
EDID Override Protocol from the UEFI 2.0 specification.
Allow platform to provide EDID information to producer of the Graphics Output
protocol.
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
**/
#ifndef __EDID_OVERRIDE_H__
#define __EDID_OVERRIDE_H__
#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
/**
Return the current video mode information.
@param This Protocol instance pointer.
@param ChildHandle A child handle produced by the Graphics Output EFI
driver that represents a video output device.
@param Attributes The attributes associated with ChildHandle video output device.
@param EdidSize A pointer to the size, in bytes, of the Edid buffer.
@param 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.
@retval EFI_SUCCESS Valid overrides returned for ChildHandle.
@retval EFI_UNSUPPORTED ChildHandle has no overrides.
**/
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
)
;
struct _EFI_EDID_OVERRIDE_PROTOCOL {
EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID GetEdid;
};
extern EFI_GUID gEfiEdidOverrideProtocolGuid;
#endif

View File

@ -0,0 +1,92 @@
/** @file
Revision history:
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:
EfiNetworkInterfaceIdentifier.h
**/
#ifndef __EFI_NETWORK_INTERFACE_IDENTIFER_H__
#define __EFI_NETWORK_INTERFACE_IDENTIFER_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_REVISION 0x00010000
//
// Forward reference for pure ANSI compatability
//
typedef struct _EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL;
typedef enum {
EfiNetworkInterfaceUndi = 1
} EFI_NETWORK_PROTOCOL_TYPE;
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
};
extern EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid;
extern EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid_31;
#endif // _EFI_NII_H

View File

@ -0,0 +1,53 @@
/** @file
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
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: FileInfo.c
**/
#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,45 @@
/** @file
FileSystemInfo protocol as defined in the EFI 1.0 specification.
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: FileSystemInfo.h
**/
#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,42 @@
/** @file
FileSystemVolumeLabelInfo protocol as defined in the EFI 1.0 specification.
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: FileSystemVolumeLabelInfo.h
**/
#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 } \
}
//
// Protocol Name defined in spec.
//
#define EFI_FILE_SYSTEM_VOLUME_LABEL_ID \
EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID_GUID
typedef struct {
CHAR16 VolumeLabel[1];
} EFI_FILE_SYSTEM_VOLUME_LABEL_INFO;
typedef EFI_FILE_SYSTEM_VOLUME_LABEL_INFO EFI_FILE_SYSTEM_VOLUME_LABEL;
#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,321 @@
/** @file
This file declares Firmware Volume protocol.
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: FirmwareVolume.h
@par Revision Reference:
This protocol is defined in Firmware Volume specification.
Version 0.9
**/
#ifndef __FIRMWARE_VOLUME_H__
#define __FIRMWARE_VOLUME_H__
//
// Firmware Volume Protocol GUID definition
//
#define EFI_FIRMWARE_VOLUME_PROTOCOL_GUID \
{ \
0x389F751F, 0x1838, 0x4388, {0x83, 0x90, 0xCD, 0x81, 0x54, 0xBD, 0x27, 0xF8 } \
}
#define FV_DEVICE_SIGNATURE EFI_SIGNATURE_32 ('_', 'F', 'V', '_')
typedef struct _EFI_FIRMWARE_VOLUME_PROTOCOL EFI_FIRMWARE_VOLUME_PROTOCOL;
//
// EFI_FV_ATTRIBUTES bit definitions
//
typedef UINT64 EFI_FV_ATTRIBUTES;
//
// ************************************************************
// EFI_FV_ATTRIBUTES bit definitions
// ************************************************************
//
#define EFI_FV_READ_DISABLE_CAP 0x0000000000000001ULL
#define EFI_FV_READ_ENABLE_CAP 0x0000000000000002ULL
#define EFI_FV_READ_STATUS 0x0000000000000004ULL
#define EFI_FV_WRITE_DISABLE_CAP 0x0000000000000008ULL
#define EFI_FV_WRITE_ENABLE_CAP 0x0000000000000010ULL
#define EFI_FV_WRITE_STATUS 0x0000000000000020ULL
#define EFI_FV_LOCK_CAP 0x0000000000000040ULL
#define EFI_FV_LOCK_STATUS 0x0000000000000080ULL
#define EFI_FV_WRITE_POLICY_RELIABLE 0x0000000000000100ULL
#define EFI_FV_ALIGNMENT_CAP 0x0000000000008000ULL
#define EFI_FV_ALIGNMENT_2 0x0000000000010000ULL
#define EFI_FV_ALIGNMENT_4 0x0000000000020000ULL
#define EFI_FV_ALIGNMENT_8 0x0000000000040000ULL
#define EFI_FV_ALIGNMENT_16 0x0000000000080000ULL
#define EFI_FV_ALIGNMENT_32 0x0000000000100000ULL
#define EFI_FV_ALIGNMENT_64 0x0000000000200000ULL
#define EFI_FV_ALIGNMENT_128 0x0000000000400000ULL
#define EFI_FV_ALIGNMENT_256 0x0000000000800000ULL
#define EFI_FV_ALIGNMENT_512 0x0000000001000000ULL
#define EFI_FV_ALIGNMENT_1K 0x0000000002000000ULL
#define EFI_FV_ALIGNMENT_2K 0x0000000004000000ULL
#define EFI_FV_ALIGNMENT_4K 0x0000000008000000ULL
#define EFI_FV_ALIGNMENT_8K 0x0000000010000000ULL
#define EFI_FV_ALIGNMENT_16K 0x0000000020000000ULL
#define EFI_FV_ALIGNMENT_32K 0x0000000040000000ULL
#define EFI_FV_ALIGNMENT_64K 0x0000000080000000ULL
//
// Protocol API definitions
//
/**
Retrieves attributes, insures positive polarity of attribute bits, returns
resulting attributes in output parameter
@param This Calling context
@param Attributes output buffer which contains attributes
@retval EFI_INVALID_PARAMETER
@retval EFI_SUCCESS
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FV_GET_ATTRIBUTES) (
IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
OUT EFI_FV_ATTRIBUTES *Attributes
);
/**
Sets volume attributes
@param This Calling context
@param Attributes Buffer which contains attributes
@retval EFI_INVALID_PARAMETER
@retval EFI_DEVICE_ERROR
@retval EFI_SUCCESS
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FV_SET_ATTRIBUTES) (
IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
IN OUT EFI_FV_ATTRIBUTES *Attributes
);
typedef UINT32 EFI_FV_FILE_ATTRIBUTES;
#define EFI_FV_FILE_ATTRIB_ALIGNMENT 0x0000001F
/**
Read the requested file (NameGuid) and returns data in Buffer.
@param This Calling context
@param NameGuid Filename identifying which file to read
@param Buffer Pointer to pointer to buffer in which contents of file are returned.
<br>
If Buffer is NULL, only type, attributes, and size are returned as
there is no output buffer.
<br>
If Buffer != NULL and *Buffer == NULL, the output buffer is allocated
from BS pool by ReadFile
<br>
If Buffer != NULL and *Buffer != NULL, the output buffer has been
allocated by the caller and is being passed in.
@param BufferSize Indicates the buffer size passed in, and on output the size
required to complete the read
@param FoundType Indicates the type of the file who's data is returned
@param FileAttributes Indicates the attributes of the file who's data is resturned
@param AuthenticationStatus Indicates the authentication status of the data
@retval EFI_SUCCESS
@retval EFI_WARN_BUFFER_TOO_SMALL
@retval EFI_NOT_FOUND
@retval EFI_DEVICE_ERROR
@retval EFI_ACCESS_DENIED
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FV_READ_FILE) (
IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
IN EFI_GUID *NameGuid,
IN OUT VOID **Buffer,
IN OUT UINTN *BufferSize,
OUT EFI_FV_FILETYPE *FoundType,
OUT EFI_FV_FILE_ATTRIBUTES *FileAttributes,
OUT UINT32 *AuthenticationStatus
);
/**
Read the requested section from the specified file and returns data in Buffer.
@param This Calling context
@param NameGuid Filename identifying the file from which to read
@param SectionType Indicates what section type to retrieve
@param SectionInstance Indicates which instance of SectionType to retrieve
@param Buffer Pointer to pointer to buffer in which contents of file are returned.
<br>
If Buffer is NULL, only type, attributes, and size are returned as
there is no output buffer.
<br>
If Buffer != NULL and *Buffer == NULL, the output buffer is allocated
from BS pool by ReadFile
<br>
If Buffer != NULL and *Buffer != NULL, the output buffer has been
allocated by the caller and is being passed in.
@param BufferSize Indicates the buffer size passed in, and on output the size
required to complete the read
@param AuthenticationStatus Indicates the authentication status of the data
@retval EFI_SUCCESS
@retval EFI_WARN_BUFFER_TOO_SMALL
@retval EFI_OUT_OF_RESOURCES
@retval EFI_NOT_FOUND
@retval EFI_DEVICE_ERROR
@retval EFI_ACCESS_DENIED
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FV_READ_SECTION) (
IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
IN EFI_GUID *NameGuid,
IN EFI_SECTION_TYPE SectionType,
IN UINTN SectionInstance,
IN OUT VOID **Buffer,
IN OUT UINTN *BufferSize,
OUT UINT32 *AuthenticationStatus
);
typedef UINT32 EFI_FV_WRITE_POLICY;
#define EFI_FV_UNRELIABLE_WRITE 0x00000000
#define EFI_FV_RELIABLE_WRITE 0x00000001
typedef struct {
EFI_GUID *NameGuid;
EFI_FV_FILETYPE Type;
EFI_FV_FILE_ATTRIBUTES FileAttributes;
VOID *Buffer;
UINT32 BufferSize;
} EFI_FV_WRITE_FILE_DATA;
/**
Write the supplied file (NameGuid) to the FV.
@param This Calling context
@param NumberOfFiles Indicates the number of file records pointed to by FileData
@param WritePolicy Indicates the level of reliability of the write with respect to
things like power failure events.
@param FileData A pointer to an array of EFI_FV_WRITE_FILE_DATA structures. Each
element in the array indicates a file to write, and there are
NumberOfFiles elements in the input array.
@retval EFI_SUCCESS
@retval EFI_OUT_OF_RESOURCES
@retval EFI_DEVICE_ERROR
@retval EFI_WRITE_PROTECTED
@retval EFI_NOT_FOUND
@retval EFI_INVALID_PARAMETER
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FV_WRITE_FILE) (
IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
IN UINT32 NumberOfFiles,
IN EFI_FV_WRITE_POLICY WritePolicy,
IN EFI_FV_WRITE_FILE_DATA *FileData
);
/**
Given the input key, search for the next matching file in the volume.
@param This Calling context
@param Key Pointer to a caller allocated buffer that contains an implementation
specific key that is used to track where to begin searching on
successive calls.
@param FileType Indicates the file type to filter for
@param NameGuid Guid filename of the file found
@param Attributes Attributes of the file found
@param Size Size in bytes of the file found
@retval EFI_SUCCESS
@retval EFI_NOT_FOUND
@retval EFI_DEVICE_ERROR
@retval EFI_ACCESS_DENIED
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FV_GET_NEXT_FILE) (
IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
IN OUT VOID *Key,
IN OUT EFI_FV_FILETYPE *FileType,
OUT EFI_GUID *NameGuid,
OUT EFI_FV_FILE_ATTRIBUTES *Attributes,
OUT UINTN *Size
);
/**
@par Protocol Description:
The Firmware Volume Protocol provides file-level access to the firmware volume.
Each firmware volume driver must produce an instance of the Firmware Volume
Protocol if the firmware volume is to be visible to the system. The Firmware
Volume Protocol also provides mechanisms for determining and modifying some
attributes of the firmware volume.
@param GetVolumeAttributes
Retrieves volume capabilities and current settings.
@param SetVolumeAttributes
Modifies the current settings of the firmware volume.
@param ReadFile
Reads an entire file from the firmware volume.
@param ReadSection
Reads a single section from a file into a buffer.
@param WriteFile
Writes an entire file into the firmware volume.
@param GetNextFile
Provides service to allow searching the firmware volume.
@param KeySize
Data field that indicates the size in bytes of the Key input buffer for
the GetNextFile() API.
@param ParentHandle
Handle of the parent firmware volume.
**/
struct _EFI_FIRMWARE_VOLUME_PROTOCOL {
EFI_FV_GET_ATTRIBUTES GetVolumeAttributes;
EFI_FV_SET_ATTRIBUTES SetVolumeAttributes;
EFI_FV_READ_FILE ReadFile;
EFI_FV_READ_SECTION ReadSection;
EFI_FV_WRITE_FILE WriteFile;
EFI_FV_GET_NEXT_FILE GetNextFile;
UINT32 KeySize;
EFI_HANDLE ParentHandle;
};
extern EFI_GUID gEfiFirmwareVolumeProtocolGuid;
#endif

View File

@ -0,0 +1,251 @@
/** @file
This file declares Firmware Volume Block protocol.
Low level firmware device access routines to abstract firmware device
hardware.
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: FirmwareVolumeBlock.h
@par Revision Reference:
This protocol is defined in Framework of EFI Firmware Volume Block specification.
Version 0.9
**/
#ifndef __FIRMWARE_VOLUME_BLOCK_H__
#define __FIRMWARE_VOLUME_BLOCK_H__
#define EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID \
{ \
0xDE28BC59, 0x6228, 0x41BD, {0xBD, 0xF6, 0xA3, 0xB9, 0xAD, 0xB5, 0x8D, 0xA1 } \
}
typedef struct _EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL;
/**
Retrieves Volume attributes. No polarity translations are done.
@param This Calling context
@param Attributes output buffer which contains attributes
@retval EFI_INVALID_PARAMETER
@retval EFI_SUCCESS
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FVB_GET_ATTRIBUTES) (
IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
OUT EFI_FVB_ATTRIBUTES *Attributes
)
;
/**
Sets Volume attributes. No polarity translations are done.
@param This Calling context
@param Attributes On input: contains new attributes
On output: contains current attributes of FV
@retval EFI_INVALID_PARAMETER
@retval EFI_SUCCESS
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FVB_SET_ATTRIBUTES) (
IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
IN OUT EFI_FVB_ATTRIBUTES *Attributes
)
;
/**
Retrieves the physical address of a memory mapped FV.
@param This Calling context
@param Attributes Address is a pointer to a caller allocated EFI_PHYSICAL_ADDRESS
that on successful return from GetPhysicalAddress() contains the
base address of the firmware volume.
@retval EFI_UNSUPPORTED
@retval EFI_SUCCESS
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FVB_GET_PHYSICAL_ADDRESS) (
IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
OUT EFI_PHYSICAL_ADDRESS *Address
)
;
/**
Retrieves the size in bytes of a specific block within an FV.
@param This Calling context.
@param Lba Indicates which block to return the size for.
@param BlockSize BlockSize is a pointer to a caller allocated
UINTN in which the size of the block is returned.
@param NumberOfBlocks NumberOfBlocks is a pointer to a caller allocated
UINTN in which the number of consecutive blocks
starting with Lba is returned. All blocks in this
range have a size of BlockSize.
@retval EFI_INVALID_PARAMETER
@retval EFI_SUCCESS
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FVB_GET_BLOCK_SIZE) (
IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
IN EFI_LBA Lba,
OUT UINTN *BlockSize,
OUT UINTN *NumberOfBlocks
)
;
/**
Reads data beginning at Lba:Offset from FV and places the data in Buffer.
The read terminates either when *NumBytes of data have been read, or when
a block boundary is reached. *NumBytes is updated to reflect the actual
number of bytes read.
@param This Calling context
@param Lba Block in which to begin read
@param Offset Offset in the block at which to begin read
@param NumBytes At input, indicates the requested read size. At output, indicates
the actual number of bytes read.
@param Buffer Data buffer in which to place data read.
@retval EFI_INVALID_PARAMETER
@retval EFI_NOT_FOUND
@retval EFI_DEVICE_ERROR
@retval EFI_SUCCESS
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FVB_READ) (
IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
IN EFI_LBA Lba,
IN UINTN Offset,
IN OUT UINTN *NumBytes,
OUT UINT8 *Buffer
)
;
/**
Writes data beginning at Lba:Offset from FV. The write terminates either
when *NumBytes of data have been written, or when a block boundary is
reached. *NumBytes is updated to reflect the actual number of bytes
written.
@param This Calling context
@param Lba Block in which to begin write
@param Offset Offset in the block at which to begin write
@param NumBytes At input, indicates the requested write size. At output, indicates
the actual number of bytes written.
@param Buffer Buffer containing source data for the write.
@retval EFI_INVALID_PARAMETER
@retval EFI_NOT_FOUND
@retval EFI_DEVICE_ERROR
@retval EFI_SUCCESS
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FVB_WRITE) (
IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
IN EFI_LBA Lba,
IN UINTN Offset,
IN OUT UINTN *NumBytes,
IN UINT8 *Buffer
)
;
#define EFI_LBA_LIST_TERMINATOR 0xFFFFFFFFFFFFFFFFULL
/**
The EraseBlock() function erases one or more blocks as denoted by the
variable argument list. The entire parameter list of blocks must be verified
prior to erasing any blocks. If a block is requested that does not exist
within the associated firmware volume (it has a larger index than the last
block of the firmware volume), the EraseBlock() function must return
EFI_INVALID_PARAMETER without modifying the contents of the firmware volume.
@param This Calling context
@param ... Starting LBA followed by Number of Lba to erase. a -1 to terminate
the list.
@retval EFI_INVALID_PARAMETER
@retval EFI_DEVICE_ERROR
@retval EFI_SUCCESS
@retval EFI_ACCESS_DENIED
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FVB_ERASE_BLOCKS) (
IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
...
)
;
/**
@par Protocol Description:
This protocol provides control over block-oriented firmware devices.
Typically, the FFS (or an alternate file system) driver consumes the
Firmware Volume Block Protocol and produces the Firmware Volume Protocol.
@param GetAttributes
Retrieves the current volume attributes.
@param SetAttributes
Sets the current volume attributes.
@param GetPhysicalAddress
Retrieves the memory-mapped address of the firmware volume.
@param GetBlockSize
Retrieves the size for a specific block.
@param Read
Reads n bytes into a buffer from the firmware volume hardware.
@param Write
Writes n bytes from a buffer into the firmware volume hardware.
@param EraseBlocks
Erases specified block(s) and sets all values as indicated by
the EFI_FVB_ERASE_POLARITY bit.
@param ParentHandle
Handle of the parent firmware volume.
**/
struct _EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL {
EFI_FVB_GET_ATTRIBUTES GetVolumeAttributes;
EFI_FVB_SET_ATTRIBUTES SetVolumeAttributes;
EFI_FVB_GET_PHYSICAL_ADDRESS GetPhysicalAddress;
EFI_FVB_GET_BLOCK_SIZE GetBlockSize;
EFI_FVB_READ Read;
EFI_FVB_WRITE Write;
EFI_FVB_ERASE_BLOCKS EraseBlocks;
EFI_HANDLE ParentHandle;
};
extern EFI_GUID gEfiFirmwareVolumeBlockProtocolGuid;
#endif

View File

@ -0,0 +1,33 @@
/** @file
This file declares Firmware Volume Dispatch protocol.
Presence of this protocol tells the dispatch to dispatch from this Firmware
Volume
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: FirmwareVolumeDispatch.h
@par Revision Reference:
This protol will be defined in DXE CIS Spec.
Version 0.91C.
**/
#ifndef __FIRMWARE_VOLUME_DISPATCH_H__
#define __FIRMWARE_VOLUME_DISPATCH_H__
#define EFI_FIRMWARE_VOLUME_DISPATCH_PROTOCOL_GUID \
{ 0x7aa35a69, 0x506c, 0x444f, {0xa7, 0xaf, 0x69, 0x4b, 0xf5, 0x6f, 0x71, 0xc8 } }
extern EFI_GUID gEfiFirmwareVolumeDispatchProtocolGuid;
#endif

View File

@ -0,0 +1,180 @@
/** @file
The EFI_FORM_BROWSER_PROTOCOL is the interface to the EFI
Configuration Driver. This will allow the caller to direct the
configuration driver to use either the HII database or use the passed
in packet of data. This will also allow the caller to post messages
into the configuration drivers internal mailbox.
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: FormBrowser.h
@par Revision Reference:
This protocol is defined in HII spec 0.92.
**/
#ifndef __FORM_BROWSER_H__
#define __FORM_BROWSER_H__
#define EFI_FORM_BROWSER_PROTOCOL_GUID \
{ \
0xe5a1333e, 0xe1b4, 0x4d55, {0xce, 0xeb, 0x35, 0xc3, 0xef, 0x13, 0x34, 0x43 } \
}
typedef struct _EFI_FORM_BROWSER_PROTOCOL EFI_FORM_BROWSER_PROTOCOL;
typedef struct {
UINT32 Length;
UINT16 Type;
UINT8 Data[1];
} EFI_HII_PACKET;
typedef struct {
EFI_HII_IFR_PACK *IfrData;
EFI_HII_STRING_PACK *StringData;
} EFI_IFR_PACKET;
typedef struct {
UINTN LeftColumn;
UINTN RightColumn;
UINTN TopRow;
UINTN BottomRow;
} EFI_SCREEN_DESCRIPTOR;
/**
Provides direction to the configuration driver whether to use the HII
database or a passed-in set of data. This function also establishes a
pointer to the calling driver<65><72>s callback interface.
@param This A pointer to the EFI_FORM_BROWSER_PROTOCOL instance.
@param UseDatabase Determines whether the HII database is to be
used to gather information. If the value is FALSE, the configuration
driver will get the information provided in the passed-in Packet parameters.
@param Handle A pointer to an array of HII handles to display. This value
should correspond to the value of the HII form package that is required to
be displayed.
@param HandleCount The number of handles in the array specified by Handle.
@param Packet A pointer to a set of data containing pointers to IFR
and/or string data.
@param CallbackHandle The handle to the driver<65><72>s callback interface.
This parameter is used only when the UseDatabase parameter is FALSE
and an application wants to register a callback with the browser
@param NvMapOverride This buffer is used only when there is no NV variable
to define the current settings and the caller needs to provide to the browser
the current settings for the "fake" NV variable.
@param ScreenDimensions Allows the browser to be called so that it occupies
a portion of the physical screen instead of dynamically determining the
screen dimensions.
@param ResetRequired This BOOLEAN value will tell the caller if a reset
is required based on the data that might have been changed. The ResetRequired
parameter is primarily applicable for configuration applications, and is an
optional parameter.
@retval EFI_SUCCESS The function completed successfully
@retval EFI_NOT_FOUND The variable was not found.
@retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the result.
DataSize has been updated with the size needed to complete the request.
@retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
@retval EFI_DEVICE_ERROR The variable could not be saved due to a hardware failure.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SEND_FORM) (
IN EFI_FORM_BROWSER_PROTOCOL *This,
IN BOOLEAN UseDatabase,
IN EFI_HII_HANDLE *Handle,
IN UINTN HandleCount,
IN EFI_IFR_PACKET *Packet, OPTIONAL
IN EFI_HANDLE CallbackHandle, OPTIONAL
IN UINT8 *NvMapOverride, OPTIONAL
IN EFI_SCREEN_DESCRIPTOR *ScreenDimensions, OPTIONAL
OUT BOOLEAN *ResetRequired OPTIONAL
);
/**
Routine used to abstract a generic dialog interface and return the selected
key or string.
@param NumberOfLines The number of lines for the dialog box.
@param HotKey Defines whether a single character is parsed (TRUE)
and returned in KeyValue or if a string is returned in StringBuffer.
@param MaximumStringSize The maximum size in bytes of a typed-in string.
Because each character is a CHAR16, the minimum string returned is two bytes.
@param StringBuffer The passed-in pointer to the buffer that will hold
the typed in string if HotKey is FALSE.
@param KeyValue The EFI_INPUT_KEY value returned if HotKey is TRUE.
@param String The pointer to the first string in the list of strings
that comprise the dialog box.
@param ... A series of NumberOfLines text strings that will be used
to construct the dialog box.
@retval EFI_SUCCESS The dialog was displayed and user interaction was received.
@retval EFI_DEVICE_ERROR The user typed in an ESC character to exit the routine.
@retval EFI_INVALID_PARAMETER One of the parameters was invalid
**/
typedef
EFI_STATUS
(EFIAPI *EFI_CREATE_POP_UP) (
IN UINTN NumberOfLines,
IN BOOLEAN HotKey,
IN UINTN MaximumStringSize,
OUT CHAR16 *StringBuffer,
OUT EFI_INPUT_KEY *KeyValue,
IN CHAR16 *String,
...
);
/**
@par Protocol Description:
The EFI_FORM_BROWSER_PROTOCOL is the interface to call for drivers to
leverage the EFI configuration driver interface.
@param SendForm
Provides direction to the configuration driver whether to use the HII
database or to use a passed-in set of data. This functions also establishes
a pointer to the calling driver<65><72>s callback interface.
@param CreatePopUp
Routine used to abstract a generic dialog interface and return the
selected key or string.
**/
struct _EFI_FORM_BROWSER_PROTOCOL {
EFI_SEND_FORM SendForm;
EFI_CREATE_POP_UP CreatePopUp;
};
extern EFI_GUID gEfiFormBrowserProtocolGuid;
#endif

View File

@ -0,0 +1,227 @@
/** @file
The EFI_FORM_CALLBACK_PROTOCOL is the defined interface for access to custom
NV storage devices as well as communication of user selections in a more
interactive environment. This protocol should be published by hardware
specific drivers which want to export access to custom hardware storage or
publish IFR which has a requirement to call back the original driver.
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: FormCallback.h
@par Revision Reference:
This protocol is defined in HII spec 0.92.
**/
#ifndef __FORM_CALLBACK_H__
#define __FORM_CALLBACK_H__
#define EFI_FORM_CALLBACK_PROTOCOL_GUID \
{ \
0xf3e4543d, 0xcf35, 0x6cef, {0x35, 0xc4, 0x4f, 0xe6, 0x34, 0x4d, 0xfc, 0x54 } \
}
//
// Forward reference for pure ANSI compatability
//
typedef struct _EFI_FORM_CALLBACK_PROTOCOL EFI_FORM_CALLBACK_PROTOCOL;
#define RESET_REQUIRED 1 // Flags setting to signify that the callback operation resulted in an eventual
// reset to be done upon exit of the browser
//
#define EXIT_REQUIRED 2 // Flags setting to signify that after the processing of the callback results - exit the browser
#define SAVE_REQUIRED 4 // Flags setting to signify that after the processing of the callback results - save the NV data
#define NV_CHANGED 8 // Flags setting to signify that after the processing of the callback results - turn the NV flag on
#define NV_NOT_CHANGED 16 // Flags setting to signify that after the processing of the callback results - turn the NV flag off
#pragma pack(1)
typedef struct {
UINT8 OpCode; // Likely a string, numeric, or one-of
UINT8 Length; // Length of the EFI_IFR_DATA_ENTRY packet
UINT16 Flags; // Flags settings to determine what behavior is desired from the browser after the callback
VOID *Data; // The data in the form based on the op-code type - this is not a pointer to the data, the data follows immediately
// If the OpCode is a OneOf or Numeric type - Data is a UINT16 value
// If the OpCode is a String type - Data is a CHAR16[x] type
// If the OpCode is a Checkbox type - Data is a UINT8 value
// If the OpCode is a NV Access type - Data is a EFI_IFR_NV_DATA structure
//
} EFI_IFR_DATA_ENTRY;
typedef struct {
VOID *NvRamMap; // If the flag of the op-code specified retrieval of a copy of the NVRAM map,
// this is a pointer to a buffer copy
//
UINT32 EntryCount; // How many EFI_IFR_DATA_ENTRY entries
//
// EFI_IFR_DATA_ENTRY Data[1]; // The in-line Data entries.
//
} EFI_IFR_DATA_ARRAY;
typedef union {
EFI_IFR_DATA_ARRAY DataArray; // Primarily used by those who call back to their drivers and use HII as a repository
EFI_IFR_PACKET DataPacket; // Primarily used by those which do not use HII as a repository
CHAR16 *String; // If returning an error - fill the string with null-terminated contents
} EFI_HII_CALLBACK_PACKET;
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT16 QuestionId; // Offset into the map
UINT8 StorageWidth; // Width of the value
//
// CHAR8 Data[1]; // The Data itself
//
} EFI_IFR_NV_DATA;
#pragma pack()
//
// The following types are currently defined:
//
/**
Returns the value of a variable.
@param This A pointer to the EFI_FORM_CALLBACK_PROTOCOL instance.
@param VariableName A NULL-terminated Unicode string that is the
name of the vendor<6F><72>s variable.
@param VendorGuid A unique identifier for the vendor.
@param Attributes If not NULL, a pointer to the memory location to
return the attribute's bit-mask for the variable.
@param DataSize The size in bytes of the Buffer. A size of zero causes
the variable to be deleted.
@param Buffer The buffer to return the contents of the variable.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_NOT_FOUND The variable was not found.
@retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the result.
DataSize has been updated with the size needed to complete the request.
@retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
@retval EFI_DEVICE_ERROR The variable could not be saved due to a hardware failure.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_NV_READ) (
IN EFI_FORM_CALLBACK_PROTOCOL *This,
IN CHAR16 *VariableName,
IN EFI_GUID *VendorGuid,
OUT UINT32 *Attributes OPTIONAL,
IN OUT UINTN *DataSize,
OUT VOID *Buffer
);
/**
Sets the value of a variable.
@param This A pointer to the EFI_FORM_CALLBACK_PROTOCOL instance.
@param VariableName A NULL-terminated Unicode string that is the
name of the vendor's variable. Each VariableName is unique for each VendorGuid.
@param VendorGuid A unique identifier for the vendor.
@param Attributes Attributes bit-mask to set for the variable.
@param DataSize The size in bytes of the Buffer. A size of zero causes
the variable to be deleted.
@param Buffer The buffer containing the contents of the variable.
@param ResetRequired Returns a value from the driver that abstracts
this information and will enable a system to know if a system reset
is required to achieve the configuration changes being enabled through
this function.
@retval EFI_SUCCESS The firmware has successfully stored the variable and
its data as defined by the Attributes.
@retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold
the variable and its data.
@retval EFI_INVALID_PARAMETER An invalid combination of Attributes bits
was supplied, or the DataSize exceeds the maximum allowed.
@retval EFI_DEVICE_ERROR The variable could not be saved due to a hardware failure.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_NV_WRITE) (
IN EFI_FORM_CALLBACK_PROTOCOL *This,
IN CHAR16 *VariableName,
IN EFI_GUID *VendorGuid,
IN UINT32 Attributes,
IN UINTN DataSize,
IN VOID *Buffer,
OUT BOOLEAN *ResetRequired
);
/**
This function is called to provide results data to the driver.
@param This A pointer to the EFI_FORM_CALLBACK_PROTOCOL instance.
@param KeyValue A unique value which is sent to the original exporting
driver so that it can identify the type of data to expect. The format of
the data tends to vary based on the opcode that generated the callback.
@param Data A pointer to the data being sent to the original exporting driver.
@param Packet A pointer to a packet of information which a driver passes
back to the browser.
@return Status Code
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FORM_CALLBACK) (
IN EFI_FORM_CALLBACK_PROTOCOL *This,
IN UINT16 KeyValue,
IN EFI_IFR_DATA_ARRAY *Data,
OUT EFI_HII_CALLBACK_PACKET **Packet
);
/**
@par Protocol Description:
The EFI_FORM_CALLBACK_PROTOCOL is the defined interface for access to
custom NVS devices as well as communication of user selections in a more
interactive environment. This protocol should be published by hardware-specific
drivers that want to export access to custom hardware storage or publish IFR
that has a requirement to call back the original driver.
@param NvRead
The read operation to access the NV data serviced by a hardware-specific driver.
@param NvWrite
The write operation to access the NV data serviced by a hardware-specific driver.
@param Callback
The function that is called from the configuration browser to communicate key value pairs.
**/
struct _EFI_FORM_CALLBACK_PROTOCOL {
EFI_NV_READ NvRead;
EFI_NV_WRITE NvWrite;
EFI_FORM_CALLBACK Callback;
};
extern EFI_GUID gEfiFormCallbackProtocolGuid;
#endif

View File

@ -0,0 +1,194 @@
/** @file
Graphics Output Protocol from the UEFI 2.0 specification.
Abstraction of a very simple graphics device.
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
**/
#ifndef __GRAPHICS_OUTPUT_H__
#define __GRAPHICS_OUTPUT_H__
#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;
/**
Return the current video mode information.
@param This Protocol instance pointer.
@param ModeNumber The mode number to return information on.
@param SizeOfInfo A pointer to the size, in bytes, of the Info buffer.
@param Info A pointer to callee allocated buffer that returns information about ModeNumber.
@retval EFI_SUCCESS Mode information returned.
@retval EFI_BUFFER_TOO_SMALL The Info buffer was too small.
@retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the video mode.
@retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
@retval EFI_INVALID_PARAMETER One of the input args was NULL.
**/
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
)
;
/**
Return the current video mode information.
@param This Protocol instance pointer.
@param ModeNumber The mode number to be set.
@retval EFI_SUCCESS Graphics mode was changed.
@retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
@retval EFI_UNSUPPORTED ModeNumber is not supported by this device.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE) (
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
IN UINT32 ModeNumber
)
;
typedef struct {
UINT8 Blue;
UINT8 Green;
UINT8 Red;
UINT8 Reserved;
} 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;
/**
The following table defines actions for BltOperations:
<B>EfiBltVideoFill</B> - 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.
<B>EfiBltVideoToBltBuffer</B> - 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.
<B>EfiBltBufferToVideo</B> - 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.
<B>EfiBltVideoToVideo</B> - 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.
@param This Protocol instance pointer.
@param BltBuffer Buffer containing data to blit into video buffer. This
buffer has a size of Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
@param BltOperation Operation to perform on BlitBuffer and video memory
@param SourceX X coordinate of source for the BltBuffer.
@param SourceY Y coordinate of source for the BltBuffer.
@param DestinationX X coordinate of destination for the BltBuffer.
@param DestinationY Y coordinate of destination for the BltBuffer.
@param Width Width of rectangle in BltBuffer in pixels.
@param Height Hight of rectangle in BltBuffer in pixels.
@param Delta OPTIONAL
@retval EFI_SUCCESS The Blt operation completed.
@retval EFI_INVALID_PARAMETER BltOperation is not valid.
@retval EFI_DEVICE_ERROR A hardware error occured writting to the video buffer.
**/
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
);
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;
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;
};
extern EFI_GUID gEfiGraphicsOutputProtocolGuid;
#endif

View File

@ -0,0 +1,102 @@
/** @file
This file declares GUIDed section extraction protocol.
This interface provides a means of decoding a GUID defined encapsulation
section. There may be multiple different GUIDs associated with the GUIDed
section extraction protocol. That is, all instances of the GUIDed section
extraction protocol must have the same interface structure.
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: GuidedSectionExtraction.h
@par Revision Reference:
This protocol is defined in Firmware Volume Specification.
Version 0.9
**/
#ifndef __GUIDED_SECTION_EXTRACTION_PROTOCOL_H__
#define __GUIDED_SECTION_EXTRACTION_PROTOCOL_H__
//
// Protocol GUID definition. Each GUIDed section extraction protocol has the
// same interface but with different GUID. All the GUIDs is defined here.
// May add multiple GUIDs here.
//
#define EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID \
{ \
0xFC1BCDB0, 0x7D31, 0x49aa, {0x93, 0x6A, 0xA4, 0x60, 0x0D, 0x9D, 0xD0, 0x83 } \
}
//
// Forward reference for pure ANSI compatability
//
typedef struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL;
//
// Protocol member functions
//
/**
Processes the input section and returns the data contained therein along
with the authentication status.
@param This Indicates the EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL instance.
@param InputSection Buffer containing the input GUIDed section to be processed.
@param OutputBuffer *OutputBuffer is allocated from boot services pool memory
and contains the new section stream.
@param OutputSize A pointer to a caller-allocated UINTN in which the size
of *OutputBuffer allocation is stored.
@param AuthenticationStatus A pointer to a caller-allocated UINT32 that
indicates the authentication status of the output buffer.
@retval EFI_SUCCESS The InputSection was successfully processed and the
section contents were returned.
@retval EFI_OUT_OF_RESOURCES The system has insufficient resources to
process the request.
@retval EFI_INVALID_PARAMETER The GUID in InputSection does not match
this instance of the GUIDed Section Extraction Protocol.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_EXTRACT_GUIDED_SECTION) (
IN EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This,
IN VOID *InputSection,
OUT VOID **OutputBuffer,
OUT UINTN *OutputSize,
OUT UINT32 *AuthenticationStatus
);
//
// Protocol definition
//
/**
@par Protocol Description:
If a GUID-defined section is encountered when doing section extraction,
the section extraction driver calls the appropriate instance of the GUIDed
Section Extraction Protocol to extract the section stream contained therein.
@param ExtractSection
Takes the GUIDed section as input and produces the section stream data.
**/
struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL {
EFI_EXTRACT_GUIDED_SECTION ExtractSection;
};
//
// may add other GUID here
//
extern EFI_GUID gEfiCrc32GuidedSectionExtractionProtocolGuid;
#endif

View File

@ -0,0 +1,149 @@
/** @file
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.
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
**/
#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;
/**
Returns the size of the hash which results from a specific algorithm.
@param This Points to this instance of EFI_HASH_PROTOCOL.
@param HashAlgorithm Points to the EFI_GUID which identifies the algorithm to use.
@param HashSize Holds the returned size of the algorithm<68><6D>s hash.
@retval EFI_SUCCESS Hash size returned successfully.
@retval EFI_INVALID_PARAMETER HashSize is NULL
@retval EFI_UNSUPPORTED The algorithm specified by HashAlgorithm is not supported
by this driver.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_HASH_GET_HASH_SIZE) (
IN CONST EFI_HASH_PROTOCOL *This,
IN CONST EFI_GUID *HashAlgorithm,
OUT UINTN *HashSize
)
;
/**
Returns the size of the hash which results from a specific algorithm.
@param This Points to this instance of EFI_HASH_PROTOCOL.
@param HashAlgorithm Points to the EFI_GUID which identifies the algorithm to use.
@param Extend Specifies whether to create a new hash (FALSE) or extend the specified
existing hash (TRUE).
@param Message Points to the start of the message.
@param MessageSize The size of Message, in bytes.
@param Hash On input, if Extend is TRUE, then this holds the hash to extend. On
output, holds the resulting hash computed from the message.
@retval EFI_SUCCESS Hash returned successfully.
@retval EFI_INVALID_PARAMETER Message or Hash is NULL
@retval 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.
**/
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
)
;
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

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,411 @@
/** @file
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: IP4.h
**/
#ifndef __EFI_IP4_PROTOCOL_H__
#define __EFI_IP4_PROTOCOL_H__
#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 } \
}
typedef struct _EFI_IP4_PROTOCOL EFI_IP4_PROTOCOL;
typedef struct {
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_IPv4_ADDRESS SubnetAddress;
EFI_IPv4_ADDRESS SubnetMask;
EFI_IPv4_ADDRESS GatewayAddress;
} EFI_IP4_ROUTE_TABLE;
typedef struct {
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 {
#ifdef EFI_NET_LITTLE_ENDIAN
UINT8 HeaderLength:4;
UINT8 Version:4;
#else
UINT8 Version:4;
UINT8 HeaderLength:4;
#endif
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 {
UINT32 FragmentLength;
VOID *FragmentBuffer;
} EFI_IP4_FRAGMENT_DATA;
typedef struct {
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_IPv4_ADDRESS SourceAddress;
EFI_IPv4_ADDRESS GatewayAddress;
UINT8 Protocol;
UINT8 TypeOfService;
UINT8 TimeToLive;
BOOLEAN DoNotFragment;
} EFI_IP4_OVERRIDE_DATA;
typedef struct {
EFI_IPv4_ADDRESS DestinationAddress;
EFI_IP4_OVERRIDE_DATA *OverrideData; //OPTIONAL
UINT32 OptionsLength; //OPTIONAL
VOID *OptionsBuffer; //OPTIONAL
UINT32 TotalDataLength;
UINT32 FragmentCount;
EFI_IP4_FRAGMENT_DATA FragmentTable[1];
} EFI_IP4_TRANSMIT_DATA;
typedef struct {
EFI_EVENT Event;
EFI_STATUS Status;
union {
EFI_IP4_RECEIVE_DATA *RxData;
EFI_IP4_TRANSMIT_DATA *TxData;
} Packet;
} EFI_IP4_COMPLETION_TOKEN;
/**
Gets the current operational settings for this instance of the EFI IPv4 Protocol driver.
@param This Pointer to the EFI_IP4_PROTOCOL instance.
@param Ip4ModeData Pointer to the EFI IPv4 Protocol mode data structure.
@param MnpConfigData Pointer to the managed network configuration data structure.
@param SnpData Pointer to the simple network mode data structure.
@retval EFI_SUCCESS The operation completed successfully.
@retval EFI_INVALID_PARAMETER This is NULL.
@retval EFI_OUT_OF_RESOURCES The required mode data could not be allocated.
**/
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
)
;
/**
Assigns an IPv4 address and subnet mask to this EFI IPv4 Protocol driver instance.
@param This Pointer to the EFI_IP4_PROTOCOL instance.
@param IpConfigData Pointer to the EFI IPv4 Protocol configuration data structure.
@retval EFI_SUCCESS The driver instance was successfully opened.
@retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP,
RARP, etc.) is not finished yet.
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
@retval EFI_UNSUPPORTED One or more of the following conditions is TRUE:
A configuration protocol (DHCP, BOOTP, RARP, etc.) could
not be located when clients choose to use the default IPv4
address. This EFI IPv4 Protocol implementation does not
support this requested filter or timeout setting.
@retval EFI_OUT_OF_RESOURCES The EFI IPv4 Protocol driver instance data could not be allocated.
@retval EFI_ALREADY_STARTED The interface is already open and must be stopped before the
IPv4 address or subnet mask can be changed. The interface must
also be stopped when switching to/from raw packet mode.
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI IPv4
Protocol driver instance is not opened.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_IP4_CONFIGURE) (
IN EFI_IP4_PROTOCOL *This,
IN EFI_IP4_CONFIG_DATA *IpConfigData OPTIONAL
)
;
/**
Joins and leaves multicast groups.
@param This Pointer to the EFI_IP4_PROTOCOL instance.
@param JoinFlag Set to TRUE to join the multicast group session and FALSE to leave.
@param GroupAddress Pointer to the IPv4 multicast address.
@retval EFI_SUCCESS The operation completed successfully.
@retval EFI_INVALID_PARAMETER One or more of the following is TRUE:
- This is NULL.
- JoinFlag is TRUE and GroupAddress is NULL.
- GroupAddress is not NULL and *GroupAddress is
not a multicast IPv4 address.
@retval EFI_NOT_STARTED This instance has not been started.
@retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP,
RARP, etc.) is not finished yet.
@retval EFI_OUT_OF_RESOURCES System resources could not be allocated.
@retval EFI_UNSUPPORTED This EFI IPv4 Protocol implementation does not support multicast groups.
@retval EFI_ALREADY_STARTED The group address is already in the group table (when
JoinFlag is TRUE).
@retval EFI_NOT_FOUND The group address is not in the group table (when JoinFlag is FALSE).
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_IP4_GROUPS) (
IN EFI_IP4_PROTOCOL *This,
IN BOOLEAN JoinFlag,
IN EFI_IPv4_ADDRESS *GroupAddress OPTIONAL
)
;
/**
Adds and deletes routing table entries.
@param This Pointer to the EFI_IP4_PROTOCOL instance.
@param DeleteRoute Set to TRUE to delete this route from the routing table. Set to
FALSE to add this route to the routing table. SubnetAddress
and SubnetMask are used as the key to each route entry.
@param SubnetAddress The address of the subnet that needs to be routed.
@param SubnetMask The subnet mask of SubnetAddress.
@param GatewayAddress The unicast gateway IPv4 address for this route.
@retval EFI_SUCCESS The operation completed successfully.
@retval EFI_NOT_STARTED The driver instance has not been started.
@retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP,
RARP, etc.) is not finished yet.
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
- This is NULL.
- SubnetAddress is NULL.
- SubnetMask is NULL.
- GatewayAddress is NULL.
- *SubnetAddress is not a valid subnet address.
- *SubnetMask is not a valid subnet mask.
- *GatewayAddress is not a valid unicast IPv4 address.
@retval EFI_OUT_OF_RESOURCES Could not add the entry to the routing table.
@retval EFI_NOT_FOUND This route is not in the routing table (when DeleteRoute is TRUE).
@retval EFI_ACCESS_DENIED The route is already defined in the routing table (when
DeleteRoute is FALSE).
**/
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
)
;
/**
Places outgoing data packets into the transmit queue.
@param This Pointer to the EFI_IP4_PROTOCOL instance.
@param Token Pointer to the transmit token.
@retval EFI_SUCCESS The data has been queued for transmission.
@retval EFI_NOT_STARTED This instance has not been started.
@retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP,
RARP, etc.) is not finished yet.
@retval EFI_INVALID_PARAMETER One or more pameters are invalid.
@retval EFI_ACCESS_DENIED The transmit completion token with the same Token.Event
was already in the transmit queue.
@retval EFI_NOT_READY The completion token could not be queued because the transmit
queue is full.
@retval EFI_NOT_FOUND Not route is found to destination address.
@retval EFI_OUT_OF_RESOURCES Could not queue the transmit data.
@retval EFI_BUFFER_TOO_SMALL Token.Packet.TxData.TotalDataLength is too
short to transmit.
@retval EFI_BAD_BUFFER_SIZE The length of the IPv4 header + option length + total data length is
greater than MTU (or greater than the maximum packet size if
Token.Packet.TxData.OverrideData.
DoNotFragment is TRUE.)
**/
typedef
EFI_STATUS
(EFIAPI *EFI_IP4_TRANSMIT) (
IN EFI_IP4_PROTOCOL *This,
IN EFI_IP4_COMPLETION_TOKEN *Token
)
;
/**
Places a receiving request into the receiving queue.
@param This Pointer to the EFI_IP4_PROTOCOL instance.
@param Token Pointer to a token that is associated with the receive data descriptor.
@retval EFI_SUCCESS The receive completion token was cached.
@retval EFI_NOT_STARTED This EFI IPv4 Protocol instance has not been started.
@retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP, RARP, etc.)
is not finished yet.
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
- This is NULL.
- Token is NULL.
- Token.Event is NULL.
@retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of system
resources (usually memory).
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
The EFI IPv4 Protocol instance has been reset to startup defaults.
EFI_ACCESS_DENIED The receive completion token with the same Token.Event was already
in the receive queue.
@retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.
@retval EFI_ICMP_ERROR An ICMP error packet was received.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_IP4_RECEIVE) (
IN EFI_IP4_PROTOCOL *This,
IN EFI_IP4_COMPLETION_TOKEN *Token
)
;
/**
Abort an asynchronous transmit or receive request.
@param This Pointer to the EFI_IP4_PROTOCOL instance.
@param Token Pointer to a token that has been issued by
EFI_IP4_PROTOCOL.Transmit() or
EFI_IP4_PROTOCOL.Receive(). If NULL, all pending
tokens are aborted. Type EFI_IP4_COMPLETION_TOKEN is
defined in EFI_IP4_PROTOCOL.Transmit().
@retval EFI_SUCCESS The asynchronous I/O request was aborted and
Token.->Event was signaled. When Token is NULL, all
pending requests were aborted and their events were signaled.
@retval EFI_INVALID_PARAMETER This is NULL.
@retval EFI_NOT_STARTED This instance has not been started.
@retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP,
RARP, etc.) is not finished yet.
@retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was
not found in the transmit or receive queue. It has either completed
or was not issued by Transmit() and Receive().
**/
typedef
EFI_STATUS
(EFIAPI *EFI_IP4_CANCEL) (
IN EFI_IP4_PROTOCOL *This,
IN EFI_IP4_COMPLETION_TOKEN *Token OPTIONAL
)
;
/**
Polls for incoming data packets and processes outgoing data packets.
@param This Pointer to the EFI_IP4_PROTOCOL instance.
@retval EFI_SUCCESS Incoming or outgoing data was processed.
@retval EFI_NOT_STARTED This EFI IPv4 Protocol instance has not been started.
@retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP,
RARP, etc.) is not finished yet.
@retval EFI_INVALID_PARAMETER This is NULL.
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
@retval EFI_NOT_READY No incoming or outgoing data is processed.
@retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
Consider increasing the polling rate.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_IP4_POLL) (
IN EFI_IP4_PROTOCOL *This
)
;
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;
};
extern EFI_GUID gEfiIp4ServiceBindingProtocolGuid;
extern EFI_GUID gEfiIp4ProtocolGuid;
#endif

View File

@ -0,0 +1,121 @@
/** @file
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
**/
#ifndef __EFI_IP4CONFIG_PROTOCOL_H__
#define __EFI_IP4CONFIG_PROTOCOL_H__
#define EFI_IP4_CONFIG_PROTOCOL_GUID \
{ \
0x3b95aa31, 0x3793, 0x434b, {0x86, 0x67, 0xc8, 0x07, 0x08, 0x92, 0xe0, 0x5e } \
}
typedef struct _EFI_IP4_CONFIG_PROTOCOL 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; //OPTIONAL
} EFI_IP4_IPCONFIG_DATA;
/**
Starts running the configuration policy for the EFI IPv4 Protocol driver.
@param This Pointer to the EFI_IP4_CONFIG_PROTOCOL instance.
@param DoneEvent Event that will be signaled when the EFI IPv4 Protocol driver
configuration policy completes execution. This event must be of
type EVT_NOTIFY_SIGNAL.
@param ReconfigEvent Event that will be signaled when the EFI IPv4 Protocol driver
configuration needs to be updated. This event must be of type
EVT_NOTIFY_SIGNAL.
@retval EFI_SUCCESS The configuration policy for the EFI IPv4 Protocol driver is now
running.
@retval EFI_INVALID_PARAMETER This, DoneEvent, or ReconfigEvent is NULL.
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
@retval EFI_ALREADY_STARTED The configuration policy for the EFI IPv4 Protocol driver was
already started.
@retval EFI_DEVICE_ERROR An unexpected system error or network error occurred.
@retval EFI_UNSUPPORTED This interface does not support the EFI IPv4 Protocol driver
configuration.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_IP4_CONFIG_START) (
IN EFI_IP4_CONFIG_PROTOCOL *This,
IN EFI_EVENT DoneEvent,
IN EFI_EVENT ReconfigEvent
)
;
/**
Stops running the configuration policy for the EFI IPv4 Protocol driver.
@param This Pointer to the EFI_IP4_CONFIG_PROTOCOL instance.
@retval EFI_SUCCESS The configuration policy for the EFI IPv4 Protocol driver has been stopped.
@retval EFI_INVALID_PARAMETER This is NULL.
@retval EFI_NOT_STARTED The configuration policy for the EFI IPv4 Protocol driver was not started.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_IP4_CONFIG_STOP) (
IN EFI_IP4_CONFIG_PROTOCOL *This
)
;
/**
Returns the default configuration data (if any) for the EFI IPv4 Protocol driver.
@param This Pointer to the EFI_IP4_CONFIG_PROTOCOL instance.
@param IpConfigDataSize On input, the size of the IpConfigData buffer.
On output, the count of bytes that were written into the IpConfigData buffer.
@param IpConfigData Pointer to the EFI IPv4 Configuration Protocol driver
configuration data structure.
@retval EFI_SUCCESS The EFI IPv4 Protocol driver configuration has been returned.
@retval EFI_INVALID_PARAMETER This is NULL.
@retval EFI_NOT_STARTED The configuration policy for the EFI IPv4 Protocol driver is not
running.
@retval EFI_NOT_READY EFI IPv4 Protocol driver configuration is still running.
@retval EFI_ABORTED EFI IPv4 Protocol driver configuration could not complete.
@retval EFI_BUFFER_TOO_SMALL *IpConfigDataSize is smaller than the configuration data
buffer or IpConfigData is NULL.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_IP4_CONFIG_GET_DATA) (
IN EFI_IP4_CONFIG_PROTOCOL *This,
IN OUT UINTN *IpConfigDataSize,
OUT EFI_IP4_IPCONFIG_DATA *IpConfigData OPTIONAL
)
;
struct _EFI_IP4_CONFIG_PROTOCOL {
EFI_IP4_CONFIG_START Start;
EFI_IP4_CONFIG_STOP Stop;
EFI_IP4_CONFIG_GET_DATA GetData;
};
extern EFI_GUID gEfiIp4ConfigProtocolGuid;
#endif

View File

@ -0,0 +1,92 @@
/** @file
EFI_ISCSI_INITIATOR_NAME_PROTOCOL as defined in UEFI 2.0.
It rovides the ability to get and set the iSCSI Initiator Name.
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
**/
#ifndef __ISCSI_INITIATOR_NAME_H__
#define __ISCSI_INITIATOR_NAME_H__
#define EFI_ISCSI_INITIATOR_NAME_PROTOCOL_GUID \
{ \
0xa6a72875, 0x2962, 0x4c18, {0x9f, 0x46, 0x8d, 0xa6, 0x44, 0xcc, 0xfe } \
}
typedef struct _EFI_ISCSI_INITIATOR_NAME_PROTOCOL EFI_ISCSI_INITIATOR_NAME_PROTOCOL;
/**
Retrieves the current set value of iSCSI Initiator Name.
@param This Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL instance.
@param BufferSize Size of the buffer in bytes pointed to by Buffer / Actual size of the
variable data buffer.
@param Buffer Pointer to the buffer for data to be read.
@retval EFI_SUCCESS Data was successfully retrieved into the provided buffer and the
BufferSize was sufficient to handle the iSCSI initiator name
@retval EFI_BUFFER_TOO_SMALL BufferSize is too small for the result.
@retval EFI_INVALID_PARAMETER BufferSize or Buffer is NULL.
@retval EFI_DEVICE_ERROR The iSCSI initiator name could not be retrieved due to a hardware error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_ISCSI_INITIATOR_NAME_GET) (
IN EFI_ISCSI_INITIATOR_NAME_PROTOCOL *This,
IN OUT UINTN *BufferSize,
OUT VOID *Buffer
)
;
/**
Sets the iSCSI Initiator Name.
@param This Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL instance.
@param BufferSize Size of the buffer in bytes pointed to by Buffer.
@param Buffer Pointer to the buffer for data to be written.
@retval EFI_SUCCESS Data was successfully stored by the protocol.
@retval EFI_UNSUPPORTED Platform policies do not allow for data to be written.
@retval EFI_INVALID_PARAMETER BufferSize or Buffer is NULL, or BufferSize exceeds the maximum allowed limit.
@retval EFI_DEVICE_ERROR The data could not be stored due to a hardware error.
@retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the data.
@retval EFI_PROTOCOL_ERROR Input iSCSI initiator name does not adhere to RFC 3720
(and other related protocols)
**/
typedef EFI_STATUS
(EFIAPI *EFI_ISCSI_INITIATOR_NAME_SET) (
IN EFI_ISCSI_INITIATOR_NAME_PROTOCOL *This,
IN OUT UINTN *BufferSize,
IN VOID *Buffer
)
;
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,485 @@
/** @file
This file declares EFI IDE Controller Init Protocol
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: IdeControllerInit.h
@par Revision Reference:
This Protocol is defined in IDE Controller Initialization Protocol Specification
Version 0.9
**/
#ifndef _EFI_IDE_CONTROLLER_INIT_PROTOCOL_H
#define _EFI_IDE_CONTROLLER_INIT_PROTOCOL_H
//
// Global ID for the EFI Platform IDE Protocol GUID
//
#define EFI_IDE_CONTROLLER_INIT_PROTOCOL_GUID \
{ 0xa1e37052, 0x80d9, 0x4e65, {0xa3, 0x17, 0x3e, 0x9a, 0x55, 0xc4, 0x3e, 0xc9 } }
//
// Forward reference for pure ANSI compatability
//
typedef struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL EFI_IDE_CONTROLLER_INIT_PROTOCOL;
//
//////////////////////////////////////////////////////////////////////////////////////////
// EFI_IDE_BUS_ENUMERATION_PHASE
// EFI_IDE_CONTROLLER_ENUM_PHASE
//
typedef enum{
EfiIdeBeforeChannelEnumeration,
EfiIdeAfterChannelEnumeration,
EfiIdeBeforeChannelReset,
EfiIdeAfterChannelReset,
EfiIdeBusBeforeDevicePresenceDetection,
EfiIdeBusAfterDevicePresenceDetection,
EfiIdeResetMode,
EfiIdeBusPhaseMaximum
} EFI_IDE_CONTROLLER_ENUM_PHASE;
//
//******************************************************
// EFI_ATA_EXT_TRANSFER_PROTOCOL
//******************************************************
//
// This extended mode describes the SATA physical protocol.
// SATA physical layers can operate at different speeds.
// These speeds are defined below. Various PATA protocols
// and associated modes are not applicable to SATA devices.
//
typedef enum {
EfiAtaSataTransferProtocol
} EFI_ATA_EXT_TRANSFER_PROTOCOL;
#define EFI_SATA_AUTO_SPEED 0
#define EFI_SATA_GEN1_SPEED 1
#define EFI_SATA_GEN2_SPEED 2
//
//*******************************************************
// EFI_IDE_CABLE_TYPE
//*******************************************************
//
typedef enum {
EfiIdeCableTypeUnknown,
EfiIdeCableType40pin,
EfiIdeCableType80Pin,
EfiIdeCableTypeSerial,
EfiIdeCableTypeMaximum
} EFI_IDE_CABLE_TYPE;
//
//******************************************************
// EFI_ATA_MODE
//******************************************************
//
typedef struct {
BOOLEAN Valid;
UINT32 Mode;
} EFI_ATA_MODE;
//
//******************************************************
// EFI_ATA_EXTENDED_MODE
//******************************************************
//
typedef struct {
EFI_ATA_EXT_TRANSFER_PROTOCOL TransferProtocol;
UINT32 Mode;
} EFI_ATA_EXTENDED_MODE;
//
//******************************************************
// EFI_ATA_COLLECTIVE_MODE
//******************************************************
//
typedef struct {
EFI_ATA_MODE PioMode;
EFI_ATA_MODE SingleWordDmaMode;
EFI_ATA_MODE MultiWordDmaMode;
EFI_ATA_MODE UdmaMode;
UINT32 ExtModeCount;
EFI_ATA_EXTENDED_MODE ExtMode[1];
} EFI_ATA_COLLECTIVE_MODE;
//
//*******************************************************
// EFI_ATA_IDENTIFY_DATA
//*******************************************************
//
#pragma pack(1)
typedef struct {
UINT16 config; // General Configuration
UINT16 cylinders; // Number of Cylinders
UINT16 reserved_2;
UINT16 heads; //Number of logical heads
UINT16 vendor_data1;
UINT16 vendor_data2;
UINT16 sectors_per_track;
UINT16 vendor_specific_7_9[3];
CHAR8 SerialNo[20]; // ASCII
UINT16 vendor_specific_20_21[2];
UINT16 ecc_bytes_available;
CHAR8 FirmwareVer[8]; // ASCII
CHAR8 ModelName[40]; // ASCII
UINT16 multi_sector_cmd_max_sct_cnt;
UINT16 reserved_48;
UINT16 capabilities;
UINT16 reserved_50;
UINT16 pio_cycle_timing;
UINT16 reserved_52;
UINT16 field_validity;
UINT16 current_cylinders;
UINT16 current_heads;
UINT16 current_sectors;
UINT16 CurrentCapacityLsb;
UINT16 CurrentCapacityMsb;
UINT16 reserved_59;
UINT16 user_addressable_sectors_lo;
UINT16 user_addressable_sectors_hi;
UINT16 reserved_62;
UINT16 multi_word_dma_mode;
UINT16 advanced_pio_modes;
UINT16 min_multi_word_dma_cycle_time;
UINT16 rec_multi_word_dma_cycle_time;
UINT16 min_pio_cycle_time_without_flow_control;
UINT16 min_pio_cycle_time_with_flow_control;
UINT16 reserved_69_79[11];
UINT16 major_version_no;
UINT16 minor_version_no;
UINT16 command_set_supported_82; // word 82
UINT16 command_set_supported_83; // word 83
UINT16 command_set_feature_extn; // word 84
UINT16 command_set_feature_enb_85; // word 85
UINT16 command_set_feature_enb_86; // word 86
UINT16 command_set_feature_default; // word 87
UINT16 ultra_dma_mode; // word 88
UINT16 reserved_89_127[39];
UINT16 security_status;
UINT16 vendor_data_129_159[31];
UINT16 reserved_160_255[96];
} EFI_ATA_IDENTIFY_DATA;
#pragma pack()
//
//*******************************************************
// EFI_ATAPI_IDENTIFY_DATA
//*******************************************************
//
#pragma pack(1)
typedef struct {
UINT16 config; // General Configuration
UINT16 obsolete_1;
UINT16 specific_config;
UINT16 obsolete_3;
UINT16 retired_4_5[2];
UINT16 obsolete_6;
UINT16 cfa_reserved_7_8[2];
UINT16 retired_9;
CHAR8 SerialNo[20]; // ASCII
UINT16 retired_20_21[2];
UINT16 obsolete_22;
CHAR8 FirmwareVer[8]; // ASCII
CHAR8 ModelName[40]; // ASCII
UINT16 multi_sector_cmd_max_sct_cnt;
UINT16 reserved_48;
UINT16 capabilities_49;
UINT16 capabilities_50;
UINT16 obsolete_51_52[2];
UINT16 field_validity;
UINT16 obsolete_54_58[5];
UINT16 mutil_sector_setting;
UINT16 user_addressable_sectors_lo;
UINT16 user_addressable_sectors_hi;
UINT16 obsolete_62;
UINT16 multi_word_dma_mode;
UINT16 advanced_pio_modes;
UINT16 min_multi_word_dma_cycle_time;
UINT16 rec_multi_word_dma_cycle_time;
UINT16 min_pio_cycle_time_without_flow_control;
UINT16 min_pio_cycle_time_with_flow_control;
UINT16 reserved_69_74[6];
UINT16 queue_depth;
UINT16 reserved_76_79[4];
UINT16 major_version_no;
UINT16 minor_version_no;
UINT16 cmd_set_support_82;
UINT16 cmd_set_support_83;
UINT16 cmd_feature_support;
UINT16 cmd_feature_enable_85;
UINT16 cmd_feature_enable_86;
UINT16 cmd_feature_default;
UINT16 ultra_dma_select;
UINT16 time_required_for_sec_erase;
UINT16 time_required_for_enhanced_sec_erase;
UINT16 current_advanced_power_mgmt_value;
UINT16 master_pwd_revison_code;
UINT16 hardware_reset_result;
UINT16 current_auto_acoustic_mgmt_value;
UINT16 reserved_95_99[5];
UINT16 max_user_lba_for_48bit_addr[4];
UINT16 reserved_104_126[23];
UINT16 removable_media_status_notification_support;
UINT16 security_status;
UINT16 vendor_data_129_159[31];
UINT16 cfa_power_mode;
UINT16 cfa_reserved_161_175[15];
UINT16 current_media_serial_no[30];
UINT16 reserved_206_254[49];
UINT16 integrity_word;
} EFI_ATAPI_IDENTIFY_DATA;
#pragma pack()
//
//*******************************************************
// EFI_IDENTIFY_DATA
//*******************************************************
//
typedef union {
EFI_ATA_IDENTIFY_DATA AtaData;
EFI_ATAPI_IDENTIFY_DATA AtapiData;
} EFI_IDENTIFY_DATA;
#define EFI_ATAPI_DEVICE_IDENTIFY_DATA 0x8000
//
/////////////////////////////////////////////////////////////////////////////////////////
// Function prototype declaration, for ANSI compatability
//
/**
Returns the information about the specified IDE channel.
@param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
@param Channel Zero-based channel number.
@param Enabled TRUE if this channel is enabled. Disabled channels are not scanned
to see if any devices are present.
@param MaxDevices The maximum number of IDE devices that the bus driver
can expect on this channel.
@retval EFI_SUCCESS Information was returned without any errors.
@retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
**/
typedef
EFI_STATUS
(EFIAPI *EFI_IDE_CONTROLLER_GET_CHANNEL_INFO) (
IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
IN UINT8 Channel,
OUT BOOLEAN *Enabled,
OUT UINT8 *MaxDevices
);
/**
The notifications from the IDE bus driver that it is about to enter a certain
phase of the IDE channel enumeration process.
@param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
@param Phase The phase during enumeration.
@param Channel Zero-based channel number.
@retval EFI_SUCCESS The notification was accepted without any errors.
@retval EFI_NOT_SUPPORTED Phase is not supported.
@retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
@retval EFI_NOT_READY This phase cannot be entered at this time.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_IDE_CONTROLLER_NOTIFY_PHASE) (
IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
IN EFI_IDE_CONTROLLER_ENUM_PHASE Phase,
IN UINT8 Channel
);
/**
Submits the device information to the IDE controller driver.
@param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
@param Channel Zero-based channel number.
@param Device Zero-based device number on the Channel.
@param IdentifyData The device<63><65>s response to the ATA IDENTIFY_DEVICE command.
@retval EFI_SUCCESS The information was accepted without any errors.
@retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
Or Device is invalid.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_IDE_CONTROLLER_SUBMIT_DATA) (
IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
IN UINT8 Channel,
IN UINT8 Device,
IN EFI_IDENTIFY_DATA *IdentifyData
);
/**
Disqualifies specific modes for an IDE device.
@param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
@param Channel Zero-based channel number.
@param Device Zero-based device number on the Channel.
@param BadModes The modes that the device does not support and that
should be disqualified.
@retval EFI_SUCCESS The modes were accepted without any errors.
@retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
Or Device is invalid.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_IDE_CONTROLLER_DISQUALIFY_MODE) (
IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
IN UINT8 Channel,
IN UINT8 Device,
IN EFI_ATA_COLLECTIVE_MODE *BadModes
);
/**
Returns the information about the optimum modes for the specified IDE device.
@param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
@param Channel Zero-based channel number.
@param Device Zero-based device number on the Channel.
@param SupportedModes The optimum modes for the device.
@retval EFI_SUCCESS SupportedModes was returned.
@retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
Or Device is invalid. Or SupportedModes is NULL.
@retval EFI_NOT_READY Modes cannot be calculated due to a lack of data.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_IDE_CONTROLLER_CALCULATE_MODE) (
IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
IN UINT8 Channel,
IN UINT8 Device,
OUT EFI_ATA_COLLECTIVE_MODE **SupportedModes
);
/**
Commands the IDE controller driver to program the IDE controller hardware
so that the specified device can operate at the specified mode.
@param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
@param Channel Zero-based channel number.
@param Device Zero-based device number on the Channel.
@param Modes The modes to set.
@retval EFI_SUCCESS The command was accepted without any errors.
@retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
Or Device is invalid.
@retval EFI_NOT_READY Modes cannot be set at this time due to lack of data.
@retval EFI_DEVICE_ERROR Modes cannot be set due to hardware failure.
The IDE bus driver should not use this device.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_IDE_CONTROLLER_SET_TIMING) (
IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
IN UINT8 Channel,
IN UINT8 Device,
IN EFI_ATA_COLLECTIVE_MODE *Modes
);
//
////////////////////////////////////////////////////////////////////////////////////////////////////
// Interface structure
// EFI_IDE_CONTROLLER_INIT_PROTOCOL protocol provides the chipset specific information to the IDE bus driver.
// An IDE Bus driver wants to manage an IDE bus and possible IDE devices will have to retrieve the
// EFI_IDE_CONTROLLER_INIT_PROTOCOL instances.
//
/**
@par Protocol Description:
Provides the basic interfaces to abstract an IDE controller.
@param GetChannelInfo
Returns the information about a specific channel.
@param NotifyPhase
The notification that the IDE bus driver is about to enter the
specified phase during the enumeration process.
@param SubmitData
Submits the Drive Identify data that was returned by the device.
@param DisqualifyMode
Submits information about modes that should be disqualified.
@param CalculateMode
Calculates and returns the optimum mode for a particular IDE device.
@param SetTiming
Programs the IDE controller hardware to the default timing or per the modes
that were returned by the last call to CalculateMode().
@param EnumAll
Set to TRUE if the enumeration group includes all the channels that are
produced by this controller. FALSE if an enumeration group consists of
only one channel.
@param ChannelCount
The number of channels that are produced by this controller.
**/
struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL {
EFI_IDE_CONTROLLER_GET_CHANNEL_INFO GetChannelInfo;
EFI_IDE_CONTROLLER_NOTIFY_PHASE NotifyPhase;
EFI_IDE_CONTROLLER_SUBMIT_DATA SubmitData;
EFI_IDE_CONTROLLER_DISQUALIFY_MODE DisqualifyMode;
EFI_IDE_CONTROLLER_CALCULATE_MODE CalculateMode;
EFI_IDE_CONTROLLER_SET_TIMING SetTiming;
BOOLEAN EnumAll;
UINT8 ChannelCount;
};
extern EFI_GUID gEfiIdeControllerInitProtocolGuid;
#endif

View File

@ -0,0 +1,84 @@
/** @file
This file declares EFI Incompatible PCI Device Support Protocol
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: IncompatiblePciDeviceSupport.h
@par Revision Reference:
This protocol is defined in Framework of EFI PCI Platform Support Specification.
Version0.9
**/
#ifndef _INCOMPATIBLE_PCI_DEVICE_SUPPORT_H_
#define _INCOMPATIBLE_PCI_DEVICE_SUPPORT_H_
#define EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL_GUID \
{0xeb23f55a, 0x7863, 0x4ac2, {0x8d, 0x3d, 0x95, 0x65, 0x35, 0xde, 0x03, 0x75} }
typedef struct _EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL;
/**
Returns a list of ACPI resource descriptors that detail the special
resource configuration requirements for an incompatible PCI device.
@param This Pointer to the EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL instance.
@param VendorID A unique ID to identify the manufacturer of the PCI device.
@param DeviceID A unique ID to identify the particular PCI device.
@param RevisionID A PCI device-specific revision identifier.
@param SubsystemVendorId Specifies the subsystem vendor ID.
@param SubsystemDeviceId Specifies the subsystem device ID.
@param Configuration A list of ACPI resource descriptors that detail
the configuration requirement.
@retval EFI_SUCCESS The function always returns EFI_SUCCESS.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_CHECK_DEVICE) (
IN EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL *This,
IN UINTN VendorId,
IN UINTN DeviceId,
IN UINTN Revision,
IN UINTN SubVendorId,OPTIONAL
IN UINTN SubDeviceId,OPTIONAL
OUT VOID **Configuration
);
//
// Interface structure for the Incompatible PCI Device Support Protocol
//
/**
@par Protocol Description:
This protocol can find some incompatible PCI devices and report their
special resource requirements to the PCI bus driver.
@param CheckDevice
Returns a list of ACPI resource descriptors that detail any special
resource configuration requirements if the specified device is a recognized
incompatible PCI device.
**/
struct _EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL {
EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_CHECK_DEVICE CheckDevice;
};
extern EFI_GUID gEfiIncompatiblePciDeviceSupportProtocolGuid;
#endif

View File

@ -0,0 +1,307 @@
/** @file
This protocol abstracts the 8259 interrupt controller. This includes
PCI IRQ routing need to program the PCI Interrupt Line register.
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: Legacy8259.h
@par Revision Reference:
This protocol is defined in Framework for EFI Compatibility Support Module spec
Version 0.96
**/
#ifndef _EFI_LEGACY_8259_H
#define _EFI_LEGACY_8259_H
#define EFI_LEGACY_8259_PROTOCOL_GUID \
{ \
0x38321dba, 0x4fe0, 0x4e17, {0x8a, 0xec, 0x41, 0x30, 0x55, 0xea, 0xed, 0xc1 } \
}
typedef struct _EFI_LEGACY_8259_PROTOCOL EFI_LEGACY_8259_PROTOCOL;
typedef enum {
Efi8259Irq0,
Efi8259Irq1,
Efi8259Irq2,
Efi8259Irq3,
Efi8259Irq4,
Efi8259Irq5,
Efi8259Irq6,
Efi8259Irq7,
Efi8259Irq8,
Efi8259Irq9,
Efi8259Irq10,
Efi8259Irq11,
Efi8259Irq12,
Efi8259Irq13,
Efi8259Irq14,
Efi8259Irq15,
Efi8259IrqMax
} EFI_8259_IRQ;
typedef enum {
Efi8259LegacyMode,
Efi8259ProtectedMode,
Efi8259MaxMode
} EFI_8259_MODE;
/**
Get the 8259 interrupt masks for Irq0 - Irq15. A different mask exists for
the legacy mode mask and the protected mode mask. The base address for the 8259
is different for legacy and protected mode, so two masks are required.
@param This Protocol instance pointer.
@param MasterBase The base vector for the Master PIC in the 8259 controller
@param Slavebase The base vector for the Master PIC in the 8259 controller
@retval EFI_SUCCESS The new bases were programmed
@retval EFI_DEVICE_ERROR A device erro occured programming the vector bases
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_8259_SET_VECTOR_BASE) (
IN EFI_LEGACY_8259_PROTOCOL *This,
IN UINT8 MasterBase,
IN UINT8 SlaveBase
)
;
/**
Get the 8259 interrupt masks for Irq0 - Irq15. A different mask exists for
the legacy mode mask and the protected mode mask. The base address for the 8259
is different for legacy and protected mode, so two masks are required.
@param This Protocol instance pointer.
@param LegacyMask Bit 0 is Irq0 - Bit 15 is Irq15
@param LegacyEdgeLevel Bit 0 is Irq0 - Bit 15 is Irq15
@param ProtectedMask Bit 0 is Irq0 - Bit 15 is Irq15
@param ProtectedEdgeLevel Bit 0 is Irq0 - Bit 15 is Irq15
@retval EFI_SUCCESS 8259 status returned
@retval EFI_DEVICE_ERROR Error reading 8259
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_8259_GET_MASK) (
IN EFI_LEGACY_8259_PROTOCOL *This,
OUT UINT16 *LegacyMask, OPTIONAL
OUT UINT16 *LegacyEdgeLevel, OPTIONAL
OUT UINT16 *ProtectedMask, OPTIONAL
OUT UINT16 *ProtectedEdgeLevel OPTIONAL
)
;
/**
Set the 8259 interrupt masks for Irq0 - Irq15. A different mask exists for
the legacy mode mask and the protected mode mask. The base address for the 8259
is different for legacy and protected mode, so two masks are required.
Also set the edge/level masks.
@param This Protocol instance pointer.
@param LegacyMask Bit 0 is Irq0 - Bit 15 is Irq15
@param LegacyEdgeLevel Bit 0 is Irq0 - Bit 15 is Irq15
@param ProtectedMask Bit 0 is Irq0 - Bit 15 is Irq15
@param ProtectedEdgeLevel Bit 0 is Irq0 - Bit 15 is Irq15
@retval EFI_SUCCESS 8259 status returned
@retval EFI_DEVICE_ERROR Error reading 8259
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_8259_SET_MASK) (
IN EFI_LEGACY_8259_PROTOCOL *This,
IN UINT16 *LegacyMask, OPTIONAL
IN UINT16 *LegacyEdgeLevel, OPTIONAL
IN UINT16 *ProtectedMask, OPTIONAL
IN UINT16 *ProtectedEdgeLevel OPTIONAL
)
;
/**
Set the 8259 mode of operation. The base address for the 8259 is different for
legacy and protected mode. The legacy mode requires the master 8259 to have a
master base of 0x08 and the slave base of 0x70. The protected mode base locations
are not defined. Interrupts must be masked by the caller before this function
is called. The interrupt mask from the current mode is saved. The interrupt
mask for the new mode is Mask, or if Mask does not exist the previously saved
mask is used.
@param This Protocol instance pointer.
@param Mode Mode of operation. i.e. real mode or protected mode
@param Mask Optional interupt mask for the new mode.
@param EdgeLevel Optional trigger mask for the new mode.
@retval EFI_SUCCESS 8259 programmed
@retval EFI_DEVICE_ERROR Error writting to 8259
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_8259_SET_MODE) (
IN EFI_LEGACY_8259_PROTOCOL *This,
IN EFI_8259_MODE Mode,
IN UINT16 *Mask, OPTIONAL
IN UINT16 *EdgeLevel OPTIONAL
)
;
/**
Convert from IRQ to processor interrupt vector number.
@param This Protocol instance pointer.
@param Irq 8259 IRQ0 - IRQ15
@param Vector Processor vector number that matches Irq
@retval EFI_SUCCESS The Vector matching Irq is returned
@retval EFI_INVALID_PARAMETER Irq not valid
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_8259_GET_VECTOR) (
IN EFI_LEGACY_8259_PROTOCOL *This,
IN EFI_8259_IRQ Irq,
OUT UINT8 *Vector
)
;
/**
Enable Irq by unmasking interrupt in 8259
@param This Protocol instance pointer.
@param Irq 8259 IRQ0 - IRQ15
@param LevelTriggered TRUE if level triggered. FALSE if edge triggered.
@retval EFI_SUCCESS Irq enabled on 8259
@retval EFI_INVALID_PARAMETER Irq not valid
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_8259_ENABLE_IRQ) (
IN EFI_LEGACY_8259_PROTOCOL *This,
IN EFI_8259_IRQ Irq,
IN BOOLEAN LevelTriggered
)
;
/**
Disable Irq by masking interrupt in 8259
@param This Protocol instance pointer.
@param Irq 8259 IRQ0 - IRQ15
@retval EFI_SUCCESS Irq disabled on 8259
@retval EFI_INVALID_PARAMETER Irq not valid
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_8259_DISABLE_IRQ) (
IN EFI_LEGACY_8259_PROTOCOL *This,
IN EFI_8259_IRQ Irq
)
;
/**
PciHandle represents a PCI config space of a PCI function. Vector
represents Interrupt Pin (from PCI config space) and it is the data
that is programmed into the Interrupt Line (from the PCI config space)
register.
@param This Protocol instance pointer.
@param PciHandle PCI function to return vector for
@param Vector Vector for fucntion that matches
@retval EFI_SUCCESS A valid Vector is returned
@retval EFI_INVALID_PARAMETER PciHandle not valid
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_8259_GET_INTERRUPT_LINE) (
IN EFI_LEGACY_8259_PROTOCOL *This,
IN EFI_HANDLE PciHandle,
OUT UINT8 *Vector
)
;
/**
Send an EOI to 8259
@param This Protocol instance pointer.
@param Irq 8259 IRQ0 - IRQ15
@retval EFI_SUCCESS EOI successfully sent to 8259
@retval EFI_INVALID_PARAMETER Irq not valid
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_8259_END_OF_INTERRUPT) (
IN EFI_LEGACY_8259_PROTOCOL *This,
IN EFI_8259_IRQ Irq
)
;
/**
@par Protocol Description:
Abstracts the 8259 and APIC hardware control between EFI usage and
Compatibility16 usage.
@param SetVectorBase
Sets the vector bases for master and slave PICs.
@param GetMask
Gets IRQ and edge/level masks for 16-bit real mode and 32-bit protected mode.
@param SetMask
Sets the IRQ and edge\level masks for 16-bit real mode and 32-bit protected mode.
@param SetMode
Sets PIC mode to 16-bit real mode or 32-bit protected mode.
@param GetVector
Gets the base vector assigned to an IRQ.
@param EnableIrq
Enables an IRQ.
@param DisableIrq
Disables an IRQ.
@param GetInterruptLine
Gets an IRQ that is assigned to a PCI device.
@param EndOfInterrupt
Issues the end of interrupt command.
**/
struct _EFI_LEGACY_8259_PROTOCOL {
EFI_LEGACY_8259_SET_VECTOR_BASE SetVectorBase;
EFI_LEGACY_8259_GET_MASK GetMask;
EFI_LEGACY_8259_SET_MASK SetMask;
EFI_LEGACY_8259_SET_MODE SetMode;
EFI_LEGACY_8259_GET_VECTOR GetVector;
EFI_LEGACY_8259_ENABLE_IRQ EnableIrq;
EFI_LEGACY_8259_DISABLE_IRQ DisableIrq;
EFI_LEGACY_8259_GET_INTERRUPT_LINE GetInterruptLine;
EFI_LEGACY_8259_END_OF_INTERRUPT EndOfInterrupt;
};
extern EFI_GUID gEfiLegacy8259ProtocolGuid;
#endif

View File

@ -0,0 +1,701 @@
/** @file
The EFI Legacy BIOS Protocol is used to abstract legacy Option ROM usage
under EFI and Legacy OS boot.
Note: The names for EFI_IA32_REGISTER_SET elements were picked to follow
well known naming conventions.
Thunk - A thunk is a transition from one processor mode to another. A Thunk
is a transition from native EFI mode to 16-bit mode. A reverse thunk
would be a transition from 16-bit mode to native EFI mode.
You most likely should not use this protocol! Find the EFI way to solve the
problem to make your code portable
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: LegacyBios.h
@par Revision Reference:
This protocol is defined in Framework for EFI Compatibility Support Module spec
Version 0.96
**/
#ifndef _EFI_LEGACY_BIOS_H
#define _EFI_LEGACY_BIOS_H
#define EFI_LEGACY_BIOS_PROTOCOL_GUID \
{ \
0xdb9a1e3d, 0x45cb, 0x4abb, {0x85, 0x3b, 0xe5, 0x38, 0x7f, 0xdb, 0x2e, 0x2d } \
}
typedef struct _EFI_LEGACY_BIOS_PROTOCOL EFI_LEGACY_BIOS_PROTOCOL;
//
// Convert from 32-bit address (_Adr) to Segment:Offset 16-bit form
//
#define EFI_SEGMENT(_Adr) (UINT16) ((UINT16) (((UINTN) (_Adr)) >> 4) & 0xf000)
#define EFI_OFFSET(_Adr) (UINT16) (((UINT16) ((UINTN) (_Adr))) & 0xffff)
#define BYTE_GRANULARITY 0x01
#define WORD_GRANULARITY 0x02
#define DWORD_GRANULARITY 0x04
#define QWORD_GRANULARITY 0x08
#define PARAGRAPH_GRANULARITY 0x10
#define CARRY_FLAG 0x01
//*********************************************************
// EFI_EFLAGS_REG
//*********************************************************
typedef struct {
UINT32 CF:1;
UINT32 Reserved1:1;
UINT32 PF:1;
UINT32 Reserved2:1;
UINT32 AF:1;
UINT32 Reserved3:1;
UINT32 ZF:1;
UINT32 SF:1;
UINT32 TF:1;
UINT32 IF:1;
UINT32 DF:1;
UINT32 OF:1;
UINT32 IOPL:2;
UINT32 NT:1;
UINT32 Reserved4:2;
UINT32 VM:1;
UINT32 Reserved5:14;
} EFI_EFLAGS_REG;
//*********************************************************
// EFI_DWORD_REGS
//*********************************************************
typedef struct {
UINT32 EAX;
UINT32 EBX;
UINT32 ECX;
UINT32 EDX;
UINT32 ESI;
UINT32 EDI;
EFI_EFLAGS_REG EFlags;
UINT16 ES;
UINT16 CS;
UINT16 SS;
UINT16 DS;
UINT16 FS;
UINT16 GS;
UINT32 EBP;
UINT32 ESP;
} EFI_DWORD_REGS;
//*******************************************
// EFI_FLAGS_REG
//*******************************************
typedef struct {
UINT16 CF:1;
UINT16 Reserved1:1;
UINT16 PF:1;
UINT16 Reserved2:1;
UINT16 AF:1;
UINT16 Reserved3:1;
UINT16 ZF:1;
UINT16 SF:1;
UINT16 TF:1;
UINT16 IF:1;
UINT16 DF:1;
UINT16 OF:1;
UINT16 IOPL:2;
UINT16 NT:1;
UINT16 Reserved4:1;
} EFI_FLAGS_REG;
//*********************************************************
// EFI_WORD_REGS
//*********************************************************
typedef struct {
UINT16 AX;
UINT16 ReservedAX;
UINT16 BX;
UINT16 ReservedBX;
UINT16 CX;
UINT16 ReservedCX;
UINT16 DX;
UINT16 ReservedDX;
UINT16 SI;
UINT16 ReservedSI;
UINT16 DI;
UINT16 ReservedDI;
EFI_FLAGS_REG Flags;
UINT16 ReservedFlags;
UINT16 ES;
UINT16 CS;
UINT16 SS;
UINT16 DS;
UINT16 FS;
UINT16 GS;
UINT16 BP;
UINT16 ReservedBP;
UINT16 SP;
UINT16 ReservedSP;
} EFI_WORD_REGS;
//*********************************************************
// EFI_BYTE_REGS
//*********************************************************
typedef struct {
UINT8 AL, AH;
UINT16 ReservedAX;
UINT8 BL, BH;
UINT16 ReservedBX;
UINT8 CL, CH;
UINT16 ReservedCX;
UINT8 DL, DH;
UINT16 ReservedDX;
} EFI_BYTE_REGS;
typedef union {
EFI_DWORD_REGS E;
EFI_WORD_REGS X;
EFI_BYTE_REGS H;
} EFI_IA32_REGISTER_SET;
#pragma pack(1)
//
// $EFI table created by Legacy16 code and consumed by EFI Legacy driver
//
typedef struct {
UINT32 Signature; // "$EFI"
UINT8 TableChecksum;
UINT8 TableLength;
UINT8 EfiMajorRevision;
UINT8 EfiMinorRevision;
UINT8 TableMajorRevision;
UINT8 TableMinorRevision;
UINT8 Reserved[2];
UINT16 Legacy16CallSegment;
UINT16 Legacy16CallOffset;
UINT16 PnPInstallationCheckSegment;
UINT16 PnPInstallationCheckOffset;
UINT32 EfiSystemTable;
UINT32 OemStringPointer;
UINT32 AcpiRsdPtrPointer;
UINT16 OemRevision;
UINT32 E820Pointer;
UINT32 E820Length;
UINT32 IrqRoutingTablePointer;
UINT32 IrqRoutingTableLength;
UINT32 MpTablePtr;
UINT32 MpTableLength;
UINT16 OemIntSegment;
UINT16 OemIntOffset;
UINT16 Oem32Segment;
UINT16 Oem32Offset;
UINT16 Oem16Segment;
UINT16 Oem16Offset;
UINT16 TpmSegment;
UINT16 TpmOffset;
UINT32 IbvPointer;
UINT32 PciExpressBase;
UINT8 LastPciBus;
} EFI_COMPATIBILITY16_TABLE;
//
// define maximum number of HDD system supports
//
#define MAX_HDD_ENTRIES 0x30
typedef struct {
UINT16 Raw[256];
} ATAPI_IDENTIFY;
//
// HDD_INFO status
//
#define HDD_PRIMARY 0x01
#define HDD_SECONDARY 0x02
#define HDD_MASTER_ATAPI_CDROM 0x04
#define HDD_SLAVE_ATAPI_CDROM 0x08
#define HDD_MASTER_IDE 0x20
#define HDD_SLAVE_IDE 0x40
#define HDD_MASTER_ATAPI_ZIPDISK 0x10
#define HDD_SLAVE_ATAPI_ZIPDISK 0x80
typedef struct {
UINT16 Status;
UINT32 Bus;
UINT32 Device;
UINT32 Function;
UINT16 CommandBaseAddress;
UINT16 ControlBaseAddress;
UINT16 BusMasterAddress;
UINT8 HddIrq;
ATAPI_IDENTIFY IdentifyDrive[2];
} HDD_INFO;
//
// Parties data structures
//
typedef struct {
UINT8 DirectoryServiceValidity : 1;
UINT8 RabcaUsedFlag : 1;
UINT8 ExecuteHddDiagnosticsFlag : 1;
UINT8 Reserved : 5;
} UDC_ATTRIBUTES;
typedef struct {
UDC_ATTRIBUTES Attributes;
UINT8 DeviceNumber;
UINT8 BbsTableEntryNumberForParentDevice;
UINT8 BbsTableEntryNumberForBoot;
UINT8 BbsTableEntryNumberForHddDiag;
UINT8 BeerData[128];
UINT8 ServiceAreaData[64];
} UD_TABLE;
//
// define BBS Device Types
//
#define BBS_FLOPPY 0x01
#define BBS_HARDDISK 0x02
#define BBS_CDROM 0x03
#define BBS_PCMCIA 0x04
#define BBS_USB 0x05
#define BBS_EMBED_NETWORK 0x06
#define BBS_BEV_DEVICE 0x80
#define BBS_UNKNOWN 0xff
typedef struct {
UINT16 OldPosition : 4;
UINT16 Reserved1 : 4;
UINT16 Enabled : 1;
UINT16 Failed : 1;
UINT16 MediaPresent : 2;
UINT16 Reserved2 : 4;
} BBS_STATUS_FLAGS;
#define MAX_BBS_ENTRIES 0x100
//
// BBS_IGNORE_ENTRY is placed in the BootPriority field if the entry is to
// be skipped.
// BBS_UNPRIORITIZED_ENTRY is placed in the BootPriority field before
// priority has been assigned but indicates valid entry.
// BBS_LOWEST_PRIORITY is normally used for removable media with no media
// inserted. This allows the 16-bit CSM to allocate a drive letter to
// the device.
// BBS_DO_NOT_BOOT_FROM is used for devices that the 16-bit CSM is to assign
// a drive letter to but never boot from.
//
// AdditionalIrq??Handler usage is IBV specific. The fields have been added
// for:
// 1. Saving non-BBS card info about IRQs taken by card.
// 2. For BBS compliant cards that hook IRQs in order to have their SETUP
// executed.
//
#define BBS_DO_NOT_BOOT_FROM 0xFFFC
#define BBS_LOWEST_PRIORITY 0xFFFD
#define BBS_UNPRIORITIZED_ENTRY 0xFFFE
#define BBS_IGNORE_ENTRY 0xFFFF
typedef struct {
UINT16 BootPriority;
UINT32 Bus;
UINT32 Device;
UINT32 Function;
UINT8 Class;
UINT8 SubClass;
UINT16 MfgStringOffset;
UINT16 MfgStringSegment;
UINT16 DeviceType;
BBS_STATUS_FLAGS StatusFlags;
UINT16 BootHandlerOffset;
UINT16 BootHandlerSegment;
UINT16 DescStringOffset;
UINT16 DescStringSegment;
UINT32 InitPerReserved;
UINT32 AdditionalIrq13Handler;
UINT32 AdditionalIrq18Handler;
UINT32 AdditionalIrq19Handler;
UINT32 AdditionalIrq40Handler;
UINT8 AssignedDriveNumber;
UINT32 AdditionalIrq41Handler;
UINT32 AdditionalIrq46Handler;
UINT32 IBV1;
UINT32 IBV2;
} BBS_TABLE;
#pragma pack()
/**
Thunk to 16-bit real mode and execute a software interrupt with a vector
of BiosInt. Regs will contain the 16-bit register context on entry and
exit.
@param This Protocol instance pointer.
@param BiosInt Processor interrupt vector to invoke
@param Reg Register contexted passed into (and returned) from thunk to
16-bit mode
@retval FALSE Thunk completed, and there were no BIOS errors in the target code.
See Regs for status.
@retval TRUE There was a BIOS erro in the target code.
**/
typedef
BOOLEAN
(EFIAPI *EFI_LEGACY_BIOS_INT86) (
IN EFI_LEGACY_BIOS_PROTOCOL *This,
IN UINT8 BiosInt,
IN OUT EFI_IA32_REGISTER_SET *Regs
)
;
/**
Thunk to 16-bit real mode and call Segment:Offset. Regs will contain the
16-bit register context on entry and exit. Arguments can be passed on
the Stack argument
@param This Protocol instance pointer.
@param Segment Segemnt of 16-bit mode call
@param Offset Offset of 16-bit mdoe call
@param Reg Register contexted passed into (and returned) from thunk to
16-bit mode
@param Stack Caller allocated stack used to pass arguments
@param StackSize Size of Stack in bytes
@retval FALSE Thunk completed, and there were no BIOS errors in the target code.
See Regs for status.
@retval TRUE There was a BIOS erro in the target code.
**/
typedef
BOOLEAN
(EFIAPI *EFI_LEGACY_BIOS_FARCALL86) (
IN EFI_LEGACY_BIOS_PROTOCOL *This,
IN UINT16 Segment,
IN UINT16 Offset,
IN EFI_IA32_REGISTER_SET *Regs,
IN VOID *Stack,
IN UINTN StackSize
)
;
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_BIOS_CHECK_ROM) (
IN EFI_LEGACY_BIOS_PROTOCOL *This,
IN EFI_HANDLE PciHandle,
OUT VOID **RomImage, OPTIONAL
OUT UINTN *RomSize, OPTIONAL
OUT UINTN *Flags
/**
Test to see if a legacy PCI ROM exists for this device. Optionally return
the Legacy ROM instance for this PCI device.
@param This Protocol instance pointer.
@param PciHandle The PCI PC-AT OPROM from this devices ROM BAR will be loaded
@param RomImage Return the legacy PCI ROM for this device
@param RomSize Size of ROM Image
@param Flags Indicates if ROM found and if PC-AT.
@retval EFI_SUCCESS Legacy Option ROM availible for this device
@retval EFI_UNSUPPORTED Legacy Option ROM not supported.
**/
)
;
/**
Load a legacy PC-AT OPROM on the PciHandle device. Return information
about how many disks were added by the OPROM and the shadow address and
size. DiskStart & DiskEnd are INT 13h drive letters. Thus 0x80 is C:
@param This Protocol instance pointer.
@param PciHandle The PCI PC-AT OPROM from this devices ROM BAR will be loaded.
This value is NULL if RomImage is non-NULL. This is the normal
case.
@param RomImage A PCI PC-AT ROM image. This argument is non-NULL if there is
no hardware associated with the ROM and thus no PciHandle,
otherwise is must be NULL.
Example is PXE base code.
@param Flags Return Status if ROM was found and if was Legacy OPROM.
@param DiskStart Disk number of first device hooked by the ROM. If DiskStart
is the same as DiskEnd no disked were hooked.
@param DiskEnd Disk number of the last device hooked by the ROM.
@param RomShadowAddress Shadow address of PC-AT ROM
@param RomShadowSize Size of RomShadowAddress in bytes
@retval EFI_SUCCESS Thunk completed, see Regs for status.
@retval EFI_INVALID_PARAMETER PciHandle not found
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_BIOS_INSTALL_ROM) (
IN EFI_LEGACY_BIOS_PROTOCOL *This,
IN EFI_HANDLE PciHandle,
IN VOID **RomImage,
OUT UINTN *Flags,
OUT UINT8 *DiskStart, OPTIONAL
OUT UINT8 *DiskEnd, OPTIONAL
OUT VOID **RomShadowAddress, OPTIONAL
OUT UINT32 *ShadowedRomSize OPTIONAL
)
;
/**
Attempt to legacy boot the BootOption. If the EFI contexted has been
compromised this function will not return.
@param This Protocol instance pointer.
@param BootOption EFI Device Path from BootXXXX variable.
@param LoadOptionSize Size of LoadOption in size.
@param LoadOption LoadOption from BootXXXX variable
@retval EFI_SUCCESS Removable media not present
**/
/**
Update BDA with current Scroll, Num & Cap lock LEDS
@param This Protocol instance pointer.
@param Leds Status of current Scroll, Num & Cap lock LEDS
Bit 0 is Scroll Lock 0 = Not locked
Bit 1 is Num Lock
Bit 2 is Caps Lock
@retval EFI_SUCCESS Removable media not present
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_BIOS_BOOT) (
IN EFI_LEGACY_BIOS_PROTOCOL *This,
IN BBS_BBS_DEVICE_PATH *BootOption,
IN UINT32 LoadOptionsSize,
IN VOID *LoadOptions
)
;
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS) (
IN EFI_LEGACY_BIOS_PROTOCOL *This,
IN UINT8 Leds
)
;
/**
Retrieve legacy BBS info and assign boot priority.
@param This Protocol instance pointer.
@param HddCount Number of HDD_INFO structures
@param HddInfo Onboard IDE controller information
@param BbsCount Number of BBS_TABLE structures
@param BbsTable List BBS entries
@retval EFI_SUCCESS Tables returned
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_BIOS_GET_BBS_INFO) (
IN EFI_LEGACY_BIOS_PROTOCOL *This,
OUT UINT16 *HddCount,
OUT HDD_INFO **HddInfo,
OUT UINT16 *BbsCount,
OUT IN BBS_TABLE **BbsTable
)
;
/**
Assign drive number to legacy HDD drives prior to booting an EFI
aware OS so the OS can access drives without an EFI driver.
@param This Protocol instance pointer.
@param BbsCount Number of BBS_TABLE structures
@param BbsTable List BBS entries
@retval EFI_SUCCESS Drive numbers assigned
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_BIOS_PREPARE_TO_BOOT_EFI) (
IN EFI_LEGACY_BIOS_PROTOCOL *This,
OUT UINT16 *BbsCount,
OUT IN BBS_TABLE **BbsTable
)
;
/**
To boot from an unconventional device like parties and/or execute
HDD diagnostics.
@param This Protocol instance pointer.
@param Attributes How to interpret the other input parameters
@param BbsEntry The 0-based index into the BbsTable for the parent
device.
@param BeerData Pointer to the 128 bytes of ram BEER data.
@param ServiceAreaData Pointer to the 64 bytes of raw Service Area data. The
caller must provide a pointer to the specific Service
Area and not the start all Service Areas.
EFI_INVALID_PARAMETER if error. Does NOT return if no error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE) (
IN EFI_LEGACY_BIOS_PROTOCOL *This,
IN UDC_ATTRIBUTES Attributes,
IN UINTN BbsEntry,
IN VOID *BeerData,
IN VOID *ServiceAreaData
)
;
/**
Shadow all legacy16 OPROMs that haven't been shadowed.
Warning: Use this with caution. This routine disconnects all EFI
drivers. If used externally then caller must re-connect EFI
drivers.
@retval EFI_SUCCESS OPROMs shadowed
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS) (
IN EFI_LEGACY_BIOS_PROTOCOL *This
)
;
/**
Get a region from the LegacyBios for S3 usage.
@param This Protocol instance pointer.
@param LegacyMemorySize Size of required region
@param Region Region to use.
00 = Either 0xE0000 or 0xF0000 block
Bit0 = 1 0xF0000 block
Bit1 = 1 0xE0000 block
@param Alignment Address alignment. Bit mapped. First non-zero
bit from right is alignment.
@param LegacyMemoryAddress Region Assigned
@retval EFI_SUCCESS Region assigned
@retval Other Region not assigned
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_BIOS_GET_LEGACY_REGION) (
IN EFI_LEGACY_BIOS_PROTOCOL *This,
IN UINTN LegacyMemorySize,
IN UINTN Region,
IN UINTN Alignment,
OUT VOID **LegacyMemoryAddress
)
;
/**
Get a region from the LegacyBios for Tiano usage. Can only be invoked once.
@param This Protocol instance pointer.
@param LegacyMemorySize Size of data to copy
@param LegacyMemoryAddress Legacy Region destination address
Note: must be in region assigned by
LegacyBiosGetLegacyRegion
@param LegacyMemorySourceAddress Source of data
@retval EFI_SUCCESS Region assigned
@retval EFI_ACCESS_DENIED Destination outside assigned region
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_BIOS_COPY_LEGACY_REGION) (
IN EFI_LEGACY_BIOS_PROTOCOL *This,
IN UINTN LegacyMemorySize,
IN VOID *LegacyMemoryAddress,
IN VOID *LegacyMemorySourceAddress
)
;
/**
@par Protocol Description:
Abstracts the traditional BIOS from the rest of EFI. The LegacyBoot()
member function allows the BDS to support booting a traditional OS.
EFI thunks drivers that make EFI bindings for BIOS INT services use
all the other member functions.
@param Int86
Performs traditional software INT. See the Int86() function description.
@param FarCall86
Performs a far call into Compatibility16 or traditional OpROM code.
@param CheckPciRom
Checks if a traditional OpROM exists for this device.
@param InstallPciRom
Loads a traditional OpROM in traditional OpROM address space.
@param LegacyBoot
Boots a traditional OS.
@param UpdateKeyboardLedStatus
Updates BDA to reflect the current EFI keyboard LED status.
@param GetBbsInfo
Allows an external agent, such as BIOS Setup, to get the BBS data.
@param ShadowAllLegacyOproms
Causes all legacy OpROMs to be shadowed.
@param PrepareToBootEfi
Performs all actions prior to boot. Used when booting an EFI-aware OS
rather than a legacy OS.
@param GetLegacyRegion
Allows EFI to reserve an area in the 0xE0000 or 0xF0000 block.
@param CopyLegacyRegion
Allows EFI to copy data to the area specified by GetLegacyRegion.
@param BootUnconventionalDevice
Allows the user to boot off an unconventional device such as a PARTIES partition.
**/
struct _EFI_LEGACY_BIOS_PROTOCOL {
EFI_LEGACY_BIOS_INT86 Int86;
EFI_LEGACY_BIOS_FARCALL86 FarCall86;
EFI_LEGACY_BIOS_CHECK_ROM CheckPciRom;
EFI_LEGACY_BIOS_INSTALL_ROM InstallPciRom;
EFI_LEGACY_BIOS_BOOT LegacyBoot;
EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS UpdateKeyboardLedStatus;
EFI_LEGACY_BIOS_GET_BBS_INFO GetBbsInfo;
EFI_LEGACY_BIOS_PREPARE_TO_BOOT_EFI PrepareToBootEfi;
EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS ShadowAllLegacyOproms;
EFI_LEGACY_BIOS_GET_LEGACY_REGION GetLegacyRegion;
EFI_LEGACY_BIOS_COPY_LEGACY_REGION CopyLegacyRegion;
EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE BootUnconventionalDevice;
};
extern EFI_GUID gEfiLegacyBiosProtocolGuid;
#endif

View File

@ -0,0 +1,307 @@
/** @file
The EFI Legacy BIOS Patform Protocol is used to mate a Legacy16
implementation with this EFI code. The EFI driver that produces
the Legacy BIOS protocol is generic and consumes this protocol.
A driver that matches the Legacy16 produces this protocol
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: LegacyBiosPlatform.h
@par Revision Reference:
This protocol is defined in Framework for EFI Compatibility Support Module spec
Version 0.96
**/
#ifndef _EFI_LEGACY_BIOS_PLATFORM_H
#define _EFI_LEGACY_BIOS_PLATFORM_H
#define EFI_LEGACY_BIOS_PLATFORM_PROTOCOL_GUID \
{ \
0x783658a3, 0x4172, 0x4421, {0xa2, 0x99, 0xe0, 0x9, 0x7, 0x9c, 0xc, 0xb4 } \
}
typedef struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL EFI_LEGACY_BIOS_PLATFORM_PROTOCOL;
#pragma pack(1)
//
// Define structures for GetOemIntData
// Note:
// OemIntDataElenent is an array of structures from 0 to Count-1.
// RawData is an array of bytes from 0 to RamDataLength-1.
//
typedef struct {
UINT16 Int;
UINT16 Ax;
UINT32 RawDataLength;
UINT8 RawData[1];
} EFI_OEM_INT_DATA_ELEMENT;
typedef struct {
UINT16 Count;
EFI_OEM_INT_DATA_ELEMENT OemIntDataElement[1];
} EFI_OEM_INT_DATA;
#pragma pack()
typedef enum {
EfiGetPlatformBinaryMpTable = 0,
EfiGetPlatformBinaryOemIntData = 1,
EfiGetPlatformBinaryOem16Data = 2,
EfiGetPlatformBinaryOem32Data = 3,
EfiGetPlatformBinaryTpmBinary = 4,
EfiGetPlatformBinarySystemRom = 5,
EfiGetPlatformPciExpressBase = 6,
EfiGetPlatformPmmSize = 7,
EfiGetPlatformEndOpromShadowAddr = 8,
} EFI_GET_PLATFORM_INFO_MODE;
typedef enum {
EfiGetPlatformVgaHandle = 0,
EfiGetPlatformIdeHandle = 1,
EfiGetPlatformIsaBusHandle = 2,
EfiGetPlatformUsbHandle = 3
} EFI_GET_PLATFORM_HANDLE_MODE;
typedef enum {
EfiPlatformHookPrepareToScanRom = 0,
EfiPlatformHookShadowServiceRoms= 1,
EfiPlatformHookAfterRomInit = 2
} EFI_GET_PLATFORM_HOOK_MODE;
/**
Finds the binary data or other platform information.
@param This Protocol instance pointer.
@param Mode Specifies what data to return
@param Table Pointer to MP table.
@param TableSize Size in bytes of table.
@param Location Legacy region requested
0x00 = Any location
Bit 0 = 0xF0000 region
Bit 1 = 0xE0000 region
Multiple bits can be set
@param Alignment Address alignment for allocation.
Bit mapped. First non-zero bit from right
is alignment.
@param LegacySegment Segment in LegacyBios where Table is stored
@param LegacyOffset Offset in LegacyBios where Table is stored
@retval EFI_SUCCESS Data was returned successfully.
@retval EFI_UNSUPPORTED Mode is not supported on the platform.
@retval EFI_NOT_FOUND Binary image or table not found.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO) (
IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
IN EFI_GET_PLATFORM_INFO_MODE Mode,
OUT VOID **Table,
OUT UINTN *TableSize,
OUT UINTN *Location,
OUT UINTN *Alignment,
IN UINT16 LegacySegment,
IN UINT16 LegacyOffset
)
;
/**
Returns a buffer of handles for the requested sub-function.
@param This Protocol instance pointer.
@param Mode Specifies what handle to return.
@param Type Type from Device Path for Handle to represent.
@param HandleBuffer Handles of the device/controller in priority order
with HandleBuffer[0] highest priority.
@param HandleCount Number of handles in the buffer.
@param AdditionalData Mode specific.
@retval EFI_SUCCESS Handle is valid
@retval EFI_UNSUPPORTED Mode is not supported on the platform.
@retval EFI_NOT_FOUND Handle is not known
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE) (
IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
IN EFI_GET_PLATFORM_HANDLE_MODE Mode,
IN UINT16 Type,
OUT EFI_HANDLE **HandleBuffer,
OUT UINTN *HandleCount,
IN VOID **AdditionalData OPTIONAL
)
;
/**
Load and initialize the Legacy BIOS SMM handler.
@param This Protocol instance pointer.
@param EfiToLegacy16BootTable Pointer to Legacy16 boot table.
@retval EFI_SUCCESS SMM code loaded.
@retval EFI_DEVICE_ERROR SMM code failed to load
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_SMM_INIT) (
IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
IN VOID *EfiToLegacy16BootTable
)
;
/**
Allows platform to perform any required action after a LegacyBios operation.
@param This Protocol instance pointer.
@param Mode Specifies what handle to return.
@param Type Mode specific.
@param DeviceHandle List of PCI devices in the system.
@param ShadowAddress First free OpROM area, after other OpROMs have been dispatched.
@param Compatibility16Table Pointer to Compatibility16Table.
@param AdditionalData Mode specific Pointer to additional data returned <20>C mode specific.
@retval EFI_SUCCESS RomImage is valid
@retval EFI_UNSUPPORTED Mode is not supported on the platform.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_HOOKS) (
IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
IN EFI_GET_PLATFORM_HOOK_MODE Mode,
IN UINT16 Type,
IN EFI_HANDLE DeviceHandle,
IN OUT UINTN *ShadowAddress,
IN EFI_COMPATIBILITY16_TABLE *Compatibility16Table,
IN VOID **AdditionalData OPTIONAL
)
;
/**
Returns information associated with PCI IRQ routing.
@param This Protocol instance pointer.
@param RoutingTable Pointer to PCI IRQ Routing table.
@param RoutingTableEntries Number of entries in table.
@param LocalPirqTable $PIR table
@param PirqTableSize $PIR table size
@param LocalIrqPriorityTable List of interrupts in priority order to assign
@param IrqPriorityTableEntries- Number of entries in priority table
@retval EFI_SUCCESS Data was successfully returned.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE) (
IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
OUT VOID **RoutingTable,
OUT UINTN *RoutingTableEntries,
OUT VOID **LocalPirqTable, OPTIONAL
OUT UINTN *PirqTableSize, OPTIONAL
OUT VOID **LocalIrqPriorityTable, OPTIONAL
OUT UINTN *IrqPriorityTableEntries OPTIONAL
)
;
/**
Translates the given PIRQ accounting for bridge
@param This Protocol instance pointer.
@param PciBus PCI bus number for this device.
@param PciDevice PCI device number for this device.
@param PciFunction PCI function number for this device.
@param Pirq Input is PIRQ reported by device, output is true PIRQ.
@param PciIrq The IRQ already assigned to the PIRQ or the IRQ to be
assigned to the PIRQ.
@retval EFI_SUCCESS The PIRQ was translated.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ) (
IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
IN UINTN PciBus,
IN UINTN PciDevice,
IN UINTN PciFunction,
IN OUT UINT8 *Pirq,
OUT UINT8 *PciIrq
)
;
/**
Attempt to legacy boot the BootOption. If the EFI contexted has been
compromised this function will not return.
@param This Protocol instance pointer.
@param BbsDevicePath EFI Device Path from BootXXXX variable.
@param BbsTable Internal BBS table.
@param LoadOptionSize Size of LoadOption in size.
@param LoadOption LoadOption from BootXXXX variable
@param EfiToLegacy16BootTable Pointer to BootTable structure
@retval EFI_SUCCESS Ready to boot.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT) (
IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
IN BBS_BBS_DEVICE_PATH *BbsDevicePath,
IN VOID *BbsTable,
IN UINT32 LoadOptionsSize,
IN VOID *LoadOptions,
IN VOID *EfiToLegacy16BootTable
)
;
/**
@par Protocol Description:
Abstracts the platform portion of the traditional BIOS.
@param GetPlatformInfo
Gets binary data or other platform information.
@param GetPlatformHandle
Returns a buffer of all handles matching the requested subfunction.
@param SmmInit
Loads and initializes the traditional BIOS SMM handler.
@param PlatformHooks
Allows platform to perform any required actions after a LegacyBios operation.
@param GetRoutingTable
Gets $PIR table.
@param TranslatePirq
Translates the given PIRQ to the final value after traversing any PCI bridges.
@param PrepareToBoot
Final platform function before the system attempts to boot to a traditional OS.
**/
struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL {
EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO GetPlatformInfo;
EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE GetPlatformHandle;
EFI_LEGACY_BIOS_PLATFORM_SMM_INIT SmmInit;
EFI_LEGACY_BIOS_PLATFORM_HOOKS PlatformHooks;
EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE GetRoutingTable;
EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ TranslatePirq;
EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT PrepareToBoot;
};
extern EFI_GUID gEfiLegacyBiosPlatformProtocolGuid;
#endif

View File

@ -0,0 +1,131 @@
/** @file
This protocol manages the legacy memory regions between 0xc0000 - 0xfffff
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: LegacyInterrupt.h
@par Revision Reference:
This protocol is defined in Framework for EFI Compatibility Support Module spec
Version 0.96
**/
#ifndef _EFI_LEGACY_INTERRUPT_H_
#define _EFI_LEGACY_INTERRUPT_H_
#define EFI_LEGACY_INTERRUPT_PROTOCOL_GUID \
{ \
0x31ce593d, 0x108a, 0x485d, {0xad, 0xb2, 0x78, 0xf2, 0x1f, 0x29, 0x66, 0xbe } \
}
typedef struct _EFI_LEGACY_INTERRUPT_PROTOCOL EFI_LEGACY_INTERRUPT_PROTOCOL;
/**
Get the number of PIRQs this hardware supports.
@param This Protocol instance pointer.
@param NumberPirsq Number of PIRQs.
@retval EFI_SUCCESS Number of PIRQs returned.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS) (
IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,
OUT UINT8 *NumberPirqs
);
/**
Gets the PCI location associated with this protocol.
@param This Protocol instance pointer.
@param Bus PCI Bus
@param Device PCI Device
@param Function PCI Function
@retval EFI_SUCCESS Bus/Device/Function returned
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_INTERRUPT_GET_LOCATION) (
IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,
OUT UINT8 *Bus,
OUT UINT8 *Device,
OUT UINT8 *Function
);
/**
Read the PIRQ register and return the data
@param This Protocol instance pointer.
@param PirqNumber PIRQ register to read
@param PirqData Data read
@retval EFI_SUCCESS Data was read
@retval EFI_INVALID_PARAMETER Invalid PIRQ number
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_INTERRUPT_READ_PIRQ) (
IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,
IN UINT8 PirqNumber,
OUT UINT8 *PirqData
);
/**
Write the specified PIRQ register with the given data.
@param This Protocol instance pointer.
@param PirqNumber PIRQ register to read.
@param PirqData Data written.
@retval EFI_SUCCESS Table pointer returned
@retval EFI_INVALID_PARAMETER Invalid PIRQ number
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_INTERRUPT_WRITE_PIRQ) (
IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,
IN UINT8 PirqNumber,
IN UINT8 PirqData
);
/**
@par Protocol Description:
Abstracts the PIRQ programming from the generic EFI Compatibility Support Modules
@param GetNumberPirqs
Gets the number of PIRQs supported.
@param GetLocation
Gets the PCI bus, device, and function that associated with this protocol.
@param ReadPirq
Reads the indicated PIRQ register.
@param WritePirq
Writes to the indicated PIRQ register.
**/
struct _EFI_LEGACY_INTERRUPT_PROTOCOL {
EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS GetNumberPirqs;
EFI_LEGACY_INTERRUPT_GET_LOCATION GetLocation;
EFI_LEGACY_INTERRUPT_READ_PIRQ ReadPirq;
EFI_LEGACY_INTERRUPT_WRITE_PIRQ WritePirq;
};
extern EFI_GUID gEfiLegacyInterruptProtocolGuid;
#endif

View File

@ -0,0 +1,152 @@
/** @file
This protocol manages the legacy memory regions between 0xc0000 - 0xfffff
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: LegacyRegion.h
@par Revision Reference:
This protocol is defined in Framework for EFI Compatibility Support Module spec
Version 0.96
**/
#ifndef _EFI_LEGACY_REGION_H_
#define _EFI_LEGACY_REGION_H_
#define EFI_LEGACY_REGION_PROTOCOL_GUID \
{ \
0xfc9013a, 0x568, 0x4ba9, {0x9b, 0x7e, 0xc9, 0xc3, 0x90, 0xa6, 0x60, 0x9b } \
}
typedef struct _EFI_LEGACY_REGION_PROTOCOL EFI_LEGACY_REGION_PROTOCOL;
/**
Sets hardware to decode or not decode a region.
@param This Indicates the EFI_LEGACY_REGION_PROTOCOL instance
@param Start Start of region to decode.
@param Length Size in bytes of the region.
@param On Decode/nondecode flag.
@retval EFI_SUCCESS Decode range successfully changed.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_REGION_DECODE) (
IN EFI_LEGACY_REGION_PROTOCOL *This,
IN UINT32 Start,
IN UINT32 Length,
IN BOOLEAN *On
);
/**
Sets a region to read only.
@param This Indicates the EFI_LEGACY_REGION_PROTOCOL instance
@param Start Start of region to lock.
@param Length Size in bytes of the region.
@param Granularity Lock attribute affects this granularity in bytes.
@retval EFI_SUCCESS The region was made read only.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_REGION_LOCK) (
IN EFI_LEGACY_REGION_PROTOCOL *This,
IN UINT32 Start,
IN UINT32 Length,
OUT UINT32 *Granularity OPTIONAL
);
/**
Sets a region to read only and ensures that flash is locked from being
inadvertently modified.
@param This Indicates the EFI_LEGACY_REGION_PROTOCOL instance
@param Start Start of region to lock.
@param Length Size in bytes of the region.
@param Granularity Lock attribute affects this granularity in bytes.
@retval EFI_SUCCESS The region was made read only and flash is locked.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_REGION_BOOT_LOCK) (
IN EFI_LEGACY_REGION_PROTOCOL *This,
IN UINT32 Start,
IN UINT32 Length,
OUT UINT32 *Granularity OPTIONAL
);
/**
Sets a region to read-write.
@param This Indicates the EFI_LEGACY_REGION_PROTOCOL instance
@param Start Start of region to lock.
@param Length Size in bytes of the region.
@param Granularity Lock attribute affects this granularity in bytes.
@retval EFI_SUCCESS The region was successfully made read-write.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_LEGACY_REGION_UNLOCK) (
IN EFI_LEGACY_REGION_PROTOCOL *This,
IN UINT32 Start,
IN UINT32 Length,
OUT UINT32 *Granularity OPTIONAL
);
/**
@par Protocol Description:
Abstracts the hardware control of the physical address region 0xC0000<30>C0xFFFFF
for the traditional BIOS.
@param Decode
Specifies a region for the chipset to decode
@param Lock
Makes the specified OpROM region read only or locked.
@param BootLock
Sets a region to read only and ensures tat flash is locked from
inadvertent modification.
@param Unlock
Makes the specified OpROM region read-write or unlocked.
**/
struct _EFI_LEGACY_REGION_PROTOCOL {
EFI_LEGACY_REGION_DECODE Decode;
EFI_LEGACY_REGION_LOCK Lock;
EFI_LEGACY_REGION_BOOT_LOCK BootLock;
EFI_LEGACY_REGION_UNLOCK UnLock;
};
extern EFI_GUID gEfiLegacyRegionProtocolGuid;
#endif

View File

@ -0,0 +1,83 @@
/** @file
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.
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: LoadFile.h
**/
#ifndef __EFI_LOAD_FILE_PROTOCOL_H__
#define __EFI_LOAD_FILE_PROTOCOL_H__
#define LOAD_FILE_PROTOCOL_GUID \
{ \
0x56EC3091, 0x954C, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \
}
//
// Protocol Guid Name defined by UEFI 2.0 spec.
//
#define EFI_LOAD_FILE_PROTOCOL_GUID LOAD_FILE_PROTOCOL_GUID
typedef struct _EFI_LOAD_FILE_PROTOCOL EFI_LOAD_FILE_PROTOCOL;
/**
Causes the driver to load a specified file.
@param This Protocol instance pointer.
@param FilePath The device specific path of the file to load.
@param 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.
@param 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.
@param 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.
@retval EFI_SUCCESS The file was loaded.
@retval EFI_UNSUPPORTED The device does not support the provided BootPolicy
@retval EFI_INVALID_PARAMETER FilePath is not a valid device path, or
BufferSize is NULL.
@retval EFI_NO_MEDIA No medium was present to load the file.
@retval EFI_DEVICE_ERROR The file was not loaded due to a device error.
@retval EFI_NO_RESPONSE The remote system did not respond.
@retval EFI_NOT_FOUND The file was not found
@retval EFI_ABORTED The file load process was manually cancelled.
**/
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
)
;
struct _EFI_LOAD_FILE_PROTOCOL {
EFI_LOAD_FILE LoadFile;
};
extern EFI_GUID gEfiLoadFileProtocolGuid;
#endif

View File

@ -0,0 +1,69 @@
/** @file
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.
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: LoadedImage.h
**/
#ifndef __LOADED_IMAGE_PROTOCOL_H__
#define __LOADED_IMAGE_PROTOCOL_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
#define EFI_LOADED_IMAGE_PROTOCOL_REVISION EFI_LOADED_IMAGE_INFORMATION_REVISION
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,314 @@
/** @file
EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0.
EFI_MANAGED_NETWORK_PROTOCOL as defined in UEFI 2.0.
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: ManagedNetwork.h
**/
#ifndef _EFI_MANAGED_NETWORK_PROTOCOL_H
#define _EFI_MANAGED_NETWORK_PROTOCOL_H
#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 } \
}
typedef struct _EFI_MANAGED_NETWORK_PROTOCOL 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; //OPTIONAL
EFI_MAC_ADDRESS *SourceAddress; //OPTIONAL
UINT16 ProtocolType; //OPTIONAL
UINT32 DataLength;
UINT16 HeaderLength; //OPTIONAL
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;
/**
Returns the operational parameters for the current MNP child driver.
@param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param MnpConfigData Pointer to storage for MNP operational parameters.
@param SnpModeData Pointer to storage for SNP operational parameters.
@retval EFI_SUCCESS The operation completed successfully.
@retval EFI_INVALID_PARAMETER This is NULL.
@retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.
@retval EFI_NOT_STARTED This MNP child driver instance has not been configured. The default
values are returned in MnpConfigData if it is not NULL.
@retval Other The mode data could not be read.
**/
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
)
;
/**
Sets or clears the operational parameters for the MNP child driver.
@param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param MnpConfigData Pointer to configuration data that will be assigned to the MNP
child driver instance. If NULL, the MNP child driver instance is
reset to startup defaults and all pending transmit and receive
requests are flushed.
@retval EFI_SUCCESS The operation completed successfully.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_OUT_OF_RESOURCES Required system resources (usually memory) could not be
allocated.
@retval EFI_UNSUPPORTED The requested feature is unsupported in this [MNP]
implementation.
@retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
@retval Other The MNP child driver instance has been reset to startup defaults.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_MANAGED_NETWORK_CONFIGURE) (
IN EFI_MANAGED_NETWORK_PROTOCOL *This,
IN EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL
)
;
/**
Translates an IP multicast address to a hardware (MAC) multicast address.
@param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param Ipv6Flag Set to TRUE to if IpAddress is an IPv6 multicast address.
Set to FALSE if IpAddress is an IPv4 multicast address.
@param IpAddress Pointer to the multicast IP address (in network byte order) to convert.
@param MacAddress Pointer to the resulting multicast MAC address.
@retval EFI_SUCCESS The operation completed successfully.
@retval EFI_INVALID_PARAMETER One of the following conditions is TRUE:
- This is NULL.
- IpAddress is NULL.
- *IpAddress is not a valid multicast IP address.
- MacAddress is NULL.
@retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
@retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.
@retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
@retval Other The address could not be converted.
**/
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
)
;
/**
Enables and disables receive filters for multicast address.
@param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param JoinFlag Set to TRUE to join this multicast group.
Set to FALSE to leave this multicast group.
@param MacAddress Pointer to the multicast MAC group (address) to join or leave.
@retval EFI_SUCCESS The requested operation completed successfully.
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
- This is NULL.
- JoinFlag is TRUE and MacAddress is NULL.
- *MacAddress is not a valid multicast MAC address.
@retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
@retval EFI_ALREADY_STARTED The supplied multicast group is already joined.
@retval EFI_NOT_FOUND The supplied multicast group is not joined.
@retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
@retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation.
@retval Other The requested operation could not be completed.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_MANAGED_NETWORK_GROUPS) (
IN EFI_MANAGED_NETWORK_PROTOCOL *This,
IN BOOLEAN JoinFlag,
IN EFI_MAC_ADDRESS *MacAddress OPTIONAL
)
;
/**
Places asynchronous outgoing data packets into the transmit queue.
@param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param Token Pointer to a token associated with the transmit data descriptor.
@retval EFI_SUCCESS The transmit completion token was cached.
@retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_ACCESS_DENIED The transmit completion token is already in the transmit queue.
@retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a lack of system resources
(usually memory).
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
@retval EFI_NOT_READY The transmit request could not be queued because the transmit queue is full.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_MANAGED_NETWORK_TRANSMIT) (
IN EFI_MANAGED_NETWORK_PROTOCOL *This,
IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token
)
;
/**
Places an asynchronous receiving request into the receiving queue.
@param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param Token Pointer to a token associated with the receive data descriptor.
@retval EFI_SUCCESS The receive completion token was cached.
@retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
- This is NULL.
- Token is NULL.
- Token.Event is NULL
@retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a lack of system resources
(usually memory).
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
@retval EFI_ACCESS_DENIED The receive completion token was already in the receive queue.
@retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_MANAGED_NETWORK_RECEIVE) (
IN EFI_MANAGED_NETWORK_PROTOCOL *This,
IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token
)
;
/**
Aborts an asynchronous transmit or receive request.
@param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param Token Pointer to a token that has been issued by
EFI_MANAGED_NETWORK_PROTOCOL.Transmit() or
EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If
NULL, all pending tokens are aborted.
@retval EFI_SUCCESS The asynchronous I/O request was aborted and Token.Event
was signaled. When Token is NULL, all pending requests were
aborted and their events were signaled.
@retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
@retval EFI_INVALID_PARAMETER This is NULL.
@retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was
not found in the transmit or receive queue. It has either completed
or was not issued by Transmit() and Receive().
**/
typedef
EFI_STATUS
(EFIAPI *EFI_MANAGED_NETWORK_CANCEL) (
IN EFI_MANAGED_NETWORK_PROTOCOL *This,
IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token OPTIONAL
)
;
/**
Polls for incoming data packets and processes outgoing data packets.
@param This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@retval EFI_SUCCESS Incoming or outgoing data was processed.
@retval EFI_NOT_STARTED This MNP child driver instance has not been configured.
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
@retval EFI_NOT_READY No incoming or outgoing data was processed. Consider increasing
the polling rate.
@retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
Consider increasing the polling rate.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_MANAGED_NETWORK_POLL) (
IN EFI_MANAGED_NETWORK_PROTOCOL *This
)
;
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;
};
extern EFI_GUID gEfiManagedNetworkServiceBindingProtocolGuid;
extern EFI_GUID gEfiManagedNetworkProtocolGuid;
#endif

View File

@ -0,0 +1,508 @@
/** @file
EFI Multicast Trivial File Tranfer Protocol Definition
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.h
**/
#ifndef __EFI_MTFTP4_PROTOCOL_H__
#define __EFI_MTFTP4_PROTOCOL_H__
#define EFI_MTFTP4_SERVICE_BINDING_PROTOCOL_GUID \
{ \
0x2FE800BE, 0x8F01, 0x4aa6, {0x94, 0x6B, 0xD7, 0x13, 0x88, 0xE1, 0x83, 0x3F } \
}
#define EFI_MTFTP4_PROTOCOL_GUID \
{ \
0x3ad9df29, 0x4501, 0x478d, {0xb1, 0xf8, 0x7f, 0x7f, 0xe7, 0x0e, 0x50, 0xf3 } \
}
typedef struct _EFI_MTFTP4_PROTOCOL EFI_MTFTP4_PROTOCOL;
typedef struct _EFI_MTFTP4_TOKEN EFI_MTFTP4_TOKEN;
//
//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 definitions
//
#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;
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;
typedef struct {
EFI_MTFTP4_CONFIG_DATA ConfigData;
UINT8 SupportedOptionCount;
UINT8 **SupportedOptoins;
UINT8 UnsupportedOptionCount;
UINT8 **UnsupportedOptoins;
} EFI_MTFTP4_MODE_DATA;
typedef struct {
EFI_IPv4_ADDRESS GatewayIp;
EFI_IPv4_ADDRESS ServerIp;
UINT16 ServerPort;
UINT16 TryCount;
UINT16 TimeoutValue;
} EFI_MTFTP4_OVERRIDE_DATA;
//
// Protocol interfaces definition
//
/**
a callback function that is provided by the caller to intercept
the EFI_MTFTP4_OPCODE_DATA or EFI_MTFTP4_OPCODE_DATA8 packets processed in the
EFI_MTFTP4_PROTOCOL.ReadFile() function, and alternatively to intercept
EFI_MTFTP4_OPCODE_OACK or EFI_MTFTP4_OPCODE_ERROR packets during a call to
EFI_MTFTP4_PROTOCOL.ReadFile(), WriteFile() or ReadDirectory().
@param This Pointer to the EFI_MTFTP4_PROTOCOL instance.
@param Token The token that the caller provided in the
EFI_MTFTP4_PROTOCOL.ReadFile(), WriteFile()
or ReadDirectory() function.
@param PacketLen Indicates the length of the packet.
@param Packet Pointer to an MTFTPv4 packet.
@retval EFI_SUCCESS Operation sucess
@retval Others Abort transfer process
**/
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.
@param This Pointer to the EFI_MTFTP4_PROTOCOL instance.
@param Token The token that is provided in the
EFI_MTFTP4_PROTOCOL.ReadFile() or
EFI_MTFTP4_PROTOCOL.WriteFile() or
EFI_MTFTP4_PROTOCOL.ReadDirectory() functions
by the caller.
@retval EFI_SUCCESS Operation sucess
@retval Others Aborts download process.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_MTFTP4_TIMEOUT_CALLBACK)(
IN EFI_MTFTP4_PROTOCOL *This,
IN EFI_MTFTP4_TOKEN *Token
)
;
/**
a callback function that the caller provides to feed data to the
EFI_MTFTP4_PROTOCOL.WriteFile() function.
@param This Pointer to the EFI_MTFTP4_PROTOCOL instance.
@param Token The token provided in the
EFI_MTFTP4_PROTOCOL.WriteFile() by the caller.
@param Length Indicates the length of the raw data wanted on input, and the
length the data available on output.
@param Buffer Pointer to the buffer where the data is stored.
@retval EFI_SUCCESS Operation sucess
@retval Others Aborts session.
**/
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
)
;
/**
Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.
@param This Pointer to the EFI_MTFTP4_PROTOCOL instance.
@param ModeData Pointer to storage for the EFI MTFTPv4 Protocol driver mode data.
@retval EFI_SUCCESS The configuration data was successfully returned.
@retval EFI_OUT_OF_RESOURCES The required mode data could not be allocated.
@retval EFI_INVALID_PARAMETER This is NULL or ModeData is NULL.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_MTFTP4_GET_MODE_DATA)(
IN EFI_MTFTP4_PROTOCOL *This,
OUT EFI_MTFTP4_MODE_DATA *ModeData
)
;
/**
Initializes, changes, or resets the default operational setting for this
EFI MTFTPv4 Protocol driver instance.
@param This Pointer to the EFI_MTFTP4_PROTOCOL instance.
@param MtftpConfigData Pointer to the configuration data structure.
@retval EFI_SUCCESS The EFI MTFTPv4 Protocol driver was configured successfully.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_ACCESS_DENIED The EFI configuration could not be changed at this time because
there is one MTFTP background operation in progress.
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
RARP, etc.) has not finished yet.
@retval EFI_UNSUPPORTED A configuration protocol (DHCP, BOOTP, RARP, etc.) could not
be located when clients choose to use the default address
settings.
@retval EFI_OUT_OF_RESOURCES The EFI MTFTPv4 Protocol driver instance data could not be
allocated.
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI
MTFTPv4 Protocol driver instance is not configured.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_MTFTP4_CONFIGURE)(
IN EFI_MTFTP4_PROTOCOL *This,
IN EFI_MTFTP4_CONFIG_DATA *MtftpConfigData OPTIONAL
)
;
/**
Gets information about a file from an MTFTPv4 server.
@param This Pointer to the EFI_MTFTP4_PROTOCOL instance.
@param OverrideData Data that is used to override the existing parameters. If NULL,
the default parameters that were set in the
EFI_MTFTP4_PROTOCOL.Configure() function are used.
@param Filename Pointer to ASCIIZ file name string.
@param ModeStr Pointer to ASCIIZ mode string. If NULL, <20><>octet<65><74> will be used.
@param OptionCount Number of option/value string pairs in OptionList.
@param OptionList Pointer to array of option/value string pairs. Ignored if
OptionCount is zero.
@param PacketLength The number of bytes in the returned packet.
@param Packet The pointer to the received packet. This buffer must be freed by
the caller.
@retval EFI_SUCCESS An MTFTPv4 OACK packet was received and is in the Buffer.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_UNSUPPORTED One or more options in the OptionList are in the
unsupported list of structure EFI_MTFTP4_MODE_DATA.
@retval EFI_NOT_STARTED The EFI MTFTPv4 Protocol driver has not been started.
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
RARP, etc.) has not finished yet.
@retval EFI_ACCESS_DENIED The previous operation has not completed yet.
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
@retval EFI_TFTP_ERROR An MTFTPv4 ERROR packet was received and is in the buffer.
@retval EFI_ICMP_ERROR An ICMP ERROR packet was received and is in the Buffer.
@retval EFI_PROTOCOL_ERROR An unexpected MTFTPv4 packet was received and is in the buffer.
@retval EFI_TIMEOUT No responses were received from the MTFTPv4 server.
@retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.
**/
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
)
;
/**
Parses the options in an MTFTPv4 OACK packet.
@param This Pointer to the EFI_MTFTP4_PROTOCOL instance.
@param PacketLen Length of the OACK packet to be parsed.
@param Packet Pointer to the OACK packet to be parsed.
@param OptionCount Pointer to the number of options in following OptionList.
@param OptionList Pointer to EFI_MTFTP4_OPTION storage. Call the EFI Boot
Service FreePool() to release each option if they are not
needed any more.
@retval EFI_SUCCESS The OACK packet was valid and the OptionCount and
OptionList parameters have been updated.
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
- PacketLen is 0.
- Packet is NULL or Packet is not a valid MTFTPv4 packet.
- OptionCount is NULL.
@retval EFI_NOT_FOUND No options were found in the OACK packet.
@retval EFI_OUT_OF_RESOURCES Storage for the OptionList array cannot be allocated.
@retval EFI_PROTOCOL_ERROR One or more of the option fields is invalid.
**/
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
)
;
/**
Downloads a file from an MTFTPv4 server.
@param This Pointer to the EFI_MTFTP4_PROTOCOL instance.
@param Token Pointer to the token structure to provide the parameters that are
used in this operation.
@retval EFI_SUCCESS The data file has been transferred successfully.
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
@retval EFI_BUFFER_TOO_SMALL BufferSize is not large enough to hold the downloaded data
in downloading process.
@retval EFI_ABORTED Current operation is aborted by user.
@retval EFI_ICMP_ERROR An ICMP ERROR packet was received.
@retval EFI_TIMEOUT No responses were received from the MTFTPv4 server.
@retval EFI_TFTP_ERROR An MTFTPv4 ERROR packet was received.
@retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_MTFTP4_READ_FILE)(
IN EFI_MTFTP4_PROTOCOL *This,
IN EFI_MTFTP4_TOKEN *Token
)
;
/**
Sends a file to an MTFTPv4 server.
@param This Pointer to the EFI_MTFTP4_PROTOCOL instance.
@param Token Pointer to the token structure to provide the parameters that are
used in this operation.
@retval EFI_SUCCESS The upload session has started.
@retval EFI_UNSUPPORTED The operation is not supported by this implementation.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_UNSUPPORTED One or more options in the Token.OptionList are in
the unsupported list of structure EFI_MTFTP4_MODE_DATA.
@retval EFI_NOT_STARTED The EFI MTFTPv4 Protocol driver has not been started.
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
RARP, etc.) is not finished yet.
@retval EFI_ALREADY_STARTED This Token is already being used in another MTFTPv4 session.
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
@retval EFI_ACCESS_DENIED The previous operation has not completed yet.
@retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_MTFTP4_WRITE_FILE)(
IN EFI_MTFTP4_PROTOCOL *This,
IN EFI_MTFTP4_TOKEN *Token
)
;
/**
Downloads a data file <20><>directory<72><79> from an MTFTPv4 server. May be unsupported in some EFI
implementations.
@param This Pointer to the EFI_MTFTP4_PROTOCOL instance.
@param Token Pointer to the token structure to provide the parameters that are
used in this operation.
@retval EFI_SUCCESS The MTFTPv4 related file "directory" has been downloaded.
@retval EFI_UNSUPPORTED The operation is not supported by this implementation.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_UNSUPPORTED One or more options in the Token.OptionList are in
the unsupported list of structure EFI_MTFTP4_MODE_DATA.
@retval EFI_NOT_STARTED The EFI MTFTPv4 Protocol driver has not been started.
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
RARP, etc.) is not finished yet.
@retval EFI_ALREADY_STARTED This Token is already being used in another MTFTPv4 session.
@retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
@retval EFI_ACCESS_DENIED The previous operation has not completed yet.
@retval EFI_DEVICE_ERROR An unexpected network error or system error occurred.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_MTFTP4_READ_DIRECTORY)(
IN EFI_MTFTP4_PROTOCOL *This,
IN EFI_MTFTP4_TOKEN *Token
)
;
/**
Polls for incoming data packets and processes outgoing data packets.
@param This Pointer to the EFI_MTFTP4_PROTOCOL instance.
@retval EFI_SUCCESS Incoming or outgoing data was processed.
@retval EFI_NOT_STARTED This EFI MTFTPv4 Protocol instance has not been started.
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
RARP, etc.) is not finished yet.
@retval EFI_INVALID_PARAMETER This is NULL.
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
@retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
Consider increasing the polling rate.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_MTFTP4_POLL) (
IN EFI_MTFTP4_PROTOCOL *This
)
;
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;
};
struct _EFI_MTFTP4_TOKEN {
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 EFI_MTFTP4_CHECK_PACKET CheckPacket;
IN EFI_MTFTP4_TIMEOUT_CALLBACK TimeoutCallback;
IN EFI_MTFTP4_PACKET_NEEDED PacketNeeded;
};
extern EFI_GUID gEfiMtftp4ServiceBindingProtocolGuid;
extern EFI_GUID gEfiMtftp4ProtocolGuid;
#endif

View File

@ -0,0 +1,297 @@
/** @file
Platform Configuration Database (PCD) Protocol
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: Pcd.h
**/
#ifndef __PCD_H__
#define __PCD_H__
extern EFI_GUID gPcdProtocolGuid;
#define PCD_PROTOCOL_GUID \
{ 0x11b34006, 0xd85b, 0x4d0a, { 0xa2, 0x90, 0xd5, 0xa5, 0x71, 0x31, 0xe, 0xf7 } }
#define PCD_INVALID_TOKEN_NUMBER ((UINTN) -1)
typedef
VOID
(EFIAPI *PCD_PROTOCOL_SET_SKU) (
IN UINTN SkuId
);
typedef
UINT8
(EFIAPI *PCD_PROTOCOL_GET8) (
IN UINTN TokenNumber
);
typedef
UINT16
(EFIAPI *PCD_PROTOCOL_GET16) (
IN UINTN TokenNumber
);
typedef
UINT32
(EFIAPI *PCD_PROTOCOL_GET32) (
IN UINTN TokenNumber
);
typedef
UINT64
(EFIAPI *PCD_PROTOCOL_GET64) (
IN UINTN TokenNumber
);
typedef
VOID *
(EFIAPI *PCD_PROTOCOL_GET_POINTER) (
IN UINTN TokenNumber
);
typedef
BOOLEAN
(EFIAPI *PCD_PROTOCOL_GET_BOOLEAN) (
IN UINTN TokenNumber
);
typedef
UINTN
(EFIAPI *PCD_PROTOCOL_GET_SIZE) (
IN UINTN TokenNumber
);
typedef
UINT8
(EFIAPI *PCD_PROTOCOL_GET_EX_8) (
IN CONST EFI_GUID *Guid,
IN UINTN TokenNumber
);
typedef
UINT16
(EFIAPI *PCD_PROTOCOL_GET_EX_16) (
IN CONST EFI_GUID *Guid,
IN UINTN TokenNumber
);
typedef
UINT32
(EFIAPI *PCD_PROTOCOL_GET_EX_32) (
IN CONST EFI_GUID *Guid,
IN UINTN TokenNumber
);
typedef
UINT64
(EFIAPI *PCD_PROTOCOL_GET_EX_64) (
IN CONST EFI_GUID *Guid,
IN UINTN TokenNumber
);
typedef
VOID *
(EFIAPI *PCD_PROTOCOL_GET_EX_POINTER) (
IN CONST EFI_GUID *Guid,
IN UINTN TokenNumber
);
typedef
BOOLEAN
(EFIAPI *PCD_PROTOCOL_GET_EX_BOOLEAN) (
IN CONST EFI_GUID *Guid,
IN UINTN TokenNumber
);
typedef
UINTN
(EFIAPI *PCD_PROTOCOL_GET_EX_SIZE) (
IN CONST EFI_GUID *Guid,
IN UINTN TokenNumber
);
typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET8) (
IN UINTN TokenNumber,
IN UINT8 Value
);
typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET16) (
IN UINTN TokenNumber,
IN UINT16 Value
);
typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET32) (
IN UINTN TokenNumber,
IN UINT32 Value
);
typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET64) (
IN UINTN TokenNumber,
IN UINT64 Value
);
typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET_POINTER) (
IN UINTN TokenNumber,
IN UINTN SizeOfBuffer,
IN VOID *Buffer
);
typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET_BOOLEAN) (
IN UINTN TokenNumber,
IN BOOLEAN Value
);
typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET_EX_8) (
IN CONST EFI_GUID *Guid,
IN UINTN TokenNumber,
IN UINT8 Value
);
typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET_EX_16) (
IN CONST EFI_GUID *Guid,
IN UINTN TokenNumber,
IN UINT16 Value
);
typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET_EX_32) (
IN CONST EFI_GUID *Guid,
IN UINTN TokenNumber,
IN UINT32 Value
);
typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET_EX_64) (
IN CONST EFI_GUID *Guid,
IN UINTN TokenNumber,
IN UINT64 Value
);
typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET_EX_POINTER) (
IN CONST EFI_GUID *Guid,
IN UINTN TokenNumber,
IN UINTN SizeOfBuffer,
IN VOID *Buffer
);
typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_SET_EX_BOOLEAN) (
IN CONST EFI_GUID *Guid,
IN UINTN TokenNumber,
IN BOOLEAN Value
);
/**
Callback on SET function prototype definition.
@param[in] CallBackGuid The PCD token GUID being set.
@param[in] CallBackToken The PCD token number being set.
@param[in] TokenData A pointer to the token data being set.
@param[in] TokenDataSize The size, in bytes, of the data being set.
@retval VOID
--*/
typedef
VOID
(EFIAPI *PCD_PROTOCOL_CALLBACK) (
IN CONST EFI_GUID *CallBackGuid, OPTIONAL
IN UINTN CallBackToken,
IN OUT VOID *TokenData,
IN UINTN TokenDataSize
);
typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_CALLBACK_ONSET) (
IN UINTN TokenNumber,
IN CONST EFI_GUID *Guid, OPTIONAL
IN PCD_PROTOCOL_CALLBACK CallBackFunction
);
typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_CANCEL_CALLBACK) (
IN UINTN TokenNumber,
IN CONST EFI_GUID *Guid, OPTIONAL
IN PCD_PROTOCOL_CALLBACK CallBackFunction
);
typedef
EFI_STATUS
(EFIAPI *PCD_PROTOCOL_GET_NEXT_TOKEN) (
IN CONST EFI_GUID *Guid, OPTIONAL
IN OUT UINTN *TokenNumber
);
typedef struct {
PCD_PROTOCOL_SET_SKU SetSku;
PCD_PROTOCOL_GET8 Get8;
PCD_PROTOCOL_GET16 Get16;
PCD_PROTOCOL_GET32 Get32;
PCD_PROTOCOL_GET64 Get64;
PCD_PROTOCOL_GET_POINTER GetPtr;
PCD_PROTOCOL_GET_BOOLEAN GetBool;
PCD_PROTOCOL_GET_SIZE GetSize;
PCD_PROTOCOL_GET_EX_8 Get8Ex;
PCD_PROTOCOL_GET_EX_16 Get16Ex;
PCD_PROTOCOL_GET_EX_32 Get32Ex;
PCD_PROTOCOL_GET_EX_64 Get64Ex;
PCD_PROTOCOL_GET_EX_POINTER GetPtrEx;
PCD_PROTOCOL_GET_EX_BOOLEAN GetBoolEx;
PCD_PROTOCOL_GET_EX_SIZE GetSizeEx;
PCD_PROTOCOL_SET8 Set8;
PCD_PROTOCOL_SET16 Set16;
PCD_PROTOCOL_SET32 Set32;
PCD_PROTOCOL_SET64 Set64;
PCD_PROTOCOL_SET_POINTER SetPtr;
PCD_PROTOCOL_SET_BOOLEAN SetBool;
PCD_PROTOCOL_SET_EX_8 Set8Ex;
PCD_PROTOCOL_SET_EX_16 Set16Ex;
PCD_PROTOCOL_SET_EX_32 Set32Ex;
PCD_PROTOCOL_SET_EX_64 Set64Ex;
PCD_PROTOCOL_SET_EX_POINTER SetPtrEx;
PCD_PROTOCOL_SET_EX_BOOLEAN SetBoolEx;
PCD_PROTOCOL_CALLBACK_ONSET CallbackOnSet;
PCD_PROTOCOL_CANCEL_CALLBACK CancelCallback;
PCD_PROTOCOL_GET_NEXT_TOKEN GetNextToken;
} PCD_PROTOCOL;
#endif

View File

@ -0,0 +1,363 @@
/** @file
This file declares Pci Host Bridge Resource Allocation Protocol
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: PciHostBridgeResourceAllocation.h
@par Revision Reference:
This protocol is defined in Framework of EFI Pci Host Bridge Resource Allocation Protocol Spec
Version 0.9
**/
#ifndef _PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_H_
#define _PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_H_
#define EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GUID \
{ 0xCF8034BE, 0x6768, 0x4d8b, {0xB7,0x39,0x7C,0xCE,0x68,0x3A,0x9F,0xBE }}
typedef struct _EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL;
//
// EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ATTRIBUTES
//
// If this bit is set, then the PCI Root Bridge does not
// support separate windows for Non-prefetchable and Prefetchable
// memory. A PCI bus driver needs to include requests for Prefetchable
// memory in the Non-prefetchable memory pool.
//
#define EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM 1
//
// If this bit is set, then the PCI Root Bridge supports
// 64 bit memory windows. If this bit is not set,
// the PCI bus driver needs to include requests for 64 bit
// memory address in the corresponding 32 bit memory pool.
//
#define EFI_PCI_HOST_BRIDGE_MEM64_DECODE 2
//
// EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE
//
typedef enum {
EfiPciHostBridgeBeginEnumeration,
EfiPciHostBridgeBeginBusAllocation,
EfiPciHostBridgeEndBusAllocation,
EfiPciHostBridgeBeginResourceAllocation,
EfiPciHostBridgeAllocateResources,
EfiPciHostBridgeSetResources,
EfiPciHostBridgeFreeResources,
EfiPciHostBridgeEndResourceAllocation
} EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE;
//
// EfiPciHostBridgeBeginEnumeration
// Reset the host bridge PCI apertures and internal data structures.
// PCI enumerator should issue this notification before starting fresh
// enumeration process. Enumeration cannot be restarted after sending
// any other notification such as EfiPciHostBridgeBeginBusAllocation.
//
// EfiPciHostBridgeBeginBusAllocation
// The bus allocation phase is about to begin. No specific action
// is required here. This notification can be used to perform any
// chipset specific programming.
//
// EfiPciHostBridgeEndBusAllocation
// The bus allocation and bus programming phase is complete. No specific
// action is required here. This notification can be used to perform any
// chipset specific programming.
//
// EfiPciHostBridgeBeginResourceAllocation
// The resource allocation phase is about to begin.No specific action is
// required here. This notification can be used to perform any chipset specific programming.
//
// EfiPciHostBridgeAllocateResources
// Allocate resources per previously submitted requests for all the PCI Root
// Bridges. These resource settings are returned on the next call to
// GetProposedResources().
//
// EfiPciHostBridgeSetResources
// Program the Host Bridge hardware to decode previously allocated resources
// (proposed resources) for all the PCI Root Bridges.
//
// EfiPciHostBridgeFreeResources
// De-allocate previously allocated resources previously for all the PCI
// Root Bridges and reset the I/O and memory apertures to initial state.
//
// EfiPciHostBridgeEndResourceAllocation
// The resource allocation phase is completed. No specific action is required
// here. This notification can be used to perform any chipset specific programming.
//
// EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE
//
typedef enum {
EfiPciBeforeChildBusEnumeration,
EfiPciBeforeResourceCollection
} EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE;
//
// EfiPciBeforeChildBusEnumeration
// This notification is only applicable to PCI-PCI bridges and
// indicates that the PCI enumerator is about to begin enumerating
// the bus behind the PCI-PCI Bridge. This notification is sent after
// the primary bus number, the secondary bus number and the subordinate
// bus number registers in the PCI-PCI Bridge are programmed to valid
// (not necessary final) values
//
// EfiPciBeforeResourceCollection
// This notification is sent before the PCI enumerator probes BAR registers
// for every valid PCI function.
//
/**
Enter a certain phase of the PCI enumeration process
@param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL instance
@param Phase The phase during enumeration
@retval EFI_SUCCESS Success
@retval EFI_OUT_OF_RESOURCES If SubmitResources ( ) could not allocate resources
@retval EFI_NOT_READY This phase cannot be entered at this time
@retval EFI_DEVICE_ERROR SetResources failed due to HW error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_NOTIFY_PHASE) (
IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE Phase
);
/**
Return the device handle of the next PCI root bridge that is associated with
this Host Bridge
@param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance
@param RootBridgeHandle Returns the device handle of the next PCI Root Bridge.
On input, it holds the RootBridgeHandle returned by the most
recent call to GetNextRootBridge().The handle for the first
PCI Root Bridge is returned if RootBridgeHandle is NULL on input
@retval EFI_SUCCESS Success
@retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_NEXT_ROOT_BRIDGE) (
IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
IN OUT EFI_HANDLE *RootBridgeHandle
);
/**
Returns the attributes of a PCI Root Bridge.
@param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance
@param RootBridgeHandle The device handle of the PCI Root Bridge
that the caller is interested in
@param Attribute The pointer to attributes of the PCI Root Bridge
@retval EFI_SUCCESS Success
@retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid
@retval EFI_INVALID_PARAMETER Attributes is NULL
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_ATTRIBUTES) (
IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
IN EFI_HANDLE RootBridgeHandle,
OUT UINT64 *Attributes
);
/**
This is the request from the PCI enumerator to set up
the specified PCI Root Bridge for bus enumeration process.
@param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance
@param RootBridgeHandle The PCI Root Bridge to be set up
@param Configuration Pointer to the pointer to the PCI bus resource descriptor
@retval EFI_SUCCESS Success
@retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid
@retval EFI_DEVICE_ERROR Request failed due to hardware error
@retval EFI_OUT_OF_RESOURCES Request failed due to lack of resources
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_START_BUS_ENUMERATION) (
IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
IN EFI_HANDLE RootBridgeHandle,
OUT VOID **Configuration
);
/**
This function programs the PCI Root Bridge hardware so that
it decodes the specified PCI bus range
@param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance
@param RootBridgeHandle The PCI Root Bridge whose bus range is to be programmed
@param Configuration The pointer to the PCI bus resource descriptor
@retval EFI_SUCCESS Success
@retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid
@retval EFI_INVALID_PARAMETER Configuration is NULL
@retval EFI_INVALID_PARAMETER Configuration does not point to a valid ACPI resource descriptor
@retval EFI_INVALID_PARAMETER Configuration contains one or more memory or IO ACPI resource descriptor
@retval EFI_INVALID_PARAMETER Address Range Minimum or Address Range Length fields in Configuration
are invalid for this Root Bridge.
@retval EFI_INVALID_PARAMETER Configuration contains one or more invalid ACPI resource descriptor
@retval EFI_DEVICE_ERROR Request failed due to hardware error
@retval EFI_OUT_OF_RESOURCES Request failed due to lack of resources
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SET_BUS_NUMBERS) (
IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
IN EFI_HANDLE RootBridgeHandle,
IN VOID *Configuration
);
/**
Submits the I/O and memory resource requirements for the specified PCI Root Bridge
@param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance
@param RootBridgeHandle The PCI Root Bridge whose I/O and memory resource requirements
are being submitted
@param Configuration The pointer to the PCI I/O and PCI memory resource descriptor
@retval EFI_SUCCESS Success
@retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid
@retval EFI_INVALID_PARAMETER Configuration is NULL
@retval EFI_INVALID_PARAMETER Configuration does not point to a valid ACPI resource descriptor
@retval EFI_INVALID_PARAMETER Configuration includes a resource descriptor of unsupported type
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SUBMIT_RESOURCES) (
IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
IN EFI_HANDLE RootBridgeHandle,
IN VOID *Configuration
);
/**
This function returns the proposed resource settings for the specified
PCI Root Bridge
@param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance
@param RootBridgeHandle The PCI Root Bridge handle
@param Configuration The pointer to the pointer to the PCI I/O
and memory resource descriptor
@retval EFI_SUCCESS Success
@retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid
@retval EFI_DEVICE_ERROR Request failed due to hardware error
@retval EFI_OUT_OF_RESOURCES Request failed due to lack of resources
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_PROPOSED_RESOURCES) (
IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
IN EFI_HANDLE RootBridgeHandle,
OUT VOID **Configuration
);
/**
This function is called for all the PCI controllers that the PCI
bus driver finds. Can be used to Preprogram the controller.
@param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance
@param RootBridgeHandle The PCI Root Bridge handle
@param PciBusAddress Address of the controller on the PCI bus
@param Phase The Phase during resource allocation
@retval EFI_SUCCESS Success
@retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid
@retval EFI_DEVICE_ERROR Device pre-initialization failed due to hardware error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_PREPROCESS_CONTROLLER) (
IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
IN EFI_HANDLE RootBridgeHandle,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS PciAddress,
IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE Phase
);
/**
@par Protocol Description:
Provides the basic interfaces to abstract a PCI host bridge resource allocation.
@param NotifyPhase
The notification from the PCI bus enumerator that it is about to enter
a certain phase during the enumeration process.
@param GetNextRootBridge
Retrieves the device handle for the next PCI root bridge that is produced by the
host bridge to which this instance of the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL is attached.
@param GetAllocAttributes
Retrieves the allocation-related attributes of a PCI root bridge.
@param StartBusEnumeration
Sets up a PCI root bridge for bus enumeration.
@param SetBusNumbers
Sets up the PCI root bridge so that it decodes a specific range of bus numbers.
@param SubmitResources
Submits the resource requirements for the specified PCI root bridge.
@param GetProposedResources
Returns the proposed resource assignment for the specified PCI root bridges.
@param PreprocessController
Provides hooks from the PCI bus driver to every PCI controller
(device/function) at various stages of the PCI enumeration process that
allow the host bridge driver to preinitialize individual PCI controllers
before enumeration.
**/
struct _EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL {
EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_NOTIFY_PHASE NotifyPhase;
EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_NEXT_ROOT_BRIDGE GetNextRootBridge;
EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_ATTRIBUTES GetAllocAttributes;
EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_START_BUS_ENUMERATION StartBusEnumeration;
EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SET_BUS_NUMBERS SetBusNumbers;
EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SUBMIT_RESOURCES SubmitResources;
EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_PROPOSED_RESOURCES GetProposedResources;
EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_PREPROCESS_CONTROLLER PreprocessController;
};
extern EFI_GUID gEfiPciHostBridgeResourceAllocationProtocolGuid;
#endif

View File

@ -0,0 +1,185 @@
/** @file
This file declares EFI PCI Hot Plug Init Protocol
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: PciHotPlugInit.h
@par Revision Reference:
This protocol is defined in Framework of EFI Hot Plug Pci Initialization Protocol Spec
Version 0.9
**/
#ifndef _EFI_PCI_HOT_PLUG_INIT_H
#define _EFI_PCI_HOT_PLUG_INIT_H
//
// Global ID for the PCI Hot Plug Protocol
//
#define EFI_PCI_HOT_PLUG_INIT_PROTOCOL_GUID \
{ 0xaa0e8bc1, 0xdabc, 0x46b0, {0xa8, 0x44, 0x37, 0xb8, 0x16, 0x9b, 0x2b, 0xea } }
typedef struct _EFI_PCI_HOT_PLUG_INIT_PROTOCOL EFI_PCI_HOT_PLUG_INIT_PROTOCOL;
#define EFI_HPC_STATE_INITIALIZED 0x01
#define EFI_HPC_STATE_ENABLED 0x02
typedef UINT16 EFI_HPC_STATE;
typedef struct{
EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath;
EFI_DEVICE_PATH_PROTOCOL *HpbDevicePath;
} EFI_HPC_LOCATION;
typedef enum{
EfiPaddingPciBus,
EfiPaddingPciRootBridge
} EFI_HPC_PADDING_ATTRIBUTES;
/**
Returns a list of root Hot Plug Controllers (HPCs) that require initialization
during the boot process.
@param This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.
@param HpcCount The number of root HPCs that were returned.
@param HpcList The list of root HPCs. HpcCount defines the number of
elements in this list.
@retval EFI_SUCCESS HpcList was returned.
@retval EFI_OUT_OF_RESOURCES HpcList was not returned due to insufficient resources.
@retval EFI_INVALID_PARAMETER HpcCount is NULL or HpcList is NULL.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_GET_ROOT_HPC_LIST) (
IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This,
OUT UINTN *HpcCount,
OUT EFI_HPC_LOCATION **HpcList
);
/**
Initializes one root Hot Plug Controller (HPC). This process may causes
initialization of its subordinate buses.
@param This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.
@param HpcDevicePath The device path to the HPC that is being initialized.
@param HpcPciAddress The address of the HPC function on the PCI bus.
@param Event The event that should be signaled when the HPC initialization
is complete.
@param HpcState The state of the HPC hardware.
@retval EFI_SUCCESS If Event is NULL, the specific HPC was successfully
initialized. If Event is not NULL, Event will be signaled at a later time
when initialization is complete.
@retval EFI_UNSUPPORTED This instance of EFI_PCI_HOT_PLUG_INIT_PROTOCOL
does not support the specified HPC.
@retval EFI_OUT_OF_RESOURCES Initialization failed due to insufficient
resources.
@retval EFI_INVALID_PARAMETER HpcState is NULL.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_INITIALIZE_ROOT_HPC) (
IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This,
IN EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath,
IN UINT64 HpcPciAddress,
IN EFI_EVENT Event, OPTIONAL
OUT EFI_HPC_STATE *HpcState
);
/**
Returns the resource padding that is required by the PCI bus that is controlled
by the specified Hot Plug Controller (HPC).
@param This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.
@param HpcDevicePath The device path to the HPC.
@param HpcPciAddress The address of the HPC function on the PCI bus.
@param HpcState The state of the HPC hardware.
@param Padding The amount of resource padding that is required by the
PCI bus under the control of the specified HPC.
@param Attributes Describes how padding is accounted for. The padding
is returned in the form of ACPI 2.0 resource descriptors.
@retval EFI_SUCCESS The resource padding was successfully returned.
@retval EFI_UNSUPPORTED This instance of the EFI_PCI_HOT_PLUG_INIT_PROTOCOL
does not support the specified HPC.
@retval EFI_NOT_READY This function was called before HPC initialization is complete.
@retval EFI_INVALID_PARAMETER HpcState or Padding or Attributes is NULL.
@retval EFI_OUT_OF_RESOURCES ACPI 2.0 resource descriptors for Padding
cannot be allocated due to insufficient resources.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_GET_PCI_HOT_PLUG_PADDING) (
IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This,
IN EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath,
IN UINT64 HpcPciAddress,
OUT EFI_HPC_STATE *HpcState,
OUT VOID **Padding,
OUT EFI_HPC_PADDING_ATTRIBUTES *Attributes
);
//
// Prototypes for the PCI Hot Plug Init Protocol
//
/**
@par Protocol Description:
This protocol provides the necessary functionality to initialize the
Hot Plug Controllers (HPCs) and the buses that they control. This protocol
also provides information regarding resource padding.
@param GetRootHpcList
Returns a list of root HPCs and the buses that they control.
@param InitializeRootHpc
Initializes the specified root HPC.
@param GetResourcePadding
Returns the resource padding that is required by the HPC.
**/
struct _EFI_PCI_HOT_PLUG_INIT_PROTOCOL {
EFI_GET_ROOT_HPC_LIST GetRootHpcList;
EFI_INITIALIZE_ROOT_HPC InitializeRootHpc;
EFI_GET_PCI_HOT_PLUG_PADDING GetResourcePadding;
};
extern EFI_GUID gEfiPciHotPlugInitProtocolGuid;
#endif

View File

@ -0,0 +1,503 @@
/** @file
EFI PCI I/O Protocol
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: PciIo.h
**/
#ifndef __PCI_IO_H__
#define __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 } \
}
typedef struct _EFI_PCI_IO_PROTOCOL 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 0x0100-0x03FF or greater (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
#define EFI_PCI_IO_ATTRIBUTE_ISA_IO_16 0x10000 // I/O cycles 0x0100-0x03FF or greater (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 0x30000 // 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;
/**
Reads from the memory space of a PCI controller. Returns when either the polling exit criteria is
satisfied or after a defined duration.
@param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param Width Signifies the width of the memory or I/O operations.
@param BarIndex The BAR index of the standard PCI Configuration header to use as the
base address for the memory operation to perform.
@param Offset The offset within the selected BAR to start the memory operation.
@param Mask Mask used for the polling criteria.
@param Value The comparison value used for the polling exit criteria.
@param Delay The number of 100 ns units to poll.
@param Result Pointer to the last value read from the memory location.
@retval EFI_SUCCESS The last data returned from the access matched the poll exit criteria.
@retval EFI_UNSUPPORTED BarIndex not valid for this PCI controller.
@retval EFI_UNSUPPORTED Offset is not valid for the BarIndex of this PCI controller.
@retval EFI_TIMEOUT Delay expired before a match occurred.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
**/
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
);
/**
Enable a PCI driver to access PCI controller registers in the PCI memory or I/O space.
@param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param Width Signifies the width of the memory or I/O operations.
@param BarIndex The BAR index of the standard PCI Configuration header to use as the
base address for the memory or I/O operation to perform.
@param Offset The offset within the selected BAR to start the memory or I/O operation.
@param Count The number of memory or I/O operations to perform.
@param Buffer For read operations, the destination buffer to store the results. For write
operations, the source buffer to write data from.
@retval EFI_SUCCESS The data was read from or written to the PCI controller.
@retval EFI_UNSUPPORTED BarIndex not valid for this PCI controller.
@retval EFI_UNSUPPORTED The address range specified by Offset, Width, and Count is not
valid for the PCI BAR specified by BarIndex.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
**/
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;
/**
Enable a PCI driver to access PCI controller registers in PCI configuration space.
@param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param Width Signifies the width of the memory operations.
@param Offset The offset within the PCI configuration space for the PCI controller.
@param Count The number of PCI configuration operations to perform.
@param Buffer For read operations, the destination buffer to store the results. For write
operations, the source buffer to write data from.
@retval EFI_SUCCESS The data was read from or written to the PCI controller.
@retval EFI_UNSUPPORTED The address range specified by Offset, Width, and Count is not
valid for the PCI configuration header of the PCI controller.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
@retval EFI_INVALID_PARAMETER Buffer is NULL or Width is invalid.
**/
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;
/**
Enables a PCI driver to copy one region of PCI memory space to another region of PCI
memory space.
@param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param Width Signifies the width of the memory operations.
@param DestBarIndex The BAR index in the standard PCI Configuration header to use as the
base address for the memory operation to perform.
@param DestOffset The destination offset within the BAR specified by DestBarIndex to
start the memory writes for the copy operation.
@param SrcBarIndex The BAR index in the standard PCI Configuration header to use as the
base address for the memory operation to perform.
@param SrcOffset The source offset within the BAR specified by SrcBarIndex to start
the memory reads for the copy operation.
@param Count The number of memory operations to perform. Bytes moved is Width
size * Count, starting at DestOffset and SrcOffset.
@retval EFI_SUCCESS The data was copied from one memory region to another memory region.
@retval EFI_UNSUPPORTED DestBarIndex not valid for this PCI controller.
@retval EFI_UNSUPPORTED SrcBarIndex not valid for this PCI controller.
@retval EFI_UNSUPPORTED The address range specified by DestOffset, Width, and Count
is not valid for the PCI BAR specified by DestBarIndex.
@retval EFI_UNSUPPORTED The address range specified by SrcOffset, Width, and Count is
not valid for the PCI BAR specified by SrcBarIndex.
@retval EFI_INVALID_PARAMETER Width is invalid.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
**/
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
);
/**
Provides the PCI controller<65>Cspecific addresses needed to access system memory.
@param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param Operation Indicates if the bus master is going to read or write to system memory.
@param HostAddress The system memory address to map to the PCI controller.
@param NumberOfBytes On input the number of bytes to map. On output the number of bytes
that were mapped.
@param DeviceAddress The resulting map address for the bus master PCI controller to use to
access the hosts HostAddress.
@param Mapping A resulting value to pass to Unmap().
@retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes.
@retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
@retval EFI_DEVICE_ERROR The system hardware could not map the requested address.
**/
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
);
/**
Completes the Map() operation and releases any corresponding resources.
@param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param Mapping The mapping value returned from Map().
@retval EFI_SUCCESS The range was unmapped.
@retval EFI_DEVICE_ERROR The data was not committed to the target system memory.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_IO_PROTOCOL_UNMAP) (
IN EFI_PCI_IO_PROTOCOL *This,
IN VOID *Mapping
);
/**
Allocates pages that are suitable for an EfiPciIoOperationBusMasterCommonBuffer
mapping.
@param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param Type This parameter is not used and must be ignored.
@param MemoryType The type of memory to allocate, EfiBootServicesData or
EfiRuntimeServicesData.
@param Pages The number of pages to allocate.
@param HostAddress A pointer to store the base system memory address of the
allocated range.
@param Attributes The requested bit mask of attributes for the allocated range.
@retval EFI_SUCCESS The requested memory pages were allocated.
@retval EFI_UNSUPPORTED Attributes is unsupported. The only legal attribute bits are
MEMORY_WRITE_COMBINE and MEMORY_CACHED.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.
**/
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
);
/**
Frees memory that was allocated with AllocateBuffer().
@param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param Pages The number of pages to free.
@param HostAddress The base system memory address of the allocated range.
@retval EFI_SUCCESS The requested memory pages were freed.
@retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages
was not allocated with AllocateBuffer().
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_IO_PROTOCOL_FREE_BUFFER) (
IN EFI_PCI_IO_PROTOCOL *This,
IN UINTN Pages,
IN VOID *HostAddress
);
/**
Flushes all PCI posted write transactions from a PCI host bridge to system memory.
@param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@retval EFI_SUCCESS The PCI posted write transactions were flushed from the PCI host
bridge to system memory.
@retval EFI_DEVICE_ERROR The PCI posted write transactions were not flushed from the PCI
host bridge due to a hardware error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_IO_PROTOCOL_FLUSH) (
IN EFI_PCI_IO_PROTOCOL *This
);
/**
Retrieves this PCI controller<65><72>s current PCI bus number, device number, and function number.
@param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param SegmentNumber The PCI controller<65><72>s current PCI segment number.
@param BusNumber The PCI controller<65><72>s current PCI bus number.
@param DeviceNumber The PCI controller<65><72>s current PCI device number.
@param FunctionNumber The PCI controller<65><72>s current PCI function number.
@retval EFI_SUCCESS The PCI controller location was returned.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
**/
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
);
/**
Performs an operation on the attributes that this PCI controller supports. The operations include
getting the set of supported attributes, retrieving the current attributes, setting the current
attributes, enabling attributes, and disabling attributes.
@param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param Operation The operation to perform on the attributes for this PCI controller.
@param Attributes The mask of attributes that are used for Set, Enable, and Disable
operations.
@param Result A pointer to the result mask of attributes that are returned for the Get
and Supported operations.
@retval EFI_SUCCESS The operation on the PCI controller's attributes was completed.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_UNSUPPORTED one or more of the bits set in
Attributes are not supported by this PCI controller or one of
its parent bridges when Operation is Set, Enable or Disable.
**/
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
);
/**
Gets the attributes that this PCI controller supports setting on a BAR using
SetBarAttributes(), and retrieves the list of resource descriptors for a BAR.
@param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param BarIndex The BAR index of the standard PCI Configuration header to use as the
base address for resource range. The legal range for this field is 0..5.
@param Supports A pointer to the mask of attributes that this PCI controller supports
setting for this BAR with SetBarAttributes().
@param Resources A pointer to the ACPI 2.0 resource descriptors that describe the current
configuration of this BAR of the PCI controller.
@retval EFI_SUCCESS If Supports is not NULL, then the attributes that the PCI
controller supports are returned in Supports. If Resources
is not NULL, then the ACPI 2.0 resource descriptors that the PCI
controller is currently using are returned in Resources.
@retval EFI_INVALID_PARAMETER Both Supports and Attributes are NULL.
@retval EFI_UNSUPPORTED BarIndex not valid for this PCI controller.
@retval EFI_OUT_OF_RESOURCES There are not enough resources available to allocate
Resources.
**/
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
);
/**
Sets the attributes for a range of a BAR on a PCI controller.
@param This A pointer to the EFI_PCI_IO_PROTOCOL instance.
@param Attributes The mask of attributes to set for the resource range specified by
BarIndex, Offset, and Length.
@param BarIndex The BAR index of the standard PCI Configuration header to use as the
base address for resource range. The legal range for this field is 0..5.
@param Offset A pointer to the BAR relative base address of the resource range to be
modified by the attributes specified by Attributes.
@param Length A pointer to the length of the resource range to be modified by the
attributes specified by Attributes.
@retval EFI_SUCCESS The set of attributes specified by Attributes for the resource
range specified by BarIndex, Offset, and Length were
set on the PCI controller, and the actual resource range is returned
in Offset and Length.
@retval EFI_INVALID_PARAMETER Offset or Length is NULL.
@retval EFI_UNSUPPORTED BarIndex not valid for this PCI controller.
@retval EFI_OUT_OF_RESOURCES There are not enough resources to set the attributes on the
resource range specified by BarIndex, Offset, and
Length.
**/
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
//
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;
};
extern EFI_GUID gEfiPciIoProtocolGuid;
#endif

View File

@ -0,0 +1,207 @@
/** @file
This file declares PlatfromOpRom protocols.
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: PciPlatform.h
@par Revision Reference:
This protocol is defined in PCI Platform Support Specification
Version 0.9
**/
#ifndef _PCI_PLATFORM_H_
#define _PCI_PLATFORM_H_
//
// Protocol for GUID.
//
#define EFI_PCI_PLATFORM_PROTOCOL_GUID \
{ 0x7d75280, 0x27d4, 0x4d69, {0x90, 0xd0, 0x56, 0x43, 0xe2, 0x38, 0xb3, 0x41} }
typedef struct _EFI_PCI_PLATFORM_PROTOCOL EFI_PCI_PLATFORM_PROTOCOL;
typedef UINT32 EFI_PCI_PLATFORM_POLICY;
#define EFI_RESERVE_NONE_IO_ALIAS 0x0000
#define EFI_RESERVE_ISA_IO_ALIAS 0x0001
#define EFI_RESERVE_ISA_IO_NO_ALIAS 0x0002
#define EFI_RESERVE_VGA_IO_ALIAS 0x0004
#define EFI_RESERVE_VGA_IO_NO_ALIAS 0x0008
typedef enum {
ChipsetEntry,
ChipsetExit,
MaximumChipsetPhase
} EFI_PCI_CHIPSET_EXECUTION_PHASE;
/**
The PlatformNotify() function can be used to notify the platform driver so that
it can perform platform-specific actions. No specific actions are required.
Eight notification points are defined at this time. More synchronization points
may be added as required in the future. The PCI bus driver calls the platform driver
twice for every Phase-once before the PCI Host Bridge Resource Allocation Protocol
driver is notified, and once after the PCI Host Bridge Resource Allocation Protocol
driver has been notified.
This member function may not perform any error checking on the input parameters. It
also does not return any error codes. If this member function detects any error condition,
it needs to handle those errors on its own because there is no way to surface any
errors to the caller.
@param This Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.
@param HostBridge The handle of the host bridge controller.
@param Phase The phase of the PCI bus enumeration.
@param ChipsetPhase Defines the execution phase of the PCI chipset driver.
@retval EFI_SUCCESS The function completed successfully.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_PLATFORM_PHASE_NOTIFY) (
IN EFI_PCI_PLATFORM_PROTOCOL *This,
IN EFI_HANDLE HostBridge,
IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE Phase,
IN EFI_PCI_CHIPSET_EXECUTION_PHASE ChipsetPhase
)
;
/**
The PlatformPrepController() function can be used to notify the platform driver so that
it can perform platform-specific actions. No specific actions are required.
Several notification points are defined at this time. More synchronization points may be
added as required in the future. The PCI bus driver calls the platform driver twice for
every PCI controller-once before the PCI Host Bridge Resource Allocation Protocol driver
is notified, and once after the PCI Host Bridge Resource Allocation Protocol driver has
been notified.
This member function may not perform any error checking on the input parameters. It also
does not return any error codes. If this member function detects any error condition, it
needs to handle those errors on its own because there is no way to surface any errors to
the caller.
@param This Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.
@param HostBridge The associated PCI host bridge handle.
@param RootBridge The associated PCI root bridge handle.
@param PciAddress The address of the PCI device on the PCI bus.
@param Phase The phase of the PCI controller enumeration.
@param ChipsetPhase Defines the execution phase of the PCI chipset driver.
@retval EFI_SUCCESS The function completed successfully.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_PLATFORM_PREPROCESS_CONTROLLER) (
IN EFI_PCI_PLATFORM_PROTOCOL *This,
IN EFI_HANDLE HostBridge,
IN EFI_HANDLE RootBridge,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS PciAddress,
IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE Phase,
IN EFI_PCI_CHIPSET_EXECUTION_PHASE ChipsetPhase
)
;
/**
The GetPlatformPolicy() function retrieves the platform policy regarding PCI
enumeration. The PCI bus driver and the PCI Host Bridge Resource Allocation Protocol
driver can call this member function to retrieve the policy.
@param This Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.
@param PciPolicy The platform policy with respect to VGA and ISA aliasing.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_INVALID_PARAMETER PciPolicy is NULL.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_PLATFORM_GET_PLATFORM_POLICY) (
IN EFI_PCI_PLATFORM_PROTOCOL *This,
OUT EFI_PCI_PLATFORM_POLICY *PciPolicy
)
;
/**
The GetPciRom() function gets the PCI device's option ROM from a platform-specific location.
The option ROM will be loaded into memory. This member function is used to return an image
that is packaged as a PCI 2.2 option ROM. The image may contain both legacy and EFI option
ROMs. See the EFI 1.10 Specification for details. This member function can be used to return
option ROM images for embedded controllers. Option ROMs for embedded controllers are typically
stored in platform-specific storage, and this member function can retrieve it from that storage
and return it to the PCI bus driver. The PCI bus driver will call this member function before
scanning the ROM that is attached to any controller, which allows a platform to specify a ROM
image that is different from the ROM image on a PCI card.
@param This Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.
@param PciHandle The handle of the PCI device.
@param RomImage If the call succeeds, the pointer to the pointer to the option ROM image.
Otherwise, this field is undefined. The memory for RomImage is allocated
by EFI_PCI_PLATFORM_PROTOCOL.GetPciRom() using the EFI Boot Service AllocatePool().
It is the caller's responsibility to free the memory using the EFI Boot Service
FreePool(), when the caller is done with the option ROM.
@param RomSize If the call succeeds, a pointer to the size of the option ROM size. Otherwise,
this field is undefined.
@retval EFI_SUCCESS The option ROM was available for this device and loaded into memory.
@retval EFI_NOT_FOUND No option ROM was available for this device.
@retval EFI_OUT_OF_RESOURCES No memory was available to load the option ROM.
@retval EFI_DEVICE_ERROR An error occurred in getting the option ROM.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_PLATFORM_GET_PCI_ROM) (
IN EFI_PCI_PLATFORM_PROTOCOL *This,
IN EFI_HANDLE PciHandle,
OUT VOID **RomImage,
OUT UINTN *RomSize
)
;
/**
@par Protocol Description:
This protocol provides the interface between the PCI bus driver/PCI Host
Bridge Resource Allocation driver and a platform-specific driver to describe
the unique features of a platform.
@param PlatformNotify
The notification from the PCI bus enumerator to the platform that it is
about to enter a certain phase during the enumeration process.
@param PlatformPrepController
The notification from the PCI bus enumerator to the platform for each PCI
controller at several predefined points during PCI controller initialization.
@param GetPlatformPolicy
Retrieves the platform policy regarding enumeration.
@param GetPciRom
Gets the PCI device<63><65>s option ROM from a platform-specific location.
**/
struct _EFI_PCI_PLATFORM_PROTOCOL {
EFI_PCI_PLATFORM_PHASE_NOTIFY PhaseNotify;
EFI_PCI_PLATFORM_PREPROCESS_CONTROLLER PlatformPrepController;
EFI_PCI_PLATFORM_GET_PLATFORM_POLICY GetPlatformPolicy;
EFI_PCI_PLATFORM_GET_PCI_ROM GetPciRom;
};
extern EFI_GUID gEfiPciPlatformProtocolGuid;
#endif

View File

@ -0,0 +1,384 @@
/** @file
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
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: PciRootBridgeIo.h
**/
#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 } \
}
typedef struct _EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL 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
#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;
/**
Reads from the I/O space of a PCI Root Bridge. Returns when either the polling exit criteria is
satisfied or after a defined duration.
@param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
@param Width Signifies the width of the memory or I/O operations.
@param Address The base address of the memory or I/O operations.
@param Mask Mask used for the polling criteria.
@param Value The comparison value used for the polling exit criteria.
@param Delay The number of 100 ns units to poll.
@param Result Pointer to the last value read from the memory location.
@retval EFI_SUCCESS The last data returned from the access matched the poll exit criteria.
@retval EFI_TIMEOUT Delay expired before a match occurred.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
**/
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
);
/**
Enables a PCI driver to access PCI controller registers in the PCI root bridge memory space.
@param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
@param Width Signifies the width of the memory operations.
@param Address The base address of the memory operations.
@param Count The number of memory operations to perform.
@param Buffer For read operations, the destination buffer to store the results. For write
operations, the source buffer to write data from.
@retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
**/
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;
/**
Enables a PCI driver to copy one region of PCI root bridge memory space to another region of PCI
root bridge memory space.
@param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.
@param Width Signifies the width of the memory operations.
@param DestAddress The destination address of the memory operation.
@param SrcAddress The source address of the memory operation.
@param Count The number of memory operations to perform.
@retval EFI_SUCCESS The data was copied from one memory region to another memory region.
@retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
**/
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
);
/**
Provides the PCI controller<65>Cspecific addresses required to access system memory from a
DMA bus master.
@param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
@param Operation Indicates if the bus master is going to read or write to system memory.
@param HostAddress The system memory address to map to the PCI controller.
@param NumberOfBytes On input the number of bytes to map. On output the number of bytes
that were mapped.
@param DeviceAddress The resulting map address for the bus master PCI controller to use to
access the hosts HostAddress.
@param Mapping A resulting value to pass to Unmap().
@retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes.
@retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
@retval EFI_DEVICE_ERROR The system hardware could not map the requested address.
**/
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
);
/**
Completes the Map() operation and releases any corresponding resources.
@param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
@param Mapping The mapping value returned from Map().
@retval EFI_SUCCESS The range was unmapped.
@retval EFI_INVALID_PARAMETER Mapping is not a value that was returned by Map().
@retval EFI_DEVICE_ERROR The data was not committed to the target system memory.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_UNMAP) (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
IN VOID *Mapping
);
/**
Allocates pages that are suitable for an EfiPciOperationBusMasterCommonBuffer or
EfiPciOperationBusMasterCommonBuffer64 mapping.
@param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
@param Type This parameter is not used and must be ignored.
@param MemoryType The type of memory to allocate, EfiBootServicesData or
EfiRuntimeServicesData.
@param Pages The number of pages to allocate.
@param HostAddress A pointer to store the base system memory address of the
allocated range.
@param Attributes The requested bit mask of attributes for the allocated range.
@retval EFI_SUCCESS The requested memory pages were allocated.
@retval EFI_UNSUPPORTED Attributes is unsupported. The only legal attribute bits are
MEMORY_WRITE_COMBINE and MEMORY_CACHED.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.
**/
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
);
/**
Frees memory that was allocated with AllocateBuffer().
@param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
@param Pages The number of pages to free.
@param HostAddress The base system memory address of the allocated range.
@retval EFI_SUCCESS The requested memory pages were freed.
@retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages
was not allocated with AllocateBuffer().
**/
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
);
/**
Flushes all PCI posted write transactions from a PCI host bridge to system memory.
@param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
@retval EFI_SUCCESS The PCI posted write transactions were flushed from the PCI host
bridge to system memory.
@retval EFI_DEVICE_ERROR The PCI posted write transactions were not flushed from the PCI
host bridge due to a hardware error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FLUSH) (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This
);
/**
Gets the attributes that a PCI root bridge supports setting with SetAttributes(), and the
attributes that a PCI root bridge is currently using.
@param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
@param Supports A pointer to the mask of attributes that this PCI root bridge supports
setting with SetAttributes().
@param Attributes A pointer to the mask of attributes that this PCI root bridge is currently
using.
@retval EFI_SUCCESS If Supports is not NULL, then the attributes that the PCI root
bridge supports is returned in Supports. If Attributes is
not NULL, then the attributes that the PCI root bridge is currently
using is returned in Attributes.
@retval EFI_INVALID_PARAMETER Both Supports and Attributes are NULL.
**/
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
);
/**
Sets attributes for a resource range on a PCI root bridge.
@param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
@param Attributes The mask of attributes to set.
@param ResourceBase A pointer to the base address of the resource range to be modified by the
attributes specified by Attributes.
@param ResourceLength A pointer to the length of the resource range to be modified by the
attributes specified by Attributes.
@retval EFI_SUCCESS The set of attributes specified by Attributes for the resource
range specified by ResourceBase and ResourceLength
were set on the PCI root bridge, and the actual resource range is
returned in ResuourceBase and ResourceLength.
@retval EFI_UNSUPPORTED A bit is set in Attributes that is not supported by the PCI Root
Bridge.
@retval EFI_OUT_OF_RESOURCES There are not enough resources to set the attributes on the
resource range specified by BaseAddress and Length.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
**/
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
);
/**
Retrieves the current resource settings of this PCI root bridge in the form of a set of ACPI 2.0
resource descriptors.
@param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
@param Resources A pointer to the ACPI 2.0 resource descriptors that describe the current
configuration of this PCI root bridge.
@retval EFI_SUCCESS The current configuration of this PCI root bridge was returned in
Resources.
@retval EFI_UNSUPPORTED The current configuration of this PCI root bridge could not be
retrieved.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_CONFIGURATION) (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
IN VOID **Resources
);
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;
};
extern EFI_GUID gEfiPciRootBridgeIoProtocolGuid;
#endif

View File

@ -0,0 +1,135 @@
/** @file
Platform Driver Override protocol as defined in the EFI 1.1 specification.
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: PlatformDriverOverride.h
**/
#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 } \
}
typedef struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL;
//
// Prototypes for the Platform Driver Override Protocol
//
/**
Retrieves the image handle of the platform override driver for a controller in the system.
@param This A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_
PROTOCOL instance.
@param ControllerHandle The device handle of the controller to check if a driver override
exists.
@param DriverImageHandle On input, a pointer to the previous driver image handle returned
by GetDriver(). On output, a pointer to the next driver
image handle.
@retval EFI_SUCCESS The driver override for ControllerHandle was returned in
DriverImageHandle.
@retval EFI_NOT_FOUND A driver override for ControllerHandle was not found.
@retval EFI_INVALID_PARAMETER The handle specified by ControllerHandle is not a valid handle.
@retval EFI_INVALID_PARAMETER DriverImageHandle is not a handle that was returned on a
previous call to GetDriver().
**/
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
);
/**
Retrieves the device path of the platform override driver for a controller in the system.
@param This A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_
PROTOCOL instance.
@param ControllerHandle The device handle of the controller to check if a driver override
exists.
@param DriverImageHandle On input, a pointer to the previous driver image handle returned
by GetDriverPath(). On output, a pointer to the next driver
device path.
@retval EFI_SUCCESS The driver override for ControllerHandle was returned in
DriverImageHandle.
@retval EFI_UNSUPPORTED The operation is not supported.
@retval EFI_NOT_FOUND A driver override for ControllerHandle was not found.
@retval EFI_INVALID_PARAMETER The handle specified by ControllerHandle is not a valid handle.
@retval EFI_INVALID_PARAMETER DriverImagePath is not a device path that was returned on a
previous call to GetDriverPath().
**/
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
);
/**
Used to associate a driver image handle with a device path that was returned on a prior call to the
GetDriverPath() service. This driver image handle will then be available through the
GetDriver() service.
@param This A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_
PROTOCOL instance.
@param ControllerHandle The device handle of the controller.
@param DriverImagePath A pointer to the driver device path that was returned in a prior
call to GetDriverPath().
@param DriverImageHandle The driver image handle that was returned by LoadImage()
when the driver specified by DriverImagePath was loaded
into memory.
@retval EFI_SUCCESS The association between DriverImagePath and
DriverImageHandle was established for the controller specified
by ControllerHandle.
@retval EFI_UNSUPPORTED The operation is not supported.
@retval EFI_NOT_FOUND DriverImagePath is not a device path that was returned on a prior
call to GetDriverPath() for the controller specified by
ControllerHandle.
@retval EFI_INVALID_PARAMETER ControllerHandle is not a valid device handle.
@retval EFI_INVALID_PARAMETER DriverImagePath is not a valid device path.
@retval EFI_INVALID_PARAMETER DriverImageHandle is not a valid image handle.
**/
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
//
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;
};
extern EFI_GUID gEfiPlatformDriverOverrideProtocolGuid;
#endif

View File

@ -0,0 +1,622 @@
/** @file
EFI PXE Base Code Protocol definitions.
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: PxeBaseCode.h
**/
#ifndef __PXE_BASE_CODE_PROTOCOL_H__
#define __PXE_BASE_CODE_PROTOCOL_H__
//
// PXE Base Code protocol
//
#define EFI_PXE_BASE_CODE_PROTOCOL_GUID \
{ \
0x03c4e603, 0xac28, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}
typedef struct _EFI_PXE_BASE_CODE_PROTOCOL 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
//
/**
Enables the use of the PXE Base Code Protocol functions.
@param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
@param UseIpv6 Specifies the type of IP addresses that are to be used during the session
that is being started. Set to TRUE for IPv6 addresses, and FALSE for
IPv4 addresses.
@retval EFI_SUCCESS The PXE Base Code Protocol was started.
@retval EFI_DEVICE_ERROR The network device encountered an error during this oper
@retval EFI_UNSUPPORTED UseIpv6 is TRUE, but the Ipv6Supported field of the
EFI_PXE_BASE_CODE_MODE structure is FALSE.
@retval EFI_ALREADY_STARTED The PXE Base Code Protocol is already in the started state.
@retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid
EFI_PXE_BASE_CODE_PROTOCOL structure.
@retval EFI_OUT_OF_RESOURCES Could not allocate enough memory or other resources to start the
PXE Base Code Protocol.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PXE_BASE_CODE_START) (
IN EFI_PXE_BASE_CODE_PROTOCOL *This,
IN BOOLEAN UseIpv6
);
/**
Disables the use of the PXE Base Code Protocol functions.
@param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
@retval EFI_SUCCESS The PXE Base Code Protocol was stopped.
@retval EFI_NOT_STARTED The PXE Base Code Protocol is already in the stopped state.
@retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid
EFI_PXE_BASE_CODE_PROTOCOL structure.
@retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PXE_BASE_CODE_STOP) (
IN EFI_PXE_BASE_CODE_PROTOCOL *This
);
/**
Attempts to complete a DHCPv4 D.O.R.A. (discover / offer / request / acknowledge) or DHCPv6
S.A.R.R (solicit / advertise / request / reply) sequence.
@param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
@param SortOffers TRUE if the offers received should be sorted. Set to FALSE to try the
offers in the order that they are received.
@retval EFI_SUCCESS Valid DHCP has completed.
@retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.
@retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid
EFI_PXE_BASE_CODE_PROTOCOL structure.
@retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
@retval EFI_OUT_OF_RESOURCES Could not allocate enough memory to complete the DHCP Protocol.
@retval EFI_ABORTED The callback function aborted the DHCP Protocol.
@retval EFI_TIMEOUT The DHCP Protocol timed out.
@retval EFI_ICMP_ERROR An ICMP error packet was received during the DHCP session.
@retval EFI_NO_RESPONSE Valid PXE offer was not received.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PXE_BASE_CODE_DHCP) (
IN EFI_PXE_BASE_CODE_PROTOCOL *This,
IN BOOLEAN SortOffers
);
/**
Attempts to complete the PXE Boot Server and/or boot image discovery sequence.
@param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
@param Type The type of bootstrap to perform.
@param Layer Pointer to the boot server layer number to discover, which must be
PXE_BOOT_LAYER_INITIAL when a new server type is being
discovered.
@param UseBis TRUE if Boot Integrity Services are to be used. FALSE otherwise.
@param Info Pointer to a data structure that contains additional information on the
type of discovery operation that is to be performed.
@retval EFI_SUCCESS The Discovery sequence has been completed.
@retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
@retval EFI_OUT_OF_RESOURCES Could not allocate enough memory to complete Discovery.
@retval EFI_ABORTED The callback function aborted the Discovery sequence.
@retval EFI_TIMEOUT The Discovery sequence timed out.
@retval EFI_ICMP_ERROR An ICMP error packet was received during the PXE discovery
session.
**/
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 EFI_PXE_BASE_CODE_DISCOVER_INFO *Info OPTIONAL
);
/**
Used to perform TFTP and MTFTP services.
@param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
@param Operation The type of operation to perform.
@param BufferPtr A pointer to the data buffer.
@param Overwrite Only used on write file operations. TRUE if a file on a remote server can
be overwritten.
@param BufferSize For get-file-size operations, *BufferSize returns the size of the
requested file.
@param BlockSize The requested block size to be used during a TFTP transfer.
@param ServerIp The TFTP / MTFTP server IP address.
@param Filename A Null-terminated ASCII string that specifies a directory name or a file
name.
@param Info Pointer to the MTFTP information.
@param DontUseBuffer Set to FALSE for normal TFTP and MTFTP read file operation.
@retval EFI_SUCCESS The TFTP/MTFTP operation was completed.
@retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
@retval EFI_BUFFER_TOO_SMALL The buffer is not large enough to complete the read operation.
@retval EFI_ABORTED The callback function aborted the TFTP/MTFTP operation.
@retval EFI_TIMEOUT The TFTP/MTFTP operation timed out.
@retval EFI_ICMP_ERROR An ICMP error packet was received during the MTFTP session.
@retval EFI_TFTP_ERROR A TFTP error packet was received during the MTFTP session.
**/
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 OPTIONAL,
IN EFI_PXE_BASE_CODE_MTFTP_INFO *Info OPTIONAL,
IN BOOLEAN DontUseBuffer
);
/**
Writes a UDP packet to the network interface.
@param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
@param OpFlags The UDP operation flags.
@param DestIp The destination IP address.
@param DestPort The destination UDP port number.
@param GatewayIp The gateway IP address.
@param SrcIp The source IP address.
@param SrcPort The source UDP port number.
@param HeaderSize An optional field which may be set to the length of a header at
HeaderPtr to be prefixed to the data at BufferPtr.
@param HeaderPtr If HeaderSize is not NULL, a pointer to a header to be prefixed to the
data at BufferPtr.
@param BufferSize A pointer to the size of the data at BufferPtr.
@param BufferPtr A pointer to the data to be written.
@retval EFI_SUCCESS The UDP Write operation was completed.
@retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_BAD_BUFFER_SIZE The buffer is too long to be transmitted.
@retval EFI_ABORTED The callback function aborted the UDP Write operation.
@retval EFI_TIMEOUT The UDP Write operation timed out.
@retval EFI_ICMP_ERROR An ICMP error packet was received during the UDP write session.
**/
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
);
/**
Reads a UDP packet from the network interface.
@param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
@param OpFlags The UDP operation flags.
@param DestIp The destination IP address.
@param DestPort The destination UDP port number.
@param GatewayIp The gateway IP address.
@param SrcIp The source IP address.
@param SrcPort The source UDP port number.
@param HeaderSize An optional field which may be set to the length of a header at
HeaderPtr to be prefixed to the data at BufferPtr.
@param HeaderPtr If HeaderSize is not NULL, a pointer to a header to be prefixed to the
data at BufferPtr.
@param BufferSize A pointer to the size of the data at BufferPtr.
@param BufferPtr A pointer to the data to be read.
@retval EFI_SUCCESS The UDP Write operation was completed.
@retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
@retval EFI_BUFFER_TOO_SMALL The packet is larger than Buffer can hold.
@retval EFI_ABORTED The callback function aborted the UDP Read operation.
@retval EFI_TIMEOUT The UDP Read operation timed out.
**/
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
);
/**
Updates the IP receive filters of a network device and enables software filtering.
@param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
@param NewFilter Pointer to the new set of IP receive filters.
@retval EFI_SUCCESS The IP receive filter settings were updated.
@retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
**/
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
);
/**
Uses the ARP protocol to resolve a MAC address.
@param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
@param IpAddr Pointer to the IP address that is used to resolve a MAC address.
@param MacAddr If not NULL, a pointer to the MAC address that was resolved with the
ARP protocol.
@retval EFI_SUCCESS The IP or MAC address was resolved.
@retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_DEVICE_ERROR The network device encountered an error during this operation.
@retval EFI_ABORTED The callback function aborted the ARP Protocol.
@retval EFI_TIMEOUT The ARP Protocol encountered a timeout condition.
**/
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
);
/**
Updates the parameters that affect the operation of the PXE Base Code Protocol.
@param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
@param NewAutoArp If not NULL, a pointer to a value that specifies whether to replace the
current value of AutoARP.
@param NewSendGUID If not NULL, a pointer to a value that specifies whether to replace the
current value of SendGUID.
@param NewTTL If not NULL, a pointer to be used in place of the current value of TTL,
the <20><>time to live<76><65> field of the IP header.
@param NewToS If not NULL, a pointer to be used in place of the current value of ToS,
the <20><>type of service<63><65> field of the IP header.
@param NewMakeCallback If not NULL, a pointer to a value that specifies whether to replace the
current value of the MakeCallback field of the Mode structure.
@retval EFI_SUCCESS The new parameters values were updated.
@retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
**/
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
);
/**
Updates the station IP address and/or subnet mask values of a network device.
@param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
@param NewStationIp Pointer to the new IP address to be used by the network device.
@param NewSubnetMask Pointer to the new subnet mask to be used by the network device.
@retval EFI_SUCCESS The new station IP address and/or subnet mask were updated.
@retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
**/
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
);
/**
Updates the contents of the cached DHCP and Discover packets.
@param This Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.
@param NewDhcpDiscoverValid Pointer to a value that will replace the current
DhcpDiscoverValid field.
@param NewDhcpAckReceived Pointer to a value that will replace the current
DhcpAckReceived field.
@param NewProxyOfferReceived Pointer to a value that will replace the current
ProxyOfferReceived field.
@param NewPxeDiscoverValid Pointer to a value that will replace the current
ProxyOfferReceived field.
@param NewPxeReplyReceived Pointer to a value that will replace the current
PxeReplyReceived field.
@param NewPxeBisReplyReceived Pointer to a value that will replace the current
PxeBisReplyReceived field.
@param NewDhcpDiscover Pointer to the new cached DHCP Discover packet contents.
@param NewDhcpAck Pointer to the new cached DHCP Ack packet contents.
@param NewProxyOffer Pointer to the new cached Proxy Offer packet contents.
@param NewPxeDiscover Pointer to the new cached PXE Discover packet contents.
@param NewPxeReply Pointer to the new cached PXE Reply packet contents.
@param NewPxeBisReply Pointer to the new cached PXE BIS Reply packet contents.
@retval EFI_SUCCESS The cached packet contents were updated.
@retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state.
@retval EFI_INVALID_PARAMETER This is NULL or not point to a valid EFI_PXE_BASE_CODE_PROTOCOL structure.
**/
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
#define EFI_PXE_BASE_CODE_PROTOCOL_REVISION EFI_PXE_BASE_CODE_INTERFACE_REVISION
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;
};
extern EFI_GUID gEfiPxeBaseCodeProtocolGuid;
#endif

View File

@ -0,0 +1,94 @@
/** @file
EFI PXE Base Code CallBack Protocol
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: PxeBaseCodeCallBack.h
**/
#ifndef _PXE_BASE_CODE_CALLBACK_H_
#define _PXE_BASE_CODE_CALLBACK_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
#define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_REVISION \
EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION
//
// Protocol definition
//
typedef struct _EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL 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_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;
/**
Callback function that is invoked when the PXE Base Code Protocol is about to transmit, has
received, or is waiting to receive a packet.
@param This Pointer to the EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL instance.
@param Function The PXE Base Code Protocol function that is waiting for an event.
@param Received TRUE if the callback is being invoked due to a receive event. FALSE if
the callback is being invoked due to a transmit event.
@param PacketLen The length, in bytes, of Packet. This field will have a value of zero if
this is a wait for receive event.
@param Packet If Received is TRUE, a pointer to the packet that was just received;
otherwise a pointer to the packet that is about to be transmitted.
@retval EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE if Function specifies a continue operation
@retval EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT if Function specifies an abort operation
**/
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
);
struct _EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL {
UINT64 Revision;
EFI_PXE_CALLBACK Callback;
};
extern EFI_GUID gEfiPxeBaseCodeCallbackProtocolGuid;
#endif

View File

@ -0,0 +1,233 @@
/** @file
EFI_SCSI_IO_PROTOCOL as defined in UEFI 2.0.
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
**/
#ifndef __EFI_SCSI_IO_PROTOCOL_H__
#define __EFI_SCSI_IO_PROTOCOL_H__
#define EFI_SCSI_IO_PROTOCOL_GUID \
{ \
0x932f4736, 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;
/**
Retrieves the device type information of the SCSI Controller.
@param This Protocol instance pointer.
@param DeviceType A pointer to the device type information
retrieved from the SCSI Controller.
@retval EFI_SUCCESS Retrieves the device type information successfully.
@retval EFI_INVALID_PARAMETER The DeviceType is NULL.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SCSI_IO_PROTOCOL_GET_DEVICE_TYPE) (
IN EFI_SCSI_IO_PROTOCOL *This,
OUT UINT8 *DeviceType
)
;
/**
Retrieves the device location in the SCSI channel.
@param This Protocol instance pointer.
@param Target A pointer to the Target ID of a SCSI device
on the SCSI channel.
@param Lun A pointer to the LUN of the SCSI device on
the SCSI channel.
@retval EFI_SUCCESS Retrieves the device location successfully.
@retval EFI_INVALID_PARAMETER The Target or Lun 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
)
;
/**
Resets the SCSI Bus that the SCSI Controller is attached to.
@param This Protocol instance pointer.
@retval EFI_SUCCESS The SCSI bus is reset successfully.
@retval EFI_DEVICE_ERROR Errors encountered when resetting the SCSI bus.
@retval EFI_UNSUPPORTED The bus reset operation is not supported by the
SCSI Host Controller.
@retval EFI_TIMEOUT A timeout occurred while attempting to reset
the SCSI bus.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SCSI_IO_PROTOCOL_RESET_BUS) (
IN EFI_SCSI_IO_PROTOCOL *This
)
;
/**
Resets the SCSI Controller that the device handle specifies.
@param This Protocol instance pointer.
@retval EFI_SUCCESS Reset the SCSI controller successfully.
@retval EFI_DEVICE_ERROR Errors are encountered when resetting the
SCSI Controller.
@retval EFI_UNSUPPORTED The SCSI bus does not support a device
reset operation.
@retval EFI_TIMEOUT A timeout occurred while attempting to
reset the SCSI Controller.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SCSI_IO_PROTOCOL_RESET_DEVICE) (
IN EFI_SCSI_IO_PROTOCOL *This
)
;
/**
Sends a SCSI Request Packet to the SCSI Controller for execution.
@param This Protocol instance pointer.
@param Packet The SCSI request packet to send to the SCSI
Controller specified by the device handle.
@param Event If the SCSI bus where the SCSI device is attached
does not support non-blocking I/O, then Event is
ignored, and blocking I/O is performed.
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.
@retval EFI_SUCCESS The SCSI Request Packet was sent by the host
successfully, and TransferLength bytes were
transferred to/from DataBuffer.See
HostAdapterStatus, TargetStatus,
SenseDataLength, and SenseData in that order
for additional status information.
@retval EFI_WARN_BUFFER_TOO_SMALL 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.
@retval EFI_NOT_READY The SCSI Request Packet could not be sent because
there are too many SCSI Command Packets already
queued.The caller may retry again later.
@retval EFI_DEVICE_ERROR A device error occurred while attempting to send
the SCSI Request Packet. See HostAdapterStatus,
TargetStatus, SenseDataLength, and SenseData in
that order for additional status information.
@retval EFI_INVALID_PARAMETER The contents of CommandPacket are invalid.
The SCSI Request Packet was not sent, so no
additional status information is available.
@retval EFI_UNSUPPORTED The command described by the SCSI Request Packet
is not supported by the SCSI initiator(i.e., SCSI
Host Controller). The SCSI Request Packet was not
sent, so no additional status information is
available.
@retval 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_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
)
;
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,312 @@
/** @file
SCSI Pass Through protocol.
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: ScsiPassThru.h
**/
#ifndef __SCSI_PASS_THROUGH_H__
#define __SCSI_PASS_THROUGH_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
//
typedef struct _EFI_SCSI_PASS_THRU_PROTOCOL 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;
/**
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.
@param This Protocol instance pointer.
@param Target The Target ID of the SCSI device to
send the SCSI Request Packet.
@param Lun The LUN of the SCSI device to send the
SCSI Request Packet.
@param Packet A pointer to the SCSI Request Packet to send
to the SCSI device specified by Target and Lun.
@param 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
@retval EFI_SUCCESS The 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.
@retval EFI_WARN_BUFFER_TOO_SMALL 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.
@retval 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.
@retval EFI_DEVICE_ERROR A device error occurred while attempting to send
the SCSI Request Packet. See HostAdapterStatus,
TargetStatus, SenseDataLength, and SenseData in
that order for additional status information.
@retval EFI_INVALID_PARAMETER Target, Lun, or the contents of ScsiRequestPacket
are invalid. The SCSI Request Packet was not sent,
so no additional status information is available.
@retval EFI_UNSUPPORTED The command described by the SCSI Request Packet
is not supported by the host adapter. The SCSI
Request Packet was not sent, so no additional
status information is available.
@retval 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_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
)
;
/**
Used to retrieve the list of legal Target IDs for SCSI devices
on a SCSI channel.
@param This Protocol instance pointer.
@param 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.
@param 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.
@retval EFI_SUCCESS The Target ID of the next SCSI device on the SCSI
channel was returned in Target and Lun.
@retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.
@retval 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_GET_NEXT_DEVICE) (
IN EFI_SCSI_PASS_THRU_PROTOCOL *This,
IN OUT UINT32 *Target,
IN OUT UINT64 *Lun
)
;
/**
Used to allocate and build a device path node for a SCSI device
on a SCSI channel.
@param This Protocol instance pointer.
@param Target The Target ID of the SCSI device for which
a device path node is to be allocated and built.
@param Lun The LUN of the SCSI device for which a device
path node is to be allocated and built.
@param 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.
@retval EFI_SUCCESS The device path node that describes the SCSI device
specified by Target and Lun was allocated and
returned in DevicePath.
@retval EFI_NOT_FOUND The SCSI devices specified by Target and Lun does
not exist on the SCSI channel.
@retval EFI_INVALID_PARAMETER DevicePath is NULL.
@retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate
DevicePath.
**/
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
)
;
/**
Used to translate a device path node to a Target ID and LUN.
@param This Protocol instance pointer.
@param DevicePath A pointer to the device path node that
describes a SCSI device on the SCSI channel.
@param Target A pointer to the Target ID of a SCSI device
on the SCSI channel.
@param Lun A pointer to the LUN of a SCSI device on
the SCSI channel.
@retval EFI_SUCCESS DevicePath was successfully translated to a
Target ID and LUN, and they were returned
in Target and Lun.
@retval EFI_INVALID_PARAMETER DevicePath is NULL.
@retval EFI_INVALID_PARAMETER Target is NULL.
@retval EFI_INVALID_PARAMETER Lun is NULL.
@retval EFI_UNSUPPORTED This driver does not support the device path
node type in DevicePath.
@retval 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_GET_TARGET_LUN) (
IN EFI_SCSI_PASS_THRU_PROTOCOL *This,
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
OUT UINT32 *Target,
OUT UINT64 *Lun
)
;
/**
Resets a SCSI channel.This operation resets all the
SCSI devices connected to the SCSI channel.
@param This Protocol instance pointer.
@retval EFI_SUCCESS The SCSI channel was reset.
@retval EFI_UNSUPPORTED The SCSI channel does not support
a channel reset operation.
@retval EFI_DEVICE_ERROR A device error occurred while
attempting to reset the SCSI channel.
@retval EFI_TIMEOUT A timeout occurred while attempting
to reset the SCSI channel.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SCSI_PASS_THRU_RESET_CHANNEL) (
IN EFI_SCSI_PASS_THRU_PROTOCOL *This
)
;
/**
Resets a SCSI device that is connected to a SCSI channel.
@param This Protocol instance pointer.
@param Target The Target ID of the SCSI device to reset.
@param Lun The LUN of the SCSI device to reset.
@retval EFI_SUCCESS The SCSI device specified by Target and
Lun was reset.
@retval EFI_UNSUPPORTED The SCSI channel does not support a target
reset operation.
@retval EFI_INVALID_PARAMETER Target or Lun are invalid.
@retval EFI_DEVICE_ERROR A device error occurred while attempting
to reset the SCSI device specified by Target
and Lun.
@retval EFI_TIMEOUT A timeout occurred while attempting to reset
the SCSI device specified by Target and Lun.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SCSI_PASS_THRU_RESET_TARGET) (
IN EFI_SCSI_PASS_THRU_PROTOCOL *This,
IN UINT32 Target,
IN UINT64 Lun
)
;
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;
};
extern EFI_GUID gEfiScsiPassThruProtocolGuid;
#endif

View File

@ -0,0 +1,332 @@
/** @file
EFI_EXT_SCSI_PASS_THRU_PROTOCOL as defined in UEFI 2.0.
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
**/
#ifndef __EXT_SCSI_PASS_THROUGH_PROTOCOL_H__
#define __EXT_SCSI_PASS_THROUGH_PROTOCOL_H__
#define EFI_EXT_SCSI_PASS_THRU_PROTOCOL_GUID \
{ \
0x1d3de7f0, 0x0807, 0x424f, {0xaa, 0x69, 0x11, 0xa5, 0x4e, 0x19, 0xa4, 0x6f } \
}
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;
/**
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.
@param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
@param 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.
@param Lun The LUN of the SCSI device to send the SCSI Request Packet.
@param Packet A pointer to the SCSI Request Packet to send to the SCSI device
specified by Target and Lun.
@param 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.
@retval 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.
@retval 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.
@retval 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.
@retval EFI_DEVICE_ERROR A device error occurred while attempting to send the SCSI Request
Packet.
@retval EFI_INVALID_PARAMETER Target, Lun, or the contents of ScsiRequestPacket are invalid.
@retval 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.
@retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
**/
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
)
;
/**
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.
@param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
@param 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.
@param 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.
@retval EFI_SUCCESS The Target ID and LUN of the next SCSI device on the SCSI
channel was returned in Target and Lun.
@retval EFI_INVALID_PARAMETER Target array is not all 0xF, and Target and Lun were
not returned on a previous call to GetNextTargetLun().
@retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.
**/
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
)
;
/**
Used to allocate and build a device path node for a SCSI device on a SCSI channel.
@param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
@param 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.
@param Lun The LUN of the SCSI device for which a device path node is to be
allocated and built.
@param 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.
@retval EFI_SUCCESS The device path node that describes the SCSI device specified by
Target and Lun was allocated and returned in
DevicePath.
@retval EFI_INVALID_PARAMETER DevicePath is NULL.
@retval EFI_NOT_FOUND The SCSI devices specified by Target and Lun does not exist
on the SCSI channel.
@retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath.
**/
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
)
;
/**
Used to translate a device path node to a Target ID and LUN.
@param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
@param DevicePath A pointer to a single device path node that describes the SCSI device
on the SCSI channel.
@param Target A pointer to the Target Array which represents the ID of a SCSI device
on the SCSI channel.
@param Lun A pointer to the LUN of a SCSI device on the SCSI channel.
@retval EFI_SUCCESS DevicePath was successfully translated to a Target ID and
LUN, and they were returned in Target and Lun.
@retval EFI_INVALID_PARAMETER DevicePath or Target or Lun is NULL.
@retval EFI_NOT_FOUND A valid translation from DevicePath to a Target ID and LUN
does not exist.
@retval EFI_UNSUPPORTED This driver does not support the device path node type in
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
)
;
/**
Resets a SCSI channel. This operation resets all the SCSI devices connected to the SCSI channel.
@param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
@retval EFI_SUCCESS The SCSI channel was reset.
@retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the SCSI channel.
@retval EFI_TIMEOUT A timeout occurred while attempting to reset the SCSI channel.
@retval EFI_UNSUPPORTED The SCSI channel does not support a channel reset operation.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_EXT_SCSI_PASS_THRU_RESET_CHANNEL) (
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This
)
;
/**
Resets a SCSI logical unit that is connected to a SCSI channel.
@param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
@param 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.
@param Lun The LUN of the SCSI device to reset.
@retval EFI_SUCCESS The SCSI device specified by Target and Lun was reset.
@retval EFI_INVALID_PARAMETER Target or Lun is NULL.
@retval EFI_TIMEOUT A timeout occurred while attempting to reset the SCSI device
specified by Target and Lun.
@retval EFI_UNSUPPORTED The SCSI channel does not support a target reset operation.
@retval 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_RESET_TARGET_LUN) (
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
IN UINT8 *Target,
IN UINT64 Lun
)
;
/**
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.
@param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
@param 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.
@retval EFI_SUCCESS The Target ID of the next SCSI device on the SCSI
channel was returned in Target.
@retval EFI_INVALID_PARAMETER Target or Lun is NULL.
@retval EFI_TIMEOUT Target array is not all 0xF, and Target were not
returned on a previous call to GetNextTarget().
@retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET) (
IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
IN OUT UINT8 **Target
)
;
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,162 @@
/** @file
This file declares Section Extraction protocols.
This interface provides a means of decoding a set of sections into a linked list of
leaf sections. This provides for an extensible and flexible file format.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the 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: SectionExtraction.h
@par Revision Reference:
This protocol is defined in Firmware Volume Specification.
Version 0.9
**/
#ifndef __SECTION_EXTRACTION_PROTOCOL_H__
#define __SECTION_EXTRACTION_PROTOCOL_H__
//
// Protocol GUID definition
//
#define EFI_SECTION_EXTRACTION_PROTOCOL_GUID \
{ \
0x448F5DA4, 0x6DD7, 0x4FE1, {0x93, 0x07, 0x69, 0x22, 0x41, 0x92, 0x21, 0x5D } \
}
typedef struct _EFI_SECTION_EXTRACTION_PROTOCOL EFI_SECTION_EXTRACTION_PROTOCOL;
//
// Protocol member functions
//
/**
Creates and returns a new section stream handle to represent the new section stream.
@param This Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance.
@param SectionStreamLength Size in bytes of the section stream.
@param SectionStream Buffer containing the new section stream.
@param SectionStreamHandle A pointer to a caller-allocated UINTN that,
on output, contains the new section stream handle.
@retval EFI_SUCCESS The SectionStream was successfully processed and
the section stream handle was returned.
@retval EFI_OUT_OF_RESOURCES The system has insufficient resources to
process the request.
@retval EFI_INVALID_PARAMETER The section stream may be corrupt or the value
of SectionStreamLength may be incorrect.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_OPEN_SECTION_STREAM) (
IN EFI_SECTION_EXTRACTION_PROTOCOL *This,
IN UINTN SectionStreamLength,
IN VOID *SectionStream,
OUT UINTN *SectionStreamHandle
);
/**
Reads and returns a single section from a section stream.
@param This Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance.
@param SectionStreamHandle Indicates from which section stream to read.
@param SectionType Pointer to an EFI_SECTION_TYPE.
@param SectionDefinitionGuid Pointer to an EFI_GUID.If SectionType ==
EFI_SECTION_GUID_DEFINED, SectionDefinitionGuid indicates what section GUID
to search for.If SectionType !=EFI_SECTION_GUID_DEFINED, then
SectionDefinitionGuid is unused and is ignored.
@param SectionInstance Indicates which instance of the requested section
type to return when SectionType is not NULL.
@param SectionStreamHandle A pointer to a caller-allocated UINTN that, on output,
contains the new section stream handle.
@param Buffer Pointer to a pointer to a buffer in which the section
contents are returned.
@param BufferSize Pointer to a caller-allocated UINTN.
@param AuthenticationStatus Pointer to a caller-allocated UINT32 in
which any meta-data from encapsulation GUID-defined sections is returned.
@retval EFI_SUCCESS The SectionStream was successfully processed and
the section contents were returned in Buffer.
@retval EFI_PROTOCOL_ERROR A GUID-defined section was encountered in
the section stream with its EFI_GUIDED_SECTION_PROCESSING_REQUIRED bit set,
but there was no corresponding GUIDed Section Extraction Protocol in
the handle database.
@retval EFI_NOT_FOUND An error was encountered when parsing the SectionStream,
which indicates that the SectionStream is not correctly formatted.
Or The requested section does not exist.
@retval EFI_OUT_OF_RESOURCES The system has insufficient resources to process
the request.
@retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist.
@retval EFI_BUFFER_TOO_SMALL The size of the input buffer is insufficient to
contain the requested section.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_GET_SECTION) (
IN EFI_SECTION_EXTRACTION_PROTOCOL *This,
IN UINTN SectionStreamHandle,
IN EFI_SECTION_TYPE *SectionType,
IN EFI_GUID *SectionDefinitionGuid,
IN UINTN SectionInstance,
IN VOID **Buffer,
IN OUT UINTN *BufferSize,
OUT UINT32 *AuthenticationStatus
);
/**
Deletes a section stream handle and returns all associated resources to the system.
@param This Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance.
@param SectionStreamHandle Indicates the section stream to close.
@retval EFI_SUCCESS The SectionStream was successfully processed and
the section stream handle was returned.
@retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_CLOSE_SECTION_STREAM) (
IN EFI_SECTION_EXTRACTION_PROTOCOL *This,
IN UINTN SectionStreamHandle
);
//
// Protocol definition
//
/**
@par Protocol Description:
The Section Extraction Protocol provides a simple method of extracting
sections from arbitrarily complex files.
@param OpenSectionStream
Takes a bounded stream of sections and returns a section stream handle.
@param GetSection
Given a section stream handle, retrieves the requested section and
meta-data from the section stream.
@param CloseSectionStream
Given a section stream handle, closes the section stream.
**/
struct _EFI_SECTION_EXTRACTION_PROTOCOL {
EFI_OPEN_SECTION_STREAM OpenSectionStream;
EFI_GET_SECTION GetSection;
EFI_CLOSE_SECTION_STREAM CloseSectionStream;
};
extern EFI_GUID gEfiSectionExtractionProtocolGuid;
#endif

View File

@ -0,0 +1,266 @@
/** @file
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.
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: SerialIo.h
**/
#ifndef __SERIAL_IO_PROTOCOL_H__
#define __SERIAL_IO_PROTOCOL_H__
#define EFI_SERIAL_IO_PROTOCOL_GUID \
{ \
0xBB25CF6F, 0xF1D4, 0x11D2, {0x9A, 0x0C, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0xFD } \
}
typedef struct _EFI_SERIAL_IO_PROTOCOL 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
//
/**
Reset the serial device.
@param This Protocol instance pointer.
@retval EFI_SUCCESS The device was reset.
@retval EFI_DEVICE_ERROR The serial device could not be reset.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SERIAL_RESET) (
IN EFI_SERIAL_IO_PROTOCOL *This
)
;
/**
Sets the baud rate, receive FIFO depth, transmit/receice time out, parity,
data buts, and stop bits on a serial device.
@param This Protocol instance pointer.
@param BaudRate The requested baud rate. A BaudRate value of 0 will use the the
device's default interface speed.
@param 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.
@param 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.
@param Parity The type of parity to use on this serial device. A Parity value of
DefaultParity will use the device's default parity value.
@param 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.
@param 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.
@retval EFI_SUCCESS The device was reset.
@retval 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
)
;
/**
Set the control bits on a serial device
@param This Protocol instance pointer.
@param Control Set the bits of Control that are settable.
@retval EFI_SUCCESS The new control bits were set on the serial device.
@retval EFI_UNSUPPORTED The serial device does not support this operation.
@retval EFI_DEVICE_ERROR The serial device is not functioning correctly.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SERIAL_SET_CONTROL_BITS) (
IN EFI_SERIAL_IO_PROTOCOL *This,
IN UINT32 Control
)
;
/**
Retrieves the status of thecontrol bits on a serial device
@param This Protocol instance pointer.
@param Control A pointer to return the current Control signals from the serial device.
@retval EFI_SUCCESS The control bits were read from the serial device.
@retval 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
)
;
/**
Writes data to a serial device.
@param This Protocol instance pointer.
@param BufferSize On input, the size of the Buffer. On output, the amount of
data actually written.
@param Buffer The buffer of data to write
@retval EFI_SUCCESS The data was written.
@retval EFI_DEVICE_ERROR The device reported an error.
@retval EFI_TIMEOUT The data write was stopped due to a timeout.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SERIAL_WRITE) (
IN EFI_SERIAL_IO_PROTOCOL *This,
IN OUT UINTN *BufferSize,
IN VOID *Buffer
)
;
/**
Writes data to a serial device.
@param This Protocol instance pointer.
@param BufferSize On input, the size of the Buffer. On output, the amount of
data returned in Buffer.
@param Buffer The buffer to return the data into.
@retval EFI_SUCCESS The data was read.
@retval EFI_DEVICE_ERROR The device reported an error.
@retval 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
)
;
/**
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
#define EFI_SERIAL_IO_PROTOCOL_REVISION SERIAL_IO_INTERFACE_REVISION
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;
};
extern EFI_GUID gEfiSerialIoProtocolGuid;
#endif

View File

@ -0,0 +1,74 @@
/** @file
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: ServiceBinding.h
**/
#ifndef __EFI_SERVICE_BINDING_H__
#define __EFI_SERVICE_BINDING_H__
//
// Forward reference for pure ANSI compatability
//
typedef struct _EFI_SERVICE_BINDING_PROTOCOL EFI_SERVICE_BINDING_PROTOCOL;
/**
Creates a child handle with a set of I/O services.
@param This Protocol instance pointer.
@param 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.
@retval EFI_SUCCES The child handle was created with the I/O services
@retval EFI_INVALID_PARAMETER ChildHandle is NULL.
@retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to create
the child
@retval other The child handle was not created
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SERVICE_BINDING_CREATE_CHILD) (
IN EFI_SERVICE_BINDING_PROTOCOL *This,
IN OUT EFI_HANDLE *ChildHandle
)
;
/**
Destroys a child handle with a set of I/O services.
@param This Protocol instance pointer.
@param ChildHandle Handle of the child to destroy
@retval EFI_SUCCES The I/O services were removed from the child handle
@retval EFI_UNSUPPORTED The child handle does not support the I/O services
that are being removed.
@retval EFI_INVALID_PARAMETER Child handle is not a valid EFI Handle.
@retval EFI_ACCESS_DENIED The child handle could not be destroyed because its
I/O services are being used.
@retval other The child handle was not destroyed
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SERVICE_BINDING_DESTROY_CHILD) (
IN EFI_SERVICE_BINDING_PROTOCOL *This,
IN EFI_HANDLE ChildHandle
)
;
struct _EFI_SERVICE_BINDING_PROTOCOL {
EFI_SERVICE_BINDING_CREATE_CHILD CreateChild;
EFI_SERVICE_BINDING_DESTROY_CHILD DestroyChild;
};
#endif

View File

@ -0,0 +1,328 @@
/** @file
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
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: SimpleFileSystem.h
**/
#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 } \
}
typedef struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL EFI_SIMPLE_FILE_SYSTEM_PROTOCOL;
typedef struct _EFI_FILE EFI_FILE;
typedef struct _EFI_FILE *EFI_FILE_HANDLE;
typedef struct _EFI_FILE EFI_FILE_PROTOCOL;
/**
Open the root directory on a volume.
@param This Protocol instance pointer.
@param Root Returns an Open file handle for the root directory
@retval EFI_SUCCESS The device was opened.
@retval EFI_UNSUPPORTED This volume does not suppor the file system.
@retval EFI_NO_MEDIA The device has no media.
@retval EFI_DEVICE_ERROR The device reported an error.
@retval EFI_VOLUME_CORRUPTED The file system structures are corrupted
@retval EFI_ACCESS_DENIED The service denied access to the file
@retval EFI_OUT_OF_RESOURCES The volume was not opened due to lack of resources
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME) (
IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This,
OUT EFI_FILE **Root
)
;
#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION 0x00010000
struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL {
UINT64 Revision;
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME OpenVolume;
};
/**
Open the root directory on a volume.
@param This Protocol instance pointer.
@param NewHandle Returns File Handle for FileName
@param FileName Null terminated string. "\", ".", and ".." are supported
@param OpenMode Open mode for file.
@param Attributes Only used for EFI_FILE_MODE_CREATE
@retval EFI_SUCCESS The device was opened.
@retval EFI_NOT_FOUND The specified file could not be found on the device
@retval EFI_NO_MEDIA The device has no media.
@retval EFI_MEDIA_CHANGED The media has changed
@retval EFI_DEVICE_ERROR The device reported an error.
@retval EFI_VOLUME_CORRUPTED The file system structures are corrupted
@retval EFI_ACCESS_DENIED The service denied access to the file
@retval EFI_OUT_OF_RESOURCES The volume was not opened due to lack of resources
@retval EFI_VOLUME_FULL The volume is full.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_OPEN) (
IN EFI_FILE *This,
OUT EFI_FILE **NewHandle,
IN CHAR16 *FileName,
IN UINT64 OpenMode,
IN UINT64 Attributes
)
;
//
// Open modes
//
#define EFI_FILE_MODE_READ 0x0000000000000001ULL
#define EFI_FILE_MODE_WRITE 0x0000000000000002ULL
#define EFI_FILE_MODE_CREATE 0x8000000000000000ULL
//
// File attributes
//
#define EFI_FILE_READ_ONLY 0x0000000000000001ULL
#define EFI_FILE_HIDDEN 0x0000000000000002ULL
#define EFI_FILE_SYSTEM 0x0000000000000004ULL
#define EFI_FILE_RESERVED 0x0000000000000008ULL
#define EFI_FILE_DIRECTORY 0x0000000000000010ULL
#define EFI_FILE_ARCHIVE 0x0000000000000020ULL
#define EFI_FILE_VALID_ATTR 0x0000000000000037ULL
/**
Close the file handle
@param This Protocol instance pointer.
@retval EFI_SUCCESS The device was opened.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_CLOSE) (
IN EFI_FILE *This
)
;
/**
Close and delete the file handle
@param This Protocol instance pointer.
@retval EFI_SUCCESS The device was opened.
@retval EFI_WARN_DELETE_FAILURE The handle was closed but the file was not deleted
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_DELETE) (
IN EFI_FILE *This
)
;
/**
Read data from the file.
@param This Protocol instance pointer.
@param BufferSize On input size of buffer, on output amount of data in buffer.
@param Buffer The buffer in which data is read.
@retval EFI_SUCCESS Data was read.
@retval EFI_NO_MEDIA The device has no media
@retval EFI_DEVICE_ERROR The device reported an error
@retval EFI_VOLUME_CORRUPTED The file system structures are corrupted
@retval EFI_BUFFER_TO_SMALL BufferSize is too small. BufferSize contains required size
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_READ) (
IN EFI_FILE *This,
IN OUT UINTN *BufferSize,
OUT VOID *Buffer
)
;
/**
Write data from to the file.
@param This Protocol instance pointer.
@param BufferSize On input size of buffer, on output amount of data in buffer.
@param Buffer The buffer in which data to write.
@retval EFI_SUCCESS Data was written.
@retval EFI_UNSUPPORT Writes to Open directory are not supported
@retval EFI_NO_MEDIA The device has no media
@retval EFI_DEVICE_ERROR The device reported an error
@retval EFI_VOLUME_CORRUPTED The file system structures are corrupted
@retval EFI_WRITE_PROTECTED The device is write protected
@retval EFI_ACCESS_DENIED The file was open for read only
@retval EFI_VOLUME_FULL The volume is full
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_WRITE) (
IN EFI_FILE *This,
IN OUT UINTN *BufferSize,
IN VOID *Buffer
)
;
/**
Set a files current position
@param This Protocol instance pointer.
@param Position Byte possition from the start of the file
@retval EFI_SUCCESS Data was written.
@retval EFI_UNSUPPORTED Seek request for non-zero is not valid on open.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_SET_POSITION) (
IN EFI_FILE *This,
IN UINT64 Position
)
;
/**
Get a files current position
@param This Protocol instance pointer.
@param Position Byte possition from the start of the file
@retval EFI_SUCCESS Data was written.
@retval EFI_UNSUPPORTED Seek request for non-zero is not valid on open.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_GET_POSITION) (
IN EFI_FILE *This,
OUT UINT64 *Position
)
;
/**
Get information about a file
@param This Protocol instance pointer.
@param InformationType Type of info to return in Buffer
@param BufferSize On input size of buffer, on output amount of data in buffer.
@param Buffer The buffer to return data.
@retval EFI_SUCCESS Data was returned.
@retval EFI_UNSUPPORT InformationType is not supported
@retval EFI_NO_MEDIA The device has no media
@retval EFI_DEVICE_ERROR The device reported an error
@retval EFI_VOLUME_CORRUPTED The file system structures are corrupted
@retval EFI_WRITE_PROTECTED The device is write protected
@retval EFI_ACCESS_DENIED The file was open for read only
@retval EFI_BUFFER_TOO_SMALL Buffer was too small, required size returned in BufferSize
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_GET_INFO) (
IN EFI_FILE *This,
IN EFI_GUID *InformationType,
IN OUT UINTN *BufferSize,
OUT VOID *Buffer
)
;
/**
Set information about a file
@param File Protocol instance pointer.
@param InformationType Type of info in Buffer
@param BufferSize Size of buffer.
@param Buffer The data to write.
@retval EFI_SUCCESS Data was returned.
@retval EFI_UNSUPPORT InformationType is not supported
@retval EFI_NO_MEDIA The device has no media
@retval EFI_DEVICE_ERROR The device reported an error
@retval EFI_VOLUME_CORRUPTED The file system structures are corrupted
@retval EFI_WRITE_PROTECTED The device is write protected
@retval EFI_ACCESS_DENIED The file was open for read only
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_SET_INFO) (
IN EFI_FILE *This,
IN EFI_GUID *InformationType,
IN UINTN BufferSize,
IN VOID *Buffer
)
;
/**
Flush data back for the file handle
@param This Protocol instance pointer.
@retval EFI_SUCCESS Data was written.
@retval EFI_UNSUPPORT Writes to Open directory are not supported
@retval EFI_NO_MEDIA The device has no media
@retval EFI_DEVICE_ERROR The device reported an error
@retval EFI_VOLUME_CORRUPTED The file system structures are corrupted
@retval EFI_WRITE_PROTECTED The device is write protected
@retval EFI_ACCESS_DENIED The file was open for read only
@retval EFI_VOLUME_FULL The volume is full
**/
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_FLUSH) (
IN EFI_FILE *This
)
;
#define EFI_FILE_HANDLE_REVISION 0x00010000
#define EFI_FILE_PROTOCOL_REVISION EFI_FILE_HANDLE_REVISION
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;
};
extern EFI_GUID gEfiSimpleFileSystemProtocolGuid;
#endif

View File

@ -0,0 +1,580 @@
/** @file
Simple Network protocol as defined in the EFI 1.0 specification.
Basic network device abstraction.
Rx - Received
Tx - Transmit
MCast - MultiCast
...
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: SimpleNetwork.h
**/
#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 } \
}
typedef struct _EFI_SIMPLE_NETWORK_PROTOCOL 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
//
/**
Changes the state of a network interface from "stopped" to "started".
@param This Protocol instance pointer.
@retval EFI_SUCCESS The network interface was started.
@retval EFI_ALREADY_STARTED The network interface is already in the started state.
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
@retval EFI_UNSUPPORTED This function is not supported by the network interface.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_START) (
IN EFI_SIMPLE_NETWORK_PROTOCOL *This
)
;
/**
Changes the state of a network interface from "started" to "stopped".
@param This Protocol instance pointer.
@retval EFI_SUCCESS The network interface was stopped.
@retval EFI_ALREADY_STARTED The network interface is already in the stopped state.
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
@retval 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
)
;
/**
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.
@param This Protocol instance pointer.
@param 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.
@param 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.
@retval EFI_SUCCESS The network interface was initialized.
@retval EFI_NOT_STARTED The network interface has not been started
@retval EFI_OUT_OF_RESOURCES There was not enough memory for the transmit and
receive buffers. .
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
@retval 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
)
;
/**
Resets a network adapter and re-initializes it with the parameters that were
provided in the previous call to Initialize().
@param This Protocol instance pointer.
@param ExtendedVerification Indicates that the driver may perform a more
exhaustive verification operation of the device
during reset.
@retval EFI_SUCCESS The network interface was reset.
@retval EFI_NOT_STARTED The network interface has not been started
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
@retval 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
)
;
/**
Resets a network adapter and leaves it in a state that is safe for
another driver to initialize.
@param This Protocol instance pointer.
@retval EFI_SUCCESS The network interface was shutdown.
@retval EFI_NOT_STARTED The network interface has not been started
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
@retval 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
)
;
/**
Manages the multicast receive filters of a network interface.
@param This Protocol instance pointer.
@param Enable A bit mask of receive filters to enable on the network interface.
@param Disable A bit mask of receive filters to disable on the network interface.
@param ResetMCastFilter Set to TRUE to reset the contents of the multicast receive
filters on the network interface to their default values.
@param 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.
@param 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.
@retval EFI_SUCCESS The multicast receive filter list was updated.
@retval EFI_NOT_STARTED The network interface has not been started
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
@retval 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
)
;
/**
Modifies or resets the current station address, if supported.
@param This Protocol instance pointer.
@param Reset Flag used to reset the station address to the network interfaces
permanent address.
@param New New station address to be used for the network interface.
@retval EFI_SUCCESS The network interfaces station address was updated.
@retval EFI_NOT_STARTED The network interface has not been started
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
@retval 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
)
;
/**
Resets or collects the statistics on a network interface.
@param This Protocol instance pointer.
@param Reset Set to TRUE to reset the statistics for the network interface.
@param StatisticsSize On input the size, in bytes, of StatisticsTable. On
output the size, in bytes, of the resulting table of
statistics.
@param StatisticsTable A pointer to the EFI_NETWORK_STATISTICS structure that
contains the statistics.
@retval EFI_SUCCESS The statistics were collected from the network interface.
@retval EFI_NOT_STARTED The network interface has not been started.
@retval EFI_BUFFER_TOO_SMALL The Statistics buffer was too small. The current buffer
size needed to hold the statistics is returned in
StatisticsSize.
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
@retval 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
)
;
/**
Converts a multicast IP address to a multicast HW MAC address.
@param This Protocol instance pointer.
@param 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].
@param IP The multicast IP address that is to be converted to a multicast
HW MAC address.
@param MAC The multicast HW MAC address that is to be generated from IP.
@retval EFI_SUCCESS The multicast IP address was mapped to the multicast
HW MAC address.
@retval EFI_NOT_STARTED The network interface has not been started.
@retval EFI_BUFFER_TOO_SMALL The Statistics buffer was too small. The current buffer
size needed to hold the statistics is returned in
StatisticsSize.
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
@retval 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
)
;
/**
Performs read and write operations on the NVRAM device attached to a
network interface.
@param This Protocol instance pointer.
@param ReadWrite TRUE for read operations, FALSE for write operations.
@param 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.
@param BufferSize The number of bytes to read or write from the NVRAM device.
This must also be a multiple of NvramAccessSize.
@param Buffer A pointer to the data buffer.
@retval EFI_SUCCESS The NVRAM access was performed.
@retval EFI_NOT_STARTED The network interface has not been started.
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
@retval 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
)
;
/**
Reads the current interrupt status and recycled transmit buffer status from
a network interface.
@param This Protocol instance pointer.
@param 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.
@param 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.
@retval EFI_SUCCESS The status of the network interface was retrieved.
@retval EFI_NOT_STARTED The network interface has not been started.
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
@retval 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
)
;
/**
Places a packet in the transmit queue of a network interface.
@param This Protocol instance pointer.
@param 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.
@param BufferSize The size, in bytes, of the entire packet (media header and
data) to be transmitted through the network interface.
@param 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.
@param 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.
@param DsetAddr The destination HW MAC address. If HeaderSize is zero, then this
parameter is ignored.
@param Protocol The type of header to build. If HeaderSize is zero, then this
parameter is ignored. See RFC 1700, section "Ether Types", for
examples.
@retval EFI_SUCCESS The packet was placed on the transmit queue.
@retval EFI_NOT_STARTED The network interface has not been started.
@retval EFI_NOT_READY The network interface is too busy to accept this transmit request.
@retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
@retval 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
)
;
/**
Receives a packet from a network interface.
@param This Protocol instance pointer.
@param 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.
@param 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.
@param Buffer A pointer to the data buffer to receive both the media header and
the data.
@param SrcAddr The source HW MAC address. If this parameter is NULL, the
HW MAC source address will not be extracted from the media
header.
@param DsetAddr The destination HW MAC address. If this parameter is NULL,
the HW MAC destination address will not be extracted from the
media header.
@param 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.
@retval EFI_SUCCESS The received data was stored in Buffer, and BufferSize has
been updated to the number of bytes received.
@retval EFI_NOT_STARTED The network interface has not been started.
@retval EFI_NOT_READY The network interface is too busy to accept this transmit
request.
@retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.
@retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
@retval EFI_DEVICE_ERROR The command could not be sent to the network interface.
@retval 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
)
;
#define EFI_SIMPLE_NETWORK_PROTOCOL_REVISION 0x00010000
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;
};
extern EFI_GUID gEfiSimpleNetworkProtocolGuid;
#endif

View File

@ -0,0 +1,97 @@
/** @file
Simple Pointer protocol from the EFI 1.1 specification.
Abstraction of a very simple pointer device like a mice or tracekballs.
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: SimplePointer.h
**/
#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 } \
}
typedef struct _EFI_SIMPLE_POINTER_PROTOCOL 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;
/**
Resets the pointer device hardware.
@param This A pointer to the EFI_SIMPLE_POINTER_PROTOCOL
instance.
@param ExtendedVerification Indicates that the driver may perform a more exhaustive
verification operation of the device during reset.
@retval EFI_SUCCESS The device was reset.
@retval EFI_DEVICE_ERROR The device is not functioning correctly and could not be reset.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_POINTER_RESET) (
IN EFI_SIMPLE_POINTER_PROTOCOL *This,
IN BOOLEAN ExtendedVerification
);
/**
Retrieves the current state of a pointer device.
@param This A pointer to the EFI_SIMPLE_POINTER_PROTOCOL
instance.
@param State A pointer to the state information on the pointer device.
@retval EFI_SUCCESS The state of the pointer device was returned in State.
@retval EFI_NOT_READY The state of the pointer device has not changed since the last call to
GetState().
@retval EFI_DEVICE_ERROR A device error occurred while attempting to retrieve the pointer device's
current state.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_POINTER_GET_STATE) (
IN EFI_SIMPLE_POINTER_PROTOCOL *This,
IN OUT EFI_SIMPLE_POINTER_STATE *State
);
struct _EFI_SIMPLE_POINTER_PROTOCOL {
EFI_SIMPLE_POINTER_RESET Reset;
EFI_SIMPLE_POINTER_GET_STATE GetState;
EFI_EVENT WaitForInput;
EFI_SIMPLE_POINTER_MODE *Mode;
};
extern EFI_GUID gEfiSimplePointerProtocolGuid;
#endif

View File

@ -0,0 +1,126 @@
/** @file
Simple Text In protocol from the EFI 1.0 specification.
Abstraction of a very simple input device like a keyboard or serial
terminal.
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: SimpleTextIn.h
**/
#ifndef __SIMPLE_TEXT_IN_PROTOCOL_H__
#define __SIMPLE_TEXT_IN_PROTOCOL_H__
#define EFI_SIMPLE_TEXT_IN_PROTOCOL_GUID \
{ \
0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
}
#define EFI_SIMPLE_INPUT_PROTOCOL_GUID EFI_SIMPLE_TEXT_IN_PROTOCOL_GUID
#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID EFI_SIMPLE_TEXT_IN_PROTOCOL_GUID
typedef struct _EFI_SIMPLE_TEXT_IN_PROTOCOL EFI_SIMPLE_TEXT_IN_PROTOCOL;
typedef struct _EFI_SIMPLE_TEXT_IN_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL;
//
// Data structures
//
typedef struct {
UINT16 ScanCode;
CHAR16 UnicodeChar;
} EFI_INPUT_KEY;
//
// Required unicode control chars
//
#define CHAR_NULL 0x0000
#define CHAR_BACKSPACE 0x0008
#define CHAR_TAB 0x0009
#define CHAR_LINEFEED 0x000A
#define CHAR_CARRIAGE_RETURN 0x000D
//
// EFI Scan codes
//
#define SCAN_NULL 0x0000
#define SCAN_UP 0x0001
#define SCAN_DOWN 0x0002
#define SCAN_RIGHT 0x0003
#define SCAN_LEFT 0x0004
#define SCAN_HOME 0x0005
#define SCAN_END 0x0006
#define SCAN_INSERT 0x0007
#define SCAN_DELETE 0x0008
#define SCAN_PAGE_UP 0x0009
#define SCAN_PAGE_DOWN 0x000A
#define SCAN_F1 0x000B
#define SCAN_F2 0x000C
#define SCAN_F3 0x000D
#define SCAN_F4 0x000E
#define SCAN_F5 0x000F
#define SCAN_F6 0x0010
#define SCAN_F7 0x0011
#define SCAN_F8 0x0012
#define SCAN_F9 0x0013
#define SCAN_F10 0x0014
#define SCAN_F11 0x0015
#define SCAN_F12 0x0016
#define SCAN_ESC 0x0017
/**
Reset the input device and optionaly run diagnostics
@param This Protocol instance pointer.
@param ExtendedVerification Driver may perform diagnostics on reset.
@retval EFI_SUCCESS The device was reset.
@retval EFI_DEVICE_ERROR The device is not functioning properly and could not be reset.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_INPUT_RESET) (
IN EFI_SIMPLE_TEXT_IN_PROTOCOL *This,
IN BOOLEAN ExtendedVerification
)
;
/**
Reads the next keystroke from the input device. The WaitForKey Event can
be used to test for existance of a keystroke via WaitForEvent () call.
@param This Protocol instance pointer.
@param Key Driver may perform diagnostics on reset.
@retval EFI_SUCCESS The keystroke information was returned.
@retval EFI_NOT_READY There was no keystroke data availiable.
@retval EFI_DEVICE_ERROR The keydtroke information was not returned due to
hardware errors.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_INPUT_READ_KEY) (
IN EFI_SIMPLE_TEXT_IN_PROTOCOL *This,
OUT EFI_INPUT_KEY *Key
)
;
struct _EFI_SIMPLE_TEXT_IN_PROTOCOL {
EFI_INPUT_RESET Reset;
EFI_INPUT_READ_KEY ReadKeyStroke;
EFI_EVENT WaitForKey;
} EFI_SIMPLE_INPUT_PROTOCOL;
extern EFI_GUID gEfiSimpleTextInProtocolGuid;
#endif

View File

@ -0,0 +1,390 @@
/** @file
Simple Text Out protocol from the EFI 1.0 specification.
Abstraction of a very simple text based output device like VGA text mode or
a serial terminal. The Simple Text Out protocol instance can represent
a single hardware device or a virtual device that is an agregation
of multiple physical devices.
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: SimpleTextOut.h
**/
#ifndef __SIMPLE_TEXT_OUT_H__
#define __SIMPLE_TEXT_OUT_H__
#define EFI_SIMPLE_TEXT_OUT_PROTOCOL_GUID \
{ \
0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
}
#define EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID EFI_SIMPLE_TEXT_OUT_PROTOCOL_GUID
typedef struct _EFI_SIMPLE_TEXT_OUT_PROTOCOL EFI_SIMPLE_TEXT_OUT_PROTOCOL;
typedef struct _EFI_SIMPLE_TEXT_OUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL;
//
// Define's for required EFI Unicode Box Draw characters
//
#define BOXDRAW_HORIZONTAL 0x2500
#define BOXDRAW_VERTICAL 0x2502
#define BOXDRAW_DOWN_RIGHT 0x250c
#define BOXDRAW_DOWN_LEFT 0x2510
#define BOXDRAW_UP_RIGHT 0x2514
#define BOXDRAW_UP_LEFT 0x2518
#define BOXDRAW_VERTICAL_RIGHT 0x251c
#define BOXDRAW_VERTICAL_LEFT 0x2524
#define BOXDRAW_DOWN_HORIZONTAL 0x252c
#define BOXDRAW_UP_HORIZONTAL 0x2534
#define BOXDRAW_VERTICAL_HORIZONTAL 0x253c
#define BOXDRAW_DOUBLE_HORIZONTAL 0x2550
#define BOXDRAW_DOUBLE_VERTICAL 0x2551
#define BOXDRAW_DOWN_RIGHT_DOUBLE 0x2552
#define BOXDRAW_DOWN_DOUBLE_RIGHT 0x2553
#define BOXDRAW_DOUBLE_DOWN_RIGHT 0x2554
#define BOXDRAW_DOWN_LEFT_DOUBLE 0x2555
#define BOXDRAW_DOWN_DOUBLE_LEFT 0x2556
#define BOXDRAW_DOUBLE_DOWN_LEFT 0x2557
#define BOXDRAW_UP_RIGHT_DOUBLE 0x2558
#define BOXDRAW_UP_DOUBLE_RIGHT 0x2559
#define BOXDRAW_DOUBLE_UP_RIGHT 0x255a
#define BOXDRAW_UP_LEFT_DOUBLE 0x255b
#define BOXDRAW_UP_DOUBLE_LEFT 0x255c
#define BOXDRAW_DOUBLE_UP_LEFT 0x255d
#define BOXDRAW_VERTICAL_RIGHT_DOUBLE 0x255e
#define BOXDRAW_VERTICAL_DOUBLE_RIGHT 0x255f
#define BOXDRAW_DOUBLE_VERTICAL_RIGHT 0x2560
#define BOXDRAW_VERTICAL_LEFT_DOUBLE 0x2561
#define BOXDRAW_VERTICAL_DOUBLE_LEFT 0x2562
#define BOXDRAW_DOUBLE_VERTICAL_LEFT 0x2563
#define BOXDRAW_DOWN_HORIZONTAL_DOUBLE 0x2564
#define BOXDRAW_DOWN_DOUBLE_HORIZONTAL 0x2565
#define BOXDRAW_DOUBLE_DOWN_HORIZONTAL 0x2566
#define BOXDRAW_UP_HORIZONTAL_DOUBLE 0x2567
#define BOXDRAW_UP_DOUBLE_HORIZONTAL 0x2568
#define BOXDRAW_DOUBLE_UP_HORIZONTAL 0x2569
#define BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE 0x256a
#define BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL 0x256b
#define BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL 0x256c
//
// EFI Required Block Elements Code Chart
//
#define BLOCKELEMENT_FULL_BLOCK 0x2588
#define BLOCKELEMENT_LIGHT_SHADE 0x2591
//
// EFI Required Geometric Shapes Code Chart
//
#define GEOMETRICSHAPE_UP_TRIANGLE 0x25b2
#define GEOMETRICSHAPE_RIGHT_TRIANGLE 0x25ba
#define GEOMETRICSHAPE_DOWN_TRIANGLE 0x25bc
#define GEOMETRICSHAPE_LEFT_TRIANGLE 0x25c4
//
// EFI Required Arrow shapes
//
#define ARROW_LEFT 0x2190
#define ARROW_UP 0x2191
#define ARROW_RIGHT 0x2192
#define ARROW_DOWN 0x2193
//
// EFI Console Colours
//
#define EFI_BLACK 0x00
#define EFI_BLUE 0x01
#define EFI_GREEN 0x02
#define EFI_CYAN (EFI_BLUE | EFI_GREEN)
#define EFI_RED 0x04
#define EFI_MAGENTA (EFI_BLUE | EFI_RED)
#define EFI_BROWN (EFI_GREEN | EFI_RED)
#define EFI_LIGHTGRAY (EFI_BLUE | EFI_GREEN | EFI_RED)
#define EFI_BRIGHT 0x08
#define EFI_DARKGRAY (EFI_BRIGHT)
#define EFI_LIGHTBLUE (EFI_BLUE | EFI_BRIGHT)
#define EFI_LIGHTGREEN (EFI_GREEN | EFI_BRIGHT)
#define EFI_LIGHTCYAN (EFI_CYAN | EFI_BRIGHT)
#define EFI_LIGHTRED (EFI_RED | EFI_BRIGHT)
#define EFI_LIGHTMAGENTA (EFI_MAGENTA | EFI_BRIGHT)
#define EFI_YELLOW (EFI_BROWN | EFI_BRIGHT)
#define EFI_WHITE (EFI_BLUE | EFI_GREEN | EFI_RED | EFI_BRIGHT)
#define EFI_TEXT_ATTR(f, b) ((f) | ((b) << 4))
#define EFI_BACKGROUND_BLACK 0x00
#define EFI_BACKGROUND_BLUE 0x10
#define EFI_BACKGROUND_GREEN 0x20
#define EFI_BACKGROUND_CYAN (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN)
#define EFI_BACKGROUND_RED 0x40
#define EFI_BACKGROUND_MAGENTA (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_RED)
#define EFI_BACKGROUND_BROWN (EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED)
#define EFI_BACKGROUND_LIGHTGRAY (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED)
//
// We currently define attributes from 0 - 7F for color manipulations
// To internally handle the local display characteristics for a particular character, we are defining
// Bit 7 to signify the local glyph representation for a character. If turned on, glyphs will be
// pulled from the wide glyph database and will display locally as a wide character (16 X 19 versus 8 X 19)
// If bit 7 is off, the narrow glyph database will be used. This does NOT affect information that is sent to
// non-local displays (e.g. serial or LAN consoles).
//
#define EFI_WIDE_ATTRIBUTE 0x80
/**
Reset the text output device hardware and optionaly run diagnostics
@param This Protocol instance pointer.
@param ExtendedVerification Driver may perform more exhaustive verfication
operation of the device during reset.
@retval EFI_SUCCESS The text output device was reset.
@retval EFI_DEVICE_ERROR The text output device is not functioning correctly and
could not be reset.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TEXT_RESET) (
IN EFI_SIMPLE_TEXT_OUT_PROTOCOL *This,
IN BOOLEAN ExtendedVerification
)
;
/**
Write a Unicode string to the output device.
@param This Protocol instance pointer.
@param String The NULL-terminated Unicode string to be displayed on the output
device(s). All output devices must also support the Unicode
drawing defined in this file.
@retval EFI_SUCCESS The string was output to the device.
@retval EFI_DEVICE_ERROR The device reported an error while attempting to output
the text.
@retval EFI_UNSUPPORTED The output device's mode is not currently in a
defined text mode.
@retval EFI_WARN_UNKNOWN_GLYPH This warning code indicates that some of the
characters in the Unicode string could not be
rendered and were skipped.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TEXT_STRING) (
IN EFI_SIMPLE_TEXT_OUT_PROTOCOL *This,
IN CHAR16 *String
)
;
/**
Verifies that all characters in a Unicode string can be output to the
target device.
@param This Protocol instance pointer.
@param String The NULL-terminated Unicode string to be examined for the output
device(s).
@retval EFI_SUCCESS The device(s) are capable of rendering the output string.
@retval EFI_UNSUPPORTED Some of the characters in the Unicode string cannot be
rendered by one or more of the output devices mapped
by the EFI handle.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TEXT_TEST_STRING) (
IN EFI_SIMPLE_TEXT_OUT_PROTOCOL *This,
IN CHAR16 *String
)
;
/**
Returns information for an available text mode that the output device(s)
supports.
@param This Protocol instance pointer.
@param ModeNumber The mode number to return information on.
@param Columns Returns the geometry of the text output device for the
requested ModeNumber.
@param Rows Returns the geometry of the text output device for the
requested ModeNumber.
@retval EFI_SUCCESS The requested mode information was returned.
@retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
@retval EFI_UNSUPPORTED The mode number was not valid.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TEXT_QUERY_MODE) (
IN EFI_SIMPLE_TEXT_OUT_PROTOCOL *This,
IN UINTN ModeNumber,
OUT UINTN *Columns,
OUT UINTN *Rows
)
;
/**
Sets the output device(s) to a specified mode.
@param This Protocol instance pointer.
@param ModeNumber The mode number to set.
@retval EFI_SUCCESS The requested text mode was set.
@retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
@retval EFI_UNSUPPORTED The mode number was not valid.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TEXT_SET_MODE) (
IN EFI_SIMPLE_TEXT_OUT_PROTOCOL *This,
IN UINTN ModeNumber
)
;
/**
Sets the background and foreground colors for the OutputString () and
ClearScreen () functions.
@param This Protocol instance pointer.
@param Attribute The attribute to set. Bits 0..3 are the foreground color, and
bits 4..6 are the background color. All other bits are undefined
and must be zero. The valid Attributes are defined in this file.
@retval EFI_SUCCESS The attribute was set.
@retval EFI_DEVICE_ ERROR The device had an error and could not complete the request.
@retval EFI_UNSUPPORTED The attribute requested is not defined.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TEXT_SET_ATTRIBUTE) (
IN EFI_SIMPLE_TEXT_OUT_PROTOCOL *This,
IN UINTN Attribute
)
;
/**
Clears the output device(s) display to the currently selected background
color.
@param This Protocol instance pointer.
@retval EFI_SUCCESS The operation completed successfully.
@retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
@retval EFI_UNSUPPORTED The output device is not in a valid text mode.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TEXT_CLEAR_SCREEN) (
IN EFI_SIMPLE_TEXT_OUT_PROTOCOL *This
)
;
/**
Sets the current coordinates of the cursor position
@param This Protocol instance pointer.
@param Column The position to set the cursor to. Must be greater than or
equal to zero and less than the number of columns and rows
by QueryMode ().
@param Row The position to set the cursor to. Must be greater than or
equal to zero and less than the number of columns and rows
by QueryMode ().
@retval EFI_SUCCESS The operation completed successfully.
@retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
@retval EFI_UNSUPPORTED The output device is not in a valid text mode, or the
cursor position is invalid for the current mode.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TEXT_SET_CURSOR_POSITION) (
IN EFI_SIMPLE_TEXT_OUT_PROTOCOL *This,
IN UINTN Column,
IN UINTN Row
)
;
/**
Makes the cursor visible or invisible
@param This Protocol instance pointer.
@param Visible If TRUE, the cursor is set to be visible. If FALSE, the cursor is
set to be invisible.
@retval EFI_SUCCESS The operation completed successfully.
@retval EFI_DEVICE_ERROR The device had an error and could not complete the
request, or the device does not support changing
the cursor mode.
@retval EFI_UNSUPPORTED The output device is not in a valid text mode.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TEXT_ENABLE_CURSOR) (
IN EFI_SIMPLE_TEXT_OUT_PROTOCOL *This,
IN BOOLEAN Visible
)
;
/**
Mode Structure pointed to by Simple Text Out protocol.
MaxMode - The number of modes supported by QueryMode () and SetMode ().
Mode - The text mode of the output device(s).
Attribute - The current character output attribute
CursorColumn - The cursor's column.
CursorRow - The cursor's row.
CursorVisible - The cursor is currently visbile or not.
**/
typedef struct {
INT32 MaxMode;
//
// current settings
//
INT32 Mode;
INT32 Attribute;
INT32 CursorColumn;
INT32 CursorRow;
BOOLEAN CursorVisible;
} EFI_SIMPLE_TEXT_OUTPUT_MODE;
struct _EFI_SIMPLE_TEXT_OUT_PROTOCOL {
EFI_TEXT_RESET Reset;
EFI_TEXT_STRING OutputString;
EFI_TEXT_TEST_STRING TestString;
EFI_TEXT_QUERY_MODE QueryMode;
EFI_TEXT_SET_MODE SetMode;
EFI_TEXT_SET_ATTRIBUTE SetAttribute;
EFI_TEXT_CLEAR_SCREEN ClearScreen;
EFI_TEXT_SET_CURSOR_POSITION SetCursorPosition;
EFI_TEXT_ENABLE_CURSOR EnableCursor;
//
// Current mode
//
EFI_SIMPLE_TEXT_OUTPUT_MODE *Mode;
};
extern EFI_GUID gEfiSimpleTextOutProtocolGuid;
#endif

View File

@ -0,0 +1,237 @@
/** @file
This file declares the EFI SMBus Host Controller protocol
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: Smbus.h
@par Revision Reference:
This protocol is defined in Framework of EFI SMBus Host Controller Specification
Version 0.9
**/
#ifndef _EFI_SMBUS_H
#define _EFI_SMBUS_H
#define EFI_SMBUS_HC_PROTOCOL_GUID \
{ \
0xe49d33ed, 0x513d, 0x4634, {0xb6, 0x98, 0x6f, 0x55, 0xaa, 0x75, 0x1c, 0x1b } \
}
typedef struct _EFI_SMBUS_HC_PROTOCOL EFI_SMBUS_HC_PROTOCOL;
/**
Executes an SMBus operation to an SMBus controller.
@param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.
@param SlaveAddress The SMBus slave address of the device with which to communicate.
@param Command This command is transmitted by the SMBus host
controller to the SMBus slave device and the interpretation is
SMBus slave device specific.
@param Operation Signifies which particular SMBus hardware protocol
instance that it will use to execute the SMBus transactions.
@param PecCheck Defines if Packet Error Code (PEC) checking is required
for this operation.
@param Length Signifies the number of bytes that this operation will do.
@param Buffer Contains the value of data to execute to the SMBus slave device.
@retval EFI_SUCCESS The last data that was returned from the access
matched the poll exit criteria.
@retval EFI_CRC_ERROR The checksum is not correct (PEC is incorrect)
@retval EFI_TIMEOUT Timeout expired before the operation was completed.
Timeout is determined by the SMBus host controller device.
@retval EFI_OUT_OF_RESOURCES The request could not be completed
due to a lack of resources.
@retval EFI_DEVICE_ERROR The request was not completed because
a failure reflected in the Host Status Register bit.
@retval EFI_INVALID_PARAMETER Operation is not defined in EFI_SMBUS_OPERATION.
Or Length/Buffer is NULL for operations except for EfiSmbusQuickRead and
EfiSmbusQuickWrite. Length is outside the range of valid values.
@retval EFI_UNSUPPORTED The SMBus operation or PEC is not supported.
@retval EFI_BUFFER_TOO_SMALL Buffer is not sufficient for this operation.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMBUS_HC_EXECUTE_OPERATION) (
IN EFI_SMBUS_HC_PROTOCOL *This,
IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
IN EFI_SMBUS_DEVICE_COMMAND Command,
IN EFI_SMBUS_OPERATION Operation,
IN BOOLEAN PecCheck,
IN OUT UINTN *Length,
IN OUT VOID *Buffer
);
typedef struct {
UINT32 VendorSpecificId;
UINT16 SubsystemDeviceId;
UINT16 SubsystemVendorId;
UINT16 Interface;
UINT16 DeviceId;
UINT16 VendorId;
UINT8 VendorRevision;
UINT8 DeviceCapabilities;
} EFI_SMBUS_UDID;
/**
CallBack function can be registered in EFI_SMBUS_HC_PROTOCOL_NOTIFY.
@param SlaveAddress The SMBUS hardware address to which the SMBUS
device is preassigned or allocated.
@param Data Data of the SMBus host notify command that
the caller wants to be called.
@return Status Code
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMBUS_NOTIFY_FUNCTION) (
IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
IN UINTN Data
);
/**
Sets the SMBus slave device addresses for the device with a given unique ID
or enumerates the entire bus.
@param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.
@param ArpAll A Boolean expression that indicates if the host drivers need
to enumerate all the devices or enumerate only the device that is identified
by SmbusUdid. If ArpAll is TRUE, SmbusUdid and SlaveAddress are optional.
If ArpAll is FALSE, ArpDevice will enumerate SmbusUdid and the address
will be at SlaveAddress.
@param SmbusUdid The Unique Device Identifier (UDID) that is associated
with this device.
@param SlaveAddress The SMBus slave address that is associated with an SMBus UDID.
@retval EFI_SUCCESS The SMBus slave device address was set.
@retval EFI_INVALID_PARAMETER SlaveAddress is NULL.
@retval EFI_OUT_OF_RESOURCES The request could not be completed
due to a lack of resources.
@retval EFI_TIMEOUT The SMBus slave device did not respond.
@retval EFI_DEVICE_ERROR The request was not completed because the transaction failed.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE) (
IN EFI_SMBUS_HC_PROTOCOL *This,
IN BOOLEAN ArpAll,
IN EFI_SMBUS_UDID *SmbusUdid, OPTIONAL
IN OUT EFI_SMBUS_DEVICE_ADDRESS *SlaveAddress OPTIONAL
);
typedef struct {
EFI_SMBUS_DEVICE_ADDRESS SmbusDeviceAddress;
EFI_SMBUS_UDID SmbusDeviceUdid;
} EFI_SMBUS_DEVICE_MAP;
/**
The GetArpMap() function returns the mapping of all the SMBus devices
that are enumerated by the SMBus host driver.
@param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.
@param Length Size of the buffer that contains the SMBus device map.
@param SmbusDeviceMap The pointer to the device map as enumerated
by the SMBus controller driver.
@retval EFI_SUCCESS The device map was returned correctly in the buffer.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP) (
IN EFI_SMBUS_HC_PROTOCOL *This,
IN OUT UINTN *Length,
IN OUT EFI_SMBUS_DEVICE_MAP **SmbusDeviceMap
);
/**
The Notify() function registers all the callback functions to allow the
bus driver to call these functions when the SlaveAddress/Data pair happens.
@param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.
@param SlaveAddress Address that the host controller detects as
sending a message and calls all the registered functions.
@param Data Data that the host controller detects as sending a message
and calls all the registered functions.
@param NotifyFunction The function to call when the bus driver
detects the SlaveAddress and Data pair.
@retval EFI_SUCCESS NotifyFunction was registered.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMBUS_HC_PROTOCOL_NOTIFY) (
IN EFI_SMBUS_HC_PROTOCOL *This,
IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
IN UINTN Data,
IN EFI_SMBUS_NOTIFY_FUNCTION NotifyFunction
);
/**
@par Protocol Description:
Provides basic SMBus host controller management and basic data
transactions over the SMBus.
@param Execute
Executes the SMBus operation to an SMBus slave device.
@param ArpDevice
Allows an SMBus 2.0 device(s) to be Address Resolution Protocol (ARP)
@param GetArpMap
Allows a driver to retrieve the address that was allocated by the SMBus
host controller during enumeration/ARP.
@param Notify
Allows a driver to register for a callback to the SMBus host
controller driver when the bus issues a notification to the bus controller driver.
**/
struct _EFI_SMBUS_HC_PROTOCOL {
EFI_SMBUS_HC_EXECUTE_OPERATION Execute;
EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE ArpDevice;
EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP GetArpMap;
EFI_SMBUS_HC_PROTOCOL_NOTIFY Notify;
};
extern EFI_GUID gEfiSmbusProtocolGuid;
#endif

View File

@ -0,0 +1,172 @@
/** @file
This file declares SMM SMRAM Access abstraction protocol
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: SmmAccess.h
@par Revision Reference:
This Protocol is defined in Framework of EFI SMM Core Interface Spec
Version 0.9.
**/
#ifndef _SMM_ACCESS_H_
#define _SMM_ACCESS_H_
typedef struct _EFI_SMM_ACCESS_PROTOCOL EFI_SMM_ACCESS_PROTOCOL;
#define EFI_SMM_ACCESS_PROTOCOL_GUID \
{ \
0x3792095a, 0xe309, 0x4c1e, {0xaa, 0x01, 0x85, 0xf5, 0x65, 0x5a, 0x17, 0xf1 } \
}
//
// SMM Access specification constant and types
//
// *******************************************************
// EFI_SMRAM_STATE
// *******************************************************
//
#define EFI_SMRAM_OPEN 0x00000001
#define EFI_SMRAM_CLOSED 0x00000002
#define EFI_SMRAM_LOCKED 0x00000004
#define EFI_CACHEABLE 0x00000008
#define EFI_ALLOCATED 0x00000010
//
// SMM Access specification Member Function
//
/**
Opens the SMRAM area to be accessible by a boot-service driver.
@param This The EFI_SMM_ACCESS_PROTOCOL instance.
@param DescriptorIndex Indicates that the driver wishes to open
the memory tagged by this index.
@retval EFI_SUCCESS The operation was successful.
@retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.
@retval EFI_NOT_STARTED The SMM base service has not been initialized.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_OPEN) (
IN EFI_SMM_ACCESS_PROTOCOL *This,
UINTN DescriptorIndex
);
/**
Inhibits access to the SMRAM.
@param This The EFI_SMM_ACCESS_PROTOCOL instance.
@param DescriptorIndex Indicates that the driver wishes to open
the memory tagged by this index.
@retval EFI_SUCCESS The operation was successful.
@retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.
@retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.
@retval EFI_NOT_STARTED The SMM base service has not been initialized.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_CLOSE) (
IN EFI_SMM_ACCESS_PROTOCOL *This,
UINTN DescriptorIndex
);
/**
Inhibits access to the SMRAM.
@param This The EFI_SMM_ACCESS_PROTOCOL instance.
@param DescriptorIndex Indicates that the driver wishes to open
the memory tagged by this index.
@retval EFI_SUCCESS The operation was successful.
@retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.
@retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.
@retval EFI_NOT_STARTED The SMM base service has not been initialized.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_LOCK) (
IN EFI_SMM_ACCESS_PROTOCOL *This,
UINTN DescriptorIndex
);
/**
Queries the memory controller for the possible regions that will support SMRAM.
@param This The EFI_SMM_ACCESS_PROTOCOL instance.
@param SmramMapSize A pointer to the size, in bytes, of the SmramMemoryMap buffer.
@param SmramMap A pointer to the buffer in which firmware places the current memory map.
@retval EFI_SUCCESS The chipset supported the given resource.
@retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_CAPABILITIES) (
IN EFI_SMM_ACCESS_PROTOCOL *This,
IN OUT UINTN *SmramMapSize,
IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap
);
/**
@par Protocol Description:
This protocol is used to control the visibility of the SMRAM on the platform.
@param Open
Opens the SMRAM.
@param Close
Closes the SMRAM.
@param Lock
Locks the SMRAM.
@param GetCapabilities
Gets information on possible SMRAM regions.
@param LockState
Indicates the current state of the SMRAM. Set to TRUE if any region is locked.
@param OpenState
Indicates the current state of the SMRAM. Set to TRUE if any region is open.
**/
struct _EFI_SMM_ACCESS_PROTOCOL {
EFI_SMM_OPEN Open;
EFI_SMM_CLOSE Close;
EFI_SMM_LOCK Lock;
EFI_SMM_CAPABILITIES GetCapabilities;
BOOLEAN LockState;
BOOLEAN OpenState;
};
extern EFI_GUID gEfiSmmAccessProtocolGuid;
#endif

View File

@ -0,0 +1,310 @@
/** @file
This file declares SMM Base abstraction protocol.
This is the base level of compatiblity for SMM drivers.
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: SmmBase.h
@par Revision Reference:
This Protocol is defined in Framework of EFI SMM Core Interface Spec
Version 0.9.
**/
#ifndef _SMM_BASE_H_
#define _SMM_BASE_H_
#define EFI_SMM_BASE_PROTOCOL_GUID \
{ \
0x1390954D, 0xda95, 0x4227, {0x93, 0x28, 0x72, 0x82, 0xc2, 0x17, 0xda, 0xa8 } \
}
typedef struct _EFI_SMM_BASE_PROTOCOL EFI_SMM_BASE_PROTOCOL;
//
// SMM Handler Definition
//
#define EFI_HANDLER_SUCCESS 0x0000
#define EFI_HANDLER_CRITICAL_EXIT 0x0001
#define EFI_HANDLER_SOURCE_QUIESCED 0x0002
#define EFI_HANDLER_SOURCE_PENDING 0x0003
/**
Entry Point to Callback service
@param SmmImageHandle A handle allocated by the SMM infrastructure code
to uniquely designate a specific DXE SMM driver.
@param CommunicationBuffer A pointer to a collection of data in memory
that will be conveyed from a non-SMM environment into an SMM environment.
The buffer must be contiguous, physically mapped, and be a physical address.
@param SourceSize The size of the CommunicationBuffer.
@return Status code
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_CALLBACK_ENTRY_POINT) (
IN EFI_HANDLE SmmImageHandle,
IN OUT VOID *CommunicationBuffer OPTIONAL,
IN OUT UINTN *SourceSize OPTIONAL
);
//
// SMM Base Protocol Definition
//
/**
Register a given driver into SMRAM.This is the equivalent of performing
the LoadImage/StartImage into System Management Mode.
@param This Protocol instance pointer.
@param FilePath Location of the image to be installed as the handler.
@param SourceBuffer Optional source buffer in case of the image file
being in memory.
@param SourceSize Size of the source image file, if in memory.
@param ImageHandle Pointer to the handle that reflects the driver
loaded into SMM.
@param LegacyIA32Binary The binary image to load is legacy 16 bit code.
@retval EFI_SUCCESS The operation was successful.
@retval EFI_OUT_OF_RESOURCES There were no additional SMRAM resources to load the handler
@retval EFI_UNSUPPORTED This platform does not support 16-bit handlers.
@retval EFI_UNSUPPORTED In runtime.
@retval EFI_INVALID_PARAMETER The handlers was not the correct image type
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_REGISTER_HANDLER) (
IN EFI_SMM_BASE_PROTOCOL *This,
IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
IN VOID *SourceBuffer OPTIONAL,
IN UINTN SourceSize,
OUT EFI_HANDLE *ImageHandle,
IN BOOLEAN LegacyIA32Binary OPTIONAL
)
;
/**
Remove a given driver SMRAM. This is the equivalent of performing
the UnloadImage System Management Mode.
@param This Protocol instance pointer.
@param ImageHandle Pointer to the handle that reflects the driver
loaded into SMM.
@retval EFI_SUCCESS The operation was successful
@retval EFI_INVALID_PARAMETER The handler did not exist
@retval EFI_UNSUPPORTED In runtime.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_UNREGISTER_HANDLER) (
IN EFI_SMM_BASE_PROTOCOL *This,
IN EFI_HANDLE ImageHandle
)
;
/**
The SMM Inter-module Communicate Service Communicate() function
provides a services to send/received messages from a registered
EFI service. The BASE protocol driver is responsible for doing
any of the copies such that the data lives in boot-service accessible RAM.
@param This Protocol instance pointer.
@param ImageHandle Pointer to the handle that reflects the driver
loaded into SMM.
@param CommunicationBuffer Pointer to the buffer to convey into SMRAM.
@param SourceSize Size of the contents of buffer..
@retval EFI_SUCCESS The message was successfully posted
@retval EFI_INVALID_PARAMETER The buffer was NULL
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_COMMUNICATE) (
IN EFI_SMM_BASE_PROTOCOL *This,
IN EFI_HANDLE ImageHandle,
IN OUT VOID *CommunicationBuffer,
IN OUT UINTN *SourceSize
)
;
/**
Register a callback to execute within SMM.
This allows receipt of messages created with the Boot Service COMMUNICATE.
@param This Protocol instance pointer.
@param CallbackAddress Address of the callback service
@param MakeFirst If present, will stipulate that the handler is posted
to be the first module executed in the dispatch table.
@param MakeLast If present, will stipulate that the handler is posted
to be last executed in the dispatch table.
@param FloatingPointSave This is an optional parameter which informs the
EFI_SMM_ACCESS_PROTOCOL Driver core if it needs to save
the floating point register state. If any of the handlers
require this, then the state will be saved for all of the handlers.
@retval EFI_SUCCESS The operation was successful
@retval EFI_OUT_OF_RESOURCES Not enough space in the dispatch queue
@retval EFI_UNSUPPORTED In runtime.
@retval EFI_UNSUPPORTED Not in SMM.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_CALLBACK_SERVICE) (
IN EFI_SMM_BASE_PROTOCOL *This,
IN EFI_HANDLE SmmImageHandle,
IN EFI_SMM_CALLBACK_ENTRY_POINT CallbackAddress,
IN BOOLEAN MakeLast OPTIONAL,
IN BOOLEAN FloatingPointSave OPTIONAL
)
;
/**
The SmmAllocatePool() function allocates a memory region of Size bytes from memory of
type PoolType and returns the address of the allocated memory in the location referenced
by Buffer. This function allocates pages from EFI SMRAM Memory as needed to grow the
requested pool type. All allocations are eight-byte aligned.
@param This Protocol instance pointer.
@param PoolType The type of pool to allocate.
The only supported type is EfiRuntimeServicesData;
the interface will internally map this runtime request to SMRAM.
@param Size The number of bytes to allocate from the pool.
@param Buffer A pointer to a pointer to the allocated buffer if the call
succeeds; undefined otherwise.
@retval EFI_SUCCESS The requested number of bytes was allocated.
@retval EFI_OUT_OF_RESOURCES The pool requested could not be allocated.
@retval EFI_INVALID_PARAMETER PoolType was invalid.
@retval EFI_UNSUPPORTED In runtime.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_ALLOCATE_POOL) (
IN EFI_SMM_BASE_PROTOCOL *This,
IN EFI_MEMORY_TYPE PoolType,
IN UINTN Size,
OUT VOID **Buffer
)
;
/**
The SmmFreePool() function returns the memory specified by Buffer to the system.
On return, the memory's type is EFI SMRAM Memory. The Buffer that is freed must
have been allocated by SmmAllocatePool().
@param This Protocol instance pointer.
@param Buffer Pointer to the buffer allocation.
@retval EFI_SUCCESS The memory was returned to the system.
@retval EFI_INVALID_PARAMETER Buffer was invalid.
@retval EFI_UNSUPPORTED In runtime.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_FREE_POOL) (
IN EFI_SMM_BASE_PROTOCOL *This,
IN VOID *Buffer
)
;
/**
This routine tells caller if execution context is SMM or not.
@param This Protocol instance pointer.
@param InSmm Whether the caller is inside SMM for IA-32 or servicing a PMI for the Itanium processor family.
@retval EFI_SUCCESS The operation was successful
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_INSIDE_OUT) (
IN EFI_SMM_BASE_PROTOCOL *This,
OUT BOOLEAN *InSmm
)
;
/**
The GetSmstLocation() function returns the locatin of the System Management
Service Table. The use of the API is such that a driver can discover the
location of the SMST in its entry point and then cache it in some driver
global variable so that the SMST can be invoked in subsequent callbacks.
@param This Protocol instance pointer.
@param Smst Pointer to the SMST.
@retval EFI_SUCCESS The operation was successful
@retval EFI_INVALID_PARAMETER Smst was invalid.
@retval EFI_UNSUPPORTED Not in SMM.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_GET_SMST_LOCATION) (
IN EFI_SMM_BASE_PROTOCOL *This,
IN OUT EFI_SMM_SYSTEM_TABLE **Smst
)
;
/**
@par Protocol Description:
This protocol is used to install SMM handlers for support of subsequent SMI/PMI
activations. This protocol is available on both IA-32 and Itanium-based systems.
@param Register
Registers a handler to run in System Management RAM (SMRAM).
@param UnRegister
Removes a handler from execution in SMRAM.
@param Communicate
Sends/receives a message for a registered handler.
@param RegisterCallback
Registers a callback from the constructor.
@param InSmm
Detects whether the caller is inside or outside of SMM. SName
@param SmmAllocatePool
Allocates SMRAM.
@param SmmFreePool
Deallocates SMRAM.
@param GetSmstLocation
Retrieves the location of the System Management System Table (SMST).
**/
struct _EFI_SMM_BASE_PROTOCOL {
EFI_SMM_REGISTER_HANDLER Register;
EFI_SMM_UNREGISTER_HANDLER UnRegister;
EFI_SMM_COMMUNICATE Communicate;
EFI_SMM_CALLBACK_SERVICE RegisterCallback;
EFI_SMM_INSIDE_OUT InSmm;
EFI_SMM_ALLOCATE_POOL SmmAllocatePool;
EFI_SMM_FREE_POOL SmmFreePool;
EFI_SMM_GET_SMST_LOCATION GetSmstLocation;
};
extern EFI_GUID gEfiSmmBaseProtocolGuid;
#endif

View File

@ -0,0 +1,139 @@
/** @file
This file declares SMM Control abstraction protocol.
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: SmmControl.h
@par Revision Reference:
This Protocol is defined in Framework of EFI SMM Core Interface Spec
Version 0.9.
**/
#ifndef _SMM_CONTROL_H_
#define _SMM_CONTROL_H_
typedef struct _EFI_SMM_CONTROL_PROTOCOL EFI_SMM_CONTROL_PROTOCOL;
#define EFI_SMM_CONTROL_PROTOCOL_GUID \
{ \
0x8d12e231, 0xc667, 0x4fd1, {0x98, 0xf2, 0x24, 0x49, 0xa7, 0xe7, 0xb2, 0xe5 } \
}
// SMM Access specification Data Structures
//
typedef struct {
UINT8 SmiTriggerRegister;
UINT8 SmiDataRegister;
} EFI_SMM_CONTROL_REGISTER;
//
// SMM Control specification member function
//
/**
Invokes SMI activation from either the preboot or runtime environment.
@param This The EFI_SMM_CONTROL_PROTOCOL instance.
@param ArgumentBuffer Optional sized data to pass into the protocol activation.
@param ArgumentBufferSize Optional size of the data.
@param Periodic Optional mechanism to engender a periodic stream.
@param ActivationInterval Optional parameter to repeat at this period one
time or, if the Periodic Boolean is set, periodically.
@retval EFI_SUCCESS The SMI/PMI has been engendered.
@retval EFI_DEVICE_ERROR The timing is unsupported.
@retval EFI_INVALID_PARAMETER The activation period is unsupported.
@retval EFI_NOT_STARTED The SMM base service has not been initialized.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_ACTIVATE) (
IN EFI_SMM_CONTROL_PROTOCOL *This,
IN OUT INT8 *ArgumentBuffer OPTIONAL,
IN OUT UINTN *ArgumentBufferSize OPTIONAL,
IN BOOLEAN Periodic OPTIONAL,
IN UINTN ActivationInterval OPTIONAL
);
/**
Clears any system state that was created in response to the Active call.
@param This The EFI_SMM_CONTROL_PROTOCOL instance.
@param Periodic Optional parameter to repeat at this period one time
@retval EFI_SUCCESS The SMI/PMI has been engendered.
@retval EFI_DEVICE_ERROR The source could not be cleared.
@retval EFI_INVALID_PARAMETER The service did not support the Periodic input argument.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_DEACTIVATE) (
IN EFI_SMM_CONTROL_PROTOCOL *This,
IN BOOLEAN Periodic OPTIONAL
);
/**
Provides information on the source register used to generate the SMI.
@param This The EFI_SMM_CONTROL_PROTOCOL instance.
@param SmiRegister Pointer to the SMI register description structure
@retval EFI_SUCCESS The register structure has been returned.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_GET_REGISTER_INFO) (
IN EFI_SMM_CONTROL_PROTOCOL *This,
IN OUT EFI_SMM_CONTROL_REGISTER *SmiRegister
);
/**
@par Protocol Description:
This protocol is used initiate SMI/PMI activations.
@param Trigger
Initiates the SMI/PMI activation.
@param Clear
Quiesces the SMI/PMI activation.
@param GetRegisterInfo
Provides data on the register used as the source of the SMI.
@param MinimumTriggerPeriod
Minimum interval at which the platform can set the period.
**/
struct _EFI_SMM_CONTROL_PROTOCOL {
EFI_SMM_ACTIVATE Trigger;
EFI_SMM_DEACTIVATE Clear;
EFI_SMM_GET_REGISTER_INFO GetRegisterInfo;
UINTN MinimumTriggerPeriod;
};
extern EFI_GUID gEfiSmmControlProtocolGuid;
#endif

View File

@ -0,0 +1,150 @@
/** @file
This file declares Smm Gpi Smi Child Protocol
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: SmmGpiDispatch.h
@par Revision Reference:
This Protocol is defined in Framework of EFI SMM Core Interface Spec
Version 0.9.
**/
#ifndef _EFI_SMM_GPI_DISPATCH_H_
#define _EFI_SMM_GPI_DISPATCH_H_
//
// Global ID for the GPI SMI Protocol
//
#define EFI_SMM_GPI_DISPATCH_PROTOCOL_GUID \
{ \
0xe0744b81, 0x9513, 0x49cd, {0x8c, 0xea, 0xe9, 0x24, 0x5e, 0x70, 0x39, 0xda } \
}
typedef struct _EFI_SMM_GPI_DISPATCH_PROTOCOL EFI_SMM_GPI_DISPATCH_PROTOCOL;
//
// Related Definitions
//
//
// GpiMask is a bit mask of 32 possible general purpose inputs that can generate a
// a SMI. Bit 0 corresponds to logical GPI[0], 1 corresponds to logical GPI[1], etc.
//
// The logical GPI index to physical pin on device is described by the GPI device name
// found on the same handle as the GpiSmi child dispatch protocol. The GPI device name
// is defined as protocol with a GUID name and NULL protocol pointer.
//
typedef struct {
UINTN GpiNum;
} EFI_SMM_GPI_DISPATCH_CONTEXT;
//
// Member functions
//
/**
Dispatch function for a GPI SMI handler.
@param DispatchHandle Handle of this dispatch function.
@param DispatchContext Pointer to the dispatch function's context.
The DispatchContext fields are filled in by the dispatching driver prior to
invoking this dispatch function.
@return None
**/
typedef
VOID
(EFIAPI *EFI_SMM_GPI_DISPATCH) (
IN EFI_HANDLE DispatchHandle,
IN EFI_SMM_GPI_DISPATCH_CONTEXT *DispatchContext
);
/**
Register a child SMI source dispatch function with a parent SMM driver
@param This Protocol instance pointer.
@param DispatchFunction Pointer to dispatch function to be invoked for
this SMI source
@param DispatchContext Pointer to the dispatch function's context.
The caller fills this context in before calling
the register function to indicate to the register
function the GPI(s) for which the dispatch function
should be invoked.
@param DispatchHandle Handle of dispatch function, for when interfacing
with the parent Sx state SMM driver.
@retval EFI_SUCCESS The dispatch function has been successfully
registered and the SMI source has been enabled.
@retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
@retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
child.
@retval EFI_INVALID_PARAMETER DispatchContext is invalid. The GPI input value
is not within valid range.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_GPI_REGISTER) (
IN EFI_SMM_GPI_DISPATCH_PROTOCOL *This,
IN EFI_SMM_GPI_DISPATCH DispatchFunction,
IN EFI_SMM_GPI_DISPATCH_CONTEXT *DispatchContext,
OUT EFI_HANDLE *DispatchHandle
);
/**
Unregister a child SMI source dispatch function with a parent SMM driver
@param This Protocol instance pointer.
@param DispatchHandle Handle of dispatch function to deregister.
@retval EFI_SUCCESS The dispatch function has been successfully
unregistered and the SMI source has been disabled
if there are no other registered child dispatch
functions for this SMI source.
@retval EFI_INVALID_PARAMETER Handle is invalid.
@retval other TBD
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_GPI_UNREGISTER) (
IN EFI_SMM_GPI_DISPATCH_PROTOCOL *This,
IN EFI_HANDLE DispatchHandle
);
//
// Interface structure for the SMM GPI SMI Dispatch Protocol
//
/**
@par Protocol Description:
Provides the parent dispatch service for the General Purpose Input
(GPI) SMI source generator.
@param Register
Installs a child service to be dispatched by this protocol.
@param UnRegister
Removes a child service dispatched by this protocol.
@param NumSupportedGpis
Denotes the maximum value of inputs that can have handlers attached.
**/
struct _EFI_SMM_GPI_DISPATCH_PROTOCOL {
EFI_SMM_GPI_REGISTER Register;
EFI_SMM_GPI_UNREGISTER UnRegister;
UINTN NumSupportedGpis;
};
extern EFI_GUID gEfiSmmGpiDispatchProtocolGuid;
#endif

View File

@ -0,0 +1,193 @@
/** @file
This file declares EFI Smm ICH [N] Specific Smi Child Protocol
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: SmmIchnDispatch.h
@par Revision Reference:
This Protocol is defined in Framework of EFI SMM Core Interface Spec
Version 0.9.
**/
#ifndef _EFI_SMM_ICHN_DISPATCH_H_
#define _EFI_SMM_ICHN_DISPATCH_H_
//
// Global ID for the ICH SMI Protocol
//
#define EFI_SMM_ICHN_DISPATCH_PROTOCOL_GUID \
{ \
0xc50b323e, 0x9075, 0x4f2a, {0xac, 0x8e, 0xd2, 0x59, 0x6a, 0x10, 0x85, 0xcc } \
}
typedef struct _EFI_SMM_ICHN_DISPATCH_PROTOCOL EFI_SMM_ICHN_DISPATCH_PROTOCOL;
//
// Related Definitions
//
//
// ICHN Specific SMIs. These are miscellaneous SMI sources that are supported by the
// ICHN specific SMI implementation. These may change over time. TrapNumber is only
// valid if the Type is Trap.
//
typedef enum {
//
// NOTE: NEVER delete items from this list/enumeration! Doing so will prevent other versions
// of the code from compiling. If the ICH version your driver is written for doesn't support
// some of these SMIs, then simply return EFI_UNSUPPORTED when a child/client tries to register
// for them.
//
IchnMch,
IchnPme,
IchnRtcAlarm,
IchnRingIndicate,
IchnAc97Wake,
IchnSerialIrq,
IchnY2KRollover,
IchnTcoTimeout,
IchnOsTco,
IchnNmi,
IchnIntruderDetect,
IchnBiosWp,
IchnMcSmi,
IchnPmeB0,
IchnThrmSts,
IchnSmBus,
IchnIntelUsb2,
IchnMonSmi7,
IchnMonSmi6,
IchnMonSmi5,
IchnMonSmi4,
IchnDevTrap13,
IchnDevTrap12,
IchnDevTrap11,
IchnDevTrap10,
IchnDevTrap9,
IchnDevTrap8,
IchnDevTrap7,
IchnDevTrap6,
IchnDevTrap5,
IchnDevTrap3,
IchnDevTrap2,
IchnDevTrap1,
IchnDevTrap0,
IchnIoTrap3,
IchnIoTrap2,
IchnIoTrap1,
IchnIoTrap0,
//
// INSERT NEW ITEMS JUST BEFORE THIS LINE
//
NUM_ICHN_TYPES // the number of items in this enumeration
} EFI_SMM_ICHN_SMI_TYPE;
typedef struct {
EFI_SMM_ICHN_SMI_TYPE Type;
} EFI_SMM_ICHN_DISPATCH_CONTEXT;
//
// Member functions
//
/**
Dispatch function for a ICH n specific SMI handler.
@param DispatchHandle Handle of this dispatch function.
@param DispatchContext Pointer to the dispatch function's context.
The DispatchContext fields are filled in
by the dispatching driver prior to
invoking this dispatch function.
Nothing
**/
typedef
VOID
(EFIAPI *EFI_SMM_ICHN_DISPATCH) (
IN EFI_HANDLE DispatchHandle,
IN EFI_SMM_ICHN_DISPATCH_CONTEXT *DispatchContext
);
/**
Register a child SMI source dispatch function with a parent SMM driver
@param This Protocol instance pointer.
@param DispatchFunction Pointer to dispatch function to be invoked for
this SMI source
@param DispatchContext Pointer to the dispatch function's context.
The caller fills this context in before calling
the register function to indicate to the register
function the ICHN SMI source for which the dispatch
function should be invoked.
@param DispatchHandle Handle of dispatch function, for when interfacing
with the parent Sx state SMM driver.
@retval EFI_SUCCESS The dispatch function has been successfully
registered and the SMI source has been enabled.
@retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
@retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
child.
@retval EFI_INVALID_PARAMETER DispatchContext is invalid. The ICHN input value
is not within valid range.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_ICHN_REGISTER) (
IN EFI_SMM_ICHN_DISPATCH_PROTOCOL *This,
IN EFI_SMM_ICHN_DISPATCH DispatchFunction,
IN EFI_SMM_ICHN_DISPATCH_CONTEXT *DispatchContext,
OUT EFI_HANDLE *DispatchHandle
);
/**
Unregister a child SMI source dispatch function with a parent SMM driver
@param This Protocol instance pointer.
@param DispatchHandle Handle of dispatch function to deregister.
@retval EFI_SUCCESS The dispatch function has been successfully
unregistered and the SMI source has been disabled
if there are no other registered child dispatch
functions for this SMI source.
@retval EFI_INVALID_PARAMETER Handle is invalid.
@retval other TBD
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_ICHN_UNREGISTER) (
IN EFI_SMM_ICHN_DISPATCH_PROTOCOL *This,
IN EFI_HANDLE DispatchHandle
);
//
// Interface structure for the SMM Ich n specific SMI Dispatch Protocol
//
/**
@par Protocol Description:
Provides the parent dispatch service for a given SMI source generator.
@param Register
Installs a child service to be dispatched by this protocol.
@param UnRegister
Removes a child service dispatched by this protocol.
**/
struct _EFI_SMM_ICHN_DISPATCH_PROTOCOL {
EFI_SMM_ICHN_REGISTER Register;
EFI_SMM_ICHN_UNREGISTER UnRegister;
};
extern EFI_GUID gEfiSmmIchnDispatchProtocolGuid;
#endif

View File

@ -0,0 +1,194 @@
/** @file
This file declares EFI Smm Periodic Timer Smi Child Protocol
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: SmmPeriodicTimerDispatch.h
@par Revision Reference:
This Protocol is defined in Framework of EFI SMM Core Interface Spec
Version 0.9.
**/
#ifndef _EFI_SMM_PERIODIC_TIMER_DISPATCH_H_
#define _EFI_SMM_PERIODIC_TIMER_DISPATCH_H_
//
// Global ID for the Periodic Timer SMI Protocol
//
#define EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL_GUID \
{ \
0x9cca03fc, 0x4c9e, 0x4a19, {0x9b, 0x6, 0xed, 0x7b, 0x47, 0x9b, 0xde, 0x55 } \
}
typedef struct _EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL;
//
// Related Definitions
//
//
// Period is the minimum period of time in 100 nanosecond units that child gets called.
// The child will be called back after a time greater than the time Period.
//
// SmiTickInterval is the period of time interval between SMIs. Children of this interface
// should use this field when registering for periodic timer intervals when a finer
// granularity periodic SMI is desired. Valid values for this field are those returned
// by GetNextInterval. A value of 0 indicates the parent is allowed to use any SMI
// interval period to satisfy the requested period.
// Example: A chipset supports periodic SMIs on every 64ms or 2 seconds.
// A child wishes schedule a period SMI to fire on a period of 3 seconds, there
// are several ways to approach the problem:
// 1. The child may accept a 4 second periodic rate, in which case it registers with
// Period = 40000
// SmiTickInterval = 20000
// The resulting SMI will occur every 2 seconds with the child called back on
// every 2nd SMI.
// NOTE: the same result would occur if the child set SmiTickInterval = 0.
// 2. The child may choose the finer granularity SMI (64ms):
// Period = 30000
// SmiTickInterval = 640
// The resulting SMI will occur every 64ms with the child called back on
// every 47th SMI.
// NOTE: the child driver should be aware that this will result in more
// SMIs occuring during system runtime which can negatively impact system
// performance.
//
// ElapsedTime is the actual time in 100 nanosecond units elapsed since last called, a
// value of 0 indicates an unknown amount of time.
//
typedef struct {
UINT64 Period;
UINT64 SmiTickInterval;
UINT64 ElapsedTime;
} EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT;
//
// Member functions
//
/**
Dispatch function for a Periodic Timer SMI handler.
@param DispatchHandle Handle of this dispatch function.
@param DispatchContext Pointer to the dispatch function's context.
The DispatchContext fields are filled in
by the dispatching driver prior to
invoking this dispatch function.
Nothing
**/
typedef
VOID
(EFIAPI *EFI_SMM_PERIODIC_TIMER_DISPATCH) (
IN EFI_HANDLE DispatchHandle,
IN EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT *DispatchContext
);
/**
Returns the next SMI tick period supported by the chipset. The order
returned is from longest to shortest interval period.
@param This Protocol instance pointer.
@param SmiTickInterval Pointer to pointer of next shorter SMI interval
period supported by the child. This parameter works as a get-first,
get-next field.The first time this function is called, *SmiTickInterval
should be set to NULL to get the longest SMI interval.The returned
*SmiTickInterval should be passed in on subsequent calls to get the
next shorter interval period until *SmiTickInterval = NULL.
@retval EFI_SUCCESS The service returned successfully.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_PERIODIC_TIMER_INTERVAL) (
IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL *This,
IN OUT UINT64 **SmiTickInterval
);
/**
Register a child SMI source dispatch function with a parent SMM driver
@param This Protocol instance pointer.
@param DispatchFunction Pointer to dispatch function to be invoked for
this SMI source
@param DispatchContext Pointer to the dispatch function's context.
The caller fills this context in before calling
the register function to indicate to the register
function the period at which the dispatch function
should be invoked.
@param DispatchHandle Handle of dispatch function, for when interfacing
with the parent Sx state SMM driver.
@retval EFI_SUCCESS The dispatch function has been successfully
registered and the SMI source has been enabled.
@retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
@retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
child.
@retval EFI_INVALID_PARAMETER DispatchContext is invalid. The period input value
is not within valid range.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_PERIODIC_TIMER_REGISTER) (
IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL *This,
IN EFI_SMM_PERIODIC_TIMER_DISPATCH DispatchFunction,
IN EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT *DispatchContext,
OUT EFI_HANDLE *DispatchHandle
);
/**
Unregister a child SMI source dispatch function with a parent SMM driver
@param This Protocol instance pointer.
@param DispatchHandle Handle of dispatch function to deregister.
@retval EFI_SUCCESS The dispatch function has been successfully
unregistered and the SMI source has been disabled
if there are no other registered child dispatch
functions for this SMI source.
@retval EFI_INVALID_PARAMETER Handle is invalid.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_PERIODIC_TIMER_UNREGISTER) (
IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL *This,
IN EFI_HANDLE DispatchHandle
);
//
// Interface structure for the SMM Periodic Timer Dispatch Protocol
//
/**
@par Protocol Description:
Provides the parent dispatch service for the periodical timer SMI source generator.
@param Register
Installs a child service to be dispatched by this protocol.
@param UnRegister
Removes a child service dispatched by this protocol.
@param GetNextShorterInterval
Returns the next SMI tick period that is supported by the chipset.
**/
struct _EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL {
EFI_SMM_PERIODIC_TIMER_REGISTER Register;
EFI_SMM_PERIODIC_TIMER_UNREGISTER UnRegister;
EFI_SMM_PERIODIC_TIMER_INTERVAL GetNextShorterInterval;
};
extern EFI_GUID gEfiSmmPeriodicTimerDispatchProtocolGuid;
#endif

View File

@ -0,0 +1,147 @@
/** @file
This file declares EFI Smm Power Button Smi Child Protocol
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: SmmPowerButtonDispatch.h
@par Revision Reference:
This Protocol is defined in Framework of EFI SMM Core Interface Spec
Version 0.9.
**/
#ifndef _EFI_SMM_POWER_BUTTON_DISPATCH_H_
#define _EFI_SMM_POWER_BUTTON_DISPATCH_H_
//
// Global ID for the Power Button SMI Protocol
//
#define EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL_GUID \
{ \
0xb709efa0, 0x47a6, 0x4b41, {0xb9, 0x31, 0x12, 0xec, 0xe7, 0xa8, 0xee, 0x56 } \
}
typedef struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL;
//
// Related Definitions
//
//
// Power Button. Example, Use for changing LEDs before ACPI OS is on.
// - DXE/BDS Phase
// - OS Install Phase
//
typedef enum {
PowerButtonEntry,
PowerButtonExit
} EFI_POWER_BUTTON_PHASE;
typedef struct {
EFI_POWER_BUTTON_PHASE Phase;
} EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT;
//
// Member functions
//
/**
Dispatch function for a Power Button SMI handler.
@param DispatchHandle Handle of this dispatch function.
@param DispatchContext Pointer to the dispatch function's context.
The DispatchContext fields are filled in
by the dispatching driver prior to
invoking this dispatch function.
Nothing
**/
typedef
VOID
(EFIAPI *EFI_SMM_POWER_BUTTON_DISPATCH) (
IN EFI_HANDLE DispatchHandle,
IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT *DispatchContext
);
/**
Register a child SMI source dispatch function with a parent SMM driver
@param This Protocol instance pointer.
@param DispatchFunction Pointer to dispatch function to be invoked for
this SMI source
@param DispatchContext Pointer to the dispatch function's context.
The caller fills this context in before calling
the register function to indicate to the register
function the Power Button SMI phase for which the dispatch
function should be invoked.
@param DispatchHandle Handle of dispatch function, for when interfacing
with the parent Sx state SMM driver.
@retval EFI_SUCCESS The dispatch function has been successfully
registered and the SMI source has been enabled.
@retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
@retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
child.
@retval EFI_INVALID_PARAMETER DispatchContext is invalid. The Power Button SMI
phase is not within valid range.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_POWER_BUTTON_REGISTER) (
IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL *This,
IN EFI_SMM_POWER_BUTTON_DISPATCH DispatchFunction,
IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT *DispatchContext,
OUT EFI_HANDLE *DispatchHandle
);
/**
Unregister a child SMI source dispatch function with a parent SMM driver
@param This Protocol instance pointer.
@param DispatchHandle Handle of dispatch function to deregister.
@retval EFI_SUCCESS The dispatch function has been successfully
unregistered and the SMI source has been disabled
if there are no other registered child dispatch
functions for this SMI source.
@retval EFI_INVALID_PARAMETER Handle is invalid.
@retval other TBD
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_POWER_BUTTON_UNREGISTER) (
IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL *This,
IN EFI_HANDLE DispatchHandle
);
//
// Interface structure for the SMM Power Button SMI Dispatch Protocol
//
/**
@par Protocol Description:
Provides the parent dispatch service for the SMM power button SMI source generator.
@param Register
Installs a child service to be dispatched by this protocol.
@param UnRegister
Removes a child service dispatched by this protocol.
**/
struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL {
EFI_SMM_POWER_BUTTON_REGISTER Register;
EFI_SMM_POWER_BUTTON_UNREGISTER UnRegister;
};
extern EFI_GUID gEfiSmmPowerButtonDispatchProtocolGuid;
#endif

View File

@ -0,0 +1,147 @@
/** @file
This file declares EFI Smm Standby Button Smi Child Protocol
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: SmmStandbyButtonDispatch.h
@par Revision Reference:
This Protocol is defined in Framework of EFI SMM Core Interface Spec
Version 0.9.
**/
#ifndef _EFI_SMM_STANDBY_BUTTON_DISPATCH_H_
#define _EFI_SMM_STANDBY_BUTTON_DISPATCH_H_
//
// Global ID for the Standby Button SMI Protocol
//
#define EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL_GUID \
{ \
0x78965b98, 0xb0bf, 0x449e, {0x8b, 0x22, 0xd2, 0x91, 0x4e, 0x49, 0x8a, 0x98 } \
}
typedef struct _EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL;
//
// Related Definitions
//
//
// Standby Button. Example, Use for changing LEDs before ACPI OS is on.
// - DXE/BDS Phase
// - OS Install Phase
//
typedef enum {
Entry,
Exit
} EFI_STANDBY_BUTTON_PHASE;
typedef struct {
EFI_STANDBY_BUTTON_PHASE Phase;
} EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT;
//
// Member functions
//
/**
Dispatch function for a Standby Button SMI handler.
@param DispatchHandle Handle of this dispatch function.
@param DispatchContext Pointer to the dispatch function's context.
The DispatchContext fields are filled in
by the dispatching driver prior to
invoking this dispatch function.
@return Nothing
**/
typedef
VOID
(EFIAPI *EFI_SMM_STANDBY_BUTTON_DISPATCH) (
IN EFI_HANDLE DispatchHandle,
IN EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT *DispatchContext
);
/**
Register a child SMI source dispatch function with a parent SMM driver
@param This Protocol instance pointer.
@param DispatchFunction Pointer to dispatch function to be invoked for
this SMI source
@param DispatchContext Pointer to the dispatch function's context.
The caller fills this context in before calling
the register function to indicate to the register
function the Standby Button SMI phase for which the dispatch
function should be invoked.
@param DispatchHandle Handle of dispatch function, for when interfacing
with the parent Sx state SMM driver.
@retval EFI_SUCCESS The dispatch function has been successfully
registered and the SMI source has been enabled.
@retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
@retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
child.
@retval EFI_INVALID_PARAMETER DispatchContext is invalid. The Standby Button SMI
phase is not within valid range.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_STANDBY_BUTTON_REGISTER) (
IN EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL *This,
IN EFI_SMM_STANDBY_BUTTON_DISPATCH DispatchFunction,
IN EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT *DispatchContext,
OUT EFI_HANDLE *DispatchHandle
);
/**
Unregister a child SMI source dispatch function with a parent SMM driver
@param This Protocol instance pointer.
@param DispatchHandle Handle of dispatch function to deregister.
@retval EFI_SUCCESS The dispatch function has been successfully
unregistered and the SMI source has been disabled
if there are no other registered child dispatch
functions for this SMI source.
@retval EFI_INVALID_PARAMETER Handle is invalid.
@retval other TBD
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_STANDBY_BUTTON_UNREGISTER) (
IN EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL *This,
IN EFI_HANDLE DispatchHandle
);
//
// Interface structure for the SMM Standby Button SMI Dispatch Protocol
//
/**
@par Protocol Description:
Provides the parent dispatch service for the standby button SMI source generator.
@param Register
Installs a child service to be dispatched by this protocol.
@param UnRegister
Removes a child service dispatched by this protocol.
**/
struct _EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL {
EFI_SMM_STANDBY_BUTTON_REGISTER Register;
EFI_SMM_STANDBY_BUTTON_UNREGISTER UnRegister;
};
extern EFI_GUID gEfiSmmStandbyButtonDispatchProtocolGuid;
#endif

View File

@ -0,0 +1,86 @@
/** @file
This file declares SMM Status code Protocol.
This code abstracts SMM Status Code reporting.
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: SmmStatusCode.h
@par Revision Reference:
This Protocol is defined in Framework of EFI SMM Core Interface Spec
Version 0.9.
**/
#ifndef _PROTOCOL_SMM_STATUS_CODE_H__
#define _PROTOCOL_SMM_STATUS_CODE_H__
//
// Global ID for the Smm Status Code Protocol
//
#define EFI_SMM_STATUS_CODE_PROTOCOL_GUID \
{ \
0x6afd2b77, 0x98c1, 0x4acd, {0xa6, 0xf9, 0x8a, 0x94, 0x39, 0xde, 0xf, 0xb1 } \
}
typedef struct _EFI_SMM_STATUS_CODE_PROTOCOL EFI_SMM_STATUS_CODE_PROTOCOL;
/**
Service to emit the status code in SMM.
@param This Pointer to EFI_SMM_STATUS_CODE_PROTOCOL instance.
@param CodeType Indicates the type of status code being reported.
@param Value Describes the current status of a hardware or software entity.
This included information about the class and subclass that is used to
classify the entity as well as an operation.
@param Instance The enumeration of a hardware or software entity within
the system. Valid instance numbers start with 1.
@param CallerId This optional parameter may be used to identify the caller.
This parameter allows the status code driver to apply different rules to
different callers.
@param Data This optional parameter may be used to pass additional data.
@retval EFI_SUCCESS The function completed successfully
@retval EFI_DEVICE_ERROR The function should not be completed due to a device error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_REPORT_STATUS_CODE) (
IN EFI_SMM_STATUS_CODE_PROTOCOL *This,
IN EFI_STATUS_CODE_TYPE CodeType,
IN EFI_STATUS_CODE_VALUE Value,
IN UINT32 Instance,
IN EFI_GUID *CallerId,
IN EFI_STATUS_CODE_DATA *Data OPTIONAL
);
/**
@par Protocol Description:
Provides status code services from SMM.
@param ReportStatusCode
Allows for the SMM agent to produce a status code output.
**/
struct _EFI_SMM_STATUS_CODE_PROTOCOL {
EFI_SMM_REPORT_STATUS_CODE ReportStatusCode;
};
extern EFI_GUID gEfiSmmStatusCodeProtocolGuid;
#endif

View File

@ -0,0 +1,149 @@
/** @file
This file declares EFI Smm Software Smi Child Protocol
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: SmmSwDispatch.h
@par Revision Reference:
This Protocol is defined in Framework of EFI SMM Core Interface Spec
Version 0.9.
**/
#ifndef _EFI_SMM_SW_DISPATCH_H_
#define _EFI_SMM_SW_DISPATCH_H_
//
// Global ID for the SW SMI Protocol
//
#define EFI_SMM_SW_DISPATCH_PROTOCOL_GUID \
{ \
0xe541b773, 0xdd11, 0x420c, {0xb0, 0x26, 0xdf, 0x99, 0x36, 0x53, 0xf8, 0xbf } \
}
typedef struct _EFI_SMM_SW_DISPATCH_PROTOCOL EFI_SMM_SW_DISPATCH_PROTOCOL;
//
// Related Definitions
//
//
// A particular chipset may not support all possible software SMI input values.
// For example, the ICH supports only values 00h to 0FFh. The parent only allows a single
// child registration for each SwSmiInputValue.
//
typedef struct {
UINTN SwSmiInputValue;
} EFI_SMM_SW_DISPATCH_CONTEXT;
//
// Member functions
//
/**
Dispatch function for a Software SMI handler.
@param DispatchHandle Handle of this dispatch function.
@param DispatchContext Pointer to the dispatch function's context.
The SwSmiInputValue field is filled in
by the software dispatch driver prior to
invoking this dispatch function.
The dispatch function will only be called
for input values for which it is registered.
Nothing
**/
typedef
VOID
(EFIAPI *EFI_SMM_SW_DISPATCH) (
IN EFI_HANDLE DispatchHandle,
IN EFI_SMM_SW_DISPATCH_CONTEXT *DispatchContext
);
/**
Register a child SMI source dispatch function with a parent SMM driver
@param This Protocol instance pointer.
@param DispatchFunction Pointer to dispatch function to be invoked for
this SMI source
@param DispatchContext Pointer to the dispatch function's context.
The caller fills this context in before calling
the register function to indicate to the register
function which Software SMI input value the
dispatch function should be invoked for.
@param DispatchHandle Handle of dispatch function, for when interfacing
with the parent Sx state SMM driver.
@retval EFI_SUCCESS The dispatch function has been successfully
registered and the SMI source has been enabled.
@retval EFI_DEVICE_ERROR The SW driver was unable to enable the SMI source.
@retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
child.
@retval EFI_INVALID_PARAMETER DispatchContext is invalid. The SW SMI input value
is not within valid range.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_SW_REGISTER) (
IN EFI_SMM_SW_DISPATCH_PROTOCOL *This,
IN EFI_SMM_SW_DISPATCH DispatchFunction,
IN EFI_SMM_SW_DISPATCH_CONTEXT *DispatchContext,
OUT EFI_HANDLE *DispatchHandle
);
/**
Unregister a child SMI source dispatch function with a parent SMM driver
@param This Protocol instance pointer.
@param DispatchHandle Handle of dispatch function to deregister.
@retval EFI_SUCCESS The dispatch function has been successfully
unregistered and the SMI source has been disabled
if there are no other registered child dispatch
functions for this SMI source.
@retval EFI_INVALID_PARAMETER Handle is invalid.
@retval other TBD
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_SW_UNREGISTER) (
IN EFI_SMM_SW_DISPATCH_PROTOCOL *This,
IN EFI_HANDLE DispatchHandle
);
//
// Interface structure for the SMM Software SMI Dispatch Protocol
//
/**
@par Protocol Description:
Provides the parent dispatch service for a given SMI source generator.
@param Register
Installs a child service to be dispatched by this protocol.
@param UnRegister
Removes a child service dispatched by this protocol.
@param MaximumSwiValue
A read-only field that describes the maximum value that can be used
in the EFI_SMM_SW_DISPATCH_PROTOCOL.Register() service.
**/
struct _EFI_SMM_SW_DISPATCH_PROTOCOL {
EFI_SMM_SW_REGISTER Register;
EFI_SMM_SW_UNREGISTER UnRegister;
UINTN MaximumSwiValue;
};
extern EFI_GUID gEfiSmmSwDispatchProtocolGuid;
#endif

View File

@ -0,0 +1,160 @@
/** @file
This file declares EFI Smm Sx Smi Child Protocol
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: SmmSxDispatch.h
@par Revision Reference:
This Protocol is defined in Framework of EFI SMM Core Interface Spec
Version 0.9.
**/
#ifndef _EFI_SMM_SX_DISPATCH_H_
#define _EFI_SMM_SX_DISPATCH_H_
//
// Global ID for the Sx SMI Protocol
//
#define EFI_SMM_SX_DISPATCH_PROTOCOL_GUID \
{ \
0x14fc52be, 0x1dc, 0x426c, {0x91, 0xae, 0xa2, 0x3c, 0x3e, 0x22, 0xa, 0xe8 } \
}
typedef struct _EFI_SMM_SX_DISPATCH_PROTOCOL EFI_SMM_SX_DISPATCH_PROTOCOL;
//
// Related Definitions
//
typedef enum {
SxS0,
SxS1,
SxS2,
SxS3,
SxS4,
SxS5,
EfiMaximumSleepType
} EFI_SLEEP_TYPE;
typedef enum {
SxEntry,
SxExit,
EfiMaximumPhase
} EFI_SLEEP_PHASE;
typedef struct {
EFI_SLEEP_TYPE Type;
EFI_SLEEP_PHASE Phase;
} EFI_SMM_SX_DISPATCH_CONTEXT;
//
// Member functions
//
/**
Dispatch function for a Sx state SMI handler.
@param DispatchHandle Handle of this dispatch function.
@param DispatchContext Pointer to the dispatch function<6F><6E>s context.
The Type and Phase fields are filled in by the Sx dispatch driver
prior to invoking this dispatch function. For this interface,
the Sx driver will call the dispatch function for all Sx type
and phases, so the Sx state handler(s) must check the Type and
Phase field of EFI_SMM_SX_DISPATCH_CONTEXT and act accordingly.
Nothing
**/
typedef
VOID
(EFIAPI *EFI_SMM_SX_DISPATCH) (
IN EFI_HANDLE DispatchHandle,
IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext
);
/**
Register a child SMI source dispatch function with a parent SMM driver
@param This Protocol instance pointer.
@param DispatchFunction Pointer to dispatch function to be invoked for
this SMI source
@param DispatchContext Pointer to the dispatch function's context.
The caller fills this context in before calling
the register function to indicate to the register
function which Sx state type and phase the caller
wishes to be called back on. For this intertace,
the Sx driver will call the registered handlers for
all Sx type and phases, so the Sx state handler(s)
must check the Type and Phase field of the Dispatch
context and act accordingly.
@param DispatchHandle Handle of dispatch function, for when interfacing
with the parent Sx state SMM driver.
@retval EFI_SUCCESS The dispatch function has been successfully
registered and the SMI source has been enabled.
@retval EFI_UNSUPPORTED The Sx driver or hardware does not support that
Sx Type/Phase.
@retval EFI_DEVICE_ERROR The Sx driver was unable to enable the SMI source.
@retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
child.
@retval EFI_INVALID_PARAMETER DispatchContext is invalid. Type & Phase are not
within valid range.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_SX_REGISTER) (
IN EFI_SMM_SX_DISPATCH_PROTOCOL *This,
IN EFI_SMM_SX_DISPATCH DispatchFunction,
IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext,
OUT EFI_HANDLE *DispatchHandle
);
/**
Unregister a child SMI source dispatch function with a parent SMM driver
@param This Protocol instance pointer.
@param DispatchHandle Handle of dispatch function to deregister.
@retval EFI_SUCCESS The dispatch function has been successfully unregistered and the
SMI source has been disabled if there are no other registered child
dispatch functions for this SMI source.
@retval EFI_INVALID_PARAMETER Handle is invalid.
@retval other TBD
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_SX_UNREGISTER) (
IN EFI_SMM_SX_DISPATCH_PROTOCOL *This,
IN EFI_HANDLE DispatchHandle
);
//
// Interface structure for the SMM Child Dispatch Protocol
//
/**
@par Protocol Description:
Provides the parent dispatch service for a given Sx-state source generator.
@param Register
Installs a child service to be dispatched by this protocol.
@param UnRegister
Removes a child service dispatched by this protocol.
**/
struct _EFI_SMM_SX_DISPATCH_PROTOCOL {
EFI_SMM_SX_REGISTER Register;
EFI_SMM_SX_UNREGISTER UnRegister;
};
extern EFI_GUID gEfiSmmSxDispatchProtocolGuid;
#endif

View File

@ -0,0 +1,141 @@
/** @file
This file declares EFI Smm USB Smi Child Protocol.
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: SmmUsbDispatch.h
@par Revision Reference:
This Protocol is defined in Framework of EFI SMM Core Interface Spec
Version 0.9.
**/
#ifndef _EFI_SMM_USB_DISPATCH_H_
#define _EFI_SMM_USB_DISPATCH_H_
//
// Global ID for the USB Protocol
//
#define EFI_SMM_USB_DISPATCH_PROTOCOL_GUID \
{ \
0xa05b6ffd, 0x87af, 0x4e42, {0x95, 0xc9, 0x62, 0x28, 0xb6, 0x3c, 0xf3, 0xf3 } \
}
typedef struct _EFI_SMM_USB_DISPATCH_PROTOCOL EFI_SMM_USB_DISPATCH_PROTOCOL;
//
// Related Definitions
//
typedef enum {
UsbLegacy,
UsbWake
} EFI_USB_SMI_TYPE;
typedef struct {
EFI_USB_SMI_TYPE Type;
EFI_DEVICE_PATH_PROTOCOL *Device;
} EFI_SMM_USB_DISPATCH_CONTEXT;
//
// Member functions
//
/**
Dispatch function for a USB SMI handler.
@param DispatchHandle Handle of this dispatch function.
@param DispatchContext Pointer to the dispatch function's context.
The DispatchContext fields are filled in
by the dispatching driver prior to
invoking this dispatch function.
Nothing
**/
typedef
VOID
(EFIAPI *EFI_SMM_USB_DISPATCH) (
IN EFI_HANDLE DispatchHandle,
IN EFI_SMM_USB_DISPATCH_CONTEXT *DispatchContext
);
/**
Register a child SMI source dispatch function with a parent SMM driver
@param This Protocol instance pointer.
@param DispatchFunction Pointer to dispatch function to be invoked for
this SMI source
@param DispatchContext Pointer to the dispatch function's context.
The caller fills this context in before calling
the register function to indicate to the register
function the USB SMI types for which the dispatch
function should be invoked.
@param DispatchHandle Handle of dispatch function, for when interfacing
with the parent Sx state SMM driver.
@retval EFI_SUCCESS The dispatch function has been successfully
registered and the SMI source has been enabled.
@retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
@retval EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this
child.
@retval EFI_INVALID_PARAMETER DispatchContext is invalid. The USB SMI type
is not within valid range.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_USB_REGISTER) (
IN EFI_SMM_USB_DISPATCH_PROTOCOL *This,
IN EFI_SMM_USB_DISPATCH DispatchFunction,
IN EFI_SMM_USB_DISPATCH_CONTEXT *DispatchContext,
OUT EFI_HANDLE *DispatchHandle
);
/**
Unregister a child SMI source dispatch function with a parent SMM driver
@param This Protocol instance pointer.
@param DispatchHandle Handle of dispatch function to deregister.
@retval EFI_SUCCESS The dispatch function has been successfully
unregistered and the SMI source has been disabled
if there are no other registered child dispatch
functions for this SMI source.
@retval EFI_INVALID_PARAMETER Handle is invalid.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_USB_UNREGISTER) (
IN EFI_SMM_USB_DISPATCH_PROTOCOL *This,
IN EFI_HANDLE DispatchHandle
);
//
// Interface structure for the SMM USB SMI Dispatch Protocol
//
/**
@par Protocol Description:
Provides the parent dispatch service for the USB SMI source generator.
@param Register
Installs a child service to be dispatched by this protocol.
@param UnRegister
Removes a child service dispatched by this protocol.
**/
struct _EFI_SMM_USB_DISPATCH_PROTOCOL {
EFI_SMM_USB_REGISTER Register;
EFI_SMM_USB_UNREGISTER UnRegister;
};
extern EFI_GUID gEfiSmmUsbDispatchProtocolGuid;
#endif

View File

@ -0,0 +1,236 @@
/** @file
EFI_TAPE_IO_PROTOCOL as defined in the UEFI 2.0.
Provide services to control and access a tape device.
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: TapeIo.h
**/
#ifndef __EFI_TAPE_IO_PROTOCOL_H__
#define __EFI_TAPE_IO_PROTOCOL_H__
#define EFI_TAPE_IO_PROTOCOL_GUID \
{ \
0x1e93e633, 0xd65a, 0x459e, {0xab, 0x84, 0x93, 0xd9, 0xec, 0x26, 0x6d, 0x18 } \
}
typedef struct _EFI_TAPE_IO_PROTOCOL EFI_TAPE_IO_PROTOCOL;
typedef struct {
UINT64 Signature;
UINT32 Revision;
UINT32 BootDescSize;
UINT32 BootDescCRC;
EFI_GUID TapeGUID;
EFI_GUID TapeType;
EFI_GUID TapeUnique;
UINT32 BLLocation;
UINT32 BLBlocksize;
UINT32 BLFilesize;
CHAR8 OSVersion[40];
CHAR8 AppVersion[40];
CHAR8 CreationDate[10];
CHAR8 CreationTime[10];
CHAR8 SystemName[256]; // UTF-8
CHAR8 TapeTitle[120]; // UTF-8
CHAR8 pad[468]; // pad to 1024
} TAPE_HEADER;
/**
Reads from the tape.
@param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
@param BufferSize Size of the buffer in bytes pointed to by Buffer.
@param Buffer Pointer to the buffer for data to be read into.
@retval EFI_SUCCESS Data was successfully transferred from the media.
@retval EFI_END_OF_FILE A filemark was encountered which limited the data
transferred by the read operation or the head is positioned
just after a filemark.
@retval EFI_NO_MEDIA No media is loaded in the device.
@retval EFI_NOT_READY The transfer failed since the device was not ready (e.g. not
online). The transfer may be retried at a later time.
@retval EFI_UNSUPPORTED The device does not support this type of transfer.
@retval EFI_TIMEOUT The transfer failed to complete within the timeout specified.
@retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.
The transfer was aborted since the current position of the
media may be incorrect.
@retval EFI_INVALID_PARAMETER A NULL Buffer was specified with a non-zero
BufferSize or the device is operating in fixed block
size mode and the BufferSize was not a multiple of
device<63><65>s fixed block size
@retval EFI_DEVICE_ERROR A device error occurred while attempting to transfer data
from the media.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TAPE_READ) (
IN EFI_TAPE_IO_PROTOCOL *This,
IN OUT UINTN *BufferSize,
OUT VOID *Buffer
)
;
/**
Writes to the tape.
@param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
@param BufferSize Size of the buffer in bytes pointed to by Buffer.
@param Buffer Pointer to the buffer for data to be written from.
@retval EFI_SUCCESS Data was successfully transferred to the media.
@retval EFI_END_OF_MEDIA The logical end of media has been reached. Data may have
been successfully transferred to the media.
@retval EFI_NO_MEDIA No media is loaded in the device.
@retval EFI_NOT_READY The transfer failed since the device was not ready (e.g. not
online). The transfer may be retried at a later time.
@retval EFI_UNSUPPORTED The device does not support this type of transfer.
@retval EFI_TIMEOUT The transfer failed to complete within the timeout specified.
@retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.
The transfer was aborted since the current position of the
media may be incorrect.
@retval EFI_WRITE_PROTECTED The media in the device is write-protected. The transfer
was aborted since a write cannot be completed.
@retval EFI_INVALID_PARAMETER A NULL Buffer was specified with a non-zero
BufferSize or the device is operating in fixed block
size mode and the BufferSize was not a multiple of
device<63><65>s fixed block size
@retval EFI_DEVICE_ERROR A device error occurred while attempting to transfer data
from the media.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TAPE_WRITE) (
IN EFI_TAPE_IO_PROTOCOL *This,
IN UINTN *BufferSize,
IN VOID *Buffer
)
;
/**
Rewinds the tape.
@param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
@retval EFI_SUCCESS The media was successfully repositioned.
@retval EFI_NO_MEDIA No media is loaded in the device.
@retval EFI_NOT_READY Repositioning the media failed since the device was not
ready (e.g. not online). The transfer may be retried at a later time.
@retval EFI_UNSUPPORTED The device does not support this type of media repositioning.
@retval EFI_TIMEOUT Repositioning of the media did not complete within the timeout specified.
@retval EFI_DEVICE_ERROR A device error occurred while attempting to reposition the media.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TAPE_REWIND) (
IN EFI_TAPE_IO_PROTOCOL *This
)
;
/**
Positions the tape.
@param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
@param Direction Direction and number of data blocks or filemarks to space over on media.
@param Type Type of mark to space over on media.
@retval EFI_SUCCESS The media was successfully repositioned.
@retval EFI_END_OF_MEDIA Beginning or end of media was reached before the
indicated number of data blocks or filemarks were found.
@retval EFI_NO_MEDIA No media is loaded in the device.
@retval EFI_NOT_READY The reposition failed since the device was not ready (e.g. not
online). The reposition may be retried at a later time.
@retval EFI_UNSUPPORTED The device does not support this type of repositioning.
@retval EFI_TIMEOUT The repositioning failed to complete within the timeout specified.
@retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.
Repositioning the media was aborted since the current
position of the media may be incorrect.
@retval EFI_DEVICE_ERROR A device error occurred while attempting to reposition the media.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TAPE_SPACE) (
IN EFI_TAPE_IO_PROTOCOL *This,
INTN Direction,
UINTN Type
)
;
/**
Writes filemarks to the media.
@param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
@param Count Number of filemarks to write to the media.
@retval EFI_SUCCESS Data was successfully transferred from the media.
@retval EFI_NO_MEDIA No media is loaded in the device.
@retval EFI_NOT_READY The transfer failed since the device was not ready (e.g. not
online). The transfer may be retried at a later time.
@retval EFI_UNSUPPORTED The device does not support this type of repositioning.
@retval EFI_TIMEOUT The transfer failed to complete within the timeout specified.
@retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.
The transfer was aborted since the current position of the
media may be incorrect.
@retval EFI_DEVICE_ERROR A device error occurred while attempting to transfer data from the media.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TAPE_WRITEFM) (
IN EFI_TAPE_IO_PROTOCOL *This,
IN UINTN Count
)
;
/**
Resets the tape device.
@param This A pointer to the EFI_TAPE_IO_PROTOCOL instance.
@param ExtendedVerification Indicates whether the parent bus should also be reset.
@retval EFI_SUCCESS The bus and/or device were successfully reset.
@retval EFI_NO_MEDIA No media is loaded in the device.
@retval EFI_NOT_READY The reset failed since the device and/or bus was not ready.
The reset may be retried at a later time.
@retval EFI_UNSUPPORTED The device does not support this type of reset.
@retval EFI_TIMEOUT The reset did not complete within the timeout allowed.
@retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the bus and/or device.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TAPE_RESET) (
IN EFI_TAPE_IO_PROTOCOL *This,
IN BOOLEAN ExtendedVerification
)
;
struct _EFI_TAPE_IO_PROTOCOL {
EFI_TAPE_READ TapeRead;
EFI_TAPE_WRITE TapeWrite;
EFI_TAPE_REWIND TapeRewind;
EFI_TAPE_SPACE TapeSpace;
EFI_TAPE_WRITEFM TapeWriteFM;
EFI_TAPE_RESET TapeReset;
};
extern EFI_GUID gEfiTapeIoProtocolGuid;
#endif

View File

@ -0,0 +1,507 @@
/** @file
EFI TCPv4 Protocol Definition
The EFI TCPv4 Service Binding Protocol is used to locate EFI TCPv4 Protocol drivers to create
and destroy child of the driver to communicate with other host using TCP protocol.
The EFI TCPv4 Protocol provides services to send and receive data stream.
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: Tcp4.h
**/
#ifndef __EFI_TCP4_PROTOCOL_H__
#define __EFI_TCP4_PROTOCOL_H__
#define EFI_TCP4_SERVICE_BINDING_PROTOCOL_GUID \
{ \
0x00720665, 0x67EB, 0x4a99, {0xBA, 0xF7, 0xD3, 0xC3, 0x3A, 0x1C, 0x7C, 0xC9 } \
}
#define EFI_TCP4_PROTOCOL_GUID \
{ \
0x65530BC7, 0xA359, 0x410f, {0xB0, 0x10, 0x5A, 0xAD, 0xC7, 0xEC, 0x2B, 0x62 } \
}
typedef struct _EFI_TCP4_PROTOCOL EFI_TCP4_PROTOCOL;
typedef struct {
EFI_IPv4_ADDRESS LocalAddress;
UINT16 LocalPort;
EFI_IPv4_ADDRESS RemoteAddress;
UINT16 RemotePort;
} EFI_TCP4_SERVICE_POINT;
typedef struct {
EFI_HANDLE DriverHandle;
UINTN ServiceCount;
EFI_TCP4_SERVICE_POINT Services[1];
} EFI_TCP4_VARIABLE_DATA;
typedef struct {
BOOLEAN UseDefaultAddress;
EFI_IPv4_ADDRESS StationAddress;
EFI_IPv4_ADDRESS SubnetMask;
UINT16 StationPort;
EFI_IPv4_ADDRESS RemoteAddress;
UINT16 RemotePort;
BOOLEAN ActiveFlag;
} EFI_TCP4_ACCESS_POINT;
typedef struct {
UINTN ReceiveBufferSize;
UINTN SendBufferSize;
UINTN MaxSynBackLog;
UINTN ConnectionTimeout;
UINTN DataRetries;
UINTN FinTimeout;
UINTN TimeWaitTimeout;
UINTN KeepAliveProbes;
UINTN KeepAliveTime;
UINTN KeepAliveInterval;
BOOLEAN EnableNagle;
BOOLEAN EnableTimeStamp;
BOOLEAN EnableWindowScaling;
BOOLEAN EnableSelectiveAck;
BOOLEAN EnablePathMtuDiscovery;
} EFI_TCP4_OPTION;
typedef struct {
//
// I/O parameters
//
UINT8 TypeOfService;
UINT8 TimeToLive;
//
// Access Point
//
EFI_TCP4_ACCESS_POINT AccessPoint;
//
// TCP Control Options
//
EFI_TCP4_OPTION *ControlOption;
} EFI_TCP4_CONFIG_DATA;
typedef enum {
Tcp4StateClosed = 0,
Tcp4StateListen = 1,
Tcp4StateSynSent = 2,
Tcp4StateSynReceived = 3,
Tcp4StateEstablished = 4,
Tcp4StateFinWait1 = 5,
Tcp4StateFinWait2 = 6,
Tcp4StateClosing = 7,
Tcp4StateTimeWait = 8,
Tcp4StateCloseWait = 9,
Tcp4StateLastAck = 10
} EFI_TCP4_CONNECTION_STATE;
typedef struct {
EFI_EVENT Event;
EFI_STATUS Status;
} EFI_TCP4_COMPLETION_TOKEN;
typedef struct {
EFI_TCP4_COMPLETION_TOKEN CompletionToken;
} EFI_TCP4_CONNECTION_TOKEN;
typedef struct {
EFI_TCP4_COMPLETION_TOKEN CompletionToken;
EFI_HANDLE NewChildHandle;
} EFI_TCP4_LISTEN_TOKEN;
typedef struct {
UINTN FragmentLength;
VOID *FragmentBuffer;
} EFI_TCP4_FRAGMENT_DATA;
typedef struct {
BOOLEAN UrgentFlag;
IN OUT UINTN DataLength;
UINTN FragmentCount;
EFI_TCP4_FRAGMENT_DATA FragmentTable[1];
} EFI_TCP4_RECEIVE_DATA;
typedef struct {
BOOLEAN Push;
BOOLEAN Urgent;
UINTN DataLength;
UINTN FragmentCount;
EFI_TCP4_FRAGMENT_DATA FragmentTable[1];
} EFI_TCP4_TRANSMIT_DATA;
typedef struct {
EFI_TCP4_COMPLETION_TOKEN CompletionToken;
union {
EFI_TCP4_RECEIVE_DATA *RxData;
EFI_TCP4_TRANSMIT_DATA *TxData;
} Packet;
} EFI_TCP4_IO_TOKEN;
typedef struct {
EFI_TCP4_COMPLETION_TOKEN CompletionToken;
BOOLEAN AbortOnClose;
} EFI_TCP4_CLOSE_TOKEN;
//
// Interface definition for TCP4 protocol
//
/**
Get the current operational status.
@param This Pointer to the EFI_TCP4_PROTOCOL instance.
@param Tcp4State Pointer to the buffer to receive the current TCP state.
@param Tcp4ConfigData Pointer to the buffer to receive the current TCP configuration.
@param Ip4ModeData Pointer to the buffer to receive the current IPv4 configuration
data used by the TCPv4 instance.
@param MnpConfigData Pointer to the buffer to receive the current MNP configuration
data used indirectly by the TCPv4 instance.
@param SnpModeData Pointer to the buffer to receive the current SNP configuration
data used indirectly by the TCPv4 instance.
@retval EFI_SUCCESS The mode data was read.
@retval EFI_INVALID_PARAMETER This is NULL.
@retval EFI_NOT_STARTED No configuration data is available because this instance hasn<73><6E>t
been started.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TCP4_GET_MODE_DATA) (
IN EFI_TCP4_PROTOCOL *This,
OUT EFI_TCP4_CONNECTION_STATE *Tcp4State OPTIONAL,
OUT EFI_TCP4_CONFIG_DATA *Tcp4ConfigData OPTIONAL,
OUT EFI_IP4_MODE_DATA *Ip4ModeData OPTIONAL,
OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
)
;
/**
Initialize or brutally reset the operational parameters for this EFI TCPv4 instance.
@param This Pointer to the EFI_TCP4_PROTOCOL instance.
@param Tcp4ConfigData Pointer to the configure data to configure the instance.
@retval EFI_SUCCESS The operational settings are set, changed, or reset
successfully.
@retval EFI_INVALID_PARAMETER Some parameter is invalid.
@retval EFI_NO_MAPPING When using a default address, configuration (through
DHCP, BOOTP, RARP, etc.) is not finished yet.
@retval EFI_ACCESS_DENIED Configuring TCP instance when it is configured without
calling Configure() with NULL to reset it.
@retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
@retval EFI_UNSUPPORTED One or more of the control options are not supported in
the implementation.
@retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources when
executing Configure().
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TCP4_CONFIGURE) (
IN EFI_TCP4_PROTOCOL *This,
IN EFI_TCP4_CONFIG_DATA *TcpConfigData OPTIONAL
)
;
/**
Add or delete a route entry to the route table
@param This Pointer to the EFI_TCP4_PROTOCOL instance.
@param DeleteRoute Set it to TRUE to delete this route from the routing table. Set it to
FALSE to add this route to the routing table.
DestinationAddress and SubnetMask are used as the
keywords to search route entry.
@param SubnetAddress The destination network.
@param SubnetMask The subnet mask of the destination network.
@param GatewayAddress The gateway address for this route. It must be on the same
subnet with the station address unless a direct route is specified.
@retval EFI_SUCCESS The operation completed successfully.
@retval EFI_NOT_STARTED The EFI TCPv4 Protocol instance has not been configured.
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
RARP, etc.) is not finished yet.
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
- This is NULL.
- SubnetAddress is NULL.
- SubnetMask is NULL.
- GatewayAddress is NULL.
- *SubnetAddress is not NULL a valid subnet address.
- *SubnetMask is not a valid subnet mask.
- *GatewayAddress is not a valid unicast IP address or it
is not in the same subnet.
@retval EFI_OUT_OF_RESOURCES Could not allocate enough resources to add the entry to the
routing table.
@retval EFI_NOT_FOUND This route is not in the routing table.
@retval EFI_ACCESS_DENIED The route is already defined in the routing table.
@retval EFI_UNSUPPORTED The TCP driver does not support this operation.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TCP4_ROUTES) (
IN EFI_TCP4_PROTOCOL *This,
IN BOOLEAN DeleteRoute,
IN EFI_IPv4_ADDRESS *SubnetAddress,
IN EFI_IPv4_ADDRESS *SubnetMask,
IN EFI_IPv4_ADDRESS *GatewayAddress
)
;
/**
Initiate a nonblocking TCP connection request for an active TCP instance.
@param This Pointer to the EFI_TCP4_PROTOCOL instance.
@param ConnectionToken Pointer to the connection token to return when the TCP three
way handshake finishes.
@retval EFI_SUCCESS The connection request is successfully initiated and the state
- of this TCPv4 instance has been changed to
- Tcp4StateSynSent.
@retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured.
@retval EFI_ACCESS_DENIED One or more of the following conditions are TRUE:
- This instance is not configured as an active one.
- This instance is not in Tcp4StateClosed state.
@retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
- This is NULL.
- ConnectionToken is NULL.
- ConnectionToken->CompletionToken.Event is NULL.
@retval EFI_OUT_OF_RESOURCES The driver can<61><6E>t allocate enough resource to initiate the activeopen.
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TCP4_CONNECT) (
IN EFI_TCP4_PROTOCOL *This,
IN EFI_TCP4_CONNECTION_TOKEN *ConnectionToken
)
;
/**
Listen on the passive instance to accept an incoming connection request. This is a nonblocking operation.
@param This Pointer to the EFI_TCP4_PROTOCOL instance.
@param ListenToken Pointer to the listen token to return when operation finishes.
@retval EFI_SUCCESS The listen token has been queued successfully.
@retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured.
@retval EFI_ACCESS_DENIED One or more of the following are TRUE:
- This instance is not a passive instance.
- This instance is not in Tcp4StateListen state.
- The same listen token has already existed in the listen
token queue of this TCP instance.
@retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
- This is NULL.
- ListenToken is NULL.
- ListentToken->CompletionToken.Event is NULL.
@retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.
@retval EFI_DEVICE_ERROR Any unexpected and not belonged to above category error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TCP4_ACCEPT) (
IN EFI_TCP4_PROTOCOL *This,
IN EFI_TCP4_LISTEN_TOKEN *ListenToken
)
;
/**
Queues outgoing data into the transmit queue.
@param This Pointer to the EFI_TCP4_PROTOCOL instance.
@param Token Pointer to the completion token to queue to the transmit queue.
@retval EFI_SUCCESS The data has been queued for transmission.
@retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured.
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
RARP, etc.) is not finished yet.
@retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
- This is NULL.
- Token is NULL.
- Token->CompletionToken.Event is NULL.
- Token->Packet.TxData is NULL L.
- Token->Packet.FragmentCount is zero.
- Token->Packet.DataLength is not equal to the sum of fragment lengths.
@retval EFI_ACCESS_DENIED One or more of the following conditions is TRUE:
- A transmit completion token with the same Token->CompletionToken.Event
was already in the transmission queue.
- The current instance is in Tcp4StateClosed state.
- The current instance is a passive one and it is in
Tcp4StateListen state.
- User has called Close() to disconnect this connection.
@retval EFI_NOT_READY The completion token could not be queued because the
transmit queue is full.
@retval EFI_OUT_OF_RESOURCES Could not queue the transmit data because of resource
shortage.
@retval EFI_NETWORK_UNREACHABLE There is no route to the destination network or address.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TCP4_TRANSMIT) (
IN EFI_TCP4_PROTOCOL *This,
IN EFI_TCP4_IO_TOKEN *Token
)
;
/**
Places an asynchronous receive request into the receiving queue.
@param This Pointer to the EFI_TCP4_PROTOCOL instance.
@param Token Pointer to a token that is associated with the receive data
descriptor.
@retval EFI_SUCCESS The receive completion token was cached.
@retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured.
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP, RARP,
etc.) is not finished yet.
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
- This is NULL.
- Token is NULL.
- Token->CompletionToken.Event is NULL.
- Token->Packet.RxData is NULL.
- Token->Packet.RxData->DataLength is 0.
- The Token->Packet.RxData->DataLength is not
the sum of all FragmentBuffer length in FragmentTable.
@retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of
system resources (usually memory).
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
@retval EFI_ACCESS_DENIED One or more of the following conditions is TRUE:
- A receive completion token with the same Token-
>CompletionToken.Event was already in the receive
queue.
- The current instance is in Tcp4StateClosed state.
- The current instance is a passive one and it is in
Tcp4StateListen state.
- User has called Close() to disconnect this connection.
@retval EFI_CONNECTION_FIN The communication peer has closed the connection and there is
no any buffered data in the receive buffer of this instance.
@retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TCP4_RECEIVE) (
IN EFI_TCP4_PROTOCOL *This,
IN EFI_TCP4_IO_TOKEN *Token
)
;
/**
Disconnecting a TCP connection gracefully or reset a TCP connection. This function is a
nonblocking operation.
@param This Pointer to the EFI_TCP4_PROTOCOL instance.
@param CloseToken Pointer to the close token to return when operation finishes.
@retval EFI_SUCCESS The Close() is called successfully.
@retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured.
@retval EFI_ACCESS_DENIED One or more of the following are TRUE:
- Configure() has been called with
TcpConfigData set to NULL and this function has
not returned.
- Previous Close() call on this instance has not
finished.
@retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
- This is NULL.
- CloseToken is NULL.
- CloseToken->CompletionToken.Event is NULL.
@retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation.
@retval EFI_DEVICE_ERROR Any unexpected and not belonged to above category error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TCP4_CLOSE) (
IN EFI_TCP4_PROTOCOL *This,
IN EFI_TCP4_CLOSE_TOKEN *CloseToken
)
;
/**
Abort an asynchronous connection, listen, transmission or receive request.
@param This Pointer to the EFI_TCP4_PROTOCOL instance.
@param Token Pointer to a token that has been issued by
EFI_TCP4_PROTOCOL.Connect(),
EFI_TCP4_PROTOCOL.Accept(),
EFI_TCP4_PROTOCOL.Transmit() or
EFI_TCP4_PROTOCOL.Receive(). If NULL, all pending
tokens issued by above four functions will be aborted. Type
EFI_TCP4_COMPLETION_TOKEN is defined in
EFI_TCP4_PROTOCOL.Connect().
@retval EFI_SUCCESS Incoming or outgoing data was processed.
@retval EFI_INVALID_PARAMETER This is NULL.
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
@retval EFI_NOT_READY No incoming or outgoing data is processed.
@retval EFI_TIMEOUT Data was dropped out of the transmission or receive queue.
Consider increasing the polling rate.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TCP4_CANCEL) (
IN EFI_TCP4_PROTOCOL *This,
IN EFI_TCP4_COMPLETION_TOKEN *Token OPTIONAL
)
;
/**
Poll to receive incoming data and transmit outgoing segments.
@param This Pointer to the EFI_TCP4_PROTOCOL instance.
@retval EFI_SUCCESS Incoming or outgoing data was processed.
@retval EFI_INVALID_PARAMETER This is NULL.
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
@retval EFI_NOT_READY No incoming or outgoing data is processed.
@retval EFI_TIMEOUT Data was dropped out of the transmission or receive queue.
Consider increasing the polling rate.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TCP4_POLL) (
IN EFI_TCP4_PROTOCOL *This
)
;
struct _EFI_TCP4_PROTOCOL {
EFI_TCP4_GET_MODE_DATA GetModeData;
EFI_TCP4_CONFIGURE Configure;
EFI_TCP4_ROUTES Routes;
EFI_TCP4_CONNECT Connect;
EFI_TCP4_ACCEPT Accept;
EFI_TCP4_TRANSMIT Transmit;
EFI_TCP4_RECEIVE Receive;
EFI_TCP4_CLOSE Close;
EFI_TCP4_CANCEL Cancel;
EFI_TCP4_POLL Poll;
};
#define EFI_CONNECTION_FIN EFIERR (104)
#define EFI_CONNECTION_RESET EFIERR (105)
#define EFI_CONNECTION_REFUSED EFIERR (106)
extern EFI_GUID gEfiTcp4ServiceBindingProtocolGuid;
extern EFI_GUID gEfiTcp4ProtocolGuid;
#endif

View File

@ -0,0 +1,363 @@
/** @file
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: Udp4.h
**/
#ifndef __EFI_UDP4_PROTOCOL_H__
#define __EFI_UDP4_PROTOCOL_H__
//
//GUID definitions
//
#define EFI_UDP4_SERVICE_BINDING_PROTOCOL_GUID \
{ \
0x83f01464, 0x99bd, 0x45e5, {0xb3, 0x83, 0xaf, 0x63, 0x05, 0xd8, 0xe9, 0xe6 } \
}
#define EFI_UDP4_PROTOCOL_GUID \
{ \
0x3ad9df29, 0x4501, 0x478d, {0xb1, 0xf8, 0x7f, 0x7f, 0xe7, 0x0e, 0x50, 0xf3 } \
}
typedef struct _EFI_UDP4_PROTOCOL EFI_UDP4_PROTOCOL;
typedef struct {
EFI_HANDLE InstanceHandle;
EFI_IPv4_ADDRESS LocalAddress;
UINT16 LocalPort;
EFI_IPv4_ADDRESS RemoteAddress;
UINT16 RemotePort;
} EFI_UDP4_SERVICE_POINT;
typedef struct {
EFI_HANDLE DriverHandle;
UINT32 ServiceCount;
EFI_UDP4_SERVICE_POINT Services[1];
} EFI_UDP4_VARIABLE_DATA;
//
//ICMP error definitions
//
#define EFI_NETWORK_UNREACHABLE EFIERR(100)
#define EFI_HOST_UNREACHABLE EFIERR(101)
#define EFI_PROTOCOL_UNREACHABLE EFIERR(102)
#define EFI_PORT_UNREACHABLE EFIERR(103)
typedef struct {
UINT32 FragmentLength;
VOID *FragmentBuffer;
} EFI_UDP4_FRAGMENT_DATA;
typedef struct {
EFI_IPv4_ADDRESS SourceAddress;
UINT16 SourcePort;
EFI_IPv4_ADDRESS DestinationAddress;
UINT16 DestinationPort;
} EFI_UDP4_SESSION_DATA;
typedef struct {
//
// Receiving Filters
//
BOOLEAN AcceptBroadcast;
BOOLEAN AcceptPromiscuous;
BOOLEAN AcceptAnyPort;
BOOLEAN AllowDuplicatePort;
//
// I/O parameters
//
UINT8 TypeOfService;
UINT8 TimeToLive;
BOOLEAN DoNotFragment;
UINT32 ReceiveTimeout;
UINT32 TransmitTimeout;
//
// Access Point
//
BOOLEAN UseDefaultAddress;
EFI_IPv4_ADDRESS StationAddress;
EFI_IPv4_ADDRESS SubnetMask;
UINT16 StationPort;
EFI_IPv4_ADDRESS RemoteAddress;
UINT16 RemotePort;
} EFI_UDP4_CONFIG_DATA;
typedef struct {
EFI_UDP4_SESSION_DATA *UdpSessionData; //OPTIONAL
EFI_IPv4_ADDRESS *GatewayAddress; //OPTIONAL
UINT32 DataLength;
UINT32 FragmentCount;
EFI_UDP4_FRAGMENT_DATA FragmentTable[1];
} EFI_UDP4_TRANSMIT_DATA;
typedef struct {
EFI_TIME TimeStamp;
EFI_EVENT RecycleSignal;
EFI_UDP4_SESSION_DATA UdpSession;
UINT32 DataLength;
UINT32 FragmentCount;
EFI_UDP4_FRAGMENT_DATA FragmentTable[1];
} EFI_UDP4_RECEIVE_DATA;
typedef struct {
EFI_EVENT Event;
EFI_STATUS Status;
union {
EFI_UDP4_RECEIVE_DATA *RxData;
EFI_UDP4_TRANSMIT_DATA *TxData;
} Packet;
} EFI_UDP4_COMPLETION_TOKEN;
/**
Reads the current operational settings.
@param This Pointer to the EFI_UDP4_PROTOCOL instance.
@param Udp4ConfigData Pointer to the buffer to receive the current configuration data.
@param Ip4ModeData Pointer to the EFI IPv4 Protocol mode data structure.
@param MnpConfigData Pointer to the managed network configuration data structure.
@param SnpModeData Pointer to the simple network mode data structure.
@retval EFI_SUCCESS The mode data was read.
@retval EFI_NOT_STARTED When Udp4ConfigData is queried, no configuration data is
available because this instance has not been started.
@retval EFI_INVALID_PARAMETER This is NULL.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_UDP4_GET_MODE_DATA) (
IN EFI_UDP4_PROTOCOL *This,
OUT EFI_UDP4_CONFIG_DATA *Udp4ConfigData OPTIONAL,
OUT EFI_IP4_MODE_DATA *Ip4ModeData OPTIONAL,
OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
)
;
/**
Initializes, changes, or resets the operational parameters for this instance of the EFI UDPv4
Protocol.
@param This Pointer to the EFI_UDP4_PROTOCOL instance.
@param Udp4ConfigData Pointer to the buffer to receive the current configuration data.
@retval EFI_SUCCESS The configuration settings were set, changed, or reset successfully.
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
RARP, etc.) is not finished yet.
@retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:
@retval EFI_ALREADY_STARTED The EFI UDPv4 Protocol instance is already started/configured
and must be stopped/reset before it can be reconfigured.
@retval EFI_ACCESS_DENIED UdpConfigData. AllowDuplicatePort is FALSE
and UdpConfigData.StationPort is already used by
other instance.
@retval EFI_OUT_OF_RESOURCES The EFI UDPv4 Protocol driver cannot allocate memory for this
EFI UDPv4 Protocol instance.
@retval EFI_DEVICE_ERROR An unexpected network or system error occurred and this instance
was not opened.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_UDP4_CONFIGURE) (
IN EFI_UDP4_PROTOCOL *This,
IN EFI_UDP4_CONFIG_DATA *UdpConfigData OPTIONAL
)
;
/**
Joins and leaves multicast groups.
@param This Pointer to the EFI_UDP4_PROTOCOL instance.
@param JoinFlag Set to TRUE to join a multicast group. Set to FALSE to leave one
or all multicast groups.
@param MulticastAddress Pointer to multicast group address to join or leave.
@retval EFI_SUCCESS The operation completed successfully.
@retval EFI_NOT_STARTED The EFI UDPv4 Protocol instance has not been started.
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
RARP, etc.) is not finished yet.
@retval EFI_OUT_OF_RESOURCES Could not allocate resources to join the group.
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
- This is NULL.
- JoinFlag is TRUE and MulticastAddress is NULL.
- JoinFlag is TRUE and *MulticastAddress is not
a valid multicast address.
@retval EFI_ALREADY_STARTED The group address is already in the group table (when
JoinFlag is TRUE).
@retval EFI_NOT_FOUND The group address is not in the group table (when JoinFlag is
FALSE).
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_UDP4_GROUPS) (
IN EFI_UDP4_PROTOCOL *This,
IN BOOLEAN JoinFlag,
IN EFI_IPv4_ADDRESS *MulticastAddress OPTIONAL
)
;
/**
Adds and deletes routing table entries.
@param This Pointer to the EFI_UDP4_PROTOCOL instance.
@param DeleteRoute Set to TRUE to delete this route from the routing table.
Set to FALSE to add this route to the routing table.
@param SubnetAddress The destination network address that needs to be routed.
@param SubnetMask The subnet mask of SubnetAddress.
@param GatewayAddress The gateway IP address for this route.
@retval EFI_SUCCESS The operation completed successfully.
@retval EFI_NOT_STARTED The EFI UDPv4 Protocol instance has not been started.
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
- RARP, etc.) is not finished yet.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_OUT_OF_RESOURCES Could not add the entry to the routing table.
@retval EFI_NOT_FOUND This route is not in the routing table.
@retval EFI_ACCESS_DENIED The route is already defined in the routing table.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_UDP4_ROUTES) (
IN EFI_UDP4_PROTOCOL *This,
IN BOOLEAN DeleteRoute,
IN EFI_IPv4_ADDRESS *SubnetAddress,
IN EFI_IPv4_ADDRESS *SubnetMask,
IN EFI_IPv4_ADDRESS *GatewayAddress
)
;
/**
Polls for incoming data packets and processes outgoing data packets.
@param This Pointer to the EFI_UDP4_PROTOCOL instance.
@retval EFI_SUCCESS Incoming or outgoing data was processed.
@retval EFI_INVALID_PARAMETER This is NULL.
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
@retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_UDP4_POLL) (
IN EFI_UDP4_PROTOCOL *This
)
;
/**
Places an asynchronous receive request into the receiving queue.
@param This Pointer to the EFI_UDP4_PROTOCOL instance.
@param Token Pointer to a token that is associated with the receive data
descriptor.
@retval EFI_SUCCESS The receive completion token was cached.
@retval EFI_NOT_STARTED This EFI UDPv4 Protocol instance has not been started.
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP, RARP, etc.)
is not finished yet.
@retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
@retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of system
resources (usually memory).
@retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
@retval EFI_ACCESS_DENIED A receive completion token with the same Token.Event was already in
the receive queue.
@retval EFI_NOT_READY The receive request could not be queued because the receive queue is full.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_UDP4_RECEIVE) (
IN EFI_UDP4_PROTOCOL *This,
IN EFI_UDP4_COMPLETION_TOKEN *Token
)
;
/**
Queues outgoing data packets into the transmit queue.
@param This Pointer to the EFI_UDP4_PROTOCOL instance.
@param Token Pointer to the completion token that will be placed into the
transmit queue.
@retval EFI_SUCCESS The data has been queued for transmission.
@retval EFI_NOT_STARTED This EFI UDPv4 Protocol instance has not been started.
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
RARP, etc.) is not finished yet.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_ACCESS_DENIED The transmit completion token with the same
Token.Event was already in the transmit queue.
@retval EFI_NOT_READY The completion token could not be queued because the
transmit queue is full.
@retval EFI_OUT_OF_RESOURCES Could not queue the transmit data.
@retval EFI_NOT_FOUND There is no route to the destination network or address.
@retval EFI_BAD_BUFFER_SIZE The data length is greater than the maximum UDP packet
size. Or the length of the IP header + UDP header + data
length is greater than MTU if DoNotFragment is TRUE.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_UDP4_TRANSMIT) (
IN EFI_UDP4_PROTOCOL *This,
IN EFI_UDP4_COMPLETION_TOKEN *Token
)
;
/**
Aborts an asynchronous transmit or receive request.
@param This Pointer to the EFI_UDP4_PROTOCOL instance.
@param Token Pointer to a token that has been issued by
EFI_UDP4_PROTOCOL.Transmit() or
EFI_UDP4_PROTOCOL.Receive().If NULL, all pending
tokens are aborted.
@retval EFI_SUCCESS The asynchronous I/O request was aborted and Token.Event
was signaled. When Token is NULL, all pending requests are
aborted and their events are signaled.
@retval EFI_INVALID_PARAMETER This is NULL.
@retval EFI_NOT_STARTED This instance has not been started.
@retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP,
RARP, etc.) is not finished yet.
@retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was
not found in the transmit or receive queue. It has either completed
or was not issued by Transmit() and Receive().
**/
typedef
EFI_STATUS
(EFIAPI *EFI_UDP4_CANCEL)(
IN EFI_UDP4_PROTOCOL *This,
IN EFI_UDP4_COMPLETION_TOKEN *Token OPTIONAL
)
;
struct _EFI_UDP4_PROTOCOL {
EFI_UDP4_GET_MODE_DATA GetModeData;
EFI_UDP4_CONFIGURE Configure;
EFI_UDP4_GROUPS Groups;
EFI_UDP4_ROUTES Routes;
EFI_UDP4_TRANSMIT Transmit;
EFI_UDP4_RECEIVE Receive;
EFI_UDP4_CANCEL Cancel;
EFI_UDP4_POLL Poll;
};
extern EFI_GUID gEfiUdp4ServiceBindingProtocolGuid;
extern EFI_GUID gEfiUdp4ProtocolGuid;
#endif

View File

@ -0,0 +1,168 @@
/** @file
UGA Draw protocol from the EFI 1.1 specification.
Abstraction of a very simple graphics device.
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: UgaDraw.h
**/
#ifndef __UGA_DRAW_H__
#define __UGA_DRAW_H__
#define EFI_UGA_DRAW_PROTOCOL_GUID \
{ \
0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \
}
typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;
/**
Return the current video mode information.
@param This Protocol instance pointer.
@param HorizontalResolution Current video horizontal resolution in pixels
@param VerticalResolution Current video vertical resolution in pixels
@param ColorDepth Current video color depth in bits per pixel
@param RefreshRate Current video refresh rate in Hz.
@retval EFI_SUCCESS Mode information returned.
@retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
@retval EFI_INVALID_PARAMETER One of the input args was NULL.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE) (
IN EFI_UGA_DRAW_PROTOCOL *This,
OUT UINT32 *HorizontalResolution,
OUT UINT32 *VerticalResolution,
OUT UINT32 *ColorDepth,
OUT UINT32 *RefreshRate
)
;
/**
Return the current video mode information.
@param This Protocol instance pointer.
@param HorizontalResolution Current video horizontal resolution in pixels
@param VerticalResolution Current video vertical resolution in pixels
@param ColorDepth Current video color depth in bits per pixel
@param RefreshRate Current video refresh rate in Hz.
@retval EFI_SUCCESS Mode information returned.
@retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
**/
typedef
EFI_STATUS
(EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE) (
IN EFI_UGA_DRAW_PROTOCOL *This,
IN UINT32 HorizontalResolution,
IN UINT32 VerticalResolution,
IN UINT32 ColorDepth,
IN UINT32 RefreshRate
)
;
typedef struct {
UINT8 Blue;
UINT8 Green;
UINT8 Red;
UINT8 Reserved;
} EFI_UGA_PIXEL;
typedef union {
EFI_UGA_PIXEL Pixel;
UINT32 Raw;
} EFI_UGA_PIXEL_UNION;
typedef enum {
EfiUgaVideoFill,
EfiUgaVideoToBltBuffer,
EfiUgaBltBufferToVideo,
EfiUgaVideoToVideo,
EfiUgaBltMax
} EFI_UGA_BLT_OPERATION;
/**
Type specifying a pointer to a function to perform an UGA Blt operation.
The following table defines actions for BltOperations:
<B>EfiUgaVideoFill</B> - 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.
<B>EfiUgaVideoToBltBuffer</B> - 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.
<B>EfiUgaBltBufferToVideo</B> - 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.
<B>EfiUgaVideoToVideo</B> - 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.
@param[in] This - Protocol instance pointer.
@param[in] BltBuffer - Buffer containing data to blit into video buffer. This
buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
@param[in] BltOperation - Operation to perform on BlitBuffer and video memory
@param[in] SourceX - X coordinate of source for the BltBuffer.
@param[in] SourceY - Y coordinate of source for the BltBuffer.
@param[in] DestinationX - X coordinate of destination for the BltBuffer.
@param[in] DestinationY - Y coordinate of destination for the BltBuffer.
@param[in] Width - Width of rectangle in BltBuffer in pixels.
@param[in] Height - Hight of rectangle in BltBuffer in pixels.
@param[in] Delta - OPTIONAL
@retval EFI_SUCCESS - The Blt operation completed.
@retval EFI_INVALID_PARAMETER - BltOperation is not valid.
@retval EFI_DEVICE_ERROR - A hardware error occured writting to the video buffer.
--*/
typedef
EFI_STATUS
(EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT) (
IN EFI_UGA_DRAW_PROTOCOL * This,
IN EFI_UGA_PIXEL * BltBuffer, OPTIONAL
IN EFI_UGA_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
);
struct _EFI_UGA_DRAW_PROTOCOL {
EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode;
EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode;
EFI_UGA_DRAW_PROTOCOL_BLT Blt;
};
extern EFI_GUID gEfiUgaDrawProtocolGuid;
#endif

View File

@ -0,0 +1,183 @@
/** @file
Unicode Collation protocol that follows the EFI 1.0 specification.
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: UnicodeCollation.h
**/
#ifndef __UNICODE_COLLATION_H__
#define __UNICODE_COLLATION_H__
#define EFI_UNICODE_COLLATION_PROTOCOL_GUID \
{ \
0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}
typedef struct _EFI_UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL;
//
// Protocol data structures and defines
//
#define EFI_UNICODE_BYTE_ORDER_MARK (CHAR16) (0xfeff)
//
// Protocol member functions
//
/**
Performs a case-insensitive comparison of two Null-terminated Unicode
strings.
@param This Protocol instance pointer.
@param Str1 A pointer to a Null-terminated Unicode string.
@param Str2 A pointer to a Null-terminated Unicode string.
@retval 0 Str1 is equivalent to Str2
@retval >_0 Str1 is lexically greater than Str2
@retval <_0 Str1 is lexically less than Str2
**/
typedef
INTN
(EFIAPI *EFI_UNICODE_COLLATION_STRICOLL) (
IN EFI_UNICODE_COLLATION_PROTOCOL *This,
IN CHAR16 *Str1,
IN CHAR16 *Str2
)
;
/**
Performs a case-insensitive comparison of a Null-terminated Unicode
pattern string and a Null-terminated Unicode string.
@param This Protocol instance pointer.
@param String A pointer to a Null-terminated Unicode string.
@param Pattern A pointer to a Null-terminated Unicode pattern string.
@retval TRUE Pattern was found in String.
@retval FALSE Pattern was not found in String.
**/
typedef
BOOLEAN
(EFIAPI *EFI_UNICODE_COLLATION_METAIMATCH) (
IN EFI_UNICODE_COLLATION_PROTOCOL *This,
IN CHAR16 *String,
IN CHAR16 *Pattern
)
;
/**
Converts all the Unicode characters in a Null-terminated Unicode string to
lower case Unicode characters.
@param This Protocol instance pointer.
@param String A pointer to a Null-terminated Unicode string.
NONE
**/
typedef
VOID
(EFIAPI *EFI_UNICODE_COLLATION_STRLWR) (
IN EFI_UNICODE_COLLATION_PROTOCOL *This,
IN OUT CHAR16 *Str
)
;
/**
Converts all the Unicode characters in a Null-terminated Unicode string to upper
case Unicode characters.
@param This Protocol instance pointer.
@param String A pointer to a Null-terminated Unicode string.
NONE
**/
typedef
VOID
(EFIAPI *EFI_UNICODE_COLLATION_STRUPR) (
IN EFI_UNICODE_COLLATION_PROTOCOL *This,
IN OUT CHAR16 *Str
)
;
/**
Converts an 8.3 FAT file name in an OEM character set to a Null-terminated
Unicode string.
@param This Protocol instance pointer.
@param FatSize The size of the string Fat in bytes.
@param Fat A pointer to a Null-terminated string that contains an 8.3 file
name using an OEM character set.
@param String A pointer to a Null-terminated Unicode string. The string must
be preallocated to hold FatSize Unicode characters.
NONE
**/
typedef
VOID
(EFIAPI *EFI_UNICODE_COLLATION_FATTOSTR) (
IN EFI_UNICODE_COLLATION_PROTOCOL *This,
IN UINTN FatSize,
IN CHAR8 *Fat,
OUT CHAR16 *String
)
;
/**
Converts a Null-terminated Unicode string to legal characters in a FAT
filename using an OEM character set.
@param This Protocol instance pointer.
@param String A pointer to a Null-terminated Unicode string. The string must
be preallocated to hold FatSize Unicode characters.
@param FatSize The size of the string Fat in bytes.
@param Fat A pointer to a Null-terminated string that contains an 8.3 file
name using an OEM character set.
@retval TRUE Fat is a Long File Name
@retval FALSE Fat is an 8.3 file name
**/
typedef
BOOLEAN
(EFIAPI *EFI_UNICODE_COLLATION_STRTOFAT) (
IN EFI_UNICODE_COLLATION_PROTOCOL *This,
IN CHAR16 *String,
IN UINTN FatSize,
OUT CHAR8 *Fat
)
;
struct _EFI_UNICODE_COLLATION_PROTOCOL {
//
// general
//
EFI_UNICODE_COLLATION_STRICOLL StriColl;
EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch;
EFI_UNICODE_COLLATION_STRLWR StrLwr;
EFI_UNICODE_COLLATION_STRUPR StrUpr;
//
// for supporting fat volumes
//
EFI_UNICODE_COLLATION_FATTOSTR FatToStr;
EFI_UNICODE_COLLATION_STRTOFAT StrToFat;
CHAR8 *SupportedLanguages;
};
extern EFI_GUID gEfiUnicodeCollationProtocolGuid;
#endif

View File

@ -0,0 +1,497 @@
/** @file
EFI_USB2_HC_PROTOCOL as defined in UEFI 2.0.
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: Usb2HostController.h
**/
#ifndef _USB2_HOSTCONTROLLER_H_
#define _USB2_HOSTCONTROLLER_H_
#define EFI_USB2_HC_PROTOCOL_GUID \
{ \
0x3e745226, 0x9818, 0x45b6, {0xa2, 0xac, 0xd7, 0xcd, 0xe, 0x8b, 0xa2, 0xbc } \
}
//
// Forward reference for pure ANSI compatability
//
typedef struct _EFI_USB2_HC_PROTOCOL EFI_USB2_HC_PROTOCOL;
#define EFI_USB_SPEED_FULL 0x0000 // 12 Mb/s, USB 1.1 OHCI and UHCI HC.
#define EFI_USB_SPEED_LOW 0x0001 // 1 Mb/s, USB 1.1 OHCI and UHCI HC.
#define EFI_USB_SPEED_HIGH 0x0002 // 480 Mb/s, USB 2.0 EHCI HC.
typedef struct {
UINT8 TranslatorHubAddress;
UINT8 TranslatorPortNumber;
} EFI_USB2_HC_TRANSACTION_TRANSLATOR;
//
// Protocol definitions
//
/**
Retrieves the Host Controller capabilities.
@param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
@param MaxSpeed Host controller data transfer speed.
@param PortNumber Number of the root hub ports.
@param Is64BitCapable TRUE if controller supports 64-bit memory addressing,
FALSE otherwise.
@retval EFI_SUCCESS The host controller capabilities were retrieved successfully.
@retval EFI_INVALID_PARAMETER One of the input args was NULL.
@retval EFI_DEVICE_ERROR An error was encountered while attempting to
retrieve the capabilities.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_CAPABILITY) (
IN EFI_USB2_HC_PROTOCOL *This,
OUT UINT8 *MaxSpeed,
OUT UINT8 *PortNumber,
OUT UINT8 *Is64BitCapable
)
;
/**
Provides software reset for the USB host controller.
@param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
@param Attributes A bit mask of the reset operation to perform.
@retval EFI_SUCCESS The reset operation succeeded.
@retval EFI_INVALID_PARAMETER Attributes is not valid.
@retval EFI_UNSUPPORTED The type of reset specified by Attributes is not currently
supported by the host controller hardware.
@retval EFI_ACCESS_DENIED Reset operation is rejected due to the debug port being configured
and active; only EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG or
EFI_USB_HC_RESET_HOST_WITH_DEBUG reset Attributes can be used to
perform reset operation for this host controller.
@retval EFI_DEVICE_ERROR An error was encountered while attempting to
retrieve the capabilities.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB2_HC_PROTOCOL_RESET) (
IN EFI_USB2_HC_PROTOCOL *This,
IN UINT16 Attributes
)
;
/**
Retrieves current state of the USB host controller.
@param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
@param State A pointer to the EFI_USB_HC_STATE data structure that
indicates current state of the USB host controller.
@retval EFI_SUCCESS The state information of the host controller was returned in State.
@retval EFI_INVALID_PARAMETER State is NULL.
@retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the
host controller<65><72>s current state.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_STATE) (
IN EFI_USB2_HC_PROTOCOL *This,
OUT EFI_USB_HC_STATE *State
)
;
/**
Sets the USB host controller to a specific state.
@param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
@param State Indicates the state of the host controller that will be set.
@retval EFI_SUCCESS The USB host controller was successfully placed in the state
specified by State.
@retval EFI_INVALID_PARAMETER State is not valid.
@retval EFI_DEVICE_ERROR Failed to set the state specified by State due to device error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB2_HC_PROTOCOL_SET_STATE) (
IN EFI_USB2_HC_PROTOCOL *This,
IN EFI_USB_HC_STATE State
)
;
/**
Submits control transfer to a target USB device.
@param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
@param DeviceAddress Represents the address of the target device on the USB.
@param DeviceSpeed Indicates device speed.
@param MaximumPacketLength Indicates the maximum packet size that the default control transfer
endpoint is capable of sending or receiving.
@param Request A pointer to the USB device request that will be sent to the USB device.
@param TransferDirection Specifies the data direction for the transfer. There are three values
available, EfiUsbDataIn, EfiUsbDataOut and EfiUsbNoData.
@param Data A pointer to the buffer of data that will be transmitted to USB device or
received from USB device.
@param DataLength On input, indicates the size, in bytes, of the data buffer specified by Data.
On output, indicates the amount of data actually transferred.
@param Translator A pointer to the transaction translator data.
@param TimeOut Indicates the maximum time, in milliseconds, which the transfer is
allowed to complete.
@param TransferResult A pointer to the detailed result information generated by this control
transfer.
@retval EFI_SUCCESS The control transfer was completed successfully.
@retval EFI_INVALID_PARAMETER Some parameters are invalid.
@retval EFI_OUT_OF_RESOURCES The control transfer could not be completed due to a lack of resources.
@retval EFI_TIMEOUT The control transfer failed due to timeout.
@retval EFI_DEVICE_ERROR The control transfer failed due to host controller or device error.
Caller should check TransferResult for detailed error information.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER) (
IN EFI_USB2_HC_PROTOCOL *This,
IN UINT8 DeviceAddress,
IN UINT8 DeviceSpeed,
IN UINTN MaximumPacketLength,
IN EFI_USB_DEVICE_REQUEST *Request,
IN EFI_USB_DATA_DIRECTION TransferDirection,
IN OUT VOID *Data OPTIONAL,
IN OUT UINTN *DataLength OPTIONAL,
IN UINTN TimeOut,
IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
OUT UINT32 *TransferResult
)
;
#define EFI_USB_MAX_BULK_BUFFER_NUM 10
/**
Submits bulk transfer to a bulk endpoint of a USB device.
@param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
@param DeviceAddress Represents the address of the target device on the USB.
@param EndPointAddress The combination of an endpoint number and an endpoint direction of the
target USB device.
@param DeviceSpeed Indicates device speed.
@param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
sending or receiving.
@param DataBuffersNumber Number of data buffers prepared for the transfer.
@param Data Array of pointers to the buffers of data that will be transmitted to USB
device or received from USB device.
@param DataLength When input, indicates the size, in bytes, of the data buffers specified by
Data. When output, indicates the actually transferred data size.
@param DataToggle A pointer to the data toggle value.
@param Translator A pointer to the transaction translator data.
@param TimeOut Indicates the maximum time, in milliseconds, which the transfer is
allowed to complete.
@param TransferResult A pointer to the detailed result information of the bulk transfer.
@retval EFI_SUCCESS The bulk transfer was completed successfully.
@retval EFI_INVALID_PARAMETER Some parameters are invalid.
@retval EFI_OUT_OF_RESOURCES The bulk transfer could not be submitted due to a lack of resources.
@retval EFI_TIMEOUT The bulk transfer failed due to timeout.
@retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.
Caller should check TransferResult for detailed error information.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB2_HC_PROTOCOL_BULK_TRANSFER) (
IN EFI_USB2_HC_PROTOCOL *This,
IN UINT8 DeviceAddress,
IN UINT8 EndPointAddress,
IN UINT8 DeviceSpeed,
IN UINTN MaximumPacketLength,
IN UINT8 DataBuffersNumber,
IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM],
IN OUT UINTN *DataLength,
IN OUT UINT8 *DataToggle,
IN UINTN TimeOut,
IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
OUT UINT32 *TransferResult
)
;
/**
Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.
@param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
@param DeviceAddress Represents the address of the target device on the USB.
@param EndPointAddress The combination of an endpoint number and an endpoint direction of the
target USB device.
@param DeviceSpeed Indicates device speed.
@param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
sending or receiving.
@param IsNewTransfer If TRUE, an asynchronous interrupt pipe is built between the host and the
target interrupt endpoint. If FALSE, the specified asynchronous interrupt
pipe is canceled. If TRUE, and an interrupt transfer exists for the target
end point, then EFI_INVALID_PARAMETER is returned.
@param DataToggle A pointer to the data toggle value.
@param PollingInterval Indicates the interval, in milliseconds, that the asynchronous interrupt
transfer is polled.
@param DataLength Indicates the length of data to be received at the rate specified by
PollingInterval from the target asynchronous interrupt endpoint.
@param CallBackFunction The Callback function. This function is called at the rate specified by
PollingInterval.
@param Context The context that is passed to the CallBackFunction. This is an
optional parameter and may be NULL.
@retval EFI_SUCCESS The asynchronous interrupt transfer request has been successfully
submitted or canceled.
@retval EFI_INVALID_PARAMETER Some parameters are invalid.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER) (
IN EFI_USB2_HC_PROTOCOL *This,
IN UINT8 DeviceAddress,
IN UINT8 EndPointAddress,
IN UINT8 DeviceSpeed,
IN UINTN MaxiumPacketLength,
IN BOOLEAN IsNewTransfer,
IN OUT UINT8 *DataToggle,
IN UINTN PollingInterval OPTIONAL,
IN UINTN DataLength OPTIONAL,
IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL,
IN VOID *Context OPTIONAL
)
;
/**
Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.
@param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
@param DeviceAddress Represents the address of the target device on the USB.
@param EndPointAddress The combination of an endpoint number and an endpoint direction of the
target USB device.
@param DeviceSpeed Indicates device speed.
@param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
sending or receiving.
@param Data A pointer to the buffer of data that will be transmitted to USB device or
received from USB device.
@param DataLength On input, the size, in bytes, of the data buffer specified by Data. On
output, the number of bytes transferred.
@param DataToggle A pointer to the data toggle value.
@param TimeOut Indicates the maximum time, in milliseconds, which the transfer is
allowed to complete.
@param TransferResult A pointer to the detailed result information from the synchronous
interrupt transfer.
@retval EFI_SUCCESS The synchronous interrupt transfer was completed successfully.
@retval EFI_INVALID_PARAMETER Some parameters are invalid.
@retval EFI_OUT_OF_RESOURCES The synchronous interrupt transfer could not be submitted due to a lack of resources.
@retval EFI_TIMEOUT The synchronous interrupt transfer failed due to timeout.
@retval EFI_DEVICE_ERROR The synchronous interrupt transfer failed due to host controller or device error.
Caller should check TransferResult for detailed error information.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER) (
IN EFI_USB2_HC_PROTOCOL *This,
IN UINT8 DeviceAddress,
IN UINT8 EndPointAddress,
IN UINT8 DeviceSpeed,
IN UINTN MaximumPacketLength,
IN OUT VOID *Data,
IN OUT UINTN *DataLength,
IN OUT UINT8 *DataToggle,
IN UINTN TimeOut,
OUT UINT32 *TransferResult
)
;
#define EFI_USB_MAX_ISO_BUFFER_NUM 7
#define EFI_USB_MAX_ISO_BUFFER_NUM1 2
/**
Submits isochronous transfer to an isochronous endpoint of a USB device.
@param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
@param DeviceAddress Represents the address of the target device on the USB.
@param EndPointAddress The combination of an endpoint number and an endpoint direction of the
target USB device.
@param DeviceSpeed Indicates device speed.
@param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
sending or receiving.
@param DataBuffersNumber Number of data buffers prepared for the transfer.
@param Data Array of pointers to the buffers of data that will be transmitted to USB
device or received from USB device.
@param DataLength Specifies the length, in bytes, of the data to be sent to or received from
the USB device.
@param Translator A pointer to the transaction translator data.
@param TransferResult A pointer to the detailed result information of the isochronous transfer.
@retval EFI_SUCCESS The isochronous transfer was completed successfully.
@retval EFI_INVALID_PARAMETER Some parameters are invalid.
@retval EFI_OUT_OF_RESOURCES The isochronous transfer could not be submitted due to a lack of resources.
@retval EFI_TIMEOUT The isochronous transfer cannot be completed within the one USB frame time.
@retval EFI_DEVICE_ERROR The isochronous transfer failed due to host controller or device error.
Caller should check TransferResult for detailed error information.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER) (
IN EFI_USB2_HC_PROTOCOL *This,
IN UINT8 DeviceAddress,
IN UINT8 EndPointAddress,
IN UINT8 DeviceSpeed,
IN UINTN MaximumPacketLength,
IN UINT8 DataBuffersNumber,
IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],
IN UINTN DataLength,
IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
OUT UINT32 *TransferResult
)
;
/**
Submits nonblocking isochronous transfer to an isochronous endpoint of a USB device.
@param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
@param DeviceAddress Represents the address of the target device on the USB.
@param EndPointAddress The combination of an endpoint number and an endpoint direction of the
target USB device.
@param DeviceSpeed Indicates device speed.
@param MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of
sending or receiving.
@param DataBuffersNumber Number of data buffers prepared for the transfer.
@param Data Array of pointers to the buffers of data that will be transmitted to USB
device or received from USB device.
@param DataLength Specifies the length, in bytes, of the data to be sent to or received from
the USB device.
@param Translator A pointer to the transaction translator data.
@param IsochronousCallback The Callback function. This function is called if the requested
isochronous transfer is completed.
@param Context Data passed to the IsochronousCallback function. This is an
optional parameter and may be NULL.
@retval EFI_SUCCESS The asynchronous isochronous transfer request has been successfully
submitted or canceled.
@retval EFI_INVALID_PARAMETER Some parameters are invalid.
@retval EFI_OUT_OF_RESOURCES The asynchronous isochronous transfer could not be submitted due to
a lack of resources.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER) (
IN EFI_USB2_HC_PROTOCOL *This,
IN UINT8 DeviceAddress,
IN UINT8 EndPointAddress,
IN UINT8 DeviceSpeed,
IN UINTN MaximumPacketLength,
IN UINT8 DataBuffersNumber,
IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],
IN UINTN DataLength,
IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,
IN VOID *Context OPTIONAL
)
;
/**
Retrieves the current status of a USB root hub port.
@param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
@param PortNumber Specifies the root hub port from which the status is to be retrieved.
This value is zero based.
@param PortStatus A pointer to the current port status bits and port status change bits.
@retval EFI_SUCCESS The status of the USB root hub port specified by PortNumber
was returned in PortStatus.
@retval EFI_INVALID_PARAMETER PortNumber is invalid.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS) (
IN EFI_USB2_HC_PROTOCOL *This,
IN UINT8 PortNumber,
OUT EFI_USB_PORT_STATUS *PortStatus
)
;
/**
Sets a feature for the specified root hub port.
@param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
@param PortNumber Specifies the root hub port whose feature is requested to be set. This
value is zero based.
@param PortFeature Indicates the feature selector associated with the feature set request.
@retval EFI_SUCCESS The feature specified by PortFeature was set for the USB
root hub port specified by PortNumber.
@retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE) (
IN EFI_USB2_HC_PROTOCOL *This,
IN UINT8 PortNumber,
IN EFI_USB_PORT_FEATURE PortFeature
)
;
/**
Clears a feature for the specified root hub port.
@param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
@param PortNumber Specifies the root hub port whose feature is requested to be cleared. This
value is zero based.
@param PortFeature Indicates the feature selector associated with the feature clear request.
@retval EFI_SUCCESS The feature specified by PortFeature was cleared for the USB
root hub port specified by PortNumber.
@retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE) (
IN EFI_USB2_HC_PROTOCOL *This,
IN UINT8 PortNumber,
IN EFI_USB_PORT_FEATURE PortFeature
)
;
struct _EFI_USB2_HC_PROTOCOL {
EFI_USB2_HC_PROTOCOL_GET_CAPABILITY GetCapability;
EFI_USB2_HC_PROTOCOL_RESET Reset;
EFI_USB2_HC_PROTOCOL_GET_STATE GetState;
EFI_USB2_HC_PROTOCOL_SET_STATE SetState;
EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER ControlTransfer;
EFI_USB2_HC_PROTOCOL_BULK_TRANSFER BulkTransfer;
EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER AsyncInterruptTransfer;
EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER SyncInterruptTransfer;
EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER IsochronousTransfer;
EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer;
EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus;
EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature;
EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE ClearRootHubPortFeature;
UINT16 MajorRevision;
UINT16 MinorRevision;
};
extern EFI_GUID gEfiUsb2HcProtocolGuid;
#endif

View File

@ -0,0 +1,446 @@
/** @file
EFI_USB_HC_PROTOCOL as defined in EFI 1.10.
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: UsbHostController.h
**/
#ifndef _USB_HOSTCONTROLLER_H_
#define _USB_HOSTCONTROLLER_H_
#define EFI_USB_HC_PROTOCOL_GUID \
{ \
0xf5089266, 0x1aa0, 0x4953, {0x97, 0xd8, 0x56, 0x2f, 0x8a, 0x73, 0xb5, 0x19 } \
}
//
// Forward reference for pure ANSI compatability
//
typedef struct _EFI_USB_HC_PROTOCOL EFI_USB_HC_PROTOCOL;
//
// Protocol definitions
//
/**
Provides software reset for the USB host controller.
@param This A pointer to the EFI_USB_HC_PROTOCOL instance.
@param Attributes A bit mask of the reset operation to perform.
@retval EFI_SUCCESS The reset operation succeeded.
@retval EFI_UNSUPPORTED The type of reset specified by Attributes is not currently supported
by the host controller hardware.
@retval EFI_INVALID_PARAMETER Attributes is not valid.
@retval EFI_DEVICE_ERROR An error was encountered while attempting to perform the reset operation.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_HC_PROTOCOL_RESET) (
IN EFI_USB_HC_PROTOCOL *This,
IN UINT16 Attributes
);
/**
Retrieves current state of the USB host controller.
@param This A pointer to the EFI_USB_HC_PROTOCOL instance.
@param State A pointer to the EFI_USB_HC_STATE data structure that
indicates current state of the USB host controller.
@retval EFI_SUCCESS The state information of the host controller was returned in State.
@retval EFI_INVALID_PARAMETER State is NULL.
@retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the host controller<65><72>s
current state.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_HC_PROTOCOL_GET_STATE) (
IN EFI_USB_HC_PROTOCOL *This,
OUT EFI_USB_HC_STATE *State
);
/**
Sets the USB host controller to a specific state.
@param This A pointer to the EFI_USB_HC_PROTOCOL instance.
@param State Indicates the state of the host controller that will be set.
@retval EFI_SUCCESS The USB host controller was successfully placed in the state specified by
State.
@retval EFI_INVALID_PARAMETER State is NULL.
@retval EFI_DEVICE_ERROR Failed to set the state specified by State due to device error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_HC_PROTOCOL_SET_STATE) (
IN EFI_USB_HC_PROTOCOL *This,
IN EFI_USB_HC_STATE State
);
/**
Submits control transfer to a target USB device.
@param This A pointer to the EFI_USB_HC_PROTOCOL instance.
@param DeviceAddress Represents the address of the target device on the USB, which is
assigned during USB enumeration.
@param IsSlowDevice Indicates whether the target device is slow device or full-speed
device.
@param MaximumPacketLength Indicates the maximum packet size that the default control
transfer endpoint is capable of sending or receiving.
@param Request A pointer to the USB device request that will be sent to the USB
device.
@param TransferDirection Specifies the data direction for the transfer.
@param Data A pointer to the buffer of data that will be transmitted to USB
device or received from USB device.
@param DataLength On input, indicates the size, in bytes, of the data buffer specified
by Data. On output, indicates the amount of data actually
transferred.
@param TimeOut Indicates the maximum time, in milliseconds, which the transfer
is allowed to complete.
@param TransferResult A pointer to the detailed result information generated by this
control transfer.
@retval EFI_SUCCESS The control transfer was completed successfully.
@retval EFI_OUT_OF_RESOURCES The control transfer could not be completed due to a lack of resources.
@retval EFI_INVALID_PARAMETER Some parameters are invalid.
@retval EFI_TIMEOUT The control transfer failed due to timeout.
@retval EFI_DEVICE_ERROR The control transfer failed due to host controller or device error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_HC_PROTOCOL_CONTROL_TRANSFER) (
IN EFI_USB_HC_PROTOCOL *This,
IN UINT8 DeviceAddress,
IN BOOLEAN IsSlowDevice,
IN UINT8 MaximumPacketLength,
IN EFI_USB_DEVICE_REQUEST *Request,
IN EFI_USB_DATA_DIRECTION TransferDirection,
IN OUT VOID *Data OPTIONAL,
IN OUT UINTN *DataLength OPTIONAL,
IN UINTN TimeOut,
OUT UINT32 *TransferResult
);
/**
Submits bulk transfer to a bulk endpoint of a USB device.
@param This A pointer to the EFI_USB_HC_PROTOCOL instance.
@param DeviceAddress Represents the address of the target device on the USB, which is
assigned during USB enumeration.
@param EndPointAddress The combination of an endpoint number and an endpoint
direction of the target USB device.
@param MaximumPacketLength Indicates the maximum packet size that the default control
transfer endpoint is capable of sending or receiving.
@param Data A pointer to the buffer of data that will be transmitted to USB
device or received from USB device.
@param DataLength On input, indicates the size, in bytes, of the data buffer specified
by Data. On output, indicates the amount of data actually
transferred.
@param DataToggle A pointer to the data toggle value.
@param TimeOut Indicates the maximum time, in milliseconds, which the transfer
is allowed to complete.
@param TransferResult A pointer to the detailed result information of the bulk transfer.
@retval EFI_SUCCESS The bulk transfer was completed successfully.
@retval EFI_OUT_OF_RESOURCES The bulk transfer could not be completed due to a lack of resources.
@retval EFI_INVALID_PARAMETER Some parameters are invalid.
@retval EFI_TIMEOUT The bulk transfer failed due to timeout.
@retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_HC_PROTOCOL_BULK_TRANSFER) (
IN EFI_USB_HC_PROTOCOL *This,
IN UINT8 DeviceAddress,
IN UINT8 EndPointAddress,
IN UINT8 MaximumPacketLength,
IN OUT VOID *Data,
IN OUT UINTN *DataLength,
IN OUT UINT8 *DataToggle,
IN UINTN TimeOut,
OUT UINT32 *TransferResult
);
/**
Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.
@param This A pointer to the EFI_USB_HC_PROTOCOL instance.
@param DeviceAddress Represents the address of the target device on the USB, which is
assigned during USB enumeration.
@param EndPointAddress The combination of an endpoint number and an endpoint
direction of the target USB device.
@param IsSlowDevice Indicates whether the target device is slow device or full-speed
device.
@param MaximumPacketLength Indicates the maximum packet size that the default control
transfer endpoint is capable of sending or receiving.
@param IsNewTransfer If TRUE, an asynchronous interrupt pipe is built between the host
and the target interrupt endpoint. If FALSE, the specified
@param DataToggle A pointer to the data toggle value.
@param PollingInterval Indicates the interval, in milliseconds, that the asynchronous
interrupt transfer is polled. asynchronous interrupt pipe is canceled.
@param DataLength Indicates the length of data to be received at the rate specified by
PollingInterval from the target asynchronous interrupt
endpoint.
@param CallBackFunction The Callback function.
@param Context The context that is passed to the CallBackFunction.
@retval EFI_SUCCESS The asynchronous interrupt transfer request has been successfully
submitted or canceled.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
@retval EFI_INVALID_PARAMETER Some parameters are invalid.
@retval EFI_TIMEOUT The bulk transfer failed due to timeout.
@retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER) (
IN EFI_USB_HC_PROTOCOL *This,
IN UINT8 DeviceAddress,
IN UINT8 EndPointAddress,
IN BOOLEAN IsSlowDevice,
IN UINT8 MaxiumPacketLength,
IN BOOLEAN IsNewTransfer,
IN OUT UINT8 *DataToggle,
IN UINTN PollingInterval OPTIONAL,
IN UINTN DataLength OPTIONAL,
IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL,
IN VOID *Context OPTIONAL
);
/**
Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.
@param This A pointer to the EFI_USB_HC_PROTOCOL instance.
@param DeviceAddress Represents the address of the target device on the USB, which is
assigned during USB enumeration.
@param EndPointAddress The combination of an endpoint number and an endpoint
direction of the target USB device.
@param IsSlowDevice Indicates whether the target device is slow device or full-speed
device.
@param MaximumPacketLength Indicates the maximum packet size that the default control
transfer endpoint is capable of sending or receiving.
@param Data A pointer to the buffer of data that will be transmitted to USB
device or received from USB device. asynchronous interrupt pipe is canceled.
@param DataLength On input, the size, in bytes, of the data buffer specified by Data.
On output, the number of bytes transferred.
@param DataToggle A pointer to the data toggle value.
@param TimeOut Indicates the maximum time, in milliseconds, which the transfer
is allowed to complete.
@param TransferResult A pointer to the detailed result information from the synchronous
interrupt transfer.
@retval EFI_SUCCESS The synchronous interrupt transfer was completed successfully.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
@retval EFI_INVALID_PARAMETER Some parameters are invalid.
@retval EFI_TIMEOUT The synchronous interrupt transfer failed due to timeout.
@retval EFI_DEVICE_ERROR The synchronous interrupt transfer failed due to host controller or device error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER) (
IN EFI_USB_HC_PROTOCOL *This,
IN UINT8 DeviceAddress,
IN UINT8 EndPointAddress,
IN BOOLEAN IsSlowDevice,
IN UINT8 MaximumPacketLength,
IN OUT VOID *Data,
IN OUT UINTN *DataLength,
IN OUT UINT8 *DataToggle,
IN UINTN TimeOut,
OUT UINT32 *TransferResult
);
/**
Submits isochronous transfer to an isochronous endpoint of a USB device.
@param This A pointer to the EFI_USB_HC_PROTOCOL instance.
@param DeviceAddress Represents the address of the target device on the USB, which is
assigned during USB enumeration.
@param EndPointAddress The combination of an endpoint number and an endpoint
direction of the target USB device.
@param MaximumPacketLength Indicates the maximum packet size that the default control
transfer endpoint is capable of sending or receiving.
@param Data A pointer to the buffer of data that will be transmitted to USB
device or received from USB device. asynchronous interrupt pipe is canceled.
@param DataLength Specifies the length, in bytes, of the data to be sent to or received
from the USB device.
@param TransferResult A pointer to the detailed result information from the isochronous
transfer.
@retval EFI_SUCCESS The isochronous transfer was completed successfully.
@retval EFI_OUT_OF_RESOURCES The isochronous could not be completed due to a lack of resources.
@retval EFI_INVALID_PARAMETER Some parameters are invalid.
@retval EFI_TIMEOUT The isochronous transfer failed due to timeout.
@retval EFI_DEVICE_ERROR The isochronous transfer failed due to host controller or device error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_HC_PROTOCOL_ISOCHRONOUS_TRANSFER) (
IN EFI_USB_HC_PROTOCOL *This,
IN UINT8 DeviceAddress,
IN UINT8 EndPointAddress,
IN UINT8 MaximumPacketLength,
IN OUT VOID *Data,
IN UINTN DataLength,
OUT UINT32 *TransferResult
);
/**
Submits nonblocking isochronous transfer to an isochronous endpoint of a USB device.
@param This A pointer to the EFI_USB_HC_PROTOCOL instance.
@param DeviceAddress Represents the address of the target device on the USB, which is
assigned during USB enumeration.
@param EndPointAddress The combination of an endpoint number and an endpoint
direction of the target USB device.
@param MaximumPacketLength Indicates the maximum packet size that the default control
transfer endpoint is capable of sending or receiving.
@param Data A pointer to the buffer of data that will be transmitted to USB
device or received from USB device. asynchronous interrupt pipe is canceled.
@param DataLength Specifies the length, in bytes, of the data to be sent to or received
from the USB device.
@param IsochronousCallback The Callback function.
@param Context Data passed to the IsochronousCallback function. This is
an optional parameter and may be NULL.
@retval EFI_SUCCESS The asynchronous isochronous transfer was completed successfully.
@retval EFI_OUT_OF_RESOURCES The asynchronous isochronous could not be completed due to a lack of resources.
@retval EFI_INVALID_PARAMETER Some parameters are invalid.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER) (
IN EFI_USB_HC_PROTOCOL *This,
IN UINT8 DeviceAddress,
IN UINT8 EndPointAddress,
IN UINT8 MaximumPacketLength,
IN OUT VOID *Data,
IN UINTN DataLength,
IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,
IN VOID *Context OPTIONAL
);
/**
Retrieves the number of root hub ports.
@param This A pointer to the EFI_USB_HC_PROTOCOL instance.
@param PortNumber A pointer to the number of the root hub ports.
@retval EFI_SUCCESS The port number was retrieved successfully.
@retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the port number.
@retval EFI_INVALID_PARAMETER PortNumber is NULL.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_NUMBER) (
IN EFI_USB_HC_PROTOCOL *This,
OUT UINT8 *PortNumber
);
/**
Retrieves the current status of a USB root hub port.
@param This A pointer to the EFI_USB_HC_PROTOCOL instance.
@param PortNumber Specifies the root hub port from which the status is to be retrieved.
This value is zero based.
@param PortStatus A pointer to the current port status bits and port status change bits.
@retval EFI_SUCCESS The status of the USB root hub port specified by PortNumber
was returned in PortStatus.
@retval EFI_INVALID_PARAMETER PortNumber is invalid.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS) (
IN EFI_USB_HC_PROTOCOL *This,
IN UINT8 PortNumber,
OUT EFI_USB_PORT_STATUS *PortStatus
);
/**
Sets a feature for the specified root hub port.
@param This A pointer to the EFI_USB_HC_PROTOCOL instance.
@param PortNumber Specifies the root hub port from which the status is to be retrieved.
This value is zero based.
@param PortFeature Indicates the feature selector associated with the feature set
request.
@retval EFI_SUCCESS The feature specified by PortFeature was set for the USB
root hub port specified by PortNumber.
@retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE) (
IN EFI_USB_HC_PROTOCOL *This,
IN UINT8 PortNumber,
IN EFI_USB_PORT_FEATURE PortFeature
);
/**
Clears a feature for the specified root hub port.
@param This A pointer to the EFI_USB_HC_PROTOCOL instance.
@param PortNumber Specifies the root hub port from which the status is to be cleared.
This value is zero based.
@param PortFeature Indicates the feature selector associated with the feature clear
request.
@retval EFI_SUCCESS The feature specified by PortFeature was cleared for the USB
root hub port specified by PortNumber.
@retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE) (
IN EFI_USB_HC_PROTOCOL *This,
IN UINT8 PortNumber,
IN EFI_USB_PORT_FEATURE PortFeature
);
struct _EFI_USB_HC_PROTOCOL {
EFI_USB_HC_PROTOCOL_RESET Reset;
EFI_USB_HC_PROTOCOL_GET_STATE GetState;
EFI_USB_HC_PROTOCOL_SET_STATE SetState;
EFI_USB_HC_PROTOCOL_CONTROL_TRANSFER ControlTransfer;
EFI_USB_HC_PROTOCOL_BULK_TRANSFER BulkTransfer;
EFI_USB_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER AsyncInterruptTransfer;
EFI_USB_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER SyncInterruptTransfer;
EFI_USB_HC_PROTOCOL_ISOCHRONOUS_TRANSFER IsochronousTransfer;
EFI_USB_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer;
EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_NUMBER GetRootHubPortNumber;
EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus;
EFI_USB_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature;
EFI_USB_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE ClearRootHubPortFeature;
UINT16 MajorRevision;
UINT16 MinorRevision;
};
extern EFI_GUID gEfiUsbHcProtocolGuid;
#endif

View File

@ -0,0 +1,418 @@
/** @file
EFI Usb I/O Protocol
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: UsbIo.h
**/
#ifndef __USB_IO_H__
#define __USB_IO_H__
//
// Global ID for the USB I/O Protocol
//
#define EFI_USB_IO_PROTOCOL_GUID \
{ \
0x2B2F68D6, 0x0CD2, 0x44cf, {0x8E, 0x8B, 0xBB, 0xA2, 0x0B, 0x1B, 0x5B, 0x75 } \
}
typedef struct _EFI_USB_IO_PROTOCOL EFI_USB_IO_PROTOCOL;
/**
Async USB transfer callback routine.
@param Data Data received or sent via the USB Asynchronous Transfer, if the
transfer completed successfully.
@param DataLength The length of Data received or sent via the Asynchronous
Transfer, if transfer successfully completes.
@param Context Data passed from UsbAsyncInterruptTransfer() request.
@param Status Indicates the result of the asynchronous transfer.
@retval EFI_SUCCESS The asynchronous USB transfer request has been successfully executed.
@retval EFI_DEVICE_ERROR The asynchronous USB transfer request failed.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_ASYNC_USB_TRANSFER_CALLBACK) (
IN VOID *Data,
IN UINTN DataLength,
IN VOID *Context,
IN UINT32 Status
);
//
// Prototype for EFI USB I/O protocol
//
/**
This function is used to manage a USB device with a control transfer pipe. A control transfer is
typically used to perform device initialization and configuration.
@param This A pointer to the EFI_USB_IO_PROTOCOL instance.
@param Request A pointer to the USB device request that will be sent to the USB
device.
@param Direction Indicates the data direction.
@param Data A pointer to the buffer of data that will be transmitted to USB
device or received from USB device.
@param Timeout Indicating the transfer should be completed within this time frame.
The units are in milliseconds.
@param DataLength The size, in bytes, of the data buffer specified by Data.
@param Status A pointer to the result of the USB transfer.
@retval EFI_SUCCESS The control transfer has been successfully executed.
@retval EFI_DEVICE_ERROR The transfer failed. The transfer status is returned in Status.
@retval EFI_INVALID_PARAMETE One or more parameters are invalid.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
@retval EFI_TIMEOUT The control transfer fails due to timeout.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_IO_CONTROL_TRANSFER) (
IN EFI_USB_IO_PROTOCOL *This,
IN EFI_USB_DEVICE_REQUEST *Request,
IN EFI_USB_DATA_DIRECTION Direction,
IN UINT32 Timeout,
IN OUT VOID *Data OPTIONAL,
IN UINTN DataLength OPTIONAL,
OUT UINT32 *Status
);
/**
This function is used to manage a USB device with the bulk transfer pipe. Bulk Transfers are
typically used to transfer large amounts of data to/from USB devices.
@param This A pointer to the EFI_USB_IO_PROTOCOL instance.
@param DeviceEndpoint A pointer to the USB device request that will be sent to the USB
device.
@param Data A pointer to the buffer of data that will be transmitted to USB
device or received from USB device.
@param DataLength The size, in bytes, of the data buffer specified by Data.
@param Timeout Indicating the transfer should be completed within this time frame.
The units are in milliseconds.
@param Status This parameter indicates the USB transfer status.
@retval EFI_SUCCESS The bulk transfer has been successfully executed.
@retval EFI_DEVICE_ERROR The transfer failed. The transfer status is returned in Status.
@retval EFI_INVALID_PARAMETE One or more parameters are invalid.
@retval EFI_OUT_OF_RESOURCES The request could not be submitted due to a lack of resources.
@retval EFI_TIMEOUT The control transfer fails due to timeout.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_IO_BULK_TRANSFER) (
IN EFI_USB_IO_PROTOCOL *This,
IN UINT8 DeviceEndpoint,
IN OUT VOID *Data,
IN OUT UINTN *DataLength,
IN UINTN Timeout,
OUT UINT32 *Status
);
/**
This function is used to manage a USB device with an interrupt transfer pipe. An Asynchronous
Interrupt Transfer is typically used to query a device<63><65>s status at a fixed rate. For example,
keyboard, mouse, and hub devices use this type of transfer to query their interrupt endpoints at
a fixed rate.
@param This A pointer to the EFI_USB_IO_PROTOCOL instance.
@param DeviceEndpoint A pointer to the USB device request that will be sent to the USB
device.
@param IsNewTransfer If TRUE, a new transfer will be submitted to USB controller. If
FALSE, the interrupt transfer is deleted from the device<63><65>s interrupt
transfer queue.
@param PollingInterval Indicates the periodic rate, in milliseconds, that the transfer is to be
executed.
@param DataLength Specifies the length, in bytes, of the data to be received from the
USB device.
@param Context Data passed to the InterruptCallback function.
@param InterruptCallback The Callback function. This function is called if the asynchronous
interrupt transfer is completed.
@retval EFI_SUCCESS The asynchronous USB transfer request transfer has been successfully executed.
@retval EFI_DEVICE_ERROR The asynchronous USB transfer request failed.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_IO_ASYNC_INTERRUPT_TRANSFER) (
IN EFI_USB_IO_PROTOCOL *This,
IN UINT8 DeviceEndpoint,
IN BOOLEAN IsNewTransfer,
IN UINTN PollingInterval OPTIONAL,
IN UINTN DataLength OPTIONAL,
IN EFI_ASYNC_USB_TRANSFER_CALLBACK InterruptCallBack OPTIONAL,
IN VOID *Context OPTIONAL
);
/**
This function is used to manage a USB device with an interrupt transfer pipe.
@param This A pointer to the EFI_USB_IO_PROTOCOL instance.
@param DeviceEndpoint A pointer to the USB device request that will be sent to the USB
device.
@param Data A pointer to the buffer of data that will be transmitted to USB
device or received from USB device.
@param DataLength On input, then size, in bytes, of the buffer Data. On output, the
amount of data actually transferred.
@param Timeout The time out, in seconds, for this transfer.
@param Status This parameter indicates the USB transfer status.
@retval EFI_SUCCESS The sync interrupt transfer has been successfully executed.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_DEVICE_ERROR The sync interrupt transfer request failed.
@retval EFI_OUT_OF_RESOURCES The request could not be submitted due to a lack of resources.
@retval EFI_TIMEOUT The transfer fails due to timeout.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_IO_SYNC_INTERRUPT_TRANSFER) (
IN EFI_USB_IO_PROTOCOL *This,
IN UINT8 DeviceEndpoint,
IN OUT VOID *Data,
IN OUT UINTN *DataLength,
IN UINTN Timeout,
OUT UINT32 *Status
);
/**
This function is used to manage a USB device with an isochronous transfer pipe. An Isochronous
transfer is typically used to transfer streaming data.
@param This A pointer to the EFI_USB_IO_PROTOCOL instance.
@param DeviceEndpoint A pointer to the USB device request that will be sent to the USB
device.
@param Data A pointer to the buffer of data that will be transmitted to USB
device or received from USB device.
@param DataLength The size, in bytes, of the data buffer specified by Data.
@param Status This parameter indicates the USB transfer status.
@retval EFI_SUCCESS The isochronous transfer has been successfully executed.
@retval EFI_INVALID_PARAMETER The parameter DeviceEndpoint is not valid.
@retval EFI_DEVICE_ERROR The transfer failed due to the reason other than timeout, The error status
is returned in Status.
@retval EFI_OUT_OF_RESOURCES The request could not be submitted due to a lack of resources.
@retval EFI_TIMEOUT The transfer fails due to timeout.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_IO_ISOCHRONOUS_TRANSFER) (
IN EFI_USB_IO_PROTOCOL *This,
IN UINT8 DeviceEndpoint,
IN OUT VOID *Data,
IN UINTN DataLength,
OUT UINT32 *Status
);
/**
This function is used to manage a USB device with an isochronous transfer pipe. An Isochronous
transfer is typically used to transfer streaming data.
@param This A pointer to the EFI_USB_IO_PROTOCOL instance.
@param DeviceEndpoint A pointer to the USB device request that will be sent to the USB
device.
@param Data A pointer to the buffer of data that will be transmitted to USB
device or received from USB device.
@param DataLength The size, in bytes, of the data buffer specified by Data.
@param Context Data passed to the IsochronousCallback() function.
@param IsochronousCallback The IsochronousCallback() function.
@retval EFI_SUCCESS The asynchronous isochronous transfer has been successfully submitted
to the system.
@retval EFI_INVALID_PARAMETER The parameter DeviceEndpoint is not valid.
@retval EFI_OUT_OF_RESOURCES The request could not be submitted due to a lack of resources.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_IO_ASYNC_ISOCHRONOUS_TRANSFER) (
IN EFI_USB_IO_PROTOCOL *This,
IN UINT8 DeviceEndpoint,
IN OUT VOID *Data,
IN UINTN DataLength,
IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,
IN VOID *Context OPTIONAL
);
/**
Resets and reconfigures the USB controller. This function will work for all USB devices except
USB Hub Controllers.
@param This A pointer to the EFI_USB_IO_PROTOCOL instance.
@retval EFI_SUCCESS The USB controller was reset.
@retval EFI_INVALID_PARAMETER If the controller specified by This is a USB hub.
@retval EFI_DEVICE_ERROR An error occurred during the reconfiguration process.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_IO_PORT_RESET) (
IN EFI_USB_IO_PROTOCOL *This
);
/**
Retrieves the USB Device Descriptor.
@param This A pointer to the EFI_USB_IO_PROTOCOL instance.
@param DeviceDescriptor A pointer to the caller allocated USB Device Descriptor.
@retval EFI_SUCCESS The device descriptor was retrieved successfully.
@retval EFI_INVALID_PARAMETER DeviceDescriptor is NULL.
@retval EFI_NOT_FOUND The device descriptor was not found. The device may not be configured.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_IO_GET_DEVICE_DESCRIPTOR) (
IN EFI_USB_IO_PROTOCOL *This,
OUT EFI_USB_DEVICE_DESCRIPTOR *DeviceDescriptor
);
/**
Retrieves the USB Device Descriptor.
@param This A pointer to the EFI_USB_IO_PROTOCOL instance.
@param ConfigurationDescriptor A pointer to the caller allocated USB Active Configuration
Descriptor.
@retval EFI_SUCCESS The active configuration descriptor was retrieved successfully.
@retval EFI_INVALID_PARAMETER ConfigurationDescriptor is NULL.
@retval EFI_NOT_FOUND An active configuration descriptor cannot be found. The device may not
be configured.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_IO_GET_CONFIG_DESCRIPTOR) (
IN EFI_USB_IO_PROTOCOL *This,
OUT EFI_USB_CONFIG_DESCRIPTOR *ConfigurationDescriptor
);
/**
Retrieves the Interface Descriptor for a USB Device Controller. As stated earlier, an interface
within a USB device is equivalently to a USB Controller within the current configuration.
@param This A pointer to the EFI_USB_IO_PROTOCOL instance.
@param InterfaceDescriptor A pointer to the caller allocated USB Interface Descriptor within
the configuration setting.
@retval EFI_SUCCESS The interface descriptor retrieved successfully.
@retval EFI_INVALID_PARAMETER InterfaceDescriptor is NULL.
@retval EFI_NOT_FOUND The interface descriptor cannot be found. The device may not be
correctly configured.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_IO_GET_INTERFACE_DESCRIPTOR) (
IN EFI_USB_IO_PROTOCOL *This,
OUT EFI_USB_INTERFACE_DESCRIPTOR *InterfaceDescriptor
);
/**
Retrieves an Endpoint Descriptor within a USB Controller.
@param This A pointer to the EFI_USB_IO_PROTOCOL instance.
@param EndpointIndex Indicates which endpoint descriptor to retrieve.
@param EndpointDescriptor A pointer to the caller allocated USB Endpoint Descriptor of
a USB controller.
@retval EFI_SUCCESS The endpoint descriptor was retrieved successfully.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_NOT_FOUND The endpoint descriptor cannot be found. The device may not be
correctly configured.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_IO_GET_ENDPOINT_DESCRIPTOR) (
IN EFI_USB_IO_PROTOCOL *This,
IN UINT8 EndpointIndex,
OUT EFI_USB_ENDPOINT_DESCRIPTOR *EndpointDescriptor
);
/**
Retrieves a Unicode string stored in a USB Device.
@param This A pointer to the EFI_USB_IO_PROTOCOL instance.
@param LangID The Language ID for the string being retrieved.
@param StringID The ID of the string being retrieved.
@param String A pointer to a buffer allocated by this function with
AllocatePool() to store the string.
@retval EFI_SUCCESS The string was retrieved successfully.
@retval EFI_NOT_FOUND The string specified by LangID and StringID was not found.
@retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate the return buffer String.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_IO_GET_STRING_DESCRIPTOR) (
IN EFI_USB_IO_PROTOCOL *This,
IN UINT16 LangID,
IN UINT8 StringID,
OUT CHAR16 **String
);
/**
Retrieves all the language ID codes that the USB device supports.
@param This A pointer to the EFI_USB_IO_PROTOCOL instance.
@param LangIDTable Language ID for the string the caller wants to get.
@param TableSize The size, in bytes, of the table LangIDTable.
@retval EFI_SUCCESS The support languages were retrieved successfully.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_USB_IO_GET_SUPPORTED_LANGUAGE) (
IN EFI_USB_IO_PROTOCOL *This,
OUT UINT16 **LangIDTable,
OUT UINT16 *TableSize
);
//
// Protocol Interface Structure
//
struct _EFI_USB_IO_PROTOCOL {
//
// IO transfer
//
EFI_USB_IO_CONTROL_TRANSFER UsbControlTransfer;
EFI_USB_IO_BULK_TRANSFER UsbBulkTransfer;
EFI_USB_IO_ASYNC_INTERRUPT_TRANSFER UsbAsyncInterruptTransfer;
EFI_USB_IO_SYNC_INTERRUPT_TRANSFER UsbSyncInterruptTransfer;
EFI_USB_IO_ISOCHRONOUS_TRANSFER UsbIsochronousTransfer;
EFI_USB_IO_ASYNC_ISOCHRONOUS_TRANSFER UsbAsyncIsochronousTransfer;
//
// Common device request
//
EFI_USB_IO_GET_DEVICE_DESCRIPTOR UsbGetDeviceDescriptor;
EFI_USB_IO_GET_CONFIG_DESCRIPTOR UsbGetConfigDescriptor;
EFI_USB_IO_GET_INTERFACE_DESCRIPTOR UsbGetInterfaceDescriptor;
EFI_USB_IO_GET_ENDPOINT_DESCRIPTOR UsbGetEndpointDescriptor;
EFI_USB_IO_GET_STRING_DESCRIPTOR UsbGetStringDescriptor;
EFI_USB_IO_GET_SUPPORTED_LANGUAGE UsbGetSupportedLanguages;
//
// Reset controller's parent port
//
EFI_USB_IO_PORT_RESET UsbPortReset;
};
extern EFI_GUID gEfiUsbIoProtocolGuid;
#endif