aboutsummaryrefslogtreecommitdiffstats
path: root/MdePkg/Include/Protocol/DevicePathFromText.h
blob: 998fa5cd656255223dc4b0dedd93d6fb82bc4e95 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/** @file
  EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL as defined in UEFI 2.0.
  This protocol provides service to convert text to device paths and device nodes.

  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
  SPDX-License-Identifier: BSD-2-Clause-Patent

**/

#ifndef __DEVICE_PATH_FROM_TEXT_PROTOCOL_H__
#define __DEVICE_PATH_FROM_TEXT_PROTOCOL_H__

///
/// Device Path From Text protocol
///
#define EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID \
  { \
    0x5c99a21, 0xc70f, 0x4ad2, {0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e  } \
  }

/**
  Convert text to the binary representation of a device node.

  @param  TextDeviceNode TextDeviceNode points to the text representation of a device
                         node. Conversion starts with the first character and continues
                         until the first non-device node character.

  @retval a_pointer      Pointer to the EFI device node.
  @retval NULL           if TextDeviceNode is NULL or there was insufficient memory.

**/
typedef
EFI_DEVICE_PATH_PROTOCOL*
(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_NODE)(
  IN CONST CHAR16                 *TextDeviceNode
  );


/**
  Convert text to the binary representation of a device node.

  @param  TextDeviceNode TextDevicePath points to the text representation of a device
                         path. Conversion starts with the first character and continues
                         until the first non-device path character.

  @retval a_pointer      Pointer to the allocated device path.
  @retval NULL           if TextDeviceNode is NULL or there was insufficient memory.

**/
typedef
EFI_DEVICE_PATH_PROTOCOL*
(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_PATH)(
  IN CONST CHAR16                 *TextDevicePath
  );

///
/// This protocol converts text to device paths and device nodes.
///
typedef struct {
  EFI_DEVICE_PATH_FROM_TEXT_NODE  ConvertTextToDeviceNode;
  EFI_DEVICE_PATH_FROM_TEXT_PATH  ConvertTextToDevicePath;
} EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL;

extern EFI_GUID gEfiDevicePathFromTextProtocolGuid;

#endif