xref: /freebsd-src/sys/contrib/edk2/Include/Protocol/DevicePathToText.h (revision 0d1ba6657e90b1f9b76e1c393b1555d6cf6cf260)
1*0d1ba665SWarner Losh /** @file
2*0d1ba665SWarner Losh   EFI_DEVICE_PATH_TO_TEXT_PROTOCOL as defined in UEFI 2.0.
3*0d1ba665SWarner Losh   This protocol provides service to convert device nodes and paths to text.
4*0d1ba665SWarner Losh 
5*0d1ba665SWarner Losh   Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
6*0d1ba665SWarner Losh   This program and the accompanying materials
7*0d1ba665SWarner Losh   are licensed and made available under the terms and conditions of the BSD License
8*0d1ba665SWarner Losh   which accompanies this distribution.  The full text of the license may be found at
9*0d1ba665SWarner Losh   http://opensource.org/licenses/bsd-license.php
10*0d1ba665SWarner Losh 
11*0d1ba665SWarner Losh   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12*0d1ba665SWarner Losh   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13*0d1ba665SWarner Losh 
14*0d1ba665SWarner Losh **/
15*0d1ba665SWarner Losh 
16*0d1ba665SWarner Losh #ifndef __DEVICE_PATH_TO_TEXT_PROTOCOL_H__
17*0d1ba665SWarner Losh #define __DEVICE_PATH_TO_TEXT_PROTOCOL_H__
18*0d1ba665SWarner Losh 
19*0d1ba665SWarner Losh ///
20*0d1ba665SWarner Losh /// Device Path To Text protocol
21*0d1ba665SWarner Losh ///
22*0d1ba665SWarner Losh #define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \
23*0d1ba665SWarner Losh   { \
24*0d1ba665SWarner Losh     0x8b843e20, 0x8132, 0x4852, {0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } \
25*0d1ba665SWarner Losh   }
26*0d1ba665SWarner Losh 
27*0d1ba665SWarner Losh /**
28*0d1ba665SWarner Losh   Convert a device node to its text representation.
29*0d1ba665SWarner Losh 
30*0d1ba665SWarner Losh   @param  DeviceNode     Points to the device node to be converted.
31*0d1ba665SWarner Losh   @param  DisplayOnly    If DisplayOnly is TRUE, then the shorter text representation
32*0d1ba665SWarner Losh                          of the display node is used, where applicable. If DisplayOnly
33*0d1ba665SWarner Losh                          is FALSE, then the longer text representation of the display node
34*0d1ba665SWarner Losh                          is used.
35*0d1ba665SWarner Losh   @param  AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text
36*0d1ba665SWarner Losh                          representation for a device node can be used, where applicable.
37*0d1ba665SWarner Losh 
38*0d1ba665SWarner Losh   @retval a_pointer      a pointer to the allocated text representation of the device node data
39*0d1ba665SWarner Losh   @retval NULL           if DeviceNode is NULL or there was insufficient memory.
40*0d1ba665SWarner Losh 
41*0d1ba665SWarner Losh **/
42*0d1ba665SWarner Losh typedef
43*0d1ba665SWarner Losh CHAR16*
44*0d1ba665SWarner Losh (EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE)(
45*0d1ba665SWarner Losh   IN CONST EFI_DEVICE_PATH_PROTOCOL   *DeviceNode,
46*0d1ba665SWarner Losh   IN BOOLEAN                          DisplayOnly,
47*0d1ba665SWarner Losh   IN BOOLEAN                          AllowShortcuts
48*0d1ba665SWarner Losh   );
49*0d1ba665SWarner Losh 
50*0d1ba665SWarner Losh /**
51*0d1ba665SWarner Losh   Convert a device path to its text representation.
52*0d1ba665SWarner Losh 
53*0d1ba665SWarner Losh   @param  DevicePath     Points to the device path to be converted.
54*0d1ba665SWarner Losh   @param  DisplayOnly    If DisplayOnly is TRUE, then the shorter text representation
55*0d1ba665SWarner Losh                          of the display node is used, where applicable. If DisplayOnly
56*0d1ba665SWarner Losh                          is FALSE, then the longer text representation of the display node
57*0d1ba665SWarner Losh                          is used.
58*0d1ba665SWarner Losh   @param  AllowShortcuts The AllowShortcuts is FALSE, then the shortcut forms of
59*0d1ba665SWarner Losh                          text representation for a device node cannot be used.
60*0d1ba665SWarner Losh 
61*0d1ba665SWarner Losh   @retval a_pointer      a pointer to the allocated text representation of the device node.
62*0d1ba665SWarner Losh   @retval NULL           if DevicePath is NULL or there was insufficient memory.
63*0d1ba665SWarner Losh 
64*0d1ba665SWarner Losh **/
65*0d1ba665SWarner Losh typedef
66*0d1ba665SWarner Losh CHAR16*
67*0d1ba665SWarner Losh (EFIAPI *EFI_DEVICE_PATH_TO_TEXT_PATH)(
68*0d1ba665SWarner Losh   IN CONST EFI_DEVICE_PATH_PROTOCOL   *DevicePath,
69*0d1ba665SWarner Losh   IN BOOLEAN                          DisplayOnly,
70*0d1ba665SWarner Losh   IN BOOLEAN                          AllowShortcuts
71*0d1ba665SWarner Losh   );
72*0d1ba665SWarner Losh 
73*0d1ba665SWarner Losh ///
74*0d1ba665SWarner Losh /// This protocol converts device paths and device nodes to text.
75*0d1ba665SWarner Losh ///
76*0d1ba665SWarner Losh typedef struct {
77*0d1ba665SWarner Losh   EFI_DEVICE_PATH_TO_TEXT_NODE        ConvertDeviceNodeToText;
78*0d1ba665SWarner Losh   EFI_DEVICE_PATH_TO_TEXT_PATH        ConvertDevicePathToText;
79*0d1ba665SWarner Losh } EFI_DEVICE_PATH_TO_TEXT_PROTOCOL;
80*0d1ba665SWarner Losh 
81*0d1ba665SWarner Losh extern EFI_GUID gEfiDevicePathToTextProtocolGuid;
82*0d1ba665SWarner Losh 
83*0d1ba665SWarner Losh #endif
84*0d1ba665SWarner Losh 
85*0d1ba665SWarner Losh 
86