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