xref: /freebsd/sys/contrib/edk2/Include/Protocol/DevicePathFromText.h (revision 59c8e88e72633afbc47a4ace0d2170d00d51f7dc)
1 /** @file
2   EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL as defined in UEFI 2.0.
3   This protocol provides service to convert text to device paths and device nodes.
4 
5   Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
6   SPDX-License-Identifier: BSD-2-Clause-Patent
7 
8 **/
9 
10 #ifndef __DEVICE_PATH_FROM_TEXT_PROTOCOL_H__
11 #define __DEVICE_PATH_FROM_TEXT_PROTOCOL_H__
12 
13 ///
14 /// Device Path From Text protocol
15 ///
16 #define EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID \
17   { \
18     0x5c99a21, 0xc70f, 0x4ad2, {0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e  } \
19   }
20 
21 /**
22   Convert text to the binary representation of a device node.
23 
24   @param  TextDeviceNode TextDeviceNode points to the text representation of a device
25                          node. Conversion starts with the first character and continues
26                          until the first non-device node character.
27 
28   @retval a_pointer      Pointer to the EFI device node.
29   @retval NULL           if TextDeviceNode is NULL or there was insufficient memory.
30 
31 **/
32 typedef
33 EFI_DEVICE_PATH_PROTOCOL*
34 (EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_NODE)(
35   IN CONST CHAR16                 *TextDeviceNode
36   );
37 
38 
39 /**
40   Convert text to the binary representation of a device node.
41 
42   @param  TextDeviceNode TextDevicePath points to the text representation of a device
43                          path. Conversion starts with the first character and continues
44                          until the first non-device path character.
45 
46   @retval a_pointer      Pointer to the allocated device path.
47   @retval NULL           if TextDeviceNode is NULL or there was insufficient memory.
48 
49 **/
50 typedef
51 EFI_DEVICE_PATH_PROTOCOL*
52 (EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_PATH)(
53   IN CONST CHAR16                 *TextDevicePath
54   );
55 
56 ///
57 /// This protocol converts text to device paths and device nodes.
58 ///
59 typedef struct {
60   EFI_DEVICE_PATH_FROM_TEXT_NODE  ConvertTextToDeviceNode;
61   EFI_DEVICE_PATH_FROM_TEXT_PATH  ConvertTextToDevicePath;
62 } EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL;
63 
64 extern EFI_GUID gEfiDevicePathFromTextProtocolGuid;
65 
66 #endif
67