MdePkg/Include/Protocol/Kms.h File Reference


Data Structures

struct  EFI_KMS_CLIENT_INFO
struct  EFI_KMS_KEY_DESCRIPTOR
struct  EFI_KMS_DYNAMIC_FIELD
struct  EFI_KMS_DYNAMIC_ATTRIBUTE
struct  EFI_KMS_KEY_ATTRIBUTE
struct  _EFI_KMS_PROTOCOL

Defines

#define EFI_KMS_PROTOCOL_GUID
#define EFI_KMS_DATA_TYPE_NONE   0
#define EFI_KMS_DATA_TYPE_BINARY   1
#define EFI_KMS_DATA_TYPE_ASCII   2
#define EFI_KMS_DATA_TYPE_UNICODE   4
#define EFI_KMS_DATA_TYPE_UTF8   8
#define EFI_KMS_ATTRIBUTE_TYPE_NONE   0x00
#define EFI_KMS_ATTRIBUTE_TYPE_INTEGER   0x01
#define EFI_KMS_ATTRIBUTE_TYPE_LONG_INTEGER   0x02
#define EFI_KMS_ATTRIBUTE_TYPE_BIG_INTEGER   0x03
#define EFI_KMS_ATTRIBUTE_TYPE_ENUMERATION   0x04
#define EFI_KMS_ATTRIBUTE_TYPE_BOOLEAN   0x05
#define EFI_KMS_ATTRIBUTE_TYPE_BYTE_STRING   0x06
#define EFI_KMS_ATTRIBUTE_TYPE_TEXT_STRING   0x07
#define EFI_KMS_ATTRIBUTE_TYPE_DATE_TIME   0x08
#define EFI_KMS_ATTRIBUTE_TYPE_INTERVAL   0x09
#define EFI_KMS_ATTRIBUTE_TYPE_STRUCTURE   0x0A
#define EFI_KMS_ATTRIBUTE_TYPE_DYNAMIC   0x0B
#define EFI_KMS_FORMAT_GENERIC_128_GUID
#define EFI_KMS_FORMAT_GENERIC_160_GUID
#define EFI_KMS_FORMAT_GENERIC_256_GUID
#define EFI_KMS_FORMAT_GENERIC_512_GUID
#define EFI_KMS_FORMAT_GENERIC_1024_GUID
#define EFI_KMS_FORMAT_GENERIC_2048_GUID
#define EFI_KMS_FORMAT_GENERIC_3072_GUID
#define EFI_KMS_FORMAT_MD2_128_GUID
#define EFI_KMS_FORMAT_MDC2_128_GUID
#define EFI_KMS_FORMAT_MD4_128_GUID
#define EFI_KMS_FORMAT_MDC4_128_GUID
#define EFI_KMS_FORMAT_MD5_128_GUID
#define EFI_KMS_FORMAT_MD5SHA_128_GUID
#define EFI_KMS_FORMAT_SHA1_160_GUID
#define EFI_KMS_FORMAT_SHA256_256_GUID
#define EFI_KMS_FORMAT_SHA512_512_GUID
#define EFI_KMS_FORMAT_AESXTS_128_GUID
#define EFI_KMS_FORMAT_AESXTS_256_GUID
#define EFI_KMS_FORMAT_AESCBC_128_GUID
#define EFI_KMS_FORMAT_AESCBC_256_GUID
#define EFI_KMS_FORMAT_RSASHA1_1024_GUID
#define EFI_KMS_FORMAT_RSASHA1_2048_GUID
#define EFI_KMS_FORMAT_RSASHA256_2048_GUID
#define EFI_KMS_FORMAT_RSASHA256_3072_GUID

Typedefs

typedef struct _EFI_KMS_PROTOCOL EFI_KMS_PROTOCOL
typedef IN EFI_KMS_CLIENT_INFOClient
typedef IN EFI_KMS_CLIENT_INFO
IN OUT UINTN * 
ClientDataSize
typedef IN EFI_KMS_CLIENT_INFO
IN OUT UINTN IN OUT VOID ** 
ClientData
typedef IN EFI_KMS_CLIENT_INFO
IN OUT UINT16
KeyDescriptorCount
typedef IN EFI_KMS_CLIENT_INFO
IN OUT UINT16 IN OUT
EFI_KMS_KEY_DESCRIPTOR
KeyDescriptors
typedef IN EFI_KMS_CLIENT_INFO
IN UINT8
KeyIdentifierSize
typedef IN EFI_KMS_CLIENT_INFO
IN UINT8 IN CONST VOID * 
KeyIdentifier
typedef IN EFI_KMS_CLIENT_INFO
IN UINT8 IN CONST VOID IN OUT
UINT16
KeyAttributesCount
typedef IN EFI_KMS_CLIENT_INFO
IN UINT8 IN CONST VOID IN OUT
UINT16 IN OUT
EFI_KMS_KEY_ATTRIBUTE
KeyAttributes
typedef IN EFI_KMS_CLIENT_INFO
IN OUT UINTN * 
KeyAttributeCount

Functions

typedef EFI_STATUS (EFIAPI *EFI_KMS_GET_SERVICE_STATUS)(IN EFI_KMS_PROTOCOL *This)

Variables

EFI_GUID gEfiKmsFormatGeneric128Guid
EFI_GUID gEfiKmsFormatGeneric160Guid
EFI_GUID gEfiKmsFormatGeneric256Guid
EFI_GUID gEfiKmsFormatGeneric512Guid
EFI_GUID gEfiKmsFormatGeneric1024Guid
EFI_GUID gEfiKmsFormatGeneric2048Guid
EFI_GUID gEfiKmsFormatGeneric3072Guid
EFI_GUID gEfiKmsFormatMd2128Guid
EFI_GUID gEfiKmsFormatMdc2128Guid
EFI_GUID gEfiKmsFormatMd4128Guid
EFI_GUID gEfiKmsFormatMdc4128Guid
EFI_GUID gEfiKmsFormatMd5128Guid
EFI_GUID gEfiKmsFormatMd5sha128Guid
EFI_GUID gEfiKmsFormatSha1160Guid
EFI_GUID gEfiKmsFormatSha256256Guid
EFI_GUID gEfiKmsFormatSha512512Guid
EFI_GUID gEfiKmsFormatAesxts128Guid
EFI_GUID gEfiKmsFormatAesxts256Guid
EFI_GUID gEfiKmsFormatAescbc128Guid
EFI_GUID gEfiKmsFormatAescbc256Guid
EFI_GUID gEfiKmsFormatRsasha11024Guid
EFI_GUID gEfiKmsFormatRsasha12048Guid
EFI_GUID gEfiKmsFormatRsasha2562048Guid
EFI_GUID gEfiKmsFormatRsasha2563072Guid
EFI_GUID gEfiKmsProtocolGuid

Detailed Description

The Key Management Service (KMS) protocol as defined in the UEFI 2.3.1 specification is to provides services to generate, store, retrieve, and manage cryptographic keys. The intention is to specify a simple generic protocol that could be used for many implementations.

A driver implementing the protocol may need to provide basic key service that consists of a key store and cryptographic key generation capability. It may connect to an external key server over the network, or to a Hardware Security Module (HSM) attached to the system it runs on, or anything else that is capable of providing the key management service.

Copyright (c) 2011, 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 that 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.


Define Documentation

#define EFI_KMS_ATTRIBUTE_TYPE_BIG_INTEGER   0x03

#define EFI_KMS_ATTRIBUTE_TYPE_BOOLEAN   0x05

#define EFI_KMS_ATTRIBUTE_TYPE_BYTE_STRING   0x06

#define EFI_KMS_ATTRIBUTE_TYPE_DATE_TIME   0x08

#define EFI_KMS_ATTRIBUTE_TYPE_DYNAMIC   0x0B

#define EFI_KMS_ATTRIBUTE_TYPE_ENUMERATION   0x04

#define EFI_KMS_ATTRIBUTE_TYPE_INTEGER   0x01

#define EFI_KMS_ATTRIBUTE_TYPE_INTERVAL   0x09

#define EFI_KMS_ATTRIBUTE_TYPE_LONG_INTEGER   0x02

#define EFI_KMS_ATTRIBUTE_TYPE_NONE   0x00

#define EFI_KMS_ATTRIBUTE_TYPE_STRUCTURE   0x0A

#define EFI_KMS_ATTRIBUTE_TYPE_TEXT_STRING   0x07

#define EFI_KMS_DATA_TYPE_ASCII   2

#define EFI_KMS_DATA_TYPE_BINARY   1

#define EFI_KMS_DATA_TYPE_NONE   0

#define EFI_KMS_DATA_TYPE_UNICODE   4

#define EFI_KMS_DATA_TYPE_UTF8   8

#define EFI_KMS_FORMAT_AESCBC_128_GUID

Value:

{ \
    0xa0e8ee6a, 0x0e92, 0x44d4, {0x86, 0x1b, 0x0e, 0xaa, 0x4a, 0xca, 0x44, 0xa2 } \
  }
These GUIDs define key data formats that contain data generated by cryptographic key algorithms. There may or may not be a separate data hashing algorithm associated with the key algorithm.

#define EFI_KMS_FORMAT_AESCBC_256_GUID

Value:

{ \
    0xd7e69789, 0x1f68, 0x45e8, {0x96, 0xef, 0x3b, 0x64, 0x07, 0xa5, 0xb2, 0xdc } \
  }
These GUIDs define key data formats that contain data generated by cryptographic key algorithms. There may or may not be a separate data hashing algorithm associated with the key algorithm.

#define EFI_KMS_FORMAT_AESXTS_128_GUID

Value:

{ \
    0x4776e33f, 0xdb47, 0x479a, {0xa2, 0x5f, 0xa1, 0xcd, 0x0a, 0xfa, 0xb3, 0x8b } \
  }
These GUIDs define key data formats that contain data generated by cryptographic key algorithms. There may or may not be a separate data hashing algorithm associated with the key algorithm.

#define EFI_KMS_FORMAT_AESXTS_256_GUID

Value:

{ \
    0xdc7e8613, 0xc4bb, 0x4db0, {0x84, 0x62, 0x13, 0x51, 0x13, 0x57, 0xab, 0xe2 } \
  }
These GUIDs define key data formats that contain data generated by cryptographic key algorithms. There may or may not be a separate data hashing algorithm associated with the key algorithm.

#define EFI_KMS_FORMAT_GENERIC_1024_GUID

Value:

{ \
    0x43be0b44, 0x874b, 0x4ead, {0xb0, 0x9c, 0x24, 0x1a, 0x4f, 0xbd, 0x7e, 0xb3 } \
  }
The following GUIDs define formats that contain generic key data of a specific size in bits, but which is not associated with any specific key algorithm(s).

#define EFI_KMS_FORMAT_GENERIC_128_GUID

Value:

{ \
    0xec8a3d69, 0x6ddf, 0x4108, {0x94, 0x76, 0x73, 0x37, 0xfc, 0x52, 0x21, 0x36 } \
  }
The following GUIDs define formats that contain generic key data of a specific size in bits, but which is not associated with any specific key algorithm(s).

#define EFI_KMS_FORMAT_GENERIC_160_GUID

Value:

{ \
    0xa3b3e6f8, 0xefca, 0x4bc1, {0x88, 0xfb, 0xcb, 0x87, 0x33, 0x9b, 0x25, 0x79 } \
  }
The following GUIDs define formats that contain generic key data of a specific size in bits, but which is not associated with any specific key algorithm(s).

#define EFI_KMS_FORMAT_GENERIC_2048_GUID

Value:

{ \
    0x40093f23, 0x630c, 0x4626, {0x9c, 0x48, 0x40, 0x37, 0x3b, 0x19, 0xcb, 0xbe } \
  }
The following GUIDs define formats that contain generic key data of a specific size in bits, but which is not associated with any specific key algorithm(s).

#define EFI_KMS_FORMAT_GENERIC_256_GUID

Value:

{ \
    0x70f64793, 0xc323, 0x4261, {0xac, 0x2c, 0xd8, 0x76, 0xf2, 0x7c, 0x53, 0x45 } \
  }
The following GUIDs define formats that contain generic key data of a specific size in bits, but which is not associated with any specific key algorithm(s).

#define EFI_KMS_FORMAT_GENERIC_3072_GUID

Value:

{ \
    0xb9237513, 0x6c44, 0x4411, {0xa9, 0x90, 0x21, 0xe5, 0x56, 0xe0, 0x5a, 0xde } \
  }
The following GUIDs define formats that contain generic key data of a specific size in bits, but which is not associated with any specific key algorithm(s).

#define EFI_KMS_FORMAT_GENERIC_512_GUID

Value:

{ \
    0x978fe043, 0xd7af, 0x422e, {0x8a, 0x92, 0x2b, 0x48, 0xe4, 0x63, 0xbd, 0xe6 } \
  }
The following GUIDs define formats that contain generic key data of a specific size in bits, but which is not associated with any specific key algorithm(s).

#define EFI_KMS_FORMAT_MD2_128_GUID

Value:

{ \
    0x78be11c4, 0xee44, 0x4a22, {0x9f, 0x05, 0x03, 0x85, 0x2e, 0xc5, 0xc9, 0x78 } \
  }
These GUIDS define key data formats that contain data generated by basic hash algorithms with no cryptographic properties.

#define EFI_KMS_FORMAT_MD4_128_GUID

Value:

{ \
    0xd1c17aa1, 0xcac5, 0x400f, {0xbe, 0x17, 0xe2, 0xa2, 0xae, 0x06, 0x67, 0x7c } \
  }
These GUIDS define key data formats that contain data generated by basic hash algorithms with no cryptographic properties.

#define EFI_KMS_FORMAT_MD5_128_GUID

Value:

{ \
    0xdcbc3662, 0x9cda, 0x4b52, {0xa0, 0x4c, 0x82, 0xeb, 0x1d, 0x23, 0x48, 0xc7 } \
  }
These GUIDS define key data formats that contain data generated by basic hash algorithms with no cryptographic properties.

#define EFI_KMS_FORMAT_MD5SHA_128_GUID

Value:

{ \
    0x1c178237, 0x6897, 0x459e, {0x9d, 0x36, 0x67, 0xce, 0x8e, 0xf9, 0x4f, 0x76 } \
  }
These GUIDS define key data formats that contain data generated by basic hash algorithms with no cryptographic properties.

#define EFI_KMS_FORMAT_MDC2_128_GUID

Value:

{ \
    0xf7ad60f8, 0xefa8, 0x44a3, {0x91, 0x13, 0x23, 0x1f, 0x39, 0x9e, 0xb4, 0xc7 } \
  }
These GUIDS define key data formats that contain data generated by basic hash algorithms with no cryptographic properties.

#define EFI_KMS_FORMAT_MDC4_128_GUID

Value:

{ \
    0x3fa4f847, 0xd8eb, 0x4df4, {0xbd, 0x49, 0x10, 0x3a, 0x0a, 0x84, 0x7b, 0xbc } \
  }
These GUIDS define key data formats that contain data generated by basic hash algorithms with no cryptographic properties.

#define EFI_KMS_FORMAT_RSASHA1_1024_GUID

Value:

{ \
    0x56417bed, 0x6bbe, 0x4882, {0x86, 0xa0, 0x3a, 0xe8, 0xbb, 0x17, 0xf8, 0xf9 } \
  }
These GUIDs define key data formats that contain data generated by cryptographic key algorithms. There may or may not be a separate data hashing algorithm associated with the key algorithm.

#define EFI_KMS_FORMAT_RSASHA1_2048_GUID

Value:

{ \
    0xf66447d4, 0x75a6, 0x463e, {0xa8, 0x19, 0x07, 0x7f, 0x2d, 0xda, 0x05, 0xe9 } \
  }
These GUIDs define key data formats that contain data generated by cryptographic key algorithms. There may or may not be a separate data hashing algorithm associated with the key algorithm.

#define EFI_KMS_FORMAT_RSASHA256_2048_GUID

Value:

{ \
    0xa477af13, 0x877d, 0x4060, {0xba, 0xa1, 0x25, 0xd1, 0xbe, 0xa0, 0x8a, 0xd3 } \
  }
These GUIDs define key data formats that contain data generated by cryptographic key algorithms. There may or may not be a separate data hashing algorithm associated with the key algorithm.

#define EFI_KMS_FORMAT_RSASHA256_3072_GUID

Value:

{ \
    0x4e1356c2,  0xeed, 0x463f, {0x81, 0x47, 0x99, 0x33, 0xab, 0xdb, 0xc7, 0xd5 } \
  }
These GUIDs define key data formats that contain data generated by cryptographic key algorithms. There may or may not be a separate data hashing algorithm associated with the key algorithm.

#define EFI_KMS_FORMAT_SHA1_160_GUID

Value:

{ \
    0x453c5e5a, 0x482d, 0x43f0, {0x87, 0xc9, 0x59, 0x41, 0xf3, 0xa3, 0x8a, 0xc2 } \
  }
These GUIDS define key data formats that contain data generated by basic hash algorithms with no cryptographic properties.

#define EFI_KMS_FORMAT_SHA256_256_GUID

Value:

{ \
    0x6bb4f5cd, 0x8022, 0x448d, {0xbc, 0x6d, 0x77, 0x1b, 0xae, 0x93, 0x5f, 0xc6 } \
  }
These GUIDS define key data formats that contain data generated by basic hash algorithms with no cryptographic properties.

#define EFI_KMS_FORMAT_SHA512_512_GUID

Value:

{ \
    0x2f240e12, 0xe14d, 0x475c, {0x83, 0xb0, 0xef, 0xff, 0x22, 0xd7, 0x7b, 0xe7 } \
  }
These GUIDS define key data formats that contain data generated by basic hash algorithms with no cryptographic properties.

#define EFI_KMS_PROTOCOL_GUID

Value:

{ \
    0xEC3A978D, 0x7C4E, 0x48FA, {0x9A, 0xBE, 0x6A, 0xD9, 0x1C, 0xC8, 0xF8, 0x11 } \
  }


Typedef Documentation

typedef IN EFI_KMS_CLIENT_INFO IN OUT UINTN IN OUT EFI_KMS_KEY_ATTRIBUTE IN OUT UINTN IN OUT EFI_KMS_KEY_DESCRIPTOR IN OUT UINTN IN OUT VOID ** ClientData

typedef IN EFI_KMS_CLIENT_INFO IN OUT UINTN IN OUT EFI_KMS_KEY_ATTRIBUTE IN OUT UINTN IN OUT EFI_KMS_KEY_DESCRIPTOR IN OUT UINTN * ClientDataSize

typedef IN EFI_KMS_CLIENT_INFO IN OUT UINTN* KeyAttributeCount

typedef IN EFI_KMS_CLIENT_INFO IN OUT UINTN IN OUT EFI_KMS_KEY_ATTRIBUTE * KeyAttributes

typedef IN EFI_KMS_CLIENT_INFO IN UINT8 IN CONST VOID IN OUT UINT16 * KeyAttributesCount

typedef IN EFI_KMS_CLIENT_INFO IN OUT UINTN IN OUT EFI_KMS_KEY_ATTRIBUTE IN OUT UINTN * KeyDescriptorCount

typedef IN EFI_KMS_CLIENT_INFO IN OUT UINTN IN OUT EFI_KMS_KEY_ATTRIBUTE IN OUT UINTN IN OUT EFI_KMS_KEY_DESCRIPTOR * KeyDescriptors

typedef IN EFI_KMS_CLIENT_INFO IN UINT8 IN CONST VOID * KeyIdentifier


Function Documentation

typedef EFI_STATUS ( EFIAPI *  EFI_USBFN_IO_DETECT_PORT  ) 

Get the current status of the key management service.

Parameters:
[in] This Pointer to the EFI_KMS_PROTOCOL instance.
Return values:
EFI_SUCCESS The KMS is ready for use.
EFI_NOT_READY No connection to the KMS is available.
EFI_NO_MAPPING No valid connection configuration exists for the KMS.
EFI_NO_RESPONSE No response was received from the KMS.
EFI_DEVICE_ERROR An error occurred when attempting to access the KMS.
EFI_INVALID_PARAMETER This is NULL.
Register client information with the supported KMS.

