xref: /freebsd/sys/contrib/edk2/Include/Protocol/DevicePathToText.h (revision 19fae0f66023a97a9b464b3beeeabb2081f575b3)
1 /** @file
2   EFI_DEVICE_PATH_TO_TEXT_PROTOCOL as defined in UEFI 2.0.
3   This protocol provides service to convert device nodes and paths to text.
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_TO_TEXT_PROTOCOL_H__
11 #define __DEVICE_PATH_TO_TEXT_PROTOCOL_H__
12 
13 ///
14 /// Device Path To Text protocol
15 ///
16 #define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \
17   { \
18     0x8b843e20, 0x8132, 0x4852, {0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } \
19   }
20 
21 /**
22   Convert a device node to its text representation.
23 
24   @param  DeviceNode     Points to the device node to be converted.
25   @param  DisplayOnly    If DisplayOnly is TRUE, then the shorter text representation
26                          of the display node is used, where applicable. If DisplayOnly
27                          is FALSE, then the longer text representation of the display node
28                          is used.
29   @param  AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
30                          representation for a device node can be used, where applicable.
31 
32   @retval a_pointer      a pointer to the allocated text representation of the device node data
33   @retval NULL           if DeviceNode is NULL or there was insufficient memory.
34 
35 **/
36 typedef
37 CHAR16*
38 (EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE)(
39   IN CONST EFI_DEVICE_PATH_PROTOCOL   *DeviceNode,
40   IN BOOLEAN                          DisplayOnly,
41   IN BOOLEAN                          AllowShortcuts
42   );
43 
44 /**
45   Convert a device path to its text representation.
46 
47   @param  DevicePath     Points to the device path to be converted.
48   @param  DisplayOnly    If DisplayOnly is TRUE, then the shorter text representation
49                          of the display node is used, where applicable. If DisplayOnly
50                          is FALSE, then the longer text representation of the display node
51                          is used.
52   @param  AllowShortcuts The AllowShortcuts is FALSE, then the shortcut forms of
53                          text representation for a device node cannot be used.
54 
55   @retval a_pointer      a pointer to the allocated text representation of the device node.
56   @retval NULL           if DevicePath is NULL or there was insufficient memory.
57 
58 **/
59 typedef
60 CHAR16*
61 (EFIAPI *EFI_DEVICE_PATH_TO_TEXT_PATH)(
62   IN CONST EFI_DEVICE_PATH_PROTOCOL   *DevicePath,
63   IN BOOLEAN                          DisplayOnly,
64   IN BOOLEAN                          AllowShortcuts
65   );
66 
67 ///
68 /// This protocol converts device paths and device nodes to text.
69 ///
70 typedef struct {
71   EFI_DEVICE_PATH_TO_TEXT_NODE        ConvertDeviceNodeToText;
72   EFI_DEVICE_PATH_TO_TEXT_PATH        ConvertDevicePathToText;
73 } EFI_DEVICE_PATH_TO_TEXT_PROTOCOL;
74 
75 extern EFI_GUID gEfiDevicePathToTextProtocolGuid;
76 
77 #endif
78 
79 
80