]>
Commit | Line | Data |
---|---|---|
3a10d471 | 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 | ComponentName.c\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | --*/\r | |
19 | \r | |
ed7748fe | 20 | \r |
3a10d471 | 21 | #include <PiDxe.h>\r |
22 | \r | |
ed7748fe | 23 | \r |
3a10d471 | 24 | #include <Protocol/ScsiPassThru.h>\r |
70c94b3b | 25 | #include <Protocol/ScsiPassThruExt.h>\r |
3a10d471 | 26 | #include <Protocol/ScsiIo.h>\r |
27 | #include <Protocol/ComponentName.h>\r | |
28 | #include <Protocol/DriverBinding.h>\r | |
29 | #include <Protocol/DevicePath.h>\r | |
ed7748fe | 30 | \r |
3a10d471 | 31 | #include <Library/DebugLib.h>\r |
32 | #include <Library/UefiDriverEntryPoint.h>\r | |
33 | #include <Library/UefiLib.h>\r | |
34 | #include <Library/BaseMemoryLib.h>\r | |
35 | #include <Library/ScsiLib.h>\r | |
36 | #include <Library/UefiBootServicesTableLib.h>\r | |
37 | #include <Library/DevicePathLib.h>\r | |
38 | \r | |
39 | \r | |
40 | #include "ScsiBus.h"\r | |
41 | \r | |
42 | //\r | |
43 | // EFI Component Name Protocol\r | |
44 | //\r | |
45 | EFI_COMPONENT_NAME_PROTOCOL gScsiBusComponentName = {\r | |
46 | ScsiBusComponentNameGetDriverName,\r | |
47 | ScsiBusComponentNameGetControllerName,\r | |
48 | "eng"\r | |
49 | };\r | |
50 | \r | |
51 | static EFI_UNICODE_STRING_TABLE mScsiBusDriverNameTable[] = {\r | |
52 | { "eng", (CHAR16 *) L"SCSI Bus Driver" },\r | |
53 | { NULL , NULL }\r | |
54 | };\r | |
55 | \r | |
56 | EFI_STATUS\r | |
57 | EFIAPI\r | |
58 | ScsiBusComponentNameGetDriverName (\r | |
59 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
60 | IN CHAR8 *Language,\r | |
61 | OUT CHAR16 **DriverName\r | |
62 | )\r | |
63 | /*++\r | |
64 | \r | |
65 | Routine Description:\r | |
66 | Retrieves a Unicode string that is the user readable name of the EFI Driver.\r | |
67 | \r | |
68 | Arguments:\r | |
69 | This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
70 | Language - A pointer to a three character ISO 639-2 language identifier.\r | |
71 | This is the language of the driver name that that the caller \r | |
72 | is requesting, and it must match one of the languages specified\r | |
73 | in SupportedLanguages. The number of languages supported by a \r | |
74 | driver is up to the driver writer.\r | |
75 | DriverName - A pointer to the Unicode string to return. This Unicode string\r | |
76 | is the name of the driver specified by This in the language \r | |
77 | specified by Language.\r | |
78 | \r | |
79 | Returns:\r | |
80 | EFI_SUCCESS - The Unicode string for the Driver specified by This\r | |
81 | and the language specified by Language was returned \r | |
82 | in DriverName.\r | |
83 | EFI_INVALID_PARAMETER - Language is NULL.\r | |
84 | EFI_INVALID_PARAMETER - DriverName is NULL.\r | |
85 | EFI_UNSUPPORTED - The driver specified by This does not support the \r | |
86 | language specified by Language.\r | |
87 | \r | |
88 | --*/\r | |
89 | {\r | |
90 | return LookupUnicodeString (\r | |
91 | Language,\r | |
92 | gScsiBusComponentName.SupportedLanguages,\r | |
93 | mScsiBusDriverNameTable,\r | |
94 | DriverName\r | |
95 | );\r | |
96 | }\r | |
97 | \r | |
98 | EFI_STATUS\r | |
99 | EFIAPI\r | |
100 | ScsiBusComponentNameGetControllerName (\r | |
101 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
102 | IN EFI_HANDLE ControllerHandle,\r | |
103 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
104 | IN CHAR8 *Language,\r | |
105 | OUT CHAR16 **ControllerName\r | |
106 | )\r | |
107 | /*++\r | |
108 | \r | |
109 | Routine Description:\r | |
110 | Retrieves a Unicode string that is the user readable name of the controller\r | |
111 | that is being managed by an EFI Driver.\r | |
112 | \r | |
113 | Arguments:\r | |
114 | This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
115 | ControllerHandle - The handle of a controller that the driver specified by \r | |
116 | This is managing. This handle specifies the controller \r | |
117 | whose name is to be returned.\r | |
118 | ChildHandle - The handle of the child controller to retrieve the name \r | |
119 | of. This is an optional parameter that may be NULL. It \r | |
120 | will be NULL for device drivers. It will also be NULL \r | |
121 | for a bus drivers that wish to retrieve the name of the \r | |
122 | bus controller. It will not be NULL for a bus driver \r | |
123 | that wishes to retrieve the name of a child controller.\r | |
124 | Language - A pointer to a three character ISO 639-2 language \r | |
125 | identifier. This is the language of the controller name \r | |
126 | that that the caller is requesting, and it must match one\r | |
127 | of the languages specified in SupportedLanguages. The \r | |
128 | number of languages supported by a driver is up to the \r | |
129 | driver writer.\r | |
130 | ControllerName - A pointer to the Unicode string to return. This Unicode\r | |
131 | string is the name of the controller specified by \r | |
132 | ControllerHandle and ChildHandle in the language \r | |
133 | specified by Language from the point of view of the \r | |
134 | driver specified by This. \r | |
135 | \r | |
136 | Returns:\r | |
137 | EFI_SUCCESS - The Unicode string for the user readable name in the\r | |
138 | language specified by Language for the driver \r | |
139 | specified by This was returned in DriverName.\r | |
140 | EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r | |
141 | EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid \r | |
142 | EFI_HANDLE.\r | |
143 | EFI_INVALID_PARAMETER - Language is NULL.\r | |
144 | EFI_INVALID_PARAMETER - ControllerName is NULL.\r | |
145 | EFI_UNSUPPORTED - The driver specified by This is not currently \r | |
146 | managing the controller specified by \r | |
147 | ControllerHandle and ChildHandle.\r | |
148 | EFI_UNSUPPORTED - The driver specified by This does not support the \r | |
149 | language specified by Language.\r | |
150 | \r | |
151 | --*/\r | |
152 | {\r | |
153 | return EFI_UNSUPPORTED;\r | |
154 | }\r |