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