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   Convert text to the binary representation of a device node.
40 
41   @param  TextDeviceNode TextDevicePath points to the text representation of a device
42                          path. Conversion starts with the first character and continues
43                          until the first non-device path character.
44 
45   @retval a_pointer      Pointer to the allocated device path.
46   @retval NULL           if TextDeviceNode is NULL or there was insufficient memory.
47 
48 **/
49 typedef
50 EFI_DEVICE_PATH_PROTOCOL *
51 (EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_PATH)(
52   IN CONST CHAR16                 *TextDevicePath
53   );
54 
55 ///
56 /// This protocol converts text to device paths and device nodes.
57 ///
58 typedef struct {
59   EFI_DEVICE_PATH_FROM_TEXT_NODE    ConvertTextToDeviceNode;
60   EFI_DEVICE_PATH_FROM_TEXT_PATH    ConvertTextToDevicePath;
61 } EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL;
62 
63 extern EFI_GUID  gEfiDevicePathFromTextProtocolGuid;
64 
65 #endif
66