]>
Commit | Line | Data |
---|---|---|
511710d6 | 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 | #include "DevicePath.h"\r | |
24 | \r | |
25 | EFI_HANDLE mDevicePathHandle = NULL;\r | |
26 | \r | |
e99aa5a2 | 27 | GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_UTILITIES_PROTOCOL mDevicePathUtilities = {\r |
511710d6 | 28 | GetDevicePathSizeProtocolInterface,\r |
29 | DuplicateDevicePathProtocolInterface,\r | |
30 | AppendDevicePathProtocolInterface,\r | |
31 | AppendDeviceNodeProtocolInterface,\r | |
32 | AppendDevicePathInstanceProtocolInterface,\r | |
33 | GetNextDevicePathInstanceProtocolInterface,\r | |
34 | IsDevicePathMultiInstanceProtocolInterface,\r | |
35 | CreateDeviceNodeProtocolInterface\r | |
e99aa5a2 | 36 | };\r |
37 | \r | |
38 | GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_TO_TEXT_PROTOCOL mDevicePathToText = {\r | |
511710d6 | 39 | ConvertDeviceNodeToText,\r |
40 | ConvertDevicePathToText\r | |
e99aa5a2 | 41 | };\r |
42 | \r | |
43 | GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL mDevicePathFromText = {\r | |
44 | ConvertTextToDeviceNode, \r | |
45 | ConvertTextToDevicePath \r | |
46 | };\r | |
47 | \r | |
511710d6 | 48 | GLOBAL_REMOVE_IF_UNREFERENCED const EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid = DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL;\r |
49 | GLOBAL_REMOVE_IF_UNREFERENCED const EFI_GUID mEfiDevicePathMessagingSASGuid = DEVICE_PATH_MESSAGING_SAS;\r | |
50 | \r | |
51 | EFI_STATUS\r | |
52 | EFIAPI\r | |
53 | DevicePathEntryPoint (\r | |
54 | IN EFI_HANDLE ImageHandle,\r | |
55 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
56 | )\r | |
57 | /*++\r | |
58 | \r | |
59 | Routine Description:\r | |
60 | Entry point for EFI drivers.\r | |
61 | \r | |
62 | Arguments:\r | |
63 | ImageHandle - EFI_HANDLE\r | |
64 | SystemTable - EFI_SYSTEM_TABLE\r | |
65 | \r | |
66 | Returns:\r | |
67 | EFI_SUCCESS\r | |
68 | others\r | |
69 | \r | |
70 | --*/\r | |
71 | {\r | |
72 | EFI_STATUS Status;\r | |
73 | \r | |
74 | Status = EFI_UNSUPPORTED;\r | |
e99aa5a2 | 75 | if (FeaturePcdGet (PcdDevicePathSupportDevicePathToText)) {\r |
76 | if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) {\r | |
511710d6 | 77 | Status = gBS->InstallMultipleProtocolInterfaces (\r |
78 | &mDevicePathHandle,\r | |
79 | &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,\r | |
80 | &gEfiDevicePathToTextProtocolGuid, &mDevicePathToText,\r | |
81 | &gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText,\r | |
82 | NULL\r | |
83 | );\r | |
e99aa5a2 | 84 | } else {\r |
511710d6 | 85 | Status = gBS->InstallMultipleProtocolInterfaces (\r |
86 | &mDevicePathHandle,\r | |
87 | &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,\r | |
88 | &gEfiDevicePathToTextProtocolGuid, &mDevicePathToText,\r | |
89 | NULL\r | |
90 | );\r | |
e99aa5a2 | 91 | }\r |
92 | } else {\r | |
93 | if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) {\r | |
511710d6 | 94 | Status = gBS->InstallMultipleProtocolInterfaces (\r |
95 | &mDevicePathHandle,\r | |
96 | &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,\r | |
97 | &gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText,\r | |
98 | NULL\r | |
99 | );\r | |
e99aa5a2 | 100 | } else {\r |
511710d6 | 101 | Status = gBS->InstallMultipleProtocolInterfaces (\r |
102 | &mDevicePathHandle,\r | |
103 | &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities,\r | |
104 | NULL\r | |
105 | );\r | |
e99aa5a2 | 106 | }\r |
107 | }\r | |
511710d6 | 108 | return Status;\r |
109 | }\r |