]> git.proxmox.com Git - mirror_edk2.git/blame - EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.c
Update Device Path Module to use PCD Feature Flags to determine of the Device Path...
[mirror_edk2.git] / EdkModulePkg / Universal / DevicePath / Dxe / DevicePath.c
CommitLineData
562d2849 1/*++
2
3Copyright (c) 2006, Intel Corporation
4All rights reserved. This program and the accompanying materials
5are licensed and made available under the terms and conditions of the BSD License
6which accompanies this distribution. The full text of the license may be found at
7http://opensource.org/licenses/bsd-license.php
8
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12Module Name:
13
14 DevicePathDriver.c
15
16Abstract:
17
18 Device Path Driver to produce DevPathUtilities Protocol, DevPathFromText Protocol
19 and DevPathToText Protocol.
20
21--*/
22
562d2849 23#include "DevicePath.h"
24
e99aa5a2 25EFI_HANDLE mDevicePathHandle = NULL;
26
27GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_UTILITIES_PROTOCOL mDevicePathUtilities = {\r
28 GetDevicePathSizeProtocolInterface,
29 DuplicateDevicePathProtocolInterface,
30 AppendDevicePathProtocolInterface,
31 AppendDeviceNodeProtocolInterface,
32 AppendDevicePathInstanceProtocolInterface,
33 GetNextDevicePathInstanceProtocolInterface,
34 IsDevicePathMultiInstanceProtocolInterface,
35 CreateDeviceNodeProtocolInterface
36};\r
37\r
38GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_TO_TEXT_PROTOCOL mDevicePathToText = {\r
39 ConvertDeviceNodeToText,
40 ConvertDevicePathToText
41};\r
42\r
43GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL mDevicePathFromText = {\r
44 ConvertTextToDeviceNode, \r
45 ConvertTextToDevicePath \r
46};\r
47\r
48GLOBAL_REMOVE_IF_UNREFERENCED const EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid = DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL;
49GLOBAL_REMOVE_IF_UNREFERENCED const EFI_GUID mEfiDevicePathMessagingSASGuid = DEVICE_PATH_MESSAGING_SAS;
562d2849 50
562d2849 51EFI_STATUS
52EFIAPI
53DevicePathEntryPoint (
54 IN EFI_HANDLE ImageHandle,
55 IN EFI_SYSTEM_TABLE *SystemTable
56 )
57/*++
58
59 Routine Description:
60 Entry point for EFI drivers.
61
62 Arguments:
63 ImageHandle - EFI_HANDLE
64 SystemTable - EFI_SYSTEM_TABLE
65
66 Returns:
67 EFI_SUCCESS
68 others
69
70--*/
71{
72 EFI_STATUS Status;
e99aa5a2 73
74 Status = EFI_UNSUPPORTED;
75 if (FeaturePcdGet (PcdDevicePathSupportDevicePathToText)) {\r
76 if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) {\r
77 Status = gBS->InstallMultipleProtocolInterfaces (
78 &mDevicePathHandle,
79 &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,
80 &gEfiDevicePathToTextProtocolGuid, &mDevicePathToText,
81 &gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText,
82 NULL
83 );
84 } else {\r
85 Status = gBS->InstallMultipleProtocolInterfaces (
86 &mDevicePathHandle,
87 &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,
88 &gEfiDevicePathToTextProtocolGuid, &mDevicePathToText,
89 NULL
90 );
91 }\r
92 } else {\r
93 if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) {\r
94 Status = gBS->InstallMultipleProtocolInterfaces (
95 &mDevicePathHandle,
96 &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,
97 &gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText,
98 NULL
99 );
100 } else {\r
101 Status = gBS->InstallMultipleProtocolInterfaces (
102 &mDevicePathHandle,
103 &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,
104 NULL
105 );
106 }\r
107 }\r
562d2849 108 return Status;
109}