]>
Commit | Line | Data |
---|---|---|
13d40edd | 1 | /** @file\r |
95276127 | 2 | Device Path Driver to produce DevPathUtilities Protocol, DevPathFromText Protocol\r |
3 | and DevPathToText Protocol.\r | |
4 | \r | |
13d40edd | 5 | Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r |
6 | All rights reserved. This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT 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 | |
18 | EFI_HANDLE mDevicePathHandle = NULL;\r | |
19 | \r | |
20 | GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_UTILITIES_PROTOCOL mDevicePathUtilities = {\r | |
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 | |
31 | GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_TO_TEXT_PROTOCOL mDevicePathToText = {\r | |
32 | ConvertDeviceNodeToText,\r | |
33 | ConvertDevicePathToText\r | |
34 | };\r | |
35 | \r | |
36 | GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL mDevicePathFromText = {\r | |
37 | ConvertTextToDeviceNode, \r | |
38 | ConvertTextToDevicePath \r | |
39 | };\r | |
40 | \r | |
41 | GLOBAL_REMOVE_IF_UNREFERENCED const EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid = DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL;\r | |
42 | GLOBAL_REMOVE_IF_UNREFERENCED const EFI_GUID mEfiDevicePathMessagingSASGuid = DEVICE_PATH_MESSAGING_SAS;\r | |
43 | \r | |
44 | EFI_STATUS\r | |
45 | EFIAPI\r | |
46 | DevicePathEntryPoint (\r | |
47 | IN EFI_HANDLE ImageHandle,\r | |
48 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
49 | )\r | |
50 | /*++\r | |
51 | \r | |
52 | Routine Description:\r | |
53 | Entry point for EFI drivers.\r | |
54 | \r | |
55 | Arguments:\r | |
56 | ImageHandle - EFI_HANDLE\r | |
57 | SystemTable - EFI_SYSTEM_TABLE\r | |
58 | \r | |
59 | Returns:\r | |
60 | EFI_SUCCESS\r | |
61 | others\r | |
62 | \r | |
63 | --*/\r | |
64 | {\r | |
65 | EFI_STATUS Status;\r | |
66 | \r | |
67 | Status = EFI_UNSUPPORTED;\r | |
68 | if (FeaturePcdGet (PcdDevicePathSupportDevicePathToText)) {\r | |
69 | if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) {\r | |
70 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
71 | &mDevicePathHandle,\r | |
72 | &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,\r | |
73 | &gEfiDevicePathToTextProtocolGuid, &mDevicePathToText,\r | |
74 | &gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText,\r | |
75 | NULL\r | |
76 | );\r | |
77 | } else {\r | |
78 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
79 | &mDevicePathHandle,\r | |
80 | &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,\r | |
81 | &gEfiDevicePathToTextProtocolGuid, &mDevicePathToText,\r | |
82 | NULL\r | |
83 | );\r | |
84 | }\r | |
85 | } else {\r | |
86 | if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) {\r | |
87 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
88 | &mDevicePathHandle,\r | |
89 | &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,\r | |
90 | &gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText,\r | |
91 | NULL\r | |
92 | );\r | |
93 | } else {\r | |
94 | Status = gBS->InstallMultipleProtocolInterfaces (\r | |
95 | &mDevicePathHandle,\r | |
96 | &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,\r | |
97 | NULL\r | |
98 | );\r | |
99 | }\r | |
100 | }\r | |
101 | return Status;\r | |
102 | }\r |