diff options
author | Daniil Egranov <daniil.egranov@arm.com> | 2016-06-06 19:22:25 -0500 |
---|---|---|
committer | Ryan Harkin <ryan.harkin@linaro.org> | 2016-06-22 13:35:59 +0100 |
commit | 3847e7f78c073eceea70cfd26af82bc06a054f00 (patch) | |
tree | de0156a53cd62b5f385f117f2bbad20eb86263ea | |
parent | 032082bf9906f82b77c161c1c2efbddfd4bb3751 (diff) |
EmbeddedPkg: Added device configuration protocolarmlt-20160622-001armlt-16.0616.06
The device configuration protocol definition.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daniil Egranov <daniil.egranov@arm.com>
-rw-r--r-- | EmbeddedPkg/EmbeddedPkg.dec | 1 | ||||
-rw-r--r-- | EmbeddedPkg/Include/Protocol/EmbeddedDeviceConfig.h | 127 |
2 files changed, 128 insertions, 0 deletions
diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec index 775d863c5f..2ec965a31b 100644 --- a/EmbeddedPkg/EmbeddedPkg.dec +++ b/EmbeddedPkg/EmbeddedPkg.dec @@ -69,6 +69,7 @@ gAndroidFastbootPlatformProtocolGuid = { 0x524685a0, 0x89a0, 0x11e3, {0x9d, 0x4d, 0xbf, 0xa9, 0xf6, 0xa4, 0x03, 0x08}}
gUsbDeviceProtocolGuid = { 0x021bd2ca, 0x51d2, 0x11e3, {0x8e, 0x56, 0xb7, 0x54, 0x17, 0xc7, 0x0b, 0x44 }}
gPlatformGpioProtocolGuid = { 0x52ce9845, 0x5af4, 0x43e2, {0xba, 0xfd, 0x23, 0x08, 0x12, 0x54, 0x7a, 0xc2 }}
+ gEfiEmbeddedDeviceConfigProtocolGuid = { 0x735F8C64, 0xD696, 0x44D0, { 0xBD, 0xF2, 0x44, 0x7F, 0xD0, 0x5A, 0x54, 0x06 }} [PcdsFeatureFlag.common]
gEmbeddedTokenSpaceGuid.PcdEmbeddedMacBoot|FALSE|BOOLEAN|0x00000001
diff --git a/EmbeddedPkg/Include/Protocol/EmbeddedDeviceConfig.h b/EmbeddedPkg/Include/Protocol/EmbeddedDeviceConfig.h new file mode 100644 index 0000000000..63671397df --- /dev/null +++ b/EmbeddedPkg/Include/Protocol/EmbeddedDeviceConfig.h @@ -0,0 +1,127 @@ +/** @file +* +* Copyright (c) 2016, ARM Limited. All rights reserved. +* +* This program and the accompanying materials +* are licensed and made available under the terms and conditions of the BSD License +* which accompanies this distribution. The full text of the license may be found at +* http://opensource.org/licenses/bsd-license.php +* +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +* +**/ + +#ifndef __EMBEDDED_DEVICE_CONFIG_H__ +#define __EMBEDDED_DEVICE_CONFIG_H__ + +// +// Protocol GUID +// +#define EFI_EMBEDDED_DEVICE_CONFIG_PROTOCOL_GUID { 0x735F8C64, 0xD696, 0x44D0, { 0xBD, 0xF2, 0x44, 0x7F, 0xD0, 0x5A, 0x54, 0x06 }} + +// +// Protocol interface structure +// +typedef struct _EFI_EMBEDDED_DEVICE_CONFIG_PROTOCOL EFI_EMBEDDED_DEVICE_CONFIG_PROTOCOL; + +#define EFI_EMBEDDED_DEVICE_CONFIG_REVISION 0x00010000 + +// Device configuration types and structures +typedef enum { + EfiConfigMacAddress, + EfiMaxDeviceConfigurationType +} EFI_DEVICE_CONFIGURATION_TYPE; + +typedef struct { + BOOLEAN Writable; + EFI_DEVICE_CONFIGURATION_TYPE Type; +} EFI_DEVICE_CONFIGURATION_BLOCK; + +typedef struct { + EFI_HANDLE Controller; + UINT32 SupportedConfigs; + EFI_DEVICE_CONFIGURATION_BLOCK ConfigList[EfiMaxDeviceConfigurationType]; +} EFI_DEVICE_CONFIGURATION_RECORD; + +// +// Function Prototypes +// + +/** + Check for device configuration support. + + @param This Instance pointer for this protocol + + @retval Buffer Array of configuration records. + @retval RecordCount Number of configuration records. + @retval EFI_SUCCESS Device supports external configuration. + @retval EFI_UNSUPPORTED Device does not support external configuration. + @retval EFI_DEVICE_ERROR Device configuration read error. +**/ + +typedef +EFI_STATUS +(EFIAPI *EFI_EMBEDDED_DEVICE_CONFIG_SUPPORTED) ( + IN EFI_EMBEDDED_DEVICE_CONFIG_PROTOCOL *This, + OUT EFI_DEVICE_CONFIGURATION_RECORD **Buffer, + OUT UINTN *RecordCount + ); + +/** + Set device configuration. + + @param This Instance pointer for this protocol. + @param Controller Handle of device to configure. + @param ConfigType Configuration type. + @param Buffer Configuration data. + + @retval EFI_SUCCESS Device configured successfully. + @retval EFI_UNSUPPORTED Device does not support specified configuration or + device configuration is read only. + @retval EFI_DEVICE_ERROR Device configuration failed. + +**/ + +typedef +EFI_STATUS +(EFIAPI *EFI_EMBEDDED_DEVICE_CONFIG_SET) ( + IN EFI_EMBEDDED_DEVICE_CONFIG_PROTOCOL *This, + IN EFI_HANDLE Controller, + IN EFI_DEVICE_CONFIGURATION_TYPE ConfigType, + IN VOID *Buffer + ); + +/** + Get device configuration. + + @param This Instance pointer for this protocol + @param Controller Handle of device to get a configuration. + @param ConfigType Configuration type to update. + + @retval Buffer Configuration data. + @retval EFI_SUCCESS Configuration data is available. + @retval EFI_UNSUPPORTED Device does not support specified configuration. + @retval EFI_DEVICE_ERROR Device configuration read error. + +**/ + +typedef +EFI_STATUS +(EFIAPI *EFI_EMBEDDED_DEVICE_CONFIG_GET) ( + IN EFI_EMBEDDED_DEVICE_CONFIG_PROTOCOL *This, + IN EFI_HANDLE Controller, + IN EFI_DEVICE_CONFIGURATION_TYPE ConfigType, + OUT VOID **Buffer + ); + +struct _EFI_EMBEDDED_DEVICE_CONFIG_PROTOCOL { + UINT64 Revision; + EFI_EMBEDDED_DEVICE_CONFIG_SUPPORTED Supported; + EFI_EMBEDDED_DEVICE_CONFIG_SET Set; + EFI_EMBEDDED_DEVICE_CONFIG_GET Get; +}; + +extern EFI_GUID gEfiEmbeddedDeviceConfigProtocolGuid; + +#endif // __EMBEDDED_DEVICE_CONFIG_H__ |