]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/DevicePathDxe/DevicePath.c
Update the copyright notice format
[mirror_edk2.git] / MdeModulePkg / Universal / DevicePathDxe / DevicePath.c
CommitLineData
13d40edd 1/** @file\r
95276127 2 Device Path Driver to produce DevPathUtilities Protocol, DevPathFromText Protocol\r
3 and DevPathToText Protocol.\r
4\r
e5eed7d3
HT
5Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
6This program and the accompanying materials\r
13d40edd 7are licensed and made available under the terms and conditions of the BSD License\r
8which accompanies this distribution. The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
95276127 15\r
95276127 16#include "DevicePath.h"\r
17\r
18EFI_HANDLE mDevicePathHandle = NULL;\r
19\r
572f5d8a 20GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_DEVICE_PATH_UTILITIES_PROTOCOL mDevicePathUtilities = {\r
95276127 21 GetDevicePathSizeProtocolInterface,\r
22 DuplicateDevicePathProtocolInterface,\r
23 AppendDevicePathProtocolInterface,\r
24 AppendDeviceNodeProtocolInterface,\r
25 AppendDevicePathInstanceProtocolInterface,\r
26 GetNextDevicePathInstanceProtocolInterface,\r
27 IsDevicePathMultiInstanceProtocolInterface,\r
28 CreateDeviceNodeProtocolInterface\r
29};\r
30\r
572f5d8a 31GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_DEVICE_PATH_TO_TEXT_PROTOCOL mDevicePathToText = {\r
95276127 32 ConvertDeviceNodeToText,\r
33 ConvertDevicePathToText\r
34};\r
35\r
572f5d8a 36GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL mDevicePathFromText = {\r
37 ConvertTextToDeviceNode,\r
38 ConvertTextToDevicePath\r
95276127 39};\r
40\r
572f5d8a 41GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid = DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL;\r
42GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_GUID mEfiDevicePathMessagingSASGuid = DEVICE_PATH_MESSAGING_SAS;\r
95276127 43\r
572f5d8a 44\r
45\r
46/**\r
47 The user Entry Point for DevicePath module.\r
48\r
48557c65 49 This is the entry point for DevicePath module. It installs the UEFI Device Path Utility Protocol and\r
50 optionally the Device Path to Text and Device Path from Text protocols based on feature flags.\r
572f5d8a 51\r
52 @param[in] ImageHandle The firmware allocated handle for the EFI image.\r
53 @param[in] SystemTable A pointer to the EFI System Table.\r
54\r
55 @retval EFI_SUCCESS The entry point is executed successfully.\r
56 @retval Others Some error occurs when executing this entry point.\r
57\r
58**/\r
95276127 59EFI_STATUS\r
60EFIAPI\r
61DevicePathEntryPoint (\r
62 IN EFI_HANDLE ImageHandle,\r
63 IN EFI_SYSTEM_TABLE *SystemTable\r
64 )\r
95276127 65{\r
66 EFI_STATUS Status;\r
572f5d8a 67\r
95276127 68 Status = EFI_UNSUPPORTED;\r
69 if (FeaturePcdGet (PcdDevicePathSupportDevicePathToText)) {\r
70 if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) {\r
71 Status = gBS->InstallMultipleProtocolInterfaces (\r
72 &mDevicePathHandle,\r
73 &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,\r
74 &gEfiDevicePathToTextProtocolGuid, &mDevicePathToText,\r
75 &gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText,\r
76 NULL\r
77 );\r
78 } else {\r
79 Status = gBS->InstallMultipleProtocolInterfaces (\r
80 &mDevicePathHandle,\r
81 &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,\r
82 &gEfiDevicePathToTextProtocolGuid, &mDevicePathToText,\r
83 NULL\r
84 );\r
85 }\r
86 } else {\r
87 if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) {\r
88 Status = gBS->InstallMultipleProtocolInterfaces (\r
89 &mDevicePathHandle,\r
90 &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,\r
91 &gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText,\r
92 NULL\r
93 );\r
94 } else {\r
95 Status = gBS->InstallMultipleProtocolInterfaces (\r
96 &mDevicePathHandle,\r
97 &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,\r
98 NULL\r
99 );\r
100 }\r
101 }\r
102 return Status;\r
103}\r