Parameters:
[in] This Pointer to the EFI_KMS_PROTOCOL instance.
[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.
[in,out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of data specified by the ClientData parameter. This parameter may be NULL, in which case the ClientData parameter will be ignored and no data will be transferred to or from the KMS. If the parameter is not NULL, then ClientData must be a valid pointer. If the value pointed to is 0, no data will be transferred to the KMS, but data may be returned by the KMS. For all non-zero values *ClientData will be transferred to the KMS, which may also return data to the caller. In all cases, the value upon return to the caller will be the size of the data block returned to the caller, which will be zero if no data is returned from the KMS.
[in,out] ClientData Pointer to a pointer to an arbitrary block of data of ClientDataSize that is to be passed directly to the KMS if it supports the use of client data. This parameter may be NULL if and only if the ClientDataSize parameter is also NULL. Upon return to the caller, *ClientData points to a block of data of ClientDataSize that was returned from the KMS. If the returned value for *ClientDataSize is zero, then the returned value for *ClientData must be NULL and should be ignored by the caller. The KMS protocol consumer is responsible for freeing all valid buffers used for client data regardless of whether they are allocated by the caller for input to the function or by the implementation for output back to the caller.
Return values:
EFI_SUCCESS The client information has been accepted by the KMS.
EFI_NOT_READY No connection to the KMS is available.
EFI_NO_RESPONSE There was no response from the device or the key server.
EFI_ACCESS_DENIED Access was denied by the device or the key server.
EFI_DEVICE_ERROR An error occurred when attempting to access the KMS.
EFI_OUT_OF_RESOURCES Required resources were not available to perform the function.
EFI_INVALID_PARAMETER This is NULL.
EFI_UNSUPPORTED The KMS does not support the use of client identifiers.
Request that the KMS generate one or more new keys and associate them with key identifiers. The key value(s) is returned to the caller.

Parameters:
[in] This Pointer to the EFI_KMS_PROTOCOL instance.
[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.
[in,out] KeyDescriptorCount Pointer to a count of the number of key descriptors to be processed by this operation. On return, this number will be updated with the number of key descriptors successfully processed.
[in,out] KeyDescriptors Pointer to an array of EFI_KMS_KEY_DESCRIPTOR structures which describe the keys to be generated. On input, the KeyIdentifierSize and the KeyIdentifier may specify an identifier to be used for the key, but this is not required. The KeyFormat field must specify a key format GUID reported as supported by the KeyFormats field of the EFI_KMS_PROTOCOL. The value for this field in the first key descriptor will be considered the default value for subsequent key descriptors requested in this operation if those key descriptors have a NULL GUID in the key format field. On output, the KeyIdentifierSize and KeyIdentifier fields will specify an identifier for the key which will be either the original identifier if one was provided, or an identifier generated either by the KMS or the KMS protocol implementation. The KeyFormat field will be updated with the GUID used to generate the key if it was a NULL GUID, and the KeyValue field will contain a pointer to memory containing the key value for the generated key. Memory for both the KeyIdentifier and the KeyValue fields will be allocated with the BOOT_SERVICES_DATA type and must be freed by the caller when it is no longer needed. Also, the KeyStatus field must reflect the result of the request relative to that key.
[in,out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of data specified by the ClientData parameter. This parameter may be NULL, in which case the ClientData parameter will be ignored and no data will be transferred to or from the KMS. If the parameter is not NULL, then ClientData must be a valid pointer. If the value pointed to is 0, no data will be transferred to the KMS, but data may be returned by the KMS. For all non-zero values *ClientData will be transferred to the KMS, which may also return data to the caller. In all cases, the value upon return to the caller will be the size of the data block returned to the caller, which will be zero if no data is returned from the KMS.
[in,out] ClientData Pointer to a pointer to an arbitrary block of data of ClientDataSize that is to be passed directly to the KMS if it supports the use of client data. This parameter may be NULL if and only if the ClientDataSize parameter is also NULL. Upon return to the caller, *ClientData points to a block of data of ClientDataSize that was returned from the KMS. If the returned value for *ClientDataSize is zero, then the returned value for *ClientData must be NULL and should be ignored by the caller. The KMS protocol consumer is responsible for freeing all valid buffers used for client data regardless of whether they are allocated by the caller for input to the function or by the implementation for output back to the caller.
Return values:
EFI_SUCCESS Successfully generated and retrieved all requested keys.
EFI_UNSUPPORTED This function is not supported by the KMS. --OR-- One (or more) of the key requests submitted is not supported by the KMS. Check individual key request(s) to see which ones may have been processed.
EFI_OUT_OF_RESOURCES Required resources were not available to perform the function.
EFI_TIMEOUT Timed out waiting for device or key server. Check individual key request(s) to see which ones may have been processed.
EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a ClientId is required by the server and either no id was provided or an invalid id was provided.
EFI_DEVICE_ERROR An error occurred when attempting to access the KMS. Check individual key request(s) to see which ones may have been processed.
EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL, KeyDescriptorCount is NULL, or Keys is NULL.
EFI_NOT_FOUND One or more EFI_KMS_KEY_DESCRIPTOR structures could not be processed properly. KeyDescriptorCount contains the number of structures which were successfully processed. Individual structures will reflect the status of the processing for that structure.
Retrieve an existing key.

Parameters:
[in] This Pointer to the EFI_KMS_PROTOCOL instance.
[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.
[in,out] KeyDescriptorCount Pointer to a count of the number of key descriptors to be processed by this operation. On return, this number will be updated with the number of key descriptors successfully processed.
[in,out] KeyDescriptors Pointer to an array of EFI_KMS_KEY_DESCRIPTOR structures which describe the keys to be retrieved from the KMS. On input, the KeyIdentifierSize and the KeyIdentifier must specify an identifier to be used to retrieve a specific key. All other fields in the descriptor should be NULL. On output, the KeyIdentifierSize and KeyIdentifier fields will be unchanged, while the KeyFormat and KeyValue fields will be updated values associated with this key identifier. Memory for the KeyValue field will be allocated with the BOOT_SERVICES_DATA type and must be freed by the caller when it is no longer needed. Also, the KeyStatus field will reflect the result of the request relative to the individual key descriptor.
[in,out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of data specified by the ClientData parameter. This parameter may be NULL, in which case the ClientData parameter will be ignored and no data will be transferred to or from the KMS. If the parameter is not NULL, then ClientData must be a valid pointer. If the value pointed to is 0, no data will be transferred to the KMS, but data may be returned by the KMS. For all non-zero values *ClientData will be transferred to the KMS, which may also return data to the caller. In all cases, the value upon return to the caller will be the size of the data block returned to the caller, which will be zero if no data is returned from the KMS.
[in,out] ClientData Pointer to a pointer to an arbitrary block of data of ClientDataSize that is to be passed directly to the KMS if it supports the use of client data. This parameter may be NULL if and only if the ClientDataSize parameter is also NULL. Upon return to the caller, *ClientData points to a block of data of ClientDataSize that was returned from the KMS. If the returned value for *ClientDataSize is zero, then the returned value for *ClientData must be NULL and should be ignored by the caller. The KMS protocol consumer is responsible for freeing all valid buffers used for client data regardless of whether they are allocated by the caller for input to the function or by the implementation for output back to the caller.
Return values:
EFI_SUCCESS Successfully retrieved all requested keys.
EFI_OUT_OF_RESOURCES Could not allocate resources for the method processing.
EFI_TIMEOUT Timed out waiting for device or key server. Check individual key request(s) to see which ones may have been processed.
EFI_BUFFER_TOO_SMALL If multiple keys are associated with a single identifier, and the KeyValue buffer does not contain enough structures (KeyDescriptorCount) to contain all the key data, then the available structures will be filled and KeyDescriptorCount will be updated to indicate the number of keys which could not be processed.
EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a ClientId is required by the server and either none or an invalid id was provided.
EFI_DEVICE_ERROR Device or key server error. Check individual key request(s) to see which ones may have been processed.
EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL, KeyDescriptorCount is NULL, or Keys is NULL.
EFI_NOT_FOUND One or more EFI_KMS_KEY_DESCRIPTOR structures could not be processed properly. KeyDescriptorCount contains the number of structures which were successfully processed. Individual structures will reflect the status of the processing for that structure.
EFI_UNSUPPORTED The implementation/KMS does not support this function.
Add a new key.

Parameters:
[in] This Pointer to the EFI_KMS_PROTOCOL instance.
[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.
[in,out] KeyDescriptorCount Pointer to a count of the number of key descriptors to be processed by this operation. On normal return, this number will be updated with the number of key descriptors successfully processed.
[in,out] KeyDescriptors Pointer to an array of EFI_KMS_KEY_DESCRIPTOR structures which describe the keys to be added. On input, the KeyId field for first key must contain valid identifier data to be used for adding a key to the KMS. The values for these fields in this key definition will be considered default values for subsequent keys requested in this operation. A value of 0 in any subsequent KeyId field will be replaced with the current default value. The KeyFormat and KeyValue fields for each key to be added must contain consistent values to be associated with the given KeyId. On return, the KeyStatus field will reflect the result of the operation for each key request.
[in,out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of data specified by the ClientData parameter. This parameter may be NULL, in which case the ClientData parameter will be ignored and no data will be transferred to or from the KMS. If the parameter is not NULL, then ClientData must be a valid pointer. If the value pointed to is 0, no data will be transferred to the KMS, but data may be returned by the KMS. For all non-zero values *ClientData will be transferred to the KMS, which may also return data to the caller. In all cases, the value upon return to the caller will be the size of the data block returned to the caller, which will be zero if no data is returned from the KMS.
[in,out] ClientData Pointer to a pointer to an arbitrary block of data of ClientDataSize that is to be passed directly to the KMS if it supports the use of client data. This parameter may be NULL if and only if the ClientDataSize parameter is also NULL. Upon return to the caller, *ClientData points to a block of data of ClientDataSize that was returned from the KMS. If the returned value for *ClientDataSize is zero, then the returned value for *ClientData must be NULL and should be ignored by the caller. The KMS protocol consumer is responsible for freeing all valid buffers used for client data regardless of whether they are allocated by the caller for input to the function or by the implementation for output back to the caller.
Return values:
EFI_SUCCESS Successfully added all requested keys.
EFI_OUT_OF_RESOURCES Could not allocate required resources.
EFI_TIMEOUT Timed out waiting for device or key server. Check individual key request(s) to see which ones may have been processed.
EFI_BUFFER_TOO_SMALL If multiple keys are associated with a single identifier, and the KeyValue buffer does not contain enough structures (KeyDescriptorCount) to contain all the key data, then the available structures will be filled and KeyDescriptorCount will be updated to indicate the number of keys which could not be processed
EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a ClientId is required by the server and either none or an invalid id was provided.
EFI_DEVICE_ERROR Device or key server error. Check individual key request(s) to see which ones may have been processed.
EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL, KeyDescriptorCount is NULL, or Keys is NULL.
EFI_NOT_FOUND One or more EFI_KMS_KEY_DESCRIPTOR structures could not be processed properly. KeyDescriptorCount contains the number of structures which were successfully processed. Individual structures will reflect the status of the processing for that structure.
EFI_UNSUPPORTED The implementation/KMS does not support this function.
Delete an existing key from the KMS database.

Parameters:
[in] This Pointer to the EFI_KMS_PROTOCOL instance.
[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.
[in,out] KeyDescriptorCount Pointer to a count of the number of key descriptors to be processed by this operation. On normal return, this number will be updated with the number of key descriptors successfully processed.
[in,out] KeyDescriptors Pointer to an array of EFI_KMS_KEY_DESCRIPTOR structures which describe the keys to be deleted. On input, the KeyId field for first key must contain valid identifier data to be used for adding a key to the KMS. The values for these fields in this key definition will be considered default values for subsequent keys requested in this operation. A value of 0 in any subsequent KeyId field will be replaced with the current default value. The KeyFormat and KeyValue fields are ignored, but should be 0. On return, the KeyStatus field will reflect the result of the operation for each key request.
[in,out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of data specified by the ClientData parameter. This parameter may be NULL, in which case the ClientData parameter will be ignored and no data will be transferred to or from the KMS. If the parameter is not NULL, then ClientData must be a valid pointer. If the value pointed to is 0, no data will be transferred to the KMS, but data may be returned by the KMS. For all non-zero values *ClientData will be transferred to the KMS, which may also return data to the caller. In all cases, the value upon return to the caller will be the size of the data block returned to the caller, which will be zero if no data is returned from the KMS.
[in,out] ClientData Pointer to a pointer to an arbitrary block of data of ClientDataSize that is to be passed directly to the KMS if it supports the use of client data. This parameter may be NULL if and only if the ClientDataSize parameter is also NULL. Upon return to the caller, *ClientData points to a block of data of ClientDataSize that was returned from the KMS. If the returned value for *ClientDataSize is zero, then the returned value for *ClientData must be NULL and should be ignored by the caller. The KMS protocol consumer is responsible for freeing all valid buffers used for client data regardless of whether they are allocated by the caller for input to the function or by the implementation for output back to the caller.
Return values:
EFI_SUCCESS Successfully deleted all requested keys.
EFI_OUT_OF_RESOURCES Could not allocate required resources.
EFI_TIMEOUT Timed out waiting for device or key server. Check individual key request(s) to see which ones may have been processed.
EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a ClientId is required by the server and either none or an invalid id was provided.
EFI_DEVICE_ERROR Device or key server error. Check individual key request(s) to see which ones may have been processed.
EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL, KeyDescriptorCount is NULL, or Keys is NULL.
EFI_NOT_FOUND One or more EFI_KMS_KEY_DESCRIPTOR structures could not be processed properly. KeyDescriptorCount contains the number of structures which were successfully processed. Individual structures will reflect the status of the processing for that structure.
EFI_UNSUPPORTED The implementation/KMS does not support this function.
Get one or more attributes associated with a specified key identifier. If none are found, the returned attributes count contains a value of zero.

Parameters:
[in] This Pointer to the EFI_KMS_PROTOCOL instance.
[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.
[in] KeyIdentifierSize Pointer to the size in bytes of the KeyIdentifier variable.
[in] KeyIdentifier Pointer to the key identifier associated with this key.
[in,out] KeyAttributesCount Pointer to the number of EFI_KMS_KEY_ATTRIBUTE structures associated with the Key identifier. If none are found, the count value is zero on return. On input this value reflects the number of KeyAttributes that may be returned. On output, the value reflects the number of completed KeyAttributes structures found.
[in,out] KeyAttributes Pointer to an array of EFI_KMS_KEY_ATTRIBUTE structures associated with the Key Identifier. On input, the fields in the structure should be NULL. On output, the attribute fields will have updated values for attributes associated with this key identifier.
[in,out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of data specified by the ClientData parameter. This parameter may be NULL, in which case the ClientData parameter will be ignored and no data will be transferred to or from the KMS. If the parameter is not NULL, then ClientData must be a valid pointer. If the value pointed to is 0, no data will be transferred to the KMS, but data may be returned by the KMS. For all non-zero values *ClientData will be transferred to the KMS, which may also return data to the caller. In all cases, the value upon return to the caller will be the size of the data block returned to the caller, which will be zero if no data is returned from the KMS.
[in,out] ClientData Pointer to a pointer to an arbitrary block of data of ClientDataSize that is to be passed directly to the KMS if it supports the use of client data. This parameter may be NULL if and only if the ClientDataSize parameter is also NULL. Upon return to the caller, *ClientData points to a block of data of ClientDataSize that was returned from the KMS. If the returned value for *ClientDataSize is zero, then the returned value for *ClientData must be NULL and should be ignored by the caller. The KMS protocol consumer is responsible for freeing all valid buffers used for client data regardless of whether they are allocated by the caller for input to the function or by the implementation for output back to the caller.
Return values:
EFI_SUCCESS Successfully retrieved all key attributes.
EFI_OUT_OF_RESOURCES Could not allocate resources for the method processing.
EFI_TIMEOUT Timed out waiting for device or key server. Check individual key attribute request(s) to see which ones may have been processed.
EFI_BUFFER_TOO_SMALL If multiple key attributes are associated with a single identifier, and the KeyAttributes buffer does not contain enough structures (KeyAttributesCount) to contain all the key attributes data, then the available structures will be filled and KeyAttributesCount will be updated to indicate the number of key attributes which could not be processed.
EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a ClientId is required by the server and either none or an invalid id was provided.
EFI_DEVICE_ERROR Device or key server error. Check individual key attribute request(s) (i.e. key attribute status for each) to see which ones may have been processed.
EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL, KeyIdentifierSize is NULL , or KeyIdentifier is NULL, or KeyAttributes is NULL, or KeyAttributesSize is NULL.
EFI_NOT_FOUND The KeyIdentifier could not be found. KeyAttributesCount contains zero. Individual structures will reflect the status of the processing for that structure.
EFI_UNSUPPORTED The implementation/KMS does not support this function.
Add one or more attributes to a key specified by a key identifier.

Parameters:
[in] This Pointer to the EFI_KMS_PROTOCOL instance.
[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.
[in] KeyIdentifierSize Pointer to the size in bytes of the KeyIdentifier variable.
[in] KeyIdentifier Pointer to the key identifier associated with this key.
[in,out] KeyAttributesCount Pointer to the number of EFI_KMS_KEY_ATTRIBUTE structures to associate with the Key. On normal returns, this number will be updated with the number of key attributes successfully processed.
[in,out] KeyAttributes Pointer to an array of EFI_KMS_KEY_ATTRIBUTE structures providing the attribute information to associate with the key. On input, the values for the fields in the structure are completely filled in. On return the KeyAttributeStatus field will reflect the result of the operation for each key attribute request.
[in,out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of data specified by the ClientData parameter. This parameter may be NULL, in which case the ClientData parameter will be ignored and no data will be transferred to or from the KMS. If the parameter is not NULL, then ClientData must be a valid pointer. If the value pointed to is 0, no data will be transferred to the KMS, but data may be returned by the KMS. For all non-zero values *ClientData will be transferred to the KMS, which may also return data to the caller. In all cases, the value upon return to the caller will be the size of the data block returned to the caller, which will be zero if no data is returned from the KMS.
[in,out] ClientData Pointer to a pointer to an arbitrary block of data of ClientDataSize that is to be passed directly to the KMS if it supports the use of client data. This parameter may be NULL if and only if the ClientDataSize parameter is also NULL. Upon return to the caller, *ClientData points to a block of data of ClientDataSize that was returned from the KMS. If the returned value for *ClientDataSize is zero, then the returned value for *ClientData must be NULL and should be ignored by the caller. The KMS protocol consumer is responsible for freeing all valid buffers used for client data regardless of whether they are allocated by the caller for input to the function or by the implementation for output back to the caller.
Return values:
EFI_SUCCESS Successfully added all requested key attributes.
EFI_OUT_OF_RESOURCES Could not allocate required resources.
EFI_TIMEOUT Timed out waiting for device or key server. Check individual key attribute request(s) to see which ones may have been processed.
EFI_BUFFER_TOO_SMALL If multiple keys attributes are associated with a single key identifier, and the attributes buffer does not contain enough structures (KeyAttributesCount) to contain all the data, then the available structures will be filled and KeyAttributesCount will be updated to indicate the number of key attributes which could not be processed. The status of each key attribute is also updated indicating success or failure for that attribute in case there are other errors for those attributes that could be processed.
EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a ClientId is required by the server and either none or an invalid id was provided.
EFI_DEVICE_ERROR Device or key server error. Check individual key attribute request(s) (i.e. key attribute status for each) to see which ones may have been processed.
EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL, KeyAttributesCount is NULL, or KeyAttributes is NULL, or KeyIdentifierSize is NULL, or KeyIdentifer is NULL.
EFI_NOT_FOUND The KeyIdentifier could not be found. On return the KeyAttributesCount contains the number of attributes processed. Individual structures will reflect the status of the processing for that structure.
EFI_UNSUPPORTED The implementation/KMS does not support this function.
Delete attributes to a key specified by a key identifier.

Parameters:
[in] This Pointer to the EFI_KMS_PROTOCOL instance.
[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.
[in] KeyIdentifierSize Pointer to the size in bytes of the KeyIdentifier variable.
[in] KeyIdentifier Pointer to the key identifier associated with this key.
[in,out] KeyAttributesCount Pointer to the number of EFI_KMS_KEY_ATTRIBUTE structures to associate with the Key. On input, the count value is one or more. On normal returns, this number will be updated with the number of key attributes successfully processed.
[in,out] KeyAttributes Pointer to an array of EFI_KMS_KEY_ATTRIBUTE structures providing the attribute information to associate with the key. On input, the values for the fields in the structure are completely filled in. On return the KeyAttributeStatus field will reflect the result of the operation for each key attribute request.
[in,out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of data specified by the ClientData parameter. This parameter may be NULL, in which case the ClientData parameter will be ignored and no data will be transferred to or from the KMS. If the parameter is not NULL, then ClientData must be a valid pointer. If the value pointed to is 0, no data will be transferred to the KMS, but data may be returned by the KMS. For all non-zero values *ClientData will be transferred to the KMS, which may also return data to the caller. In all cases, the value upon return to the caller will be the size of the data block returned to the caller, which will be zero if no data is returned from the KMS.
[in,out] ClientData Pointer to a pointer to an arbitrary block of data of ClientDataSize that is to be passed directly to the KMS if it supports the use of client data. This parameter may be NULL if and only if the ClientDataSize parameter is also NULL. Upon return to the caller, *ClientData points to a block of data of ClientDataSize that was returned from the KMS. If the returned value for *ClientDataSize is zero, then the returned value for *ClientData must be NULL and should be ignored by the caller. The KMS protocol consumer is responsible for freeing all valid buffers used for client data regardless of whether they are allocated by the caller for input to the function or by the implementation for output back to the caller.
Return values:
EFI_SUCCESS Successfully deleted all requested key attributes.
EFI_OUT_OF_RESOURCES Could not allocate required resources.
EFI_TIMEOUT Timed out waiting for device or key server. Check individual key attribute request(s) to see which ones may have been processed.
EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a ClientId is required by the server and either none or an invalid id was provided.
EFI_DEVICE_ERROR Device or key server error. Check individual key attribute request(s) (i.e. key attribute status for each) to see which ones may have been processed.
EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL, KeyAttributesCount is NULL, or KeyAttributes is NULL, or KeyIdentifierSize is NULL, or KeyIdentifer is NULL.
EFI_NOT_FOUND The KeyIdentifier could not be found or the attribute could not be found. On return the KeyAttributesCount contains the number of attributes processed. Individual structures will reflect the status of the processing for that structure.
EFI_UNSUPPORTED The implementation/KMS does not support this function.
Retrieve one or more key that has matched all of the specified key attributes.

Parameters:
[in] This Pointer to the EFI_KMS_PROTOCOL instance.
[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.
[in,out] KeyAttributesCount Pointer to a count of the number of key attribute structures that must be matched for each returned key descriptor. On input the count value is one or more. On normal returns, this number will be updated with the number of key attributes successfully processed.
[in,out] KeyAttributes Pointer to an array of EFI_KMS_KEY_ATTRIBUTE structure to search for. On input, the values for the fields in the structure are completely filled in. On return the KeyAttributeStatus field will reflect the result of the operation for each key attribute request.
[in,out] KeyDescriptorCount Pointer to a count of the number of key descriptors matched by this operation. On entry, this number will be zero. On return, this number will be updated to the number of key descriptors successfully found.
[in,out] KeyDescriptors Pointer to an array of EFI_KMS_KEY_DESCRIPTOR structures which describe the keys from the KMS having the KeyAttribute(s) specified. On input, this pointer will be NULL. On output, the array will contain an EFI_KMS_KEY_DESCRIPTOR structure for each key meeting the search criteria. Memory for the array and all KeyValue fields will be allocated with the EfiBootServicesData type and must be freed by the caller when it is no longer needed. Also, the KeyStatus field of each descriptor will reflect the result of the request relative to that key descriptor.
[in,out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of data specified by the ClientData parameter. This parameter may be NULL, in which case the ClientData parameter will be ignored and no data will be transferred to or from the KMS. If the parameter is not NULL, then ClientData must be a valid pointer. If the value pointed to is 0, no data will be transferred to the KMS, but data may be returned by the KMS. For all non-zero values *ClientData will be transferred to the KMS, which may also return data to the caller. In all cases, the value upon return to the caller will be the size of the data block returned to the caller, which will be zero if no data is returned from the KMS.
[in,out] ClientData Pointer to a pointer to an arbitrary block of data of ClientDataSize that is to be passed directly to the KMS if it supports the use of client data. This parameter may be NULL if and only if the ClientDataSize parameter is also NULL. Upon return to the caller, *ClientData points to a block of data of ClientDataSize that was returned from the KMS. If the returned value for *ClientDataSize is zero, then the returned value for *ClientData must be NULL and should be ignored by the caller. The KMS protocol consumer is responsible for freeing all valid buffers used for client data regardless of whether they are allocated by the caller for input to the function or by the implementation for output back to the caller.
Return values:
EFI_SUCCESS Successfully retrieved all requested keys.
EFI_OUT_OF_RESOURCES Could not allocate required resources.
EFI_TIMEOUT Timed out waiting for device or key server. Check individual key attribute request(s) to see which ones may have been processed.
EFI_BUFFER_TOO_SMALL If multiple keys are associated with the attribute(s), and the KeyValue buffer does not contain enough structures (KeyDescriptorCount) to contain all the key data, then the available structures will be filled and KeyDescriptorCount will be updated to indicate the number of keys which could not be processed.
EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a ClientId is required by the server and either none or an invalid id was provided.
EFI_DEVICE_ERROR Device or key server error. Check individual key attribute request(s) (i.e. key attribute status for each) to see which ones may have been processed.
EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL, KeyDescriptorCount is NULL, or KeyDescriptors is NULL or KeyAttributes is NULL, or KeyAttributesCount is NULL.
EFI_NOT_FOUND One or more EFI_KMS_KEY_ATTRIBUTE structures could not be processed properly. KeyAttributeCount contains the number of structures which were successfully processed. Individual structures will reflect the status of the processing for that structure.
EFI_UNSUPPORTED The implementation/KMS does not support this function.
Modifies the capabilities for a memory region in the global coherency domain of the processor.

Parameters:
BaseAddress The physical address that is the start address of a memory region.
Length The size in bytes of the memory region.
Capabilities The bit mask of capabilities that the memory region supports.
Return values:
EFI_SUCCESS The capabilities were set for the memory region.
EFI_INVALID_PARAMETER Length is zero.
EFI_UNSUPPORTED The capabilities specified by Capabilities do not include the memory region attributes currently in use.
EFI_ACCESS_DENIED The capabilities for the memory resource range specified by BaseAddress and Length cannot be modified.
EFI_OUT_OF_RESOURCES There are not enough system resources to modify the capabilities of the memory resource range.
Set the frequency for the I2C clock line.

Parameters:
This Pointer to an EFI_PEI_I2C_MASTER_PPI structure.
BusClockHertz Pointer to the requested I2C bus clock frequency in Hertz. Upon return this value contains the actual frequency in use by the I2C controller.
Return values:
EFI_SUCCESS The bus frequency was set successfully.
EFI_INVALID_PARAMETER BusClockHertz is NULL
EFI_UNSUPPORTED The controller does not support this frequency.
Reset the I2C controller and configure it for use.

Parameters:
This Pointer to an EFI_PEI_I2C_MASTER_PPI structure.
Return values:
EFI_SUCCESS The reset completed successfully.
EFI_DEVICE_ERROR The reset operation failed.
Start an I2C transaction on the host controller.

Parameters:
This Pointer to an EFI_PEI_I2C_MASTER_PPI structure.
SlaveAddress Address of the device on the I2C bus. Set the I2C_ADDRESSING_10_BIT when using 10-bit addresses, clear this bit for 7-bit addressing. Bits 0-6 are used for 7-bit I2C slave addresses and bits 0-9 are used for 10-bit I2C slave addresses.
RequestPacket Pointer to an EFI_I2C_REQUEST_PACKET structure describing the I2C transaction.
Return values:
EFI_SUCCESS The transaction completed successfully.
EFI_BAD_BUFFER_SIZE The RequestPacket->LengthInBytes value is too large.
EFI_DEVICE_ERROR There was an I2C error (NACK) during the transaction.
EFI_INVALID_PARAMETER RequestPacket is NULL
EFI_NO_RESPONSE The I2C device is not responding to the slave address. EFI_DEVICE_ERROR will be returned if the controller cannot distinguish when the NACK occurred.
EFI_NOT_FOUND Reserved bit set in the SlaveAddress parameter
EFI_OUT_OF_RESOURCES Insufficient memory for I2C transaction
EFI_UNSUPPORTED The controller does not support the requested transaction.
Open I/O aperture.

This function opens an I/O aperture in a ISA Host Controller for the I/O addresses specified by IoAddress to IoAddress + IoLength - 1. It is possible that more than one caller may be assigned to the same aperture. It may be possible that a single hardware aperture may be used for more than one device. This function tracks the number of times that each aperture is referenced, and doesa not close the hardware aperture (via CloseIoAperture()) until there are no more references to it.

Parameters:
This A pointer to this instance of the EFI_ISA_HC_PPI.
IoAddress An unsigned integer that specifies the first byte of the I/O space required.
IoLength An unsigned integer that specifies the number of bytes of the I/O space required.
IoApertureHandle A pointer to the returned I/O aperture handle. This value can be used on subsequent calls to CloseIoAperture().
Return values:
EFI_SUCCESS The I/O aperture was opened successfully.
EFI_UNSUPPORTED The ISA Host Controller is a subtractive-decode controller.
EFI_OUT_OF_RESOURCES There is no available I/O aperture.
Close I/O aperture.

This function closes a previously opened I/O aperture handle. If there are no more I/O aperture handles that refer to the hardware I/O aperture resource, then the hardware I/O aperture is closed. It may be possible that a single hardware aperture may be used for more than one device. This function tracks the number of times that each aperture is referenced, and does not close the hardware aperture (via CloseIoAperture()) until there are no more references to it.

Parameters:
This A pointer to this instance of the EFI_ISA_HC_PPI.
IoApertureHandle The I/O aperture handle previously returned from a call to OpenIoAperture().
Return values:
EFI_SUCCESS The I/O aperture was closed successfully.
Get the number of CPU's.

Parameters:
[in] PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
[in] This Pointer to this instance of the PPI.
[out] NumberOfProcessors Pointer to the total number of logical processors in the system, including the BSP and disabled APs.
[out] NumberOfEnabledProcessors Number of processors in the system that are enabled.
Return values:
EFI_SUCCESS The number of logical processors and enabled logical processors was retrieved.
EFI_DEVICE_ERROR The calling processor is an AP.
EFI_INVALID_PARAMETER NumberOfProcessors is NULL. NumberOfEnabledProcessors is NULL.
Get information on a specific CPU.

Parameters:
[in] PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
[in] This Pointer to this instance of the PPI.
[in] ProcessorNumber Pointer to the total number of logical processors in the system, including the BSP and disabled APs.
[out] ProcessorInfoBuffer Number of processors in the system that are enabled.
Return values:
EFI_SUCCESS Processor information was returned.
EFI_DEVICE_ERROR The calling processor is an AP.
EFI_INVALID_PARAMETER ProcessorInfoBuffer is NULL.
EFI_NOT_FOUND The processor with the handle specified by ProcessorNumber does not exist in the platform.
Activate all of the application proessors.

Parameters:
[in] PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance.
[in] Procedure A pointer to the function to be run on enabled APs of the system.
[in] SingleThread If TRUE, then all the enabled APs execute the function specified by Procedure one by one, in ascending order of processor handle number. If FALSE, then all the enabled APs execute the function specified by Procedure simultaneously.
[in] TimeoutInMicroSeconds Indicates the time limit in microseconds for APs to return from Procedure, for blocking mode only. Zero means infinity. If the timeout expires before all APs return from Procedure, then Procedure on the failed APs is terminated. All enabled APs are available for next function assigned by EFI_PEI_MP_SERVICES_PPI.StartupAllAPs() or EFI_PEI_MP_SERVICES_PPI.StartupThisAP(). If the timeout expires in blocking mode, BSP returns EFI_TIMEOUT.
[in] ProcedureArgument The parameter passed into Procedure for all APs.
Return values:
EFI_SUCCESS In blocking mode, all APs have finished before the timeout expired.
EFI_DEVICE_ERROR Caller processor is AP.
EFI_NOT_STARTED No enabled APs exist in the system.
EFI_NOT_READY Any enabled APs are busy.
EFI_TIMEOUT In blocking mode, the timeout expired before all enabled APs have finished.
EFI_INVALID_PARAMETER Procedure is NULL.
Activate a specific application processor.

Parameters:
[in] PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance.
[in] Procedure A pointer to the function to be run on enabled APs of the system.
[in] ProcessorNumber The handle number of the AP. The range is from 0 to the total number of logical processors minus 1. The total number of logical processors can be retrieved by EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().
[in] TimeoutInMicroSeconds Indicates the time limit in microseconds for APs to return from Procedure, for blocking mode only. Zero means infinity. If the timeout expires before all APs return from Procedure, then Procedure on the failed APs is terminated. All enabled APs are available for next function assigned by EFI_PEI_MP_SERVICES_PPI.StartupAllAPs() or EFI_PEI_MP_SERVICES_PPI.StartupThisAP(). If the timeout expires in blocking mode, BSP returns EFI_TIMEOUT.
[in] ProcedureArgument The parameter passed into Procedure for all APs.
Return values:
EFI_SUCCESS In blocking mode, specified AP finished before the timeout expires.
EFI_DEVICE_ERROR The calling processor is an AP.
EFI_TIMEOUT In blocking mode, the timeout expired before the specified AP has finished.
EFI_NOT_FOUND The processor with the handle specified by ProcessorNumber does not exist.
EFI_INVALID_PARAMETER ProcessorNumber specifies the BSP or disabled AP.
EFI_INVALID_PARAMETER Procedure is NULL.
Switch the boot strap processor.

Parameters:
[in] PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance.
[in] ProcessorNumber The handle number of the AP. The range is from 0 to the total number of logical processors minus 1. The total number of logical processors can be retrieved by EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().
[in] EnableOldBSP If TRUE, then the old BSP will be listed as an enabled AP. Otherwise, it will be disabled.
Return values:
EFI_SUCCESS BSP successfully switched.
EFI_UNSUPPORTED Switching the BSP cannot be completed prior to this service returning.
EFI_UNSUPPORTED Switching the BSP is not supported.
EFI_SUCCESS The calling processor is an AP.
EFI_NOT_FOUND The processor with the handle specified by ProcessorNumber does not exist.
EFI_INVALID_PARAMETER ProcessorNumber specifies the current BSP or a disabled AP.
EFI_NOT_READY The specified AP is busy.
Enable or disable an application processor.

Parameters:
[in] PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance.
[in] ProcessorNumber The handle number of the AP. The range is from 0 to the total number of logical processors minus 1. The total number of logical processors can be retrieved by EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().
[in] EnableAP Specifies the new state for the processor for enabled, FALSE for disabled.
[in] HealthFlag If not NULL, a pointer to a value that specifies the new health status of the AP. This flag corresponds to StatusFlag defined in EFI_PEI_MP_SERVICES_PPI.GetProcessorInfo(). Only the PROCESSOR_HEALTH_STATUS_BIT is used. All other bits are ignored. If it is NULL, this parameter is ignored.
Return values:
EFI_SUCCESS The specified AP was enabled or disabled successfully.
EFI_UNSUPPORTED Enabling or disabling an AP cannot be completed prior to this service returning.
EFI_UNSUPPORTED Enabling or disabling an AP is not supported.
EFI_DEVICE_ERROR The calling processor is an AP.
EFI_NOT_FOUND Processor with the handle specified by ProcessorNumber does not exist.
EFI_INVALID_PARAMETER ProcessorNumber specifies the BSP.
Identify the currently executing processor.

Parameters:
[in] PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
[in] This A pointer to the EFI_PEI_MP_SERVICES_PPI instance.
[out] ProcessorNumber The handle number of the AP. The range is from 0 to the total number of logical processors minus 1. The total number of logical processors can be retrieved by EFI_PEI_MP_SERVICES_PPI.GetNumberOfProcessors().
Return values:
EFI_SUCCESS The current processor handle number was returned in ProcessorNumber.
EFI_INVALID_PARAMETER ProcessorNumber is NULL.
Retrieve additional information associated with a PCD token in the default token space.

This includes information such as the type of value the TokenNumber is associated with as well as possible human readable name that is associated with the token.

Parameters:
[in] TokenNumber The PCD token number.
[out] PcdInfo The returned information associated with the requested TokenNumber.
Return values:
EFI_SUCCESS The PCD information was returned successfully
EFI_NOT_FOUND The PCD service could not find the requested token number.
Retrieve additional information associated with a PCD token.

This includes information such as the type of value the TokenNumber is associated with as well as possible human readable name that is associated with the token.

Parameters:
[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
[in] TokenNumber The PCD token number.
[out] PcdInfo The returned information associated with the requested TokenNumber.
Return values:
EFI_SUCCESS The PCD information was returned successfully
EFI_NOT_FOUND The PCD service could not find the requested token number.
Retrieve additional information associated with a PCD token.

This includes information such as the type of value the TokenNumber is associated with as well as possible human readable name that is associated with the token.

Parameters:
[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
[in] TokenNumber The PCD token number.
[out] PcdInfo The returned information associated with the requested TokenNumber.
Return values:
EFI_SUCCESS The PCD information was returned successfully
EFI_NOT_FOUND The PCD service could not find the requested token number.
Reset the block device hardware.

Parameters:
[in] This Indicates a pointer to the calling context.
[in] ExtendedVerification Indicates that the driver may perform a more exhausive verfication operation of the device during reset.
Return values:
EFI_SUCCESS The device was reset.
EFI_DEVICE_ERROR The device is not functioning properly and could not be reset.
Read BufferSize bytes from Lba into Buffer.

This function reads the requested number of blocks from the device. All the blocks are read, or an error is returned. If EFI_DEVICE_ERROR, EFI_NO_MEDIA,_or EFI_MEDIA_CHANGED is returned and non-blocking I/O is being used, the Event associated with this request will not be signaled.

Parameters:
[in] This Indicates a pointer to the calling context.
[in] MediaId Id of the media, changes every time the media is replaced.
[in] Lba The starting Logical Block Address to read from.
[in,out] Token A pointer to the token associated with the transaction.
[in] BufferSize Size of Buffer, must be a multiple of device block size.
[out] Buffer A pointer to the destination buffer for the data. The caller is responsible for either having implicit or explicit ownership of the buffer.
Return values:
EFI_SUCCESS The read request was queued if Token->Event is not NULL.The data was read correctly from the device if the Token->Event is NULL.
EFI_DEVICE_ERROR The device reported an error while performing the read.
EFI_NO_MEDIA There is no media in the device.
EFI_MEDIA_CHANGED The MediaId is not for the current media.
EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of the intrinsic block size of the device.
EFI_INVALID_PARAMETER The read request contains LBAs that are not valid, or the buffer is not on proper alignment.
EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
Write BufferSize bytes from Lba into Buffer.

This function writes the requested number of blocks to the device. All blocks are written, or an error is returned.If EFI_DEVICE_ERROR, EFI_NO_MEDIA, EFI_WRITE_PROTECTED or EFI_MEDIA_CHANGED is returned and non-blocking I/O is being used, the Event associated with this request will not be signaled.

Parameters:
[in] This Indicates a pointer to the calling context.
[in] MediaId The media ID that the write request is for.
[in] Lba The starting logical block address to be written. The caller is responsible for writing to only legitimate locations.
[in,out] Token A pointer to the token associated with the transaction.
[in] BufferSize Size of Buffer, must be a multiple of device block size.
[in] Buffer A pointer to the source buffer for the data.
Return values:
EFI_SUCCESS The write request was queued if Event is not NULL. The data was written correctly to the device if the Event is NULL.
EFI_WRITE_PROTECTED The device can not be written to.
EFI_NO_MEDIA There is no media in the device.
EFI_MEDIA_CHNAGED The MediaId does not matched the current device.
EFI_DEVICE_ERROR The device reported an error while performing the write.
EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.
EFI_INVALID_PARAMETER The write request contains LBAs that are not valid, or the buffer is not on proper alignment.
EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
Flush the Block Device.

If EFI_DEVICE_ERROR, EFI_NO_MEDIA,_EFI_WRITE_PROTECTED or EFI_MEDIA_CHANGED is returned and non-blocking I/O is being used, the Event associated with this request will not be signaled.

Parameters:
[in] This Indicates a pointer to the calling context.
[in,out] Token A pointer to the token associated with the transaction
Return values:
EFI_SUCCESS The flush request was queued if Event is not NULL. All outstanding data was written correctly to the device if the Event is NULL.
EFI_DEVICE_ERROR The device reported an error while writting back the data.
EFI_WRITE_PROTECTED The device cannot be written to.
EFI_NO_MEDIA There is no media in the device.
EFI_MEDIA_CHANGED The MediaId is not for the current media.
EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
Reset the block device hardware.

The Reset() function resets the block device hardware.

As part of the initialization process, the firmware/device will make a quick but reasonable attempt to verify that the device is functioning.

If the ExtendedVerificationflag is TRUE the firmware may take an extended amount of time to verify the device is operating on reset. Otherwise the reset operation is to occur as quickly as possible.

The hardware verification process is not defined by this specification and is left up to the platform firmware or driver to implement.

Parameters:
[in] This Pointer to the EFI_BLOCK_IO_CRYPTO_PROTOCOL instance.
[in] ExtendedVerification Indicates that the driver may perform a more exhausive verfication operation of the device during reset.
Return values:
EFI_SUCCESS The block device was reset.
EFI_DEVICE_ERROR The block device is not functioning correctly and could not be reset.
EFI_INVALID_PARAMETER This is NULL.
Get the capabilities of the underlying inline cryptographic interface.

The GetCapabilities() function determines whether pre-OS controllable inline crypto is supported by the system for the current disk and, if so, returns the capabilities of the crypto engine.

The caller is responsible for providing the Capabilities structure with a sufficient number of entries.

If the structure is too small, the EFI_BUFFER_TOO_SMALL error code is returned and the CapabilityCount field contains the number of entries needed to contain the capabilities.

Parameters:
[in] This Pointer to the EFI_BLOCK_IO_CRYPTO_PROTOCOL instance.
[out] Capabilities Pointer to the EFI_BLOCK_IO_CRYPTO_CAPABILITIES structure.
Return values:
EFI_SUCCESS The ICI is ready for use.
EFI_BUFFER_TOO_SMALL The Capabilities structure was too small. The number of entries needed is returned in the CapabilityCount field of the structure.
EFI_NO_RESPONSE No response was received from the ICI.
EFI_DEVICE_ERROR An error occurred when attempting to access the ICI.
EFI_INVALID_PARAMETER This is NULL.
EFI_INVALID_PARAMETER Capabilities is NULL.
Set the configuration of the underlying inline cryptographic interface.

The SetConfiguration() function allows the user to set the current configuration of the inline cryptographic interface and should be called before attempting any crypto operations.

This configures the configuration table entries with algorithms, key sizes and keys. Each configured entry can later be referred to by index at the time of storage transaction.

The configuration table index will refer to the combination ofKeyOwnerGuid, Algorithm, and CryptoKey.

KeyOwnerGuid identifies the component taking ownership of the entry. It helps components to identify their own entries, cooperate with other owner components, and avoid conflicts. This Guid identifier is there to help coordination between cooperating components and not a security or synchronization feature. The Nil GUID can be used by a component to release use of entry owned. It is also used to identify potentially available entries (see GetConfiguration).

CryptoKey specifies algorithm-specific key material to use within parameters of selected crypto capability.

This function is called infrequently typically once, on device start, before IO starts. It can be called at later times in cases the number of keysused on the drive is higher than what can be configured at a time or a new key has to be added.

Components setting or changing an entry or entries for a given index or indices must ensure that IO referencing affected indices is temporarily blocked (run-down) at the time of change.

Indices parameters in each parameter table entry allow to set only a portion of the available table entries in the crypto module anywhere from single entry to entire table supported.

If corresponding table entry or entries being set are already in use by another owner the call should be failed and none of the entries should be modified. The interface implementation must enforce atomicity of this operation (should either succeed fully or fail completely without modifying state).

Note that components using GetConfiguration command to discover available entries should be prepared that by the time of calling SetConfiguration the previously available entry may have become occupied. Such components should be prepared to re-try the sequence of operations.

Alternatively EFI_BLOCK_IO_CRYPTO_INDEX_ANY can be used to have the implementation discover and allocate available,if any, indices atomically.

An optional ResultingTable pointer can be provided by the caller to receive the newly configured entries. The array provided by the caller must have at least ConfigurationCount of entries.

Parameters:
[in] This Pointer to the EFI_BLOCK_IO_CRYPTO_PROTOCOL instance.
[in] ConfigurationCount Number of entries being configured with this call.
[in] ConfigurationTable Pointer to a table used to populate the configuration table.
[out] ResultingTable Optional pointer to a table that receives the newly configured entries.
Return values:
EFI_SUCCESS The ICI is ready for use.
EFI_NO_RESPONSE No response was received from the ICI.
EFI_DEVICE_ERROR An error occurred when attempting to access the ICI.
EFI_INVALID_PARAMETER This is NULL.
EFI_INVALID_PARAMETER ConfigurationTable is NULL.
EFI_INVALID_PARAMETER ConfigurationCount is 0.
EFI_OUT_OF_RESOURCES Could not find the requested number of available entries in the configuration table.
Get the configuration of the underlying inline cryptographic interface.

The GetConfiguration() function allows the user to get the configuration of the inline cryptographic interface.

Retrieves, entirely or partially, the currently configured key table. Note that the keys themselves are not retrieved, but rather just indices, owner GUIDs and capabilities.

If fewer entries than specified by ConfigurationCount are returned, the Index field of the unused entries is set to EFI_BLOCK_IO_CRYPTO_INDEX_ANY.

Parameters:
[in] This Pointer to the EFI_BLOCK_IO_CRYPTO_PROTOCOL instance.
[in] StartIndex Configuration table index at which to start the configuration query.
[in] ConfigurationCount Number of entries to return in the response table.
[in] KeyOwnerGuid Optional parameter to filter response down to entries with a given owner. A pointer to the Nil value can be used to return available entries. Set to NULL when no owner filtering is required.
[out] ConfigurationTable Table of configured configuration table entries (with no CryptoKey returned): configuration table index, KeyOwnerGuid, Capability. Should have sufficient space to store up to ConfigurationCount entries.
Return values:
EFI_SUCCESS The ICI is ready for use.
EFI_NO_RESPONSE No response was received from the ICI.
EFI_DEVICE_ERROR An error occurred when attempting to access the ICI.
EFI_INVALID_PARAMETER This is NULL.
EFI_INVALID_PARAMETER Configuration table is NULL.
EFI_INVALID_PARAMETER StartIndex is out of bounds.
Reads the requested number of blocks from the device and optionally decrypts them inline.

TheReadExtended() function allows the caller to perform a storage device read operation. The function reads the requested number of blocks from the device and then if Index is specified decrypts them inline. All the blocks are read and decrypted (if decryption requested), or an error is returned.

If there is no media in the device, the function returns EFI_NO_MEDIA. If the MediaId is not the ID for the current media in the device, the function returns EFI_MEDIA_CHANGED.

If EFI_DEVICE_ERROR, EFI_NO_MEDIA, or EFI_MEDIA_CHANGED is returned and nonblocking I/O is being used, the Event associated with this request will not be signaled.

In addition to standard storage transaction parameters (LBA, IO size, and buffer), this command will also specify a configuration table Index and CryptoIvInput when data has to be decrypted inline by the controller after being read from the storage device. If an Index parameter is not specified, no decryption is performed.

Parameters:
[in] This Pointer to the EFI_BLOCK_IO_CRYPTO_PROTOCOL instance.
[in] MediaId The media ID that the read request is for.
[in] LBA The starting logical block address to read from on the device.
[in,out] Token A pointer to the token associated with the transaction.
[in] BufferSize The size of the Buffer in bytes. This must be a multiple of the intrinsic block size of the device.
[out] Buffer A pointer to the destination buffer for the data. The caller is responsible for either having implicit or explicit ownership of the buffer.
[in] Index A pointer to the configuration table index. This is optional.
[in] CryptoIvInput A pointer to a buffer that contains additional cryptographic parameters as required by the capability referenced by the configuration table index, such as cryptographic initialization vector.
Return values:
EFI_SUCCESS The read request was queued if Token-> Event is not NULL. The data was read correctly from the device if the Token->Event is NULL.
EFI_DEVICE_ERROR The device reported an error while attempting to perform the read operation and/or decryption operation.
EFI_NO_MEDIA There is no media in the device.
EFI_MEDIA_CHANGED The MediaId is not for the current media.
EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of the intrinsic block size of the device.
EFI_INVALID_PARAMETER This is NULL, or the read request contains LBAs that are not valid, or the buffer is not on proper alignment.
EFI_INVALID_PARAMETER CryptoIvInput is incorrect.
EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
Optionally encrypts a specified number of blocks inline and then writes to the device.

The WriteExtended() function allows the caller to perform a storage device write operation. The function encrypts the requested number of blocks inline if Index is specified and then writes them to the device. All the blocks are encrypted (if encryption requested) and written, or an error is returned.

If there is no media in the device, the function returns EFI_NO_MEDIA. If the MediaId is not the ID for the current media in the device, the function returns EFI_MEDIA_CHANGED.

If EFI_DEVICE_ERROR, EFI_NO_MEDIA, or EFI_MEDIA_CHANGED is returned and nonblocking I/O is being used, the Event associated with this request will not be signaled.

In addition to standard storage transaction parameters (LBA, IO size, and buffer), this command will also specify a configuration table Index and a CryptoIvInput when data has to be decrypted inline by the controller before being written to the storage device. If no Index parameter is specified, no encryption is performed.

Parameters:
[in] This Pointer to the EFI_BLOCK_IO_CRYPTO_PROTOCOL instance.
[in] MediaId The media ID that the read request is for.
[in] LBA The starting logical block address to read from on the device.
[in,out] Token A pointer to the token associated with the transaction.
[in] BufferSize The size of the Buffer in bytes. This must be a multiple of the intrinsic block size of the device.
[in] Buffer A pointer to the source buffer for the data.
[in] Index A pointer to the configuration table index. This is optional.
[in] CryptoIvInput A pointer to a buffer that contains additional cryptographic parameters as required by the capability referenced by the configuration table index, such as cryptographic initialization vector.
Return values:
EFI_SUCCESS The request to encrypt (optionally) and write was queued if Event is not NULL. The data was encrypted (optionally) and written correctly to the device if the Event is NULL.
EFI_WRITE_PROTECTED The device cannot be written to.
EFI_NO_MEDIA There is no media in the device.
EFI_MEDIA_CHANGED The MediaId is not for the current media.
EFI_DEVICE_ERROR The device reported an error while attempting to encrypt blocks or to perform the write operation.
EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of the intrinsic block size of the device.
EFI_INVALID_PARAMETER This is NULL, or the write request contains LBAs that are not valid, or the buffer is not on proper alignment.
EFI_INVALID_PARAMETER CryptoIvInput is incorrect.
EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
Flushes all modified data toa physical block device.

The FlushBlocks() function flushes all modified data to the physical block device. Any modified data that has to be encrypted must have been already encrypted as a part of WriteExtended() operation - inline crypto operation cannot be a part of flush operation.

All data written to the device prior to the flush must be physically written before returning EFI_SUCCESS from this function. This would include any cached data the driver may have cached, and cached data the device may have cached. A flush may cause a read request following the flush to force a device access.

If EFI_DEVICE_ERROR, EFI_NO_MEDIA, EFI_WRITE_PROTECTED or EFI_MEDIA_CHANGED is returned and non-blocking I/O is being used, the Event associated with this request will not be signaled.

Parameters:
[in] This Pointer to the EFI_BLOCK_IO_CRYPTO_PROTOCOL instance.
[in,out] Token A pointer to the token associated with the transaction.
Return values:
EFI_SUCCESS The flush request was queued if Event is not NULL. All outstanding data was written correctly to the device if the Event is NULL.
EFI_DEVICE_ERROR The device reported an error while attempting to write data.
EFI_WRITE_PROTECTED The device cannot be written to.
EFI_NO_MEDIA There is no media in the device.
EFI_MEDIA_CHANGED The MediaId is not for the current media.
EFI_INVALID_PARAMETER This is NULL.
EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
Callback function, it is called if a Bluetooth device is found during scan process.

Parameters:
This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
Context Context passed from scan request.
CallbackInfo Data related to scan result. NULL CallbackInfo means scan complete.
Return values:
EFI_SUCCESS The callback function complete successfully.
Callback function, it is called when asynchronous transfer is completed.

Parameters:
Data Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
DataLength Specifies the length, in bytes, of the data to be received.
Context Data passed into Callback function. This is optional parameter and may be NULL.
Return values:
EFI_SUCCESS The callback function complete successfully.
Receive HCI ACL data packet in non-blocking way.

Parameters:
This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the request is deleted.
PollingInterval Indicates the periodic rate, in milliseconds, that the transfer is to be executed.
DataLength Specifies the length, in bytes, of the data to be received.
Callback The callback function. This function is called if the asynchronous transfer is completed.
Context Data passed into Callback function. This is optional parameter and may be NULL.
Return values:
EFI_SUCCESS The HCI asynchronous receive request is submitted successfully.
EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
  • DataLength is 0.
  • If IsNewTransfer is TRUE, and an asynchronous receive request already exists.
Receive HCI SCO data packet in non-blocking way.

Parameters:
This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the request is deleted.
PollingInterval Indicates the periodic rate, in milliseconds, that the transfer is to be executed.
DataLength Specifies the length, in bytes, of the data to be received.
Callback The callback function. This function is called if the asynchronous transfer is completed.
Context Data passed into Callback function. This is optional parameter and may be NULL.
Return values:
EFI_SUCCESS The HCI asynchronous receive request is submitted successfully.
EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
  • DataLength is 0.
  • If IsNewTransfer is TRUE, and an asynchronous receive request already exists.
Callback function, it is called when asynchronous transfer is completed.

Parameters:
ChannelID Bluetooth L2CAP message channel ID.
Data Data received via asynchronous transfer.
DataLength The length of Data in bytes, received via asynchronous transfer.
Context Context passed from asynchronous transfer request.
Return values:
EFI_SUCCESS The callback function complete successfully.
Callback function, it is called when asynchronous transfer is completed.

Parameters:
Data Data received via asynchronous transfer.
DataLength The length of Data in bytes, received via asynchronous transfer.
Context Context passed from asynchronous transfer request.
Return values:
EFI_SUCCESS The callback function complete successfully.
Retrieve mode data of this DNS instance.

This function is used to retrieve DNS mode data for this DNS instance.

Parameters:
[in] This Pointer to EFI_DNS4_PROTOCOL instance.
[out] DnsModeData Point to the mode data.
Return values:
EFI_SUCCESS The operation completed successfully.
EFI_NOT_STARTED When DnsConfigData is queried, no configuration data is available because this instance has not been configured.
EFI_INVALID_PARAMETER This is NULL or DnsModeData is NULL.
EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
Configure this DNS instance.

This function is used to configure DNS mode data for this DNS instance.

Parameters:
[in] This Pointer to EFI_DNS4_PROTOCOL instance.
[in] DnsConfigData Point to the Configuration data.
Return values:
EFI_SUCCESS The operation completed successfully.
EFI_UNSUPPORTED The designated protocol is not supported.
EFI_INVALID_PARAMTER Thisis NULL. The StationIp address provided in DnsConfigData is not a valid unicast. DnsServerList is NULL while DnsServerListCount is not ZERO. DnsServerListCount is ZERO while DnsServerList is not NULL
EFI_OUT_OF_RESOURCES The DNS instance data or required space could not be allocated.
EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI DNSv4 Protocol instance is not configured.
EFI_ALREADY_STARTED Second call to Configure() with DnsConfigData. To reconfigure the instance the caller must call Configure() with NULL first to return driver to unconfigured state.
Host name to host address translation.

The HostNameToIp () function is used to translate the host name to host IP address. A type A query is used to get the one or more IP addresses for this host.

Parameters:
[in] This Pointer to EFI_DNS4_PROTOCOL instance.
[in] Hostname Host name.
[in] Token Point to the completion token to translate host name to host address.
Return values:
EFI_SUCCESS The operation completed successfully.
EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: This is NULL. Token is NULL. Token.Event is NULL. HostName is NULL. HostName string is unsupported format.
EFI_NO_MAPPING There's no source address is available for use.
EFI_NOT_STARTED This instance has not been started.
IPv4 address to host name translation also known as Reverse DNS lookup.

The IpToHostName() function is used to translate the host address to host name. A type PTR query is used to get the primary name of the host. Support of this function is optional.

Parameters:
[in] This Pointer to EFI_DNS4_PROTOCOL instance.
[in] IpAddress Ip Address.
[in] Token Point to the completion token to translate host address to host name.
Return values:
EFI_SUCCESS The operation completed successfully.
EFI_UNSUPPORTED This function is not supported.
EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: This is NULL. Token is NULL. Token.Event is NULL. IpAddress is not valid IP address .
EFI_NO_MAPPING There's no source address is available for use.
EFI_ALREADY_STARTED This Token is being used in another DNS session.
EFI_NOT_STARTED This instance has not been started.
EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
Retrieve arbitrary information from the DNS server.

This GeneralLookup() function retrieves arbitrary information from the DNS. The caller supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned. All RR content (e.g., TTL) was returned. The caller need parse the returned RR to get required information. The function is optional.

Parameters:
[in] This Pointer to EFI_DNS4_PROTOCOL instance.
[in] QName Pointer to Query Name.
[in] QType Query Type.
[in] QClass Query Name.
[in] Token Point to the completion token to retrieve arbitrary information.
Return values:
EFI_SUCCESS The operation completed successfully.
EFI_UNSUPPORTED This function is not supported. Or the requested QType is not supported
EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: This is NULL. Token is NULL. Token.Event is NULL. QName is NULL.
EFI_NO_MAPPING There's no source address is available for use.
EFI_ALREADY_STARTED This Token is being used in another DNS session.
EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
This function is to update the DNS Cache.

The UpdateDnsCache() function is used to add/delete/modify DNS cache entry. DNS cache can be normally dynamically updated after the DNS resolve succeeds. This function provided capability to manually add/delete/modify the DNS cache.

Parameters:
[in] This Pointer to EFI_DNS4_PROTOCOL instance.
[in] DeleteFlag If FALSE, this function is to add one entry to the DNS Cahce. If TRUE, this function will delete matching DNS Cache entry.
[in] Override If TRUE, the maching DNS cache entry will be overwritten with the supplied parameter. If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already existed.
[in] DnsCacheEntry Pointer to DNS Cache entry.
Return values:
EFI_SUCCESS The operation completed successfully.
EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: This is NULL. DnsCacheEntry.HostName is NULL. DnsCacheEntry.IpAddress is NULL. DnsCacheEntry.Timeout is zero.
EFI_ACCESS_DENIED The DNS cache entry already exists and Override is not TRUE.
Polls for incoming data packets and processes outgoing data packets.

The Poll() function can be used by network drivers and applications to increase the rate that data packets are moved between the communications device and the transmit and receive queues. In some systems, the periodic timer event in the managed network driver may not poll the underlying communications device fast enough to transmit and/or receive all data packets without missing incoming packets or dropping outgoing packets. Drivers and applications that are experiencing packet loss should try calling the Poll() function more often.

Parameters:
[in] This Pointer to EFI_DNS4_PROTOCOL instance.
Return values:
EFI_SUCCESS Incoming or outgoing data was processed.
EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.
EFI_INVALID_PARAMETER This is NULL.
EFI_DEVICE_ERROR An unexpected system or network error occurred.
EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue. Consider increasing the polling rate.
Abort an asynchronous DNS operation, including translation between IP and Host, and general look up behavior.

The Cancel() function is used to abort a pending resolution request. After calling this function, Token.Status will be set to EFI_ABORTED and then Token.Event will be signaled. If the token is not in one of the queues, which usually means that the asynchronous operation has completed, this function will not signal the token and EFI_NOT_FOUND is returned.

Parameters:
[in] This Pointer to EFI_DNS4_PROTOCOL instance.
[in] Token Pointer to a token that has been issued by EFI_DNS4_PROTOCOL.HostNameToIp (), EFI_DNS4_PROTOCOL.IpToHostName() or EFI_DNS4_PROTOCOL.GeneralLookup(). If NULL, all pending tokens are aborted.
Return values:
EFI_SUCCESS Incoming or outgoing data was processed.
EFI_NOT_STARTED This EFI DNS4 Protocol instance has not been started.
EFI_INVALID_PARAMETER This is NULL.
EFI_NOT_FOUND When Token is not NULL, and the asynchronous DNS operation was not found in the transmit queue. It was either completed or was not issued by HostNameToIp(), IpToHostName() or GeneralLookup().
Host name to host address translation.

The HostNameToIp () function is used to translate the host name to host IP address. A type A query is used to get the one or more IPv6 addresses for this host.

Parameters:
[in] This Pointer to EFI_DNS6_PROTOCOL instance.
[in] Hostname Host name.
[in] Token Point to the completion token to translate host name to host address.
Return values:
EFI_SUCCESS The operation completed successfully.
EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: This is NULL. Token is NULL. Token.Event is NULL. HostName is NULL or buffer contained unsupported characters.
EFI_NO_MAPPING There's no source address is available for use.
EFI_ALREADY_STARTED This Token is being used in another DNS session.
EFI_NOT_STARTED This instance has not been started.
EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
Host address to host name translation.

The IpToHostName () function is used to translate the host address to host name. A type PTR query is used to get the primary name of the host. Implementation can choose to support this function or not.

Parameters:
[in] This Pointer to EFI_DNS6_PROTOCOL instance.
[in] IpAddress Ip Address.
[in] Token Point to the completion token to translate host address to host name.
Return values:
EFI_SUCCESS The operation completed successfully.
EFI_UNSUPPORTED This function is not supported.
EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: This is NULL. Token is NULL. Token.Event is NULL. IpAddress is not valid IP address.
EFI_NO_MAPPING There's no source address is available for use.
EFI_NOT_STARTED This instance has not been started.
EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
This function provides capability to retrieve arbitrary information from the DNS server.

This GeneralLookup() function retrieves arbitrary information from the DNS. The caller supplies a QNAME, QTYPE, and QCLASS, and all of the matching RRs are returned. All RR content (e.g., TTL) was returned. The caller need parse the returned RR to get required information. The function is optional. Implementation can choose to support it or not.

Parameters:
[in] This Pointer to EFI_DNS6_PROTOCOL instance.
[in] QName Pointer to Query Name.
[in] QType Query Type.
[in] QClass Query Name.
[in] Token Point to the completion token to retrieve arbitrary information.
Return values:
EFI_SUCCESS The operation completed successfully.
EFI_UNSUPPORTED This function is not supported. Or the requested QType is not supported
EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: This is NULL. Token is NULL. Token.Event is NULL. QName is NULL.
EFI_NO_MAPPING There's no source address is available for use.
EFI_NOT_STARTED This instance has not been started.
EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
This function is to update the DNS Cache.

The UpdateDnsCache() function is used to add/delete/modify DNS cache entry. DNS cache can be normally dynamically updated after the DNS resolve succeeds. This function provided capability to manually add/delete/modify the DNS cache.

Parameters:
[in] This Pointer to EFI_DNS6_PROTOCOL instance.
[in] DeleteFlag If FALSE, this function is to add one entry to the DNS Cahce. If TRUE, this function will delete matching DNS Cache entry.
[in] Override If TRUE, the maching DNS cache entry will be overwritten with the supplied parameter. If FALSE, EFI_ACCESS_DENIED will be returned if the entry to be added is already existed.
[in] DnsCacheEntry Pointer to DNS Cache entry.
Return values:
EFI_SUCCESS The operation completed successfully.
EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: This is NULL. DnsCacheEntry.HostName is NULL. DnsCacheEntry.IpAddress is NULL. DnsCacheEntry.Timeout is zero.
EFI_ACCESS_DENIED The DNS cache entry already exists and Override is not TRUE.
EFI_OUT_OF_RESOURCE Failed to allocate needed resources.
Polls for incoming data packets and processes outgoing data packets.

The Poll() function can be used by network drivers and applications to increase the rate that data packets are moved between the communications device and the transmit and receive queues.

In some systems, the periodic timer event in the managed network driver may not poll the underlying communications device fast enough to transmit and/or receive all data packets without missing incoming packets or dropping outgoing packets. Drivers and applications that are experiencing packet loss should try calling the Poll() function more often.

Parameters:
[in] This Pointer to EFI_DNS6_PROTOCOL instance.
Return values:
EFI_SUCCESS Incoming or outgoing data was processed.
EFI_NOT_STARTED This EFI DNS Protocol instance has not been started.
EFI_INVALID_PARAMETER This is NULL.
EFI_NO_MAPPING There is no source address is available for use.
EFI_DEVICE_ERROR An unexpected system or network error occurred.
EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue. Consider increasing the polling rate.
Abort an asynchronous DNS operation, including translation between IP and Host, and general look up behavior.

The Cancel() function is used to abort a pending resolution request. After calling this function, Token.Status will be set to EFI_ABORTED and then Token.Event will be signaled. If the token is not in one of the queues, which usually means that the asynchronous operation has completed, this function will not signal the token and EFI_NOT_FOUND is returned.

Parameters:
[in] This Pointer to EFI_DNS6_PROTOCOL instance.
[in] Token Pointer to a token that has been issued by EFI_DNS6_PROTOCOL.HostNameToIp (), EFI_DNS6_PROTOCOL.IpToHostName() or EFI_DNS6_PROTOCOL.GeneralLookup(). If NULL, all pending tokens are aborted.
Return values:
EFI_SUCCESS Incoming or outgoing data was processed.
EFI_NOT_STARTED This EFI DNS6 Protocol instance has not been started.
EFI_INVALID_PARAMETER This is NULL.
EFI_NO_MAPPING There's no source address is available for use.
EFI_NOT_FOUND When Token is not NULL, and the asynchronous DNS operation was not found in the transmit queue. It was either completed or was not issued by HostNameToIp(), IpToHostName() or GeneralLookup().
Set EAP configuration data.

The SetData() function sets EAP configuration to non-volatile storage or volatile storage.

Parameters:
[in] This Pointer to the EFI_EAP_CONFIGURATION_PROTOCOL instance.
[in] EapType EAP type.
[in] DataType Configuration data type.
[in] Data Pointer to configuration data.
[in] DataSize Total size of configuration data.
Return values:
EFI_SUCCESS The EAP configuration data is set successfully.
EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: Data is NULL. DataSize is 0.
EFI_UNSUPPORTED The EapType or DataType is unsupported.
EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
Get EAP configuration data.

The GetData() function gets EAP configuration.

Parameters:
[in] This Pointer to the EFI_EAP_CONFIGURATION_PROTOCOL instance.
[in] EapType EAP type.
[in] DataType Configuration data type.
[in,out] Data Pointer to configuration data.
[in,out] DataSize Total size of configuration data. On input, it means the size of Data buffer. On output, it means the size of copied Data buffer if EFI_SUCCESS, and means the size of desired Data buffer if EFI_BUFFER_TOO_SMALL.
Return values:
EFI_SUCCESS The EAP configuration data is got successfully.
EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: Data is NULL. DataSize is NULL.
EFI_UNSUPPORTED The EapType or DataType is unsupported.
EFI_NOT_FOUND The EAP configuration data is not found.
EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.
Return key generated through EAP process.

The GetKey() function return the key generated through EAP process, so that the 802.11 MAC layer driver can use MSK to derive more keys, e.g. PMK (Pairwise Master Key).

Parameters:
[in] This Pointer to the EFI_EAP_MANAGEMENT2_PROTOCOL instance.
[in,out] Msk Pointer to MSK (Master Session Key) buffer.
[in,out] MskSize MSK buffer size.
[in,out] Emsk Pointer to EMSK (Extended Master Session Key) buffer.
[in,out] EmskSize EMSK buffer size.
Return values:
EFI_SUCCESS The operation completed successfully.
EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: Msk is NULL. MskSize is NULL. Emsk is NULL. EmskSize is NULL.
EFI_NOT_READY MSK and EMSK are not generated in current session yet.
This function accepts a <MultiKeywordResp> formatted string, finds the associated keyword owners, creates a <MultiConfigResp> string from it and forwards it to the EFI_HII_ROUTING_PROTOCOL.RouteConfig function.

If there is an issue in resolving the contents of the KeywordString, then the function returns an error and also sets the Progress and ProgressErr with the appropriate information about where the issue occurred and additional data about the nature of the issue.

In the case when KeywordString containing multiple keywords, when an EFI_NOT_FOUND error is generated during processing the second or later keyword element, the system storage associated with earlier keywords is not modified. All elements of the KeywordString must successfully pass all tests for format and access prior to making any modifications to storage.

In the case when EFI_DEVICE_ERROR is returned from the processing of a KeywordString containing multiple keywords, the state of storage associated with earlier keywords is undefined.

Parameters:
This Pointer to the EFI_KEYWORD_HANDLER _PROTOCOL instance.
KeywordString A null-terminated string in <MultiKeywordResp> format.
Progress On return, points to a character in the KeywordString. Points to the string's NULL terminator if the request was successful. Points to the most recent '&' before the first failing string element if the request was not successful.
ProgressErr If during the processing of the KeywordString there was a failure, this parameter gives additional information about the possible source of the problem. The various errors are defined in "Related Definitions" below.
Return values:
EFI_SUCCESS The specified action was completed successfully.
EFI_INVALID_PARAMETER One or more of the following are TRUE: 1. KeywordString is NULL. 2. Parsing of the KeywordString resulted in an error. See Progress and ProgressErr for more data.
EFI_NOT_FOUND An element of the KeywordString was not found. See ProgressErr for more data.
EFI_OUT_OF_RESOURCES Required system resources could not be allocated. See ProgressErr for more data.
EFI_ACCESS_DENIED The action violated system policy. See ProgressErr for more data.
EFI_DEVICE_ERROR An unexpected system error occurred. See ProgressErr for more data.
This function accepts a <MultiKeywordRequest> formatted string, finds the underlying keyword owners, creates a <MultiConfigRequest> string from it and forwards it to the EFI_HII_ROUTING_PROTOCOL.ExtractConfig function.

If there is an issue in resolving the contents of the KeywordString, then the function returns an EFI_INVALID_PARAMETER and also set the Progress and ProgressErr with the appropriate information about where the issue occurred and additional data about the nature of the issue.

In the case when KeywordString is NULL, or contains multiple keywords, or when EFI_NOT_FOUND is generated while processing the keyword elements, the Results string contains values returned for all keywords processed prior to the keyword generating the error but no values for the keyword with error or any following keywords.

Parameters:
This Pointer to the EFI_KEYWORD_HANDLER _PROTOCOL instance.
NameSpaceId A null-terminated string containing the platform configuration language to search through in the system. If a NULL is passed in, then it is assumed that any platform configuration language with the prefix of "x-UEFI-" are searched.
KeywordString A null-terminated string in <MultiKeywordRequest> format. If a NULL is passed in the KeywordString field, all of the known keywords in the system for the NameSpaceId specified are returned in the Results field.
Progress On return, points to a character in the KeywordString. Points to the string's NULL terminator if the request was successful. Points to the most recent '&' before the first failing string element if the request was not successful.
ProgressErr If during the processing of the KeywordString there was a failure, this parameter gives additional information about the possible source of the problem. See the definitions in SetData() for valid value definitions.
Results A null-terminated string in <MultiKeywordResp> format is returned which has all the values filled in for the keywords in the KeywordString. This is a callee-allocated field, and must be freed by the caller after being used.
Return values:
EFI_SUCCESS The specified action was completed successfully.
EFI_INVALID_PARAMETER One or more of the following are TRUE: 1.Progress, ProgressErr, or Resuts is NULL. 2.Parsing of the KeywordString resulted in an error. See Progress and ProgressErr for more data.
EFI_NOT_FOUND An element of the KeywordString was not found. See ProgressErr for more data.
EFI_NOT_FOUND The NamespaceId specified was not found. See ProgressErr for more data.
EFI_OUT_OF_RESOURCES Required system resources could not be allocated. See ProgressErr for more data.
EFI_ACCESS_DENIED The action violated system policy. See ProgressErr for more data.
EFI_DEVICE_ERROR An unexpected system error occurred. See ProgressErr for more data.
The Request() function queues an HTTP request to this HTTP instance, similar to Transmit() function in the EFI TCP driver. When the HTTP request is sent successfully, or if there is an error, Status in token will be updated and Event will be signaled.

Parameters:
[in] This Pointer to EFI_HTTP_PROTOCOL instance.
[in] Token Pointer to storage containing HTTP request token.
Return values:
EFI_SUCCESS Outgoing data was processed.
EFI_NOT_STARTED This EFI HTTP Protocol instance has not been started.
EFI_DEVICE_ERROR An unexpected system or network error occurred.
EFI_TIMEOUT Data was dropped out of the transmit or receive queue.
EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: This is NULL. Token->Message is NULL. Token->Message->Body is not NULL, Token->Message->BodyLength is non-zero, and Token->Message->Data is NULL, but a previous call to Request()has not been completed successfully.
The Response() function queues an HTTP response to this HTTP instance, similar to Receive() function in the EFI TCP driver. When the HTTP request is sent successfully, or if there is an error, Status in token will be updated and Event will be signaled.

The HTTP driver will queue a receive token to the underlying TCP instance. When data is received in the underlying TCP instance, the data will be parsed and Token will be populated with the response data. If the data received from the remote host contains an incomplete or invalid HTTP header, the HTTP driver will continue waiting (asynchronously) for more data to be sent from the remote host before signaling Event in Token.

It is the responsibility of the caller to allocate a buffer for Body and specify the size in BodyLength. If the remote host provides a response that contains a content body, up to BodyLength bytes will be copied from the receive buffer into Body and BodyLength will be updated with the amount of bytes received and copied to Body. This allows the client to download a large file in chunks instead of into one contiguous block of memory. Similar to HTTP request, if Body is not NULL and BodyLength is non-zero and all other fields are NULL or 0, the HTTP driver will queue a receive token to underlying TCP instance. If data arrives in the receive buffer, up to BodyLength bytes of data will be copied to Body. The HTTP driver will then update BodyLength with the amount of bytes received and copied to Body.

If the HTTP driver does not have an open underlying TCP connection with the host specified in the response URL, Request() will return EFI_ACCESS_DENIED. This is consistent with RFC 2616 recommendation that HTTP clients should attempt to maintain an open TCP connection between client and host.

Parameters:
[in] This Pointer to EFI_HTTP_PROTOCOL instance.
[in] Token Pointer to storage containing HTTP response token.
Return values:
EFI_SUCCESS Allocation succeeded.
EFI_NOT_STARTED This EFI HTTP Protocol instance has not been initialized.
EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: This is NULL. Token->Message->Headers is NULL. Token->Message is NULL. Token->Message->Body is not NULL, Token->Message->BodyLength is non-zero, and Token->Message->Data is NULL, but a previous call to Response() has not been completed successfully.
EFI_ACCESS_DENIED An open TCP connection is not present with the host specified by response URL.
The Poll() function can be used by network drivers and applications to increase the rate that data packets are moved between the communication devices and the transmit and receive queues.

In some systems, the periodic timer event in the managed network driver may not poll the underlying communications device fast enough to transmit and/or receive all data packets without missing incoming packets or dropping outgoing packets. Drivers and applications that are experiencing packet loss should try calling the Poll() function more often.

Parameters:
[in] This Pointer to EFI_HTTP_PROTOCOL instance.
Return values:
EFI_SUCCESS Incoming or outgoing data was processed..
EFI_DEVICE_ERROR An unexpected system or network error occurred
EFI_INVALID_PARAMETER This is NULL.
EFI_NOT_READY No incoming or outgoing data is processed.
Create HTTP header based on a combination of seed header, fields to delete, and fields to append.

The Build() function is used to manage the headers portion of an HTTP message by providing the ability to add, remove, or replace HTTP headers.

Parameters:
[in] This Pointer to EFI_HTTP_UTILITIES_PROTOCOL instance.
[in] SeedMessageSize Size of the initial HTTP header. This can be zero.
[in] SeedMessage Initial HTTP header to be used as a base for building a new HTTP header. If NULL, SeedMessageSize is ignored.
[in] DeleteCount Number of null-terminated HTTP header field names in DeleteList.
[in] DeleteList List of null-terminated HTTP header field names to remove from SeedMessage. Only the field names are in this list because the field values are irrelevant to this operation.
[in] AppendCount Number of header fields in AppendList.
[in] AppendList List of HTTP headers to populate NewMessage with. If SeedMessage is not NULL, AppendList will be appended to the existing list from SeedMessage in NewMessage.
[out] NewMessageSize Pointer to number of header fields in NewMessage.
[out] NewMessage Pointer to a new list of HTTP headers based on.
Return values:
EFI_SUCCESS Add, remove, and replace operations succeeded.
EFI_OUT_OF_RESOURCES Could not allocate memory for NewMessage.
EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: This is NULL.
Parses HTTP header and produces an array of key/value pairs.

The Parse() function is used to transform data stored in HttpHeader into a list of fields paired with their corresponding values.

Parameters:
[in] This Pointer to EFI_HTTP_UTILITIES_PROTOCOL instance.
[in] HttpMessage Contains raw unformatted HTTP header string.
[in] HttpMessageSize Size of HTTP header.
[out] HeaderFields Array of key/value header pairs.
[out] FieldCount Number of headers in HeaderFields.
Return values:
EFI_SUCCESS Allocation succeeded.
EFI_NOT_STARTED This EFI HTTP Protocol instance has not been initialized.
EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: This is NULL. HttpMessage is NULL. HeaderFields is NULL. FieldCount is NULL.
Enable access to an I2C bus configuration.

This routine must be called at or below TPL_NOTIFY. For synchronous requests this routine must be called at or below TPL_CALLBACK.

Reconfigure the switches and multiplexers in the I2C bus to enable access to a specific I2C bus configuration. Also select the maximum clock frequency for this I2C bus configuration.

This routine uses the I2C Master protocol to perform I2C transactions on the local bus. This eliminates any recursion in the I2C stack for configuration transactions on the same I2C bus. This works because the local I2C bus is idle while the I2C bus configuration is being enabled.

If I2C transactions must be performed on other I2C busses, then the EFI_I2C_HOST_PROTOCOL, the EFI_I2C_IO_PROTCOL, or a third party I2C driver interface for a specific device must be used. This requirement is because the I2C host protocol controls the flow of requests to the I2C controller. Use the EFI_I2C_HOST_PROTOCOL when the I2C device is not enumerated by the EFI_I2C_ENUMERATE_PROTOCOL. Use a protocol produced by a third party driver when it is available or the EFI_I2C_IO_PROTOCOL when the third party driver is not available but the device is enumerated with the EFI_I2C_ENUMERATE_PROTOCOL.

When Event is NULL, EnableI2cBusConfiguration operates synchronously and returns the I2C completion status as its return value.

Parameters:
[in] This Pointer to an EFI_I2C_BUS_CONFIGURATION_MANAGEMENT_PROTOCOL structure.
[in] I2cBusConfiguration Index of an I2C bus configuration. All values in the range of zero to N-1 are valid where N is the total number of I2C bus configurations for an I2C bus.
[in] Event Event to signal when the transaction is complete
[out] I2cStatus Buffer to receive the transaction status.
Returns:
When Event is NULL, EnableI2cBusConfiguration operates synchrouously and returns the I2C completion status as its return value. In this case it is recommended to use NULL for I2cStatus. The values returned from EnableI2cBusConfiguration are:
Return values:
EFI_SUCCESS The asynchronous bus configuration request was successfully started when Event is not NULL.
EFI_SUCCESS The bus configuration request completed successfully when Event is NULL.
EFI_DEVICE_ERROR The bus configuration failed.
EFI_NO_MAPPING Invalid I2cBusConfiguration value
Enumerate the I2C devices

This function enables the caller to traverse the set of I2C devices on an I2C bus.

Parameters:
[in] This The platform data for the next device on the I2C bus was returned successfully.
[in,out] Device Pointer to a buffer containing an EFI_I2C_DEVICE structure. Enumeration is started by setting the initial EFI_I2C_DEVICE structure pointer to NULL. The buffer receives an EFI_I2C_DEVICE structure pointer to the next I2C device.
Return values:
EFI_SUCCESS The platform data for the next device on the I2C bus was returned successfully.
EFI_INVALID_PARAMETER Device is NULL
EFI_NO_MAPPING *Device does not point to a valid EFI_I2C_DEVICE structure returned in a previous call Enumerate().
Get the requested I2C bus frequency for a specified bus configuration.

This function returns the requested I2C bus clock frequency for the I2cBusConfiguration. This routine is provided for diagnostic purposes and is meant to be called after calling Enumerate to get the I2cBusConfiguration value.

Parameters:
[in] This Pointer to an EFI_I2C_ENUMERATE_PROTOCOL structure.
[in] I2cBusConfiguration I2C bus configuration to access the I2C device
[out] *BusClockHertz Pointer to a buffer to receive the I2C bus clock frequency in Hertz
Return values:
EFI_SUCCESS The I2C bus frequency was returned successfully.
EFI_INVALID_PARAMETER BusClockHertz was NULL
EFI_NO_MAPPING Invalid I2cBusConfiguration value
Queue an I2C transaction for execution on the I2C controller.

This routine must be called at or below TPL_NOTIFY. For synchronous requests this routine must be called at or below TPL_CALLBACK.

The I2C host protocol uses the concept of I2C bus configurations to describe the I2C bus. An I2C bus configuration is defined as a unique setting of the multiplexers and switches in the I2C bus which enable access to one or more I2C devices. When using a switch to divide a bus, due to bus frequency differences, the I2C bus configuration management protocol defines an I2C bus configuration for the I2C devices on each side of the switch. When using a multiplexer, the I2C bus configuration management defines an I2C bus configuration for each of the selector values required to control the multiplexer. See Figure 1 in the I2C -bus specification and user manual for a complex I2C bus configuration.

The I2C host protocol processes all transactions in FIFO order. Prior to performing the transaction, the I2C host protocol calls EnableI2cBusConfiguration to reconfigure the switches and multiplexers in the I2C bus enabling access to the specified I2C device. The EnableI2cBusConfiguration also selects the I2C bus frequency for the I2C device. After the I2C bus is configured, the I2C host protocol calls the I2C master protocol to start the I2C transaction.

When Event is NULL, QueueRequest() operates synchronously and returns the I2C completion status as its return value.

When Event is not NULL, QueueRequest() synchronously returns EFI_SUCCESS indicating that the asynchronously I2C transaction was queued. The values above are returned in the buffer pointed to by I2cStatus upon the completion of the I2C transaction when I2cStatus is not NULL.

Parameters:
[in] This Pointer to an EFI_I2C_HOST_PROTOCOL structure.
[in] I2cBusConfiguration I2C bus configuration to access the I2C device
[in] SlaveAddress Address of the device on the I2C bus. Set the I2C_ADDRESSING_10_BIT when using 10-bit addresses, clear this bit for 7-bit addressing. Bits 0-6 are used for 7-bit I2C slave addresses and bits 0-9 are used for 10-bit I2C slave addresses.
[in] Event Event to signal for asynchronous transactions, NULL for synchronous transactions
[in] RequestPacket Pointer to an EFI_I2C_REQUEST_PACKET structure describing the I2C transaction
[out] I2cStatus Optional buffer to receive the I2C transaction completion status
Return values:
EFI_SUCCESS The asynchronous transaction was successfully queued when Event is not NULL.
EFI_SUCCESS The transaction completed successfully when Event is NULL.
EFI_BAD_BUFFER_SIZE The RequestPacket->LengthInBytes value is too large.
EFI_DEVICE_ERROR There was an I2C error (NACK) during the transaction.
EFI_INVALID_PARAMETER RequestPacket is NULL
EFI_NOT_FOUND Reserved bit set in the SlaveAddress parameter
EFI_NO_MAPPING Invalid I2cBusConfiguration value
EFI_NO_RESPONSE The I2C device is not responding to the slave address. EFI_DEVICE_ERROR will be returned if the controller cannot distinguish when the NACK occurred.
EFI_OUT_OF_RESOURCES Insufficient memory for I2C transaction
EFI_UNSUPPORTED The controller does not support the requested transaction.
Queue an I2C transaction for execution on the I2C device.

This routine must be called at or below TPL_NOTIFY. For synchronous requests this routine must be called at or below TPL_CALLBACK.

This routine queues an I2C transaction to the I2C controller for execution on the I2C bus.

When Event is NULL, QueueRequest() operates synchronously and returns the I2C completion status as its return value.

When Event is not NULL, QueueRequest() synchronously returns EFI_SUCCESS indicating that the asynchronous I2C transaction was queued. The values above are returned in the buffer pointed to by I2cStatus upon the completion of the I2C transaction when I2cStatus is not NULL.

The upper layer driver writer provides the following to the platform vendor:

1. Vendor specific GUID for the I2C part 2. Guidance on proper construction of the slave address array when the I2C device uses more than one slave address. The I2C bus protocol uses the SlaveAddressIndex to perform relative to physical address translation to access the blocks of hardware within the I2C device.

Parameters:
[in] This Pointer to an EFI_I2C_IO_PROTOCOL structure.
[in] SlaveAddressIndex Index value into an array of slave addresses for the I2C device. The values in the array are specified by the board designer, with the third party I2C device driver writer providing the slave address order.
For devices that have a single slave address, this value must be zero. If the I2C device uses more than one slave address then the third party (upper level) I2C driver writer needs to specify the order of entries in the slave address array.

Third Party I2C Drivers" section in I2cMaster.h.

Parameters:
[in] Event Event to signal for asynchronous transactions, NULL for synchronous transactions
[in] RequestPacket Pointer to an EFI_I2C_REQUEST_PACKET structure describing the I2C transaction
[out] I2cStatus Optional buffer to receive the I2C transaction completion status
Return values:
EFI_SUCCESS The asynchronous transaction was successfully queued when Event is not NULL.
EFI_SUCCESS The transaction completed successfully when Event is NULL.
EFI_BAD_BUFFER_SIZE The RequestPacket->LengthInBytes value is too large.
EFI_DEVICE_ERROR There was an I2C error (NACK) during the transaction.
EFI_INVALID_PARAMETER RequestPacket is NULL.
EFI_NO_MAPPING The EFI_I2C_HOST_PROTOCOL could not set the bus configuration required to access this I2C device.
EFI_NO_RESPONSE The I2C device is not responding to the slave address selected by SlaveAddressIndex. EFI_DEVICE_ERROR will be returned if the controller cannot distinguish when the NACK occurred.
EFI_OUT_OF_RESOURCES Insufficient memory for I2C transaction
EFI_UNSUPPORTED The controller does not support the requested transaction.
Set the frequency for the I2C clock line.

This routine must be called at or below TPL_NOTIFY.

The software and controller do a best case effort of using the specified frequency for the I2C bus. If the frequency does not match exactly then the I2C master protocol selects the next lower frequency to avoid exceeding the operating conditions for any of the I2C devices on the bus. For example if 400 KHz was specified and the controller's divide network only supports 402 KHz or 398 KHz then the I2C master protocol selects 398 KHz. If there are not lower frequencies available, then return EFI_UNSUPPORTED.

Parameters:
[in] This Pointer to an EFI_I2C_MASTER_PROTOCOL structure
[in] BusClockHertz Pointer to the requested I2C bus clock frequency in Hertz. Upon return this value contains the actual frequency in use by the I2C controller.
Return values:
EFI_SUCCESS The bus frequency was set successfully.
EFI_ALREADY_STARTED The controller is busy with another transaction.
EFI_INVALID_PARAMETER BusClockHertz is NULL
EFI_UNSUPPORTED The controller does not support this frequency.
Reset the I2C controller and configure it for use

This routine must be called at or below TPL_NOTIFY.

The I2C controller is reset. The caller must call SetBusFrequench() after calling Reset().

Parameters:
[in] This Pointer to an EFI_I2C_MASTER_PROTOCOL structure.
Return values:
EFI_SUCCESS The reset completed successfully.
EFI_ALREADY_STARTED The controller is busy with another transaction.
EFI_DEVICE_ERROR The reset operation failed.
Start an I2C transaction on the host controller.

This routine must be called at or below TPL_NOTIFY. For synchronous requests this routine must be called at or below TPL_CALLBACK.

This function initiates an I2C transaction on the controller. To enable proper error handling by the I2C protocol stack, the I2C master protocol does not support queuing but instead only manages one I2C transaction at a time. This API requires that the I2C bus is in the correct configuration for the I2C transaction.

The transaction is performed by sending a start-bit and selecting the I2C device with the specified I2C slave address and then performing the specified I2C operations. When multiple operations are requested they are separated with a repeated start bit and the slave address. The transaction is terminated with a stop bit.

When Event is NULL, StartRequest operates synchronously and returns the I2C completion status as its return value.

When Event is not NULL, StartRequest synchronously returns EFI_SUCCESS indicating that the I2C transaction was started asynchronously. The transaction status value is returned in the buffer pointed to by I2cStatus upon the completion of the I2C transaction when I2cStatus is not NULL. After the transaction status is returned the Event is signaled.

Note: The typical consumer of this API is the I2C host protocol. Extreme care must be taken by other consumers of this API to prevent confusing the third party I2C drivers due to a state change at the I2C device which the third party I2C drivers did not initiate. I2C platform specific code may use this API within these guidelines.

Parameters:
[in] This Pointer to an EFI_I2C_MASTER_PROTOCOL structure.
[in] SlaveAddress Address of the device on the I2C bus. Set the I2C_ADDRESSING_10_BIT when using 10-bit addresses, clear this bit for 7-bit addressing. Bits 0-6 are used for 7-bit I2C slave addresses and bits 0-9 are used for 10-bit I2C slave addresses.
[in] RequestPacket Pointer to an EFI_I2C_REQUEST_PACKET structure describing the I2C transaction.
[in] Event Event to signal for asynchronous transactions, NULL for asynchronous transactions
[out] I2cStatus Optional buffer to receive the I2C transaction completion status
Return values:
EFI_SUCCESS The asynchronous transaction was successfully started when Event is not NULL.
EFI_SUCCESS The transaction completed successfully when Event is NULL.
EFI_ALREADY_STARTED The controller is busy with another transaction.
EFI_BAD_BUFFER_SIZE The RequestPacket->LengthInBytes value is too large.
EFI_DEVICE_ERROR There was an I2C error (NACK) during the transaction.
EFI_INVALID_PARAMETER RequestPacket is NULL
EFI_NOT_FOUND Reserved bit set in the SlaveAddress parameter
EFI_NO_RESPONSE The I2C device is not responding to the slave address. EFI_DEVICE_ERROR will be returned if the controller cannot distinguish when the NACK occurred.
EFI_OUT_OF_RESOURCES Insufficient memory for I2C transaction
EFI_UNSUPPORTED The controller does not support the requested transaction.
Set the configuration for the EFI IPv4 network stack running on the communication device this EFI IPv4 Configuration II Protocol instance manages.

This function is used to set the configuration data of type DataType for the EFI IPv4 network stack running on the communication device this EFI IPv4 Configuration II Protocol instance manages. The successfully configured data is valid after system reset or power-off. The DataSize is used to calculate the count of structure instances in the Data for some DataType that multiple structure instances are allowed. This function is always non-blocking. When setting some typeof configuration data, an asynchronous process is invoked to check the correctness of the data, such as doing address conflict detection on the manually set local IPv4 address. EFI_NOT_READY is returned immediately to indicate that such an asynchronous process is invoked and the process is not finished yet. The caller willing to get the result of the asynchronous process is required to call RegisterDataNotify() to register an event on the specified configuration data. Once the event is signaled, the caller can call GetData()to get back the configuration data in order to know the result. For other types of configuration data that do not require an asynchronous configuration process, the result of the operation is immediately returned.

Parameters:
[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance.
[in] DataType The type of data to set.
[in] DataSize Size of the buffer pointed to by Data in bytes.
[in] Data The data buffer to set. The type ofthe data buffer is associated with the DataType.
Return values:
EFI_SUCCESS The specified configuration data for the EFI IPv4 network stack is set successfully.
EFI_INVALID_PARAMETER One or more of the following are TRUE: This is NULL. Data is NULL. One or more fields in Data do not match the requirement of the data type indicated by DataType.
EFI_WRITE_PROTECTED The specified configuration data is read-only or the specified configuration data can not be set under the current policy.
EFI_ACCESS_DENIED Another set operation on the specified configuration data is already in process.
EFI_NOT_READY An asynchronous process is invoked to set the specified configuration data and the process is not finished yet.
EFI_BAD_BUFFER_SIZE The DataSize does not match the size of the type indicated by DataType.
EFI_UNSUPPORTED This DataType is not supported.
EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
EFI_DEVICE_ERROR An unexpected system error or network error occurred.
Get the configuration data for the EFI IPv4 network stack running on the communication device this EFI IPv4 Configuration II Protocol instance manages.

This function returns the configuration data of type DataType for the EFI IPv4 network stack running on the communication device this EFI IPv4 Configuration II Protocol instance manages. The caller is responsible for allocating the buffer usedto return the specified configuration data and the required size will be returned to the caller if the size of the buffer is too small. EFI_NOT_READY is returned if the specified configuration data is not ready due to an already in progress asynchronous configuration process. The caller can call RegisterDataNotify() to register an event on the specified configuration data. Once the asynchronous configuration process is finished, the event will be signaled and a subsequent GetData() call will return the specified configuration data.

Parameters:
[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance.
[in] DataType The type of data to get.
[out] DataSize On input, in bytes, the size of Data. On output, in bytes, the size of buffer required to store the specified configuration data.
[in] Data The data buffer in which the configuration data is returned. The type of the data buffer is associated with the DataType. Ignored if DataSize is 0.
Return values:
EFI_SUCCESS The specified configuration data is got successfully.
EFI_INVALID_PARAMETER One or more of the followings are TRUE: This is NULL. DataSize is NULL. Data is NULL if *DataSizeis not zero.
EFI_BUFFER_TOO_SMALL The size of Data is too small for the specified configuration data and the required size is returned in DataSize.
EFI_NOT_READY The specified configuration data is not ready due to an already in progress asynchronous configuration process.
EFI_NOT_FOUND The specified configuration data is not found.
Register an event that is to be signaled whenever a configuration process on the specified configuration data is done.

This function registers an event that is to be signaled whenever a configuration process on the specified configuration data is done. An event can be registered for different DataType simultaneously and the caller is responsible for determining which type of configuration data causes the signaling of the event in such case.

Parameters:
[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance.
[in] DataType The type of data to unregister the event for.
[in] Event The event to register.
Return values:
EFI_SUCCESS The notification event for the specified configuration data is registered.
EFI_INVALID_PARAMETER This is NULL or Event is NULL.
EFI_UNSUPPORTED The configuration data type specified by DataType is not supported.
EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
EFI_ACCESS_DENIED The Event is already registered for the DataType.
Remove a previously registered event for the specified configuration data.

This function removes a previously registeredevent for the specified configuration data.

Parameters:
[in] This Pointer to the EFI_IP4_CONFIG2_PROTOCOL instance.
[in] DataType The type of data to remove the previously registered event for.
[in] Event The event to unregister.
Return values:
EFI_SUCCESS The event registered for the specified configuration data is removed.
EFI_INVALID_PARAMETER This is NULL or Event is NULL.
EFI_NOT_FOUND The Eventhas not been registered for the specified DataType.
Handles IPsec processing for both inbound and outbound IP packets. Compare with Process() in EFI_IPSEC_PROTOCOL, this interface has the capability to process Option(Extension Header).

The EFI_IPSEC2_PROCESS process routine handles each inbound or outbound packet. The behavior is that it can perform one of the following actions: bypass the packet, discard the packet, or protect the packet.

Parameters:
[in] This Pointer to the EFI_IPSEC2_PROTOCOL instance.
[in] NicHandle Instance of the network interface.
[in] IpVer IP version.IPv4 or IPv6.
[in,out] IpHead Pointer to the IP Header it is either the EFI_IP4_HEADER or EFI_IP6_HEADER. On input, it contains the IP header. On output, 1) in tunnel mode and the traffic direction is inbound, the buffer will be reset to zero by IPsec; 2) in tunnel mode and the traffic direction is outbound, the buffer will reset to be the tunnel IP header.3) in transport mode, the related fielders (like payload length, Next header) in IP header will be modified according to the condition.
[in,out] LastHead For IP4, it is the next protocol in IP header. For IP6 it is the Next Header of the last extension header.
[in,out] OptionsBuffer On input, it contains the options (extensions header) to be processed by IPsec. On output, 1) in tunnel mode and the traffic direction is outbound, it will be set to NULL, and that means this contents was wrapped after inner header and should not be concatenated after tunnel header again; 2) in transport mode and the traffic direction is inbound, if there are IP options (extension headers) protected by IPsec, IPsec will concatenate the those options after the input options (extension headers); 3) on other situations, the output of contents of OptionsBuffer might be same with input's. The caller should take the responsibility to free the buffer both on input and on output.
[in,out] OptionsLength On input, the input length of the options buffer. On output, the output length of the options buffer.
[in,out] FragmentTable Pointer to a list of fragments. On input, these fragments contain the IP payload. On output, 1) in tunnel mode and the traffic direction is inbound, the fragments contain the whole IP payload which is from the IP inner header to the last byte of the packet; 2) in tunnel mode and the traffic direction is the outbound, the fragments contains the whole encapsulated payload which encapsulates the whole IP payload between the encapsulated header and encapsulated trailer fields. 3) in transport mode and the traffic direction is inbound, the fragments contains the IP payload which is from the next layer protocol to the last byte of the packet; 4) in transport mode and the traffic direction is outbound, the fragments contains the whole encapsulated payload which encapsulates the next layer protocol information between the encapsulated header and encapsulated trailer fields.
[in,out] FragmentCount Number of fragments.
[in] TrafficDirection Traffic direction.
[out] RecycleSignal Event for recycling of resources.
Return values:
EFI_SUCCESS The packet was processed by IPsec successfully.
EFI_ACCESS_DENIED The packet was discarded.
EFI_NOT_READY The IKE negotiation is invoked and the packet was discarded.
EFI_INVALID_PARAMETER One or more of following are TRUE: If OptionsBuffer is NULL; If OptionsLength is NULL; If FragmentTable is NULL; If FragmentCount is NULL.
Open I/O aperture.

This function opens an I/O aperture in a ISA Host Controller for the I/O addresses specified by IoAddress to IoAddress + IoLength - 1. It may be possible that a single hardware aperture may be used for more than one device. This function tracks the number of times that each aperture is referenced, and does not close the hardware aperture (via CloseIoAperture()) until there are no more references to it.

Parameters:
This A pointer to this instance of the EFI_ISA_HC_PROTOCOL.
IoAddress An unsigned integer that specifies the first byte of the I/O space required.
IoLength An unsigned integer that specifies the number of bytes of the I/O space required.
IoApertureHandle A pointer to the returned I/O aperture handle. This value can be used on subsequent calls to CloseIoAperture().
Return values:
EFI_SUCCESS The I/O aperture was opened successfully.
EFI_UNSUPPORTED The ISA Host Controller is a subtractive-decode controller.
EFI_OUT_OF_RESOURCES There is no available I/O aperture.
Close I/O aperture.

This function closes a previously opened I/O aperture handle. If there are no more I/O aperture handles that refer to the hardware I/O aperture resource, then the hardware I/O aperture is closed. It may be possible that a single hardware aperture may be used for more than one device. This function tracks the number of times that each aperture is referenced, and does not close the hardware aperture (via CloseIoAperture()) until there are no more references to it.

Parameters:
This A pointer to this instance of the EFI_ISA_HC_PROTOCOL.
IoApertureHandle The I/O aperture handle previously returned from a call to OpenIoAperture().
Return values:
EFI_SUCCESS The IO aperture was closed successfully.
Retrieve additional information associated with a PCD token.

This includes information such as the type of value the TokenNumber is associated with as well as possible human readable name that is associated with the token.

Parameters:
[in] TokenNumber The PCD token number.
[out] PcdInfo The returned information associated with the requested TokenNumber.
Return values:
EFI_SUCCESS The PCD information was returned successfully
EFI_NOT_FOUND The PCD service could not find the requested token number.
Retrieve additional information associated with a PCD token.

This includes information such as the type of value the TokenNumber is associated with as well as possible human readable name that is associated with the token.

Parameters:
[in] Guid The 128-bit unique value that designates the namespace from which to extract the value.
[in] TokenNumber The PCD token number.
[out] PcdInfo The returned information associated with the requested TokenNumber.
Return values:
EFI_SUCCESS The PCD information was returned successfully
EFI_NOT_FOUND The PCD service could not find the requested token number.
Processes a buffer containing binary DER-encoded PKCS7 signature. The signed data content may be embedded within the buffer or separated. Funtion verifies the signature of the content is valid and signing certificate was not revoked and is contained within a list of trusted signers.

Parameters:
[in] This Pointer to EFI_PKCS7_VERIFY_PROTOCOL instance.
[in] SignedData Points to buffer containing ASN.1 DER-encoded PKCS7 signature.
[in] SignedDataSize The size of SignedData buffer in bytes.
[in] InData In case of detached signature, InData points to buffer containing the raw message data previously signed and to be verified by function. In case of SignedData containing embedded data, InData must be NULL.
[in] InDataSize When InData is used, the size of InData buffer in bytes. When InData is NULL. This parameter must be 0.
[in] AllowedDb Pointer to a list of pointers to EFI_SIGNATURE_LIST structures. The list is terminated by a null pointer. The EFI_SIGNATURE_LIST structures contain lists of X.509 certificates of approved signers. Function recognizes signer certificates of type EFI_CERT_X509_GUID. Any hash certificate in AllowedDb list is ignored by this function. Function returns success if signer of the buffer is within this list (and not within RevokedDb). This parameter is required.
[in] RevokedDb Optional pointer to a list of pointers to EFI_SIGNATURE_LIST structures. The list is terminated by a null pointer. List of X.509 certificates of revoked signers and revoked file hashes. Except as noted in description of TimeStampDb signature verification will always fail if the signer of the file or the hash of the data component of the buffer is in RevokedDb list. This list is optional and caller may pass Null or pointer to NULL if not required.
[in] TimeStampDb Optional pointer to a list of pointers to EFI_SIGNATURE_LIST structures. The list is terminated by a null pointer. This parameter can be used to pass a list of X.509 certificates of trusted time stamp signers. This list is optional and caller must pass Null or pointer to NULL if not required.
[out] Content On input, points to an optional caller-allocated buffer into which the function will copy the content portion of the file after verification succeeds. This parameter is optional and if NULL, no copy of content from file is performed.
[in,out] ContentSize On input, points to the size in bytes of the optional buffer Content previously allocated by caller. On output, if the verification succeeds, the value referenced by ContentSize will contain the actual size of the content from signed file. If ContentSize indicates the caller-allocated buffer is too small to contain content, an error is returned, and ContentSize will be updated with the required size. This parameter must be 0 if Content is Null.
Return values:
EFI_SUCCESS Content signature was verified against hash of content, the signer's certificate was not found in RevokedDb, and was found in AllowedDb or if in signer is found in both AllowedDb and RevokedDb, the signing was allowed by reference to TimeStampDb as described above, and no hash matching content hash was found in RevokedDb.
EFI_SECURITY_VIOLATION The SignedData buffer was correctly formatted but signer was in RevokedDb or not in AllowedDb. Also returned if matching content hash found in RevokedDb.
EFI_COMPROMISED_DATA Calculated hash differs from signed hash.
EFI_INVALID_PARAMETER SignedData is NULL or SignedDataSize is zero. AllowedDb is NULL.
EFI_INVALID_PARAMETER Content is not NULL and ContentSize is NULL.
EFI_ABORTED Unsupported or invalid format in TimeStampDb, RevokedDb or AllowedDb list contents was detected.
EFI_NOT_FOUND Content not found because InData is NULL and no content embedded in SignedData.
EFI_UNSUPPORTED The SignedData buffer was not correctly formatted for processing by the function.
EFI_UNSUPPORTED Signed data embedded in SignedData but InData is not NULL.
EFI_BUFFER_TOO_SMALL The size of buffer indicated by ContentSize is too small to hold the content. ContentSize updated to required size.
Processes a buffer containing binary DER-encoded detached PKCS7 signature. The hash of the signed data content is calculated and passed by the caller. Function verifies the signature of the content is valid and signing certificate was not revoked and is contained within a list of trusted signers.

Parameters:
[in] This Pointer to EFI_PKCS7_VERIFY_PROTOCOL instance.
[in] Signature Points to buffer containing ASN.1 DER-encoded PKCS detached signature.
[in] SignatureSize The size of Signature buffer in bytes.
[in] InHash InHash points to buffer containing the caller calculated hash of the data. The parameter may not be NULL.
[in] InHashSize The size in bytes of InHash buffer.
[in] AllowedDb Pointer to a list of pointers to EFI_SIGNATURE_LIST structures. The list is terminated by a null pointer. The EFI_SIGNATURE_LIST structures contain lists of X.509 certificates of approved signers. Function recognizes signer certificates of type EFI_CERT_X509_GUID. Any hash certificate in AllowedDb list is ignored by this function. Function returns success if signer of the buffer is within this list (and not within RevokedDb). This parameter is required.
[in] RevokedDb Optional pointer to a list of pointers to EFI_SIGNATURE_LIST structures. The list is terminated by a null pointer. List of X.509 certificates of revoked signers and revoked file hashes. Signature verification will always fail if the signer of the file or the hash of the data component of the buffer is in RevokedDb list. This parameter is optional and caller may pass Null if not required.
[in] TimeStampDb Optional pointer to a list of pointers to EFI_SIGNATURE_LIST structures. The list is terminated by a null pointer. This parameter can be used to pass a list of X.509 certificates of trusted time stamp counter-signers.
Return values:
EFI_SUCCESS Signed hash was verified against caller-provided hash of content, the signer's certificate was not found in RevokedDb, and was found in AllowedDb or if in signer is found in both AllowedDb and RevokedDb, the signing was allowed by reference to TimeStampDb as described above, and no hash matching content hash was found in RevokedDb.
EFI_SECURITY_VIOLATION The SignedData buffer was correctly formatted but signer was in RevokedDb or not in AllowedDb. Also returned if matching content hash found in RevokedDb.
EFI_COMPROMISED_DATA Caller provided hash differs from signed hash. Or, caller and encrypted hash are different sizes.
EFI_INVALID_PARAMETER Signature is NULL or SignatureSize is zero. InHash is NULL or InHashSize is zero. AllowedDb is NULL.
EFI_ABORTED Unsupported or invalid format in TimeStampDb, RevokedDb or AllowedDb list contents was detected.
EFI_UNSUPPORTED The Signature buffer was not correctly formatted for processing by the function.
Returns information about the regular expression syntax types supported by the implementation.

This A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL instance.

RegExSyntaxTypeListSize On input, the size in bytes of RegExSyntaxTypeList. On output with a return code of EFI_SUCCESS, the size in bytes of the data returned in RegExSyntaxTypeList. On output with a return code of EFI_BUFFER_TOO_SMALL, the size of RegExSyntaxTypeListrequired to obtain the list.

RegExSyntaxTypeList A caller-allocated memory buffer filled by the driver with one EFI_REGEX_SYNTAX_TYPEelement for each supported Regular expression syntax type. The list must not change across multiple calls to the same driver. The first syntax type in the list is the default type for the driver.

Return values:
EFI_SUCCESS The regular expression syntax types list was returned successfully.
EFI_UNSUPPORTED The service is not supported by this driver.
EFI_DEVICE_ERROR The list of syntax types could not be retrieved due to a hardware or firmware error.
EFI_BUFFER_TOO_SMALL The buffer RegExSyntaxTypeList is too small to hold the result.
EFI_INVALID_PARAMETER RegExSyntaxTypeListSize is NULL
Checks if the input string matches to the regular expression pattern.

This A pointer to the EFI_REGULAR_EXPRESSION_PROTOCOL instance. Type EFI_REGULAR_EXPRESSION_PROTOCOL is defined in Section XYZ.

String A pointer to a NULL terminated string to match against the regular expression string specified by Pattern.

Pattern A pointer to a NULL terminated string that represents the regular expression.

SyntaxType A pointer to the EFI_REGEX_SYNTAX_TYPE that identifies the regular expression syntax type to use. May be NULL in which case the function will use its default regular expression syntax type.

Result On return, points to TRUE if String fully matches against the regular expression Pattern using the regular expression SyntaxType. Otherwise, points to FALSE.

Captures A Pointer to an array of EFI_REGEX_CAPTURE objects to receive the captured groups in the event of a match. The full sub-string match is put in Captures[0], and the results of N capturing groups are put in Captures[1:N]. If Captures is NULL, then this function doesn't allocate the memory for the array and does not build up the elements. It only returns the number of matching patterns in CapturesCount. If Captures is not NULL, this function returns a pointer to an array and builds up the elements in the array. CapturesCount is also updated to the number of matching patterns found. It is the caller's responsibility to free the memory pool in Captures and in each CapturePtr in the array elements.

CapturesCount On output, CapturesCount is the number of matching patterns found in String. Zero means no matching patterns were found in the string.

Return values:
EFI_SUCCESS The regular expression string matching completed successfully.
EFI_UNSUPPORTED The regular expression syntax specified by SyntaxTypeis not supported by this driver.
EFI_DEVICE_ERROR The regular expression string matching failed due to a hardware or firmware error.
EFI_INVALID_PARAMETER String, Pattern, Result, or CapturesCountis NULL.
Provides a simple HTTP-like interface to send and receive resources from a REST service.

The SendReceive() function sends an HTTP request to this REST service, and returns a response when the data is retrieved from the service. RequestMessage contains the HTTP request to the REST resource identified by RequestMessage.Request.Url. The ResponseMessage is the returned HTTP response for that request, including any HTTP status.

Parameters:
[in] This Pointer to EFI_REST_PROTOCOL instance for a particular REST service.
[in] RequestMessage Pointer to the HTTP request data for this resource.
[out] ResponseMessage Pointer to the HTTP response data obtained for this requested.
Return values:
EFI_SUCCESS Operation succeeded.
EFI_INVALID_PARAMETER This, RequestMessage, or ResponseMessage are NULL.
EFI_DEVICE_ERROR An unexpected system or network error occurred.
The GetServiceTime() function is an optional interface to obtain the current time from this REST service instance. If this REST service does not support retrieving the time, this function returns EFI_UNSUPPORTED.

Parameters:
[in] This Pointer to EFI_REST_PROTOCOL instance.
[out] Time A pointer to storage to receive a snapshot of the current time of the REST service.
Return values:
EFI_SUCCESS Operation succeeded
EFI_INVALID_PARAMETER This or Time are NULL.
EFI_UNSUPPORTED The RESTful service does not support returning the time.
EFI_DEVICE_ERROR An unexpected system or network error occurred.
Returns information about the random number generation implementation.

Parameters:
[in] This A pointer to the EFI_RNG_PROTOCOL instance.
[in,out] RNGAlgorithmListSize On input, the size in bytes of RNGAlgorithmList. On output with a return code of EFI_SUCCESS, the size in bytes of the data returned in RNGAlgorithmList. On output with a return code of EFI_BUFFER_TOO_SMALL, the size of RNGAlgorithmList required to obtain the list.
[out] RNGAlgorithmList A caller-allocated memory buffer filled by the driver with one EFI_RNG_ALGORITHM element for each supported RNG algorithm. The list must not change across multiple calls to the same driver. The first algorithm in the list is the default algorithm for the driver.
Return values:
EFI_SUCCESS The RNG algorithm list was returned successfully.
EFI_UNSUPPORTED The services is not supported by this driver.
EFI_DEVICE_ERROR The list of algorithms could not be retrieved due to a hardware or firmware error.
EFI_INVALID_PARAMETER One or more of the parameters are incorrect.
EFI_BUFFER_TOO_SMALL The buffer RNGAlgorithmList is too small to hold the result.
Produces and returns an RNG value using either the default or specified RNG algorithm.

Parameters:
[in] This A pointer to the EFI_RNG_PROTOCOL instance.
[in] RNGAlgorithm A pointer to the EFI_RNG_ALGORITHM that identifies the RNG algorithm to use. May be NULL in which case the function will use its default RNG algorithm.
[in] RNGValueLength The length in bytes of the memory buffer pointed to by RNGValue. The driver shall return exactly this numbers of bytes.
[out] RNGValue A caller-allocated memory buffer filled by the driver with the resulting RNG value.
Return values:
EFI_SUCCESS The RNG value was returned successfully.
EFI_UNSUPPORTED The algorithm specified by RNGAlgorithm is not supported by this driver.
EFI_DEVICE_ERROR An RNG value could not be retrieved due to a hardware or firmware error.
EFI_NOT_READY There is not enough random data available to satisfy the length requested by RNGValueLength.
EFI_INVALID_PARAMETER RNGValue is NULL or RNGValueLength is zero.
The DXE Foundation uses this service to measure and/or verify a UEFI image.

This service abstracts the invocation of Trusted Computing Group (TCG) measured boot, UEFI Secure boot, and UEFI User Identity infrastructure. For the former two, the DXE Foundation invokes the FileAuthentication() with a DevicePath and corresponding image in FileBuffer memory. The TCG measurement code will record the FileBuffer contents into the appropriate PCR. The image verification logic will confirm the integrity and provenance of the image in FileBuffer of length FileSize . The origin of the image will be DevicePath in these cases. If the FileBuffer is NULL, the interface will determine if the DevicePath can be connected in order to support the User Identification policy.

Parameters:
This The EFI_SECURITY2_ARCH_PROTOCOL instance.
File A pointer to the device path of the file that is being dispatched. This will optionally be used for logging.
FileBuffer A pointer to the buffer with the UEFI file image.
FileSize The size of the file.
BootPolicy A boot policy that was used to call LoadImage() UEFI service. If FileAuthentication() is invoked not from the LoadImage(), BootPolicy must be set to FALSE.
Return values:
EFI_SUCCESS The file specified by DevicePath and non-NULL FileBuffer did authenticate, and the platform policy dictates that the DXE Foundation may use the file.
EFI_SUCCESS The device path specified by NULL device path DevicePath and non-NULL FileBuffer did authenticate, and the platform policy dictates that the DXE Foundation may execute the image in FileBuffer.
EFI_SUCCESS FileBuffer is NULL and current user has permission to start UEFI device drivers on the device path specified by DevicePath.
EFI_SECURITY_VIOLATION The file specified by DevicePath and FileBuffer did not authenticate, and the platform policy dictates that the file should be placed in the untrusted state. The image has been added to the file execution table.
EFI_ACCESS_DENIED The file specified by File and FileBuffer did not authenticate, and the platform policy dictates that the DXE Foundation may not use File.
EFI_SECURITY_VIOLATION FileBuffer is NULL and the user has no permission to start UEFI device drivers on the device path specified by DevicePath.
EFI_SECURITY_VIOLATION FileBuffer is not NULL and the user has no permission to load drivers from the device path specified by DevicePath. The image has been added into the list of the deferred images.
Reads data from a file.

Parameters:
This A pointer to the EFI_FILE_PROTOCOL instance that is the file handle to read data from.
Token A pointer to the token associated with the transaction.
Return values:
EFI_SUCCESS If Event is NULL (blocking I/O): The data was read successfully. If Event is not NULL (asynchronous I/O): The request was successfully queued for processing.
EFI_NO_MEDIA The device has no medium.
EFI_DEVICE_ERROR The device reported an error.
EFI_DEVICE_ERROR An attempt was made to read from a deleted file.
EFI_DEVICE_ERROR On entry, the current file position is beyond the end of the file.
EFI_VOLUME_CORRUPTED The file system structures are corrupted.
EFI_OUT_OF_RESOURCES Unable to queue the request due to lack of resources.
Writes data to a file.

Parameters:
This A pointer to the EFI_FILE_PROTOCOL instance that is the file handle to write data to.
Token A pointer to the token associated with the transaction.
Return values:
EFI_SUCCESS If Event is NULL (blocking I/O): The data was read successfully. If Event is not NULL (asynchronous I/O): The request was successfully queued for processing.
EFI_UNSUPPORTED Writes to open directory files are not supported.
EFI_NO_MEDIA The device has no medium.
EFI_DEVICE_ERROR The device reported an error.
EFI_DEVICE_ERROR An attempt was made to write to a deleted file.
EFI_VOLUME_CORRUPTED The file system structures are corrupted.
EFI_WRITE_PROTECTED The file or medium is write-protected.
EFI_ACCESS_DENIED The file was opened read only.
EFI_VOLUME_FULL The volume is full.
EFI_OUT_OF_RESOURCES Unable to queue the request due to lack of resources.
Flushes all modified data associated with a file to a device.

Parameters:
This A pointer to the EFI_FILE_PROTOCOL instance that is the file handle to flush.
Token A pointer to the token associated with the transaction.
Return values:
EFI_SUCCESS If Event is NULL (blocking I/O): The data was read successfully. If Event is not NULL (asynchronous I/O): The request was successfully queued for processing.
EFI_NO_MEDIA The device has no medium.
EFI_DEVICE_ERROR The device reported an error.
EFI_VOLUME_CORRUPTED The file system structures are corrupted.
EFI_WRITE_PROTECTED The file or medium is write-protected.
EFI_ACCESS_DENIED The file was opened read-only.
EFI_VOLUME_FULL The volume is full.
EFI_OUT_OF_RESOURCES Unable to queue the request due to lack of resources.
This function retrieves the context driver.

The GetContextfunction returns the context of the protocol, the application identifiers supported by the protocol and the number and the CSN unique identifier of Smart Cards that are present and supported by protocol.

If AidTableSize, AidTable, CsnTableSize, CsnTable or VersionProtocol is NULL, the function does not fail but does not fill in such variables.

In case AidTableSize indicates a buffer too small to hold all the protocol AID table, only the first AidTableSize items of the table are returned in AidTable.

In case CsnTableSize indicates a buffer too small to hold the entire table of Smart Card CSN present, only the first CsnTableSize items of the table are returned in CsnTable.

VersionScEdgeProtocol returns the version of the EFI_SMART_CARD_EDGE_PROTOCOL this driver uses. For this protocol specification value is SMART_CARD_EDGE_PROTOCOL_VERSION_1.

In case of Smart Card removal the internal CSN list is immediately updated, even if a connection is opened with that Smart Card.

Parameters:
[in] This Indicates a pointer to the calling context.
[out] NumberAidSupported Number of AIDs this protocol supports.
[in,out] AidTableSize On input, number of items allocated for the AID table. On output, number of items returned by protocol.
[out] AidTable Table of the AIDs supported by the protocol.
[out] NumberSCPresent Number of currently present Smart Cards that are supported by protocol.
[in,out] CsnTableSize On input, the number of items the buffer CSN table can contain. On output, the number of items returned by the protocol.
[out] CsnTable Table of the CSN of the Smart Card present and supported by protocol.
[out] VersionScEdgeProtocol EFI_SMART_CARD_EDGE_PROTOCOL version.
Return values:
EFI_SUCCESS The requested command completed successfully.
EFI_INVALID_PARAMETER This is NULL.
EFI_INVALID_PARAMETER NumberSCPresent is NULL.
This function establish a connection with a Smart Card the protocol support.

In case of success the SCardHandle can be used.

If the ScardCsn is NULL the connection is established with the first Smart Card the protocol finds in its table of Smart Card present and supported. Else it establish context with the Smart Card whose CSN given by ScardCsn.

If ScardAid is not NULL the function returns the Smart Card AID the protocol supports. After a successful connect the SCardHandle will remain existing even in case Smart Card removed from Smart Card reader, but all function invoking this SCardHandle will fail. SCardHandle is released only on Disconnect.

Parameters:
[in] This Indicates a pointer to the calling context.
[out] SCardHandle Handle on Smart Card connection.
[in] ScardCsn CSN of the Smart Card the connection has to be established.
[out] ScardAid AID of the Smart Card the connection has been established.
Return values:
EFI_SUCCESS The requested command completed successfully.
EFI_INVALID_PARAMETER This is NULL.
EFI_INVALID_PARAMETER SCardHandle is NULL.
EFI_NO_MEDIA No Smart Card supported by protocol is present, Smart Card with CSN ScardCsn or Reader has been removed. A Disconnect should be performed.
This function releases a connection previously established by Connect.

The Disconnect function releases the connection previously established by a Connect. In case the Smart Card or the Smart Card reader has been removed before this call, this function returns EFI_SUCCESS.

Parameters:
[in] This Indicates a pointer to the calling context.
[in] SCardHandle Handle on Smart Card connection to release.
Return values:
EFI_SUCCESS The requested command completed successfully.
EFI_INVALID_PARAMETER This is NULL.
EFI_INVALID_PARAMETER No connection for SCardHandle value.
This function returns the Smart Card serial number.

Parameters:
[in] This Indicates a pointer to the calling context.
[in] SCardHandle Handle on Smart Card connection.
[out] Csn The Card Serial number, 16 bytes array.
Return values:
EFI_SUCCESS The requested command completed successfully.
EFI_INVALID_PARAMETER This is NULL.
EFI_INVALID_PARAMETER No connection for SCardHandle value.
EFI_NO_MEDIA Smart Card or Reader of SCardHandle connection has been removed. A Disconnect should be performed.
This function returns the name of the Smart Card reader used for this connection.

Parameters:
[in] This Indicates a pointer to the calling context.
[in] SCardHandle Handle on Smart Card connection.
[in,out] ReaderNameLength On input, a pointer to the variable that holds the maximal size, in bytes, of ReaderName. On output, the required size, in bytes, for ReaderName.
[out] ReaderName A pointer to a NULL terminated string that will contain the reader name.
Return values:
EFI_SUCCESS The requested command completed successfully.
EFI_INVALID_PARAMETER This is NULL.
EFI_INVALID_PARAMETER No connection for SCardHandle value.
EFI_INVALID_PARAMETER ReaderNameLength is NULL.
EFI_NO_MEDIA Smart Card or Reader of SCardHandle connection has been removed. A Disconnect should be performed.
This function authenticates a Smart Card user by presenting a PIN code.

The VerifyPinfunction presents a PIN code to the Smart Card.

If Smart Card found the PIN code correct the user is considered authenticated to current application, and the function returns TRUE.

Negative or null PinSize value rejected if PinCodeis not NULL.

A NULL PinCodebuffer means the application didn't know the PIN, in that case:

  • If PinSize value is negative the caller only wants to know if the current chain of the elements Smart Card Edge protocol, Smart Card Reader protocol and Smart Card Reader supports the Secure Pin Entry PCSC V2 functionality.
  • If PinSize value is positive or null the caller ask to perform the verify PIN using the Secure PIN Entry functionality.

In PinCode buffer, the PIN value is always given in plaintext, in case of secure messaging the SMART_CARD_EDGE_PROTOCOL will be in charge of all intermediate treatments to build the correct Smart Card APDU.

Parameters:
[in] This Indicates a pointer to the calling context.
[in] SCardHandle Handle on Smart Card connection.
[in] PinSize PIN code buffer size.
[in] PinCode PIN code to present to the Smart Card.
[out] PinResult Result of PIN code presentation to the Smart Card. TRUE when Smard Card founds the PIN code correct.
[out] RemainingAttempts Number of attempts still possible.
Return values:
EFI_SUCCESS The requested command completed successfully.
EFI_UNSUPPORTED Pinsize < 0 and Secure PIN Entry functionality not supported.
EFI_INVALID_PARAMETER This is NULL.
EFI_INVALID_PARAMETER No connection for SCardHandle value.
EFI_INVALID_PARAMETER Bad value for PinSize: value not supported by Smart Card or, negative with PinCode not null.
EFI_INVALID_PARAMETER PinResult is NULL.
EFI_NO_MEDIA Smart Card or Reader of SCardHandle connection has been removed. A Disconnect should be performed.
This function gives the remaining number of attempts for PIN code presentation.

The number of attempts to present a correct PIN is limited and depends on Smart Card and on PIN.

This function will retrieve the number of remaining possible attempts.

Parameters:
[in] This Indicates a pointer to the calling context.
[in] SCardHandle Handle on Smart Card connection.
[out] RemainingAttempts Number of attempts still possible.
Return values:
EFI_SUCCESS The requested command completed successfully.
EFI_INVALID_PARAMETER This is NULL.
EFI_INVALID_PARAMETER No connection for SCardHandle value.
EFI_INVALID_PARAMETER RemainingAttempts is NULL.
EFI_NO_MEDIA Smart Card or Reader of SCardHandle connection has been removed. A Disconnect should be performed.
This function returns a specific data from Smart Card.

The function is generic for any kind of data, but driver and application must share an EFI_GUID that identify the data.

Parameters:
[in] This Indicates a pointer to the calling context.
[in] SCardHandle Handle on Smart Card connection.
[in] DataId The type identifier of the data to get.
[in,out] DataSize On input, in bytes, the size of Data. On output, in bytes, the size of buffer required to store the specified data.
[out] Data The data buffer in which the data is returned. The type of the data buffer is associated with the DataId. Ignored if *DataSize is 0.
Return values:
EFI_SUCCESS The requested command completed successfully.
EFI_INVALID_PARAMETER This is NULL.
EFI_INVALID_PARAMETER No connection for SCardHandle value.
EFI_INVALID_PARAMETER DataId is NULL.
EFI_INVALID_PARAMETER DataSize is NULL.
EFI_INVALID_PARAMETER Data is NULL, and *DataSize is not zero.
EFI_NOT_FOUND DataId unknown for this driver.
EFI_BUFFER_TOO_SMALL The size of Data is too small for the specified data and the required size is returned in DataSize.
EFI_ACCESS_DENIED Operation not performed, conditions not fulfilled. PIN not verified.
EFI_NO_MEDIA Smart Card or Reader of SCardHandle connection has been removed. A Disconnect should be performed.
This function retrieve credentials store into the Smart Card.

The function returns a series of items in TLV (Tag Length Value) format.

First TLV item is the header item that gives the number of following containers (0x00, 0x01, Nb containers).

All these containers are a series of 4 TLV items:

  • The certificate item (0x01, certificate size, certificate)
  • The Key identifier item (0x02, 0x01, key index)
  • The key type item (0x03, 0x01, key type)
  • The key size item (0x04, 0x02, key size), key size in number of bits. Numeric multi-bytes values are on big endian format, most significant byte first:
  • The L field value for certificate (2 bytes)
  • The L field value for key size (2 bytes)
  • The value field for key size (2 bytes)

Parameters:
[in] This Indicates a pointer to the calling context.
[in] SCardHandle Handle on Smart Card connection.
[in,out] CredentialSize On input, in bytes, the size of buffer to store the list of credential. On output, in bytes, the size of buffer required to store the entire list of credentials.
[out] CredentialList List of credentials stored into the Smart Card. A list of TLV (Tag Length Value) elements organized in containers array.
Return values:
EFI_SUCCESS The requested command completed successfully.
EFI_INVALID_PARAMETER This is NULL.
EFI_INVALID_PARAMETER No connection for SCardHandle value.
EFI_INVALID_PARAMETER CredentialSize is NULL.
EFI_INVALID_PARAMETER CredentialList is NULL, if CredentialSize is not zero.
EFI_BUFFER_TOO_SMALL The size of CredentialList is too small for the specified data and the required size is returned in CredentialSize.
EFI_NO_MEDIA Smart Card or Reader of SCardHandle connection has been removed. A Disconnect should be performed.
This function signs an already hashed data with a Smart Card private key.

This function signs data, actually it is the hash of these data that is given to the function.

SignatureData buffer shall be big enough for signature. Signature size is function key size and key type.

Parameters:
[in] This Indicates a pointer to the calling context.
[in] SCardHandle Handle on Smart Card connection.
[in] KeyId Identifier of the key container, retrieved in a key index item of credentials.
[in] KeyType The key type, retrieved in a key type item of credentials.
[in] HashAlgorithm Hash algorithm used to hash the, one of:
  • EFI_HASH_ALGORITHM_SHA1_GUID
  • EFI_HASH_ALGORITHM_SHA256_GUID
  • EFI_HASH_ALGORITHM_SHA384_GUID
  • EFI_HASH_ALGORITHM_SHA512_GUID
[in] PaddingMethod Padding method used jointly with hash algorithm, one of:
  • EFI_PADDING_RSASSA_PKCS1V1P5_GUID
  • EFI_PADDING_RSASSA_PSS_GUID
[in] HashedData Hash of the data to sign. Size is function of the HashAlgorithm.
[out] SignatureData Resulting signature with private key KeyId. Size is function of the KeyType and key size retrieved in the associated key size item of credentials.
Return values:
EFI_SUCCESS The requested command completed successfully.
EFI_INVALID_PARAMETER This is NULL.
EFI_INVALID_PARAMETER No connection for SCardHandle value.
EFI_INVALID_PARAMETER KeyId is not valid.
EFI_INVALID_PARAMETER KeyType is not valid or not corresponding to KeyId.
EFI_INVALID_PARAMETER HashAlgorithm is NULL.
EFI_INVALID_PARAMETER HashAlgorithm is not valid.
EFI_INVALID_PARAMETER PaddingMethod is NULL.
EFI_INVALID_PARAMETER PaddingMethod is not valid.
EFI_INVALID_PARAMETER HashedData is NULL.
EFI_INVALID_PARAMETER SignatureData is NULL.
EFI_ACCESS_DENIED Operation not performed, conditions not fulfilled. PIN not verified.
EFI_NO_MEDIA Smart Card or Reader of SCardHandle connection has been removed. A Disconnect should be performed.
This function decrypts data with a PKI/RSA Smart Card private key.

The function decrypts some PKI/RSA encrypted data with private key securely stored into the Smart Card.

The KeyId must reference a key of type SC_EDGE_RSA_EXCHANGE.

Parameters:
[in] This Indicates a pointer to the calling context.
[in] SCardHandle Handle on Smart Card connection.
[in] KeyId Identifier of the key container, retrieved in a key index item of credentials.
[in] HashAlgorithm Hash algorithm used to hash the, one of:
  • EFI_HASH_ALGORITHM_SHA1_GUID
  • EFI_HASH_ALGORITHM_SHA256_GUID
  • EFI_HASH_ALGORITHM_SHA384_GUID
  • EFI_HASH_ALGORITHM_SHA512_GUID
[in] PaddingMethod Padding method used jointly with hash algorithm, one of:
  • EFI_PADDING_NONE_GUID
  • EFI_PADDING_RSAES_PKCS1V1P5_GUID
  • EFI_PADDING_RSAES_OAEP_GUID
[in] EncryptedSize Size of data to decrypt.
[in] EncryptedData Data to decrypt
[in,out] PlaintextSize On input, in bytes, the size of buffer to store the decrypted data. On output, in bytes, the size of buffer required to store the decrypted data.
[out] PlaintextData Buffer for decrypted data, padding removed.
Return values:
EFI_SUCCESS The requested command completed successfully.
EFI_INVALID_PARAMETER This is NULL.
EFI_INVALID_PARAMETER No connection for SCardHandle value.
EFI_INVALID_PARAMETER KeyId is not valid or associated key not of type SC_EDGE_RSA_EXCHANGE.
EFI_INVALID_PARAMETER HashAlgorithm is NULL.
EFI_INVALID_PARAMETER HashAlgorithm is not valid.
EFI_INVALID_PARAMETER PaddingMethod is NULL.
EFI_INVALID_PARAMETER PaddingMethod is not valid.
EFI_INVALID_PARAMETER EncryptedSize is 0.
EFI_INVALID_PARAMETER EncryptedData is NULL.
EFI_INVALID_PARAMETER PlaintextSize is NULL.
EFI_INVALID_PARAMETER PlaintextData is NULL.
EFI_ACCESS_DENIED Operation not performed, conditions not fulfilled. PIN not verified.
EFI_BUFFER_TOO_SMALL PlaintextSize is too small for the plaintext data and the required size is returned in PlaintextSize.
EFI_NO_MEDIA Smart Card or Reader of SCardHandle connection has been removed. A Disconnect should be performed.
This function performs a secret Diffie Hellman agreement calculation that would be used to derive a symmetric encryption / decryption key.

The function compute a DH agreement that should be diversified togenerate a symmetric key to proceed encryption or decryption.

The application and the Smart Card shall agree on the diversification process.

The KeyId must reference a key of one of the types: SC_EDGE_ECDH_256, SC_EDGE_ECDH_384 or SC_EDGE_ECDH_521.

Parameters:
[in] This Indicates a pointer to the calling context.
[in] SCardHandle Handle on Smart Card connection.
[in] KeyId Identifier of the key container, retrieved in a key index item of credentials.
[in] dataQx Public key x coordinate. Size is the same as key size for KeyId. Stored in big endian format.
[in] dataQy Public key y coordinate. Size is the same as key size for KeyId. Stored in big endian format.
[out] DHAgreement Buffer for DH agreement computed. Size must be bigger or equal to key size for KeyId.
Return values:
EFI_SUCCESS The requested command completed successfully.
EFI_INVALID_PARAMETER This is NULL.
EFI_INVALID_PARAMETER No connection for SCardHandle value.
EFI_INVALID_PARAMETER KeyId is not valid.
EFI_INVALID_PARAMETER dataQx is NULL.
EFI_INVALID_PARAMETER dataQy is NULL.
EFI_INVALID_PARAMETER DHAgreement is NULL.
EFI_ACCESS_DENIED Operation not performed, conditions not fulfilled. PIN not verified.
EFI_NO_MEDIA Smart Card or Reader of SCardHandle connection has been removed. A Disconnect should be performed.
This function requests connection to the smart card or the reader, using the appropriate reset type and protocol.

The SCardConnectfunction requests access to the smart card or the reader. Upon success, it is then possible to call SCardTransmit.

If AccessMode is set to SCARD_AM_READER, PreferredProtocols must be set to SCARD_PROTOCOL_UNDEFINED and CardAction to SCARD_CA_NORESET else function fails with EFI_INVALID_PARAMETER.

Parameters:
[in] This Indicates a pointer to the calling context.
[in] AccessMode Codes of access mode.
[in] CardAction SCARD_CA_NORESET, SCARD_CA_COLDRESET or SCARD_CA_WARMRESET.
[in] PreferredProtocols Bitmask of acceptable protocols.
[out] ActiveProtocol A flag that indicates the active protocol.
Return values:
EFI_SUCCESS The requested command completed successfully.
EFI_INVALID_PARAMETER This is NULL
EFI_INVALID_PARAMETER AccessMode is not valid.
EFI_INVALID_PARAMETER CardAction is not valid.
EFI_INVALID_PARAMETER Invalid combination of AccessMode/CardAction/ PreferredProtocols.
EFI_NOT_READY A smart card is inserted but failed to return an ATR.
EFI_UNSUPPORTED PreferredProtocols does not contain an available protocol to use.
EFI_NO_MEDIA AccessMode is set to SCARD_AM_CARD but there is no smart card inserted.
EFI_ACCESS_DENIED Access is already locked by a previous SCardConnectcall.
EFI_DEVICE_ERROR Any other error condition, typically a reader removal.
This function releases a connection previously taken by SCardConnect.

The SCardDisconnect function releases the lock previously taken by SCardConnect. In case the smart card has been removed before this call, thisfunction returns EFI_SUCCESS. If there is no previous call to SCardConnect, this function returns EFI_SUCCESS.

Parameters:
[in] This Indicates a pointer to the calling context.
[in] CardAction Codes for card action.
Return values:
EFI_SUCCESS The requested command completed successfully.
EFI_INVALID_PARAMETER This is NULL
EFI_INVALID_PARAMETER CardAction value is unknown.
EFI_UNSUPPORTED Reader does not support Eject card feature (disconnect was not performed).
EFI_DEVICE_ERROR Any other error condition, typically a reader removal.
This function retrieves some basic information about the smart card and reader.

The SCardStatusfunction retrieves basic reader and card information.

If ReaderName, State, CardProtocolor Atris NULL, the function does not fail but does not fill in such variables.

If EFI_SUCCESS is not returned, ReaderName and Atr contents shall not be considered as valid.

Parameters:
[in] This Indicates a pointer to the calling context.
[out] ReaderName A pointer to a NULL terminated string that will contain the reader name.
[in,out] ReaderNameLength On input, a pointer to the variablethat holds the maximal size, in bytes,of ReaderName. On output, the required size, in bytes, for ReaderName.
[out] State Current state of the smart card reader.
[out] CardProtocol Current protocol used to communicate with the smart card.
[out] Atr A pointer to retrieve the ATR of the smart card.
[in,out] AtrLength On input, a pointer to hold the maximum size, in bytes, of Atr(usually 33). On output, the required size, inbytes, for the smart card ATR.
Return values:
EFI_SUCCESS The requested command completed successfully.
EFI_INVALID_PARAMETER This is NULL
EFI_INVALID_PARAMETER ReaderName is not NULL but ReaderNameLength is NULL
EFI_INVALID_PARAMETER Atr is not NULL but AtrLength is NULL
EFI_BUFFER_TOO_SMALL ReaderNameLength is not big enough to hold the reader name. ReaderNameLength has been updated to the required value.
EFI_BUFFER_TOO_SMALL AtrLength is not big enough to hold the ATR. AtrLength has been updated to the required value.
EFI_DEVICE_ERROR Any other error condition, typically a reader removal.
This function sends a command to the card or reader and returns its response.

The protocol to use to communicate with the smart card has been selected through SCardConnectcall.

In case RAPDULength indicates a buffer too small to holdthe response APDU, the function fails with EFI_BUFFER_TOO_SMALL.

Parameters:
[in] This A pointer to the EFI_USBFN_IO_PROTOCOLinstance.
[in] CAPDU A pointer to a byte array thatcontains the Command APDU to send to the smart card or reader.
[in] CAPDULength Command APDU size, in bytes.
[out] RAPDU A pointer to a byte array that will contain the Response APDU.
[in,out] RAPDULength On input, the maximum size, inbytes, of the Response APDU. On output, the size, in bytes, of the Response APDU.
Return values:
EFI_SUCCESS The requested command completed successfully.
EFI_INVALID_PARAMETER This is NULL.
EFI_INVALID_PARAMETER CAPDU is NULL or CAPDULength is 0.
EFI_BUFFER_TOO_SMALL RAPDULength is not big enough to hold the response APDU. RAPDULength has been updated to the required value.
EFI_NO_MEDIA There is no card in the reader.
EFI_NOT_READY Card is not powered.
EFI_PROTOCOL_ERROR A protocol error has occurred.
EFI_TIMEOUT The reader did not respond.
EFI_ACCESS_DENIED A communication with the reader/card is already pending.
EFI_DEVICE_ERROR Any other error condition, typically a reader removal.
This function provides direct access to the reader.

This function gives direct control to send commands to the driver or the reader. The ControlCode to use is vendor dependant; the only standard code defined is the one to get PC/SC part 10 features.

InBuffer and Outbuffer may be NULL when ControlCode operation does not require them.

Parameters:
[in] This Indicates a pointer to the calling context.
[in] ControlCode The control code for the operation to perform.
[in] InBuffer A pointer to the input parameters.
[in] InBufferLength Size, in bytes, of input parameters.
[out] OutBuffer A pointer to the output parameters.
[in,out] OutBufferLength On input, maximal size, in bytes, to store output parameters. On output, the size, in bytes, of output parameters.
Return values:
EFI_SUCCESS The requested command completed successfully.
EFI_INVALID_PARAMETER This is NULL.
EFI_INVALID_PARAMETER ControlCode requires input parameters but: InBuffer is NULL or InBufferLenth is NULL or InBuffer is not NULL but InBufferLenth is less than expected.
EFI_INVALID_PARAMETER OutBuffer is not NULL but OutBufferLength is NULL.
EFI_UNSUPPORTED ControlCode is not supported.
EFI_BUFFER_TOO_SMALL OutBufferLength is not big enough to hold the output parameters. OutBufferLength has been updated to the required value.
EFI_NO_MEDIA There is no card in the reader and the control code specified requires one.
EFI_NOT_READY ControlCode requires a powered card to operate.
EFI_PROTOCOL_ERROR A protocol error has occurred.
EFI_TIMEOUT The reader did not respond.
EFI_ACCESS_DENIED A communication with the reader/card is already pending.
EFI_DEVICE_ERROR Any other error condition, typically a reader removal.
This function retrieves a reader or smart card attribute.

Possibly supported attrib values are listed in "PC/SC specification, Part 3: Requirements for PC-Connected Interface Devices".

Parameters:
[in] This Indicates a pointer to the calling context.
[in] Attrib Identifier for the attribute to retrieve.
[out] OutBuffer A pointer to a buffer that will contain attribute data.
[in,out] OutBufferLength On input, maximal size, in bytes, to store attribute data. On output, the size, in bytes, of attribute data.
Return values:
EFI_SUCCESS The requested command completed successfully.
EFI_INVALID_PARAMETER This is NULL.
EFI_INVALID_PARAMETER OutBuffer is NULL or OutBufferLength is 0.
EFI_BUFFER_TOO_SMALL OutBufferLength is not big enough to hold the output parameters. OutBufferLength has been updated to the required value.
EFI_UNSUPPORTED Attribis not supported
EFI_NO_MEDIA There is no card in the reader and Attrib value requires one.
EFI_NOT_READY Attrib requires a powered card to operate.
EFI_PROTOCOL_ERROR A protocol error has occurred.
EFI_TIMEOUT The reader did not respond.
EFI_DEVICE_ERROR Any other error condition, typically a reader removal.
Send a security protocol command to a device.

The SendData function sends a security protocol command containing the payload PayloadBuffer to the given MediaId. The security protocol command sent is defined by SecurityProtocolId and contains the security protocol specific data SecurityProtocolSpecificData. If the underlying protocol command requires a specific padding for the command payload, the SendData function shall add padding bytes to the command payload to satisfy the padding requirements.

For devices supporting the SCSI command set, the security protocol command is sent using the SECURITY PROTOCOL OUT command defined in SPC-4.

For devices supporting the ATA command set, the security protocol command is sent using one of the TRUSTED SEND commands defined in ATA8-ACS if PayloadBufferSize is non-zero. If the PayloadBufferSize is zero, the security protocol command is sent using the Trusted Non-Data command defined in ATA8-ACS.

If PayloadBuffer is NULL and PayloadBufferSize is non-zero, the function shall return EFI_INVALID_PARAMETER.

If the given MediaId does not support security protocol commands, the function shall return EFI_UNSUPPORTED. If there is no media in the device, the function returns EFI_NO_MEDIA. If the MediaId is not the ID for the current media in the device, the function returns EFI_MEDIA_CHANGED.

If the security protocol fails to complete within the Timeout period, the function shall return EFI_TIMEOUT.

If the security protocol command completes without an error, the function shall return EFI_SUCCESS. If the security protocol command completes with an error, the function shall return EFI_DEVICE_ERROR.

Parameters:
This Indicates a pointer to the calling context.
MediaId ID of the medium to receive data from.
Timeout The timeout, in 100ns units, to use for the execution of the security protocol command. A Timeout value of 0 means that this function will wait indefinitely for the security protocol command to execute. If Timeout is greater than zero, then this function will return EFI_TIMEOUT if the time required to execute the receive data command is greater than Timeout.
SecurityProtocolId The value of the "Security Protocol" parameter of the security protocol command to be sent.
SecurityProtocolSpecificData The value of the "Security Protocol Specific" parameter of the security protocol command to be sent.
PayloadBufferSize Size in bytes of the payload data buffer.
PayloadBuffer A pointer to a destination buffer to store the security protocol command specific payload data for the security protocol command.
Return values:
EFI_SUCCESS The security protocol command completed successfully.
EFI_UNSUPPORTED The given MediaId does not support security protocol commands.
EFI_DEVICE_ERROR The security protocol command completed with an error.
EFI_NO_MEDIA There is no media in the device.
EFI_MEDIA_CHANGED The MediaId is not for the current media.
EFI_INVALID_PARAMETER The PayloadBuffer is NULL and PayloadBufferSize is non-zero.
EFI_TIMEOUT A timeout occurred while waiting for the security protocol command to execute.
The EFI_TCG2_PROTOCOL GetCapability function call provides protocol capability information and state information.

Parameters:
[in] This Indicates the calling context
[in,out] ProtocolCapability The caller allocates memory for a EFI_TCG2_BOOT_SERVICE_CAPABILITY structure and sets the size field to the size of the structure allocated. The callee fills in the fields with the EFI protocol capability information and the current EFI TCG2 state information up to the number of fields which fit within the size of the structure passed in.
Return values:
EFI_SUCCESS Operation completed successfully.
EFI_DEVICE_ERROR The command was unsuccessful. The ProtocolCapability variable will not be populated.
EFI_INVALID_PARAMETER One or more of the parameters are incorrect. The ProtocolCapability variable will not be populated.
EFI_BUFFER_TOO_SMALL The ProtocolCapability variable is too small to hold the full response. It will be partially populated (required Size field will be set).
The EFI_TCG2_PROTOCOL Get Event Log function call allows a caller to retrieve the address of a given event log and its last entry.

Parameters:
[in] This Indicates the calling context
[in] EventLogFormat The type of the event log for which the information is requested.
[out] EventLogLocation A pointer to the memory address of the event log.
[out] EventLogLastEntry If the Event Log contains more than one entry, this is a pointer to the address of the start of the last entry in the event log in memory.
[out] EventLogTruncated If the Event Log is missing at least one entry because an event would have exceeded the area allocated for events, this value is set to TRUE. Otherwise, the value will be FALSE and the Event Log will be complete.
Return values:
EFI_SUCCESS Operation completed successfully.
EFI_INVALID_PARAMETER One or more of the parameters are incorrect (e.g. asking for an event log whose format is not supported).
The EFI_TCG2_PROTOCOL HashLogExtendEvent function call provides callers with an opportunity to extend and optionally log events without requiring knowledge of actual TPM commands. The extend operation will occur even if this function cannot create an event log entry (e.g. due to the event log being full).

Parameters:
[in] This Indicates the calling context
[in] Flags Bitmap providing additional information.
[in] DataToHash Physical address of the start of the data buffer to be hashed.
[in] DataToHashLen The length in bytes of the buffer referenced by DataToHash.
[in] EfiTcgEvent Pointer to data buffer containing information about the event.
Return values:
EFI_SUCCESS Operation completed successfully.
EFI_DEVICE_ERROR The command was unsuccessful.
EFI_VOLUME_FULL The extend operation occurred, but the event could not be written to one or more event logs.
EFI_INVALID_PARAMETER One or more of the parameters are incorrect.
EFI_UNSUPPORTED The PE/COFF image type is not supported.
This service enables the sending of commands to the TPM.

Parameters:
[in] This Indicates the calling context
[in] InputParameterBlockSize Size of the TPM input parameter block.
[in] InputParameterBlock Pointer to the TPM input parameter block.
[in] OutputParameterBlockSize Size of the TPM output parameter block.
[in] OutputParameterBlock Pointer to the TPM output parameter block.
Return values:
EFI_SUCCESS The command byte stream was successfully sent to the device and a response was successfully received.
EFI_DEVICE_ERROR The command was not successfully sent to the device or a response was not successfully received from the device.
EFI_INVALID_PARAMETER One or more of the parameters are incorrect.
EFI_BUFFER_TOO_SMALL The output parameter block is too small.
This service returns the currently active PCR banks.

Parameters:
[in] This Indicates the calling context
[out] ActivePcrBanks Pointer to the variable receiving the bitmap of currently active PCR banks.
Return values:
EFI_SUCCESS The bitmap of active PCR banks was stored in the ActivePcrBanks parameter.
EFI_INVALID_PARAMETER One or more of the parameters are incorrect.
This service sets the currently active PCR banks.

Parameters:
[in] This Indicates the calling context
[in] ActivePcrBanks Bitmap of the requested active PCR banks. At least one bit SHALL be set.
Return values:
EFI_SUCCESS The bitmap in ActivePcrBank parameter is already active.
EFI_INVALID_PARAMETER One or more of the parameters are incorrect.
This service retrieves the result of a previous invocation of SetActivePcrBanks.

Parameters:
[in] This Indicates the calling context
[out] OperationPresent Non-zero value to indicate a SetActivePcrBank operation was invoked during the last boot.
[out] Response The response from the SetActivePcrBank request.
Return values:
EFI_SUCCESS The result value could be returned.
EFI_INVALID_PARAMETER One or more of the parameters are incorrect.
The EFI_TREE_PROTOCOL GetCapability function call provides protocol capability information and state information about the TrEE.

Parameters:
[in] This Indicates the calling context
[out] ProtocolCapability The caller allocates memory for a TREE_BOOT_SERVICE_CAPABILITY structure and sets the size field to the size of the structure allocated. The callee fills in the fields with the EFI protocol capability information and the current TrEE state information up to the number of fields which fit within the size of the structure passed in.
Return values:
EFI_SUCCESS Operation completed successfully.
EFI_DEVICE_ERROR The command was unsuccessful. The ProtocolCapability variable will not be populated.
EFI_INVALID_PARAMETER One or more of the parameters are incorrect. The ProtocolCapability variable will not be populated.
EFI_BUFFER_TOO_SMALL The ProtocolCapability variable is too small to hold the full response. It will be partially populated (required Size field will be set).
The EFI_TREE_PROTOCOL Get Event Log function call allows a caller to retrieve the address of a given event log and its last entry.

Parameters:
[in] This Indicates the calling context
[in] EventLogFormat The type of the event log for which the information is requested.
[out] EventLogLocation A pointer to the memory address of the event log.
[out] EventLogLastEntry If the Event Log contains more than one entry, this is a pointer to the address of the start of the last entry in the event log in memory.
[out] EventLogTruncated If the Event Log is missing at least one entry because an event would have exceeded the area allocated for events, this value is set to TRUE. Otherwise, the value will be FALSE and the Event Log will be complete.
Return values:
EFI_SUCCESS Operation completed successfully.
EFI_INVALID_PARAMETER One or more of the parameters are incorrect (e.g. asking for an event log whose format is not supported).
The EFI_TREE_PROTOCOL HashLogExtendEvent function call provides callers with an opportunity to extend and optionally log events without requiring knowledge of actual TPM commands. The extend operation will occur even if this function cannot create an event log entry (e.g. due to the event log being full).

Parameters:
[in] This Indicates the calling context
[in] Flags Bitmap providing additional information.
[in] DataToHash Physical address of the start of the data buffer to be hashed.
[in] DataToHashLen The length in bytes of the buffer referenced by DataToHash.
[in] Event Pointer to data buffer containing information about the event.
Return values:
EFI_SUCCESS Operation completed successfully.
EFI_DEVICE_ERROR The command was unsuccessful.
EFI_VOLUME_FULL The extend operation occurred, but the event could not be written to one or more event logs.
EFI_INVALID_PARAMETER One or more of the parameters are incorrect.
EFI_UNSUPPORTED The PE/COFF image type is not supported.
This service enables the sending of commands to the TrEE.

Parameters:
[in] This Indicates the calling context
[in] InputParameterBlockSize Size of the TrEE input parameter block.
[in] InputParameterBlock Pointer to the TrEE input parameter block.
[in] OutputParameterBlockSize Size of the TrEE output parameter block.
[in] OutputParameterBlock Pointer to the TrEE output parameter block.
Return values:
EFI_SUCCESS The command byte stream was successfully sent to the device and a response was successfully received.
EFI_DEVICE_ERROR The command was not successfully sent to the device or a response was not successfully received from the device.
EFI_INVALID_PARAMETER One or more of the parameters are incorrect.
EFI_BUFFER_TOO_SMALL The output parameter block is too small.
Returns information about what USB port type was attached.

Parameters:
[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
[out] PortType Returns the USB port type.
Return values:
EFI_SUCCESS The function returned successfully.
EFI_INVALID_PARAMETER A parameter is invalid.
EFI_DEVICE_ERROR The physical device reported an error.
EFI_NOT_READY The physical device is busy or not ready to process this request or there is no USB port attached to the device.
Configures endpoints based on supplied device and configuration descriptors.

Assuming that the hardware has already been initialized, this function configures the endpoints using the device information supplied by DeviceInfo, activates the port, and starts receiving USB events.

This function must ignore the bMaxPacketSize0field of the Standard Device Descriptor and the wMaxPacketSize field of the Standard Endpoint Descriptor that are made available through DeviceInfo.

Parameters:
[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
[out] DeviceInfo A pointer to EFI_USBFN_DEVICE_INFO instance.
Return values:
EFI_SUCCESS The function returned successfully.
EFI_INVALID_PARAMETER A parameter is invalid.
EFI_DEVICE_ERROR The physical device reported an error.
EFI_NOT_READY The physical device is busy or not ready to process this request.
EFI_OUT_OF_RESOURCES The request could not be completed due to lack of resources.
Returns the maximum packet size of the specified endpoint type for the supplied bus speed.

If the BusSpeed is UsbBusSpeedUnknown, the maximum speed the underlying controller supports is assumed.

This protocol currently does not support isochronous or interrupt transfers. Future revisions of this protocol may eventually support it.

Parameters:
[in] This A pointer to the EFI_USBFN_IO_PROTOCOLinstance.
[in] EndpointType Endpoint type as defined as EFI_USB_ENDPOINT_TYPE.
[in] BusSpeed Bus speed as defined as EFI_USB_BUS_SPEED.
[out] MaxPacketSize The maximum packet size, in bytes, of the specified endpoint type.
Return values:
EFI_SUCCESS The function returned successfully.
EFI_INVALID_PARAMETER A parameter is invalid.
EFI_DEVICE_ERROR The physical device reported an error.
EFI_NOT_READY The physical device is busy or not ready to process this request.
Returns device specific information based on the supplied identifier as a Unicode string.

If the supplied Buffer isn't large enough, or is NULL, the method fails with EFI_BUFFER_TOO_SMALL and the required size is returned through BufferSize. All returned strings are in Unicode format.

An Id of EfiUsbDeviceInfoUnknown is treated as an invalid parameter.

Parameters:
[in] This A pointer to the EFI_USBFN_IO_PROTOCOLinstance.
[in] Id The requested information id.
[in] BufferSize On input, the size of the Buffer in bytes. On output, the amount of data returned in Buffer in bytes.
[out] Buffer A pointer to a buffer to returnthe requested information as a Unicode string.
Return values:
EFI_SUCCESS The function returned successfully.
EFI_INVALID_PARAMETER A parameter is invalid.
EFI_DEVICE_ERROR The physical device reported an error.
EFI_BUFFER_TOO_SMALL Supplied buffer isn't large enough to hold the request string.
Returns the vendor-id and product-id of the device.

Parameters:
[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
[out] Vid Returned vendor-id of the device.
[out] Pid Returned product-id of the device.
Return values:
EFI_SUCCESS The function returned successfully.
EFI_INVALID_PARAMETER A parameter is invalid.
EFI_NOT_FOUND Unable to return the vendor-id or the product-id.
Aborts the transfer on the specified endpoint.

This function should fail with EFI_INVALID_PARAMETER if the specified direction is incorrect for the endpoint.

Parameters:
[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
[in] EndpointIndex Indicates the endpoint on which the ongoing transfer needs to be canceled.
[in] Direction Direction of the endpoint.
Return values:
EFI_SUCCESS The function returned successfully.
EFI_INVALID_PARAMETER A parameter is invalid.
EFI_DEVICE_ERROR The physical device reported an error.
EFI_NOT_READY The physical device is busy or not ready to process this request.
Returns the stall state on the specified endpoint.

This function should fail with EFI_INVALID_PARAMETER if the specified direction is incorrect for the endpoint.

Parameters:
[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
[in] EndpointIndex Indicates the endpoint.
[in] Direction Direction of the endpoint.
[in,out] State Boolean, true value indicates that the endpoint is in a stalled state, false otherwise.
Return values:
EFI_SUCCESS The function returned successfully.
EFI_INVALID_PARAMETER A parameter is invalid.
EFI_DEVICE_ERROR The physical device reported an error.
EFI_NOT_READY The physical device is busy or not ready to process this request.
Sets or clears the stall state on the specified endpoint.

This function should fail with EFI_INVALID_PARAMETER if the specified direction is incorrect for the endpoint.

Parameters:
[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
[in] EndpointIndex Indicates the endpoint.
[in] Direction Direction of the endpoint.
[in] State Requested stall state on the specified endpoint. True value causes the endpoint to stall; false value clears an existing stall.
Return values:
EFI_SUCCESS The function returned successfully.
EFI_INVALID_PARAMETER A parameter is invalid.
EFI_DEVICE_ERROR The physical device reported an error.
EFI_NOT_READY The physical device is busy or not ready to process this request.
This function is called repeatedly to get information on USB bus states, receive-completion and transmit-completion events on the endpoints, and notification on setup packet on endpoint 0.

A class driver must call EFI_USBFN_IO_PROTOCOL.EventHandler()repeatedly to receive updates on the transfer status and number of bytes transferred on various endpoints.

Parameters:
[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
[out] Message Indicates the event that initiated this notification.
[in,out] PayloadSize On input, the size of the memory pointed by Payload. On output, the amount ofdata returned in Payload.
[out] Payload A pointer to EFI_USBFN_MESSAGE_PAYLOAD instance to return additional payload for current message.
Return values:
EFI_SUCCESS The function returned successfully.
EFI_INVALID_PARAMETER A parameter is invalid.
EFI_DEVICE_ERROR The physical device reported an error.
EFI_NOT_READY The physical device is busy or not ready to process this request.
EFI_BUFFER_TOO_SMALL The Supplied buffer is not large enough to hold the message payload.
This function handles transferring data to or from the host on the specified endpoint, depending on the direction specified.

A class driver must call EFI_USBFN_IO_PROTOCOL.EventHandler() repeatedly to receive updates on the transfer status and the number of bytes transferred on various endpoints. Upon an update of the transfer status, the Buffer field of the EFI_USBFN_TRANSFER_RESULT structure (as described in the function description for EFI_USBFN_IO_PROTOCOL.EventHandler()) must be initialized with the Buffer pointer that was supplied to this method.

The overview of the call sequence is illustrated in the Figure 54.

This function should fail with EFI_INVALID_PARAMETER if the specified direction is incorrect for the endpoint.

Parameters:
[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
[in] EndpointIndex Indicates the endpoint on which TX or RX transfer needs to take place.
[in] Direction Direction of the endpoint.
[in,out] BufferSize If Direction is EfiUsbEndpointDirectionDeviceRx: On input, the size of the Bufferin bytes. On output, the amount of data returned in Buffer in bytes. If Direction is EfiUsbEndpointDirectionDeviceTx: On input, the size of the Bufferin bytes. On output, the amount of data transmitted in bytes.
[in,out] Buffer If Direction is EfiUsbEndpointDirectionDeviceRx: The Buffer to return the received data. If Directionis EfiUsbEndpointDirectionDeviceTx: The Buffer that contains the data to be transmitted.
Return values:
EFI_SUCCESS The function returned successfully.
EFI_INVALID_PARAMETER A parameter is invalid.
EFI_DEVICE_ERROR The physical device reported an error.
EFI_NOT_READY The physical device is busy or not ready to process this request.
Returns the maximum supported transfer size.

Returns the maximum number of bytes that the underlying controller can accommodate in a single transfer.

Parameters:
[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
[out] MaxTransferSize The maximum supported transfer size, in bytes.
Return values:
EFI_SUCCESS The function returned successfully.
EFI_INVALID_PARAMETER A parameter is invalid.
EFI_DEVICE_ERROR The physical device reported an error.
EFI_NOT_READY The physical device is busy or not ready to process this request.
Allocates a transfer buffer of the specified sizethat satisfies the controller requirements.

The AllocateTransferBuffer() function allocates a memory region of Size bytes and returns the address of the allocated memory that satisfies the underlying controller requirements in the location referenced by Buffer.

The allocated transfer buffer must be freed using a matching call to EFI_USBFN_IO_PROTOCOL.FreeTransferBuffer()function.

Parameters:
[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
[in] Size The number of bytes to allocate for the transfer buffer.
[out] Buffer A pointer to a pointer to the allocated buffer if the call succeeds; undefined otherwise.
Return values:
EFI_SUCCESS The function returned successfully.
EFI_INVALID_PARAMETER A parameter is invalid.
EFI_OUT_OF_RESOURCES The requested transfer buffer could not be allocated.
Deallocates the memory allocated for the transfer buffer by the EFI_USBFN_IO_PROTOCOL.AllocateTransferBuffer() function.

The EFI_USBFN_IO_PROTOCOL.FreeTransferBuffer() function deallocates the memory specified by Buffer. The Buffer that is freed must have been allocated by EFI_USBFN_IO_PROTOCOL.AllocateTransferBuffer().

Parameters:
[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
[in] Buffer A pointer to the transfer buffer to deallocate.
Return values:
EFI_SUCCESS The function returned successfully.
EFI_INVALID_PARAMETER A parameter is invalid.
This function supplies power to the USB controller if needed and initializes the hardware and the internal data structures. The port must not be activated by this function.

Parameters:
[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
Return values:
EFI_SUCCESS The function returned successfully.
EFI_INVALID_PARAMETER A parameter is invalid.
EFI_DEVICE_ERROR The physical device reported an error.
This function stops the USB hardware device.

Parameters:
[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
Return values:
EFI_SUCCESS The function returned successfully.
EFI_INVALID_PARAMETER A parameter is invalid.
EFI_DEVICE_ERROR The physical device reported an error.
This function sets the configuration policy for the specified non-control endpoint.

This function can only be called before EFI_USBFN_IO_PROTOCOL.StartController() or after EFI_USBFN_IO_PROTOCOL.StopController() has been called.

Parameters:
[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
[in] EndpointIndex Indicates the non-control endpoint for which the policy needs to be set.
[in] Direction Direction of the endpoint.
[in] PolicyType Policy type the user is trying to set for the specified non-control endpoint.
[in] BufferSize The size of the Bufferin bytes.
[in] Buffer The new value for the policy parameter that PolicyType specifies.
Return values:
EFI_SUCCESS The function returned successfully.
EFI_INVALID_PARAMETER A parameter is invalid.
EFI_DEVICE_ERROR The physical device reported an error.
EFI_UNSUPPORTED Changing this policy value is not supported.
This function sets the configuration policy for the specified non-control endpoint.

This function can only be called before EFI_USBFN_IO_PROTOCOL.StartController() or after EFI_USBFN_IO_PROTOCOL.StopController() has been called.

Parameters:
[in] This A pointer to the EFI_USBFN_IO_PROTOCOL instance.
[in] EndpointIndex Indicates the non-control endpoint for which the policy needs to be set.
[in] Direction Direction of the endpoint.
[in] PolicyType Policy type the user is trying to retrieve for the specified non-control endpoint.
[in,out] BufferSize On input, the size of Bufferin bytes. On output, the amount of data returned in Bufferin bytes.
[in,out] Buffer A pointer to a buffer to return requested endpoint policy value.
Return values:
EFI_SUCCESS The function returned successfully.
EFI_INVALID_PARAMETER A parameter is invalid.
EFI_DEVICE_ERROR The specified policy value is not supported.
EFI_BUFFER_TOO_SMALL Supplied buffer is not large enough to hold requested policy value.


Variable Documentation


Generated on Wed Sep 23 16:24:23 2015 for MdePkg[ALL] by  doxygen 1.5.7.1