]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Network/IScsiDxe/ComponentName.c
1) Update SetPeiServicesTablePointer's prototype add CONST modifier.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / IScsiDxe / ComponentName.c
CommitLineData
12618416 1/** @file\r
2 UEFI Component Name(2) protocol implementation.\r
6a690e23 3\r
12618416 4Copyright (c) 2004 - 2008, Intel Corporation\r
7a444476 5All rights reserved. This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
6a690e23 12\r
13Module Name:\r
14\r
15 ComponentName.c\r
16\r
17Abstract:\r
18\r
19 ComponentName protocol for iSCSI.\r
20\r
12618416 21**/\r
6a690e23 22\r
23#include "IScsiImpl.h"\r
24\r
25//\r
26// EFI Component Name Protocol\r
27//\r
28GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gIScsiComponentName = {\r
29 IScsiComponentNameGetDriverName,\r
30 IScsiComponentNameGetControllerName,\r
31 "eng"\r
32};\r
33\r
34//\r
35// EFI Component Name 2 Protocol\r
36//\r
37GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gIScsiComponentName2 = {\r
38 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) IScsiComponentNameGetDriverName,\r
39 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) IScsiComponentNameGetControllerName,\r
40 "en"\r
41};\r
42\r
43GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mIScsiDriverNameTable[] = {\r
12618416 44 {"eng;en", L"iSCSI Driver"}, \r
45 {NULL, NULL}\r
6a690e23 46};\r
47\r
12618416 48/**\r
49 Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
50\r
51 This function retrieves the user readable name of a driver in the form of a\r
52 Unicode string. If the driver specified by This has a user readable name in\r
53 the language specified by Language, then a pointer to the driver name is\r
54 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
55 by This does not support the language specified by Language,\r
56 then EFI_UNSUPPORTED is returned.\r
57\r
58 @param This[in] A pointer to the EFI_COMPONENT_NAME_PROTOCOL\r
59 instance.\r
60\r
61 @param Language[in] A pointer to a three character ISO 639-2 language\r
62 identifier.\r
63 This is the language of the driver name that that\r
64 the caller is requesting, and it must match one of\r
65 the languages specified in SupportedLanguages. \r
66 The number of languages supported by a driver is up\r
67 to the driver writer.\r
68\r
69 @param DriverName[out] A pointer to the Unicode string to return.\r
70 This Unicode string is the name of the\r
71 driver specified by This in the language\r
72 specified by Language.\r
73\r
74 @retval EFI_SUCCESS The Unicode string for the Driver specified by\r
75 This and the language specified by Language was\r
76 returned in DriverName.\r
77\r
78 @retval EFI_INVALID_PARAMETER Language is NULL.\r
79\r
80 @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
81\r
82 @retval EFI_UNSUPPORTED The driver specified by This does not support\r
83 the language specified by Language.\r
84\r
85**/\r
6a690e23 86EFI_STATUS\r
87EFIAPI\r
88IScsiComponentNameGetDriverName (\r
89 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
90 IN CHAR8 *Language,\r
91 OUT CHAR16 **DriverName\r
92 )\r
6a690e23 93{\r
94 return LookupUnicodeString2 (\r
95 Language,\r
96 This->SupportedLanguages,\r
97 mIScsiDriverNameTable,\r
98 DriverName,\r
99 (BOOLEAN)(This == &gIScsiComponentName)\r
100 );\r
101}\r
102\r
12618416 103/**\r
104 Retrieves a Unicode string that is the user readable name of the controller\r
105 that is being managed by an EFI Driver.\r
106\r
107 @param This[in] A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
108\r
109 @param ControllerHandle[in] The handle of a controller that the driver specified by\r
110 This is managing. This handle specifies the controller\r
111 whose name is to be returned.\r
112\r
113 @param ChildHandle[in] The handle of the child controller to retrieve the name\r
114 of. This is an optional parameter that may be NULL. It\r
115 will be NULL for device drivers. It will also be NULL\r
116 for a bus drivers that wish to retrieve the name of the\r
117 bus controller. It will not be NULL for a bus driver\r
118 that wishes to retrieve the name of a child controller.\r
119\r
120 @param Language[in] A pointer to a three character ISO 639-2 language \r
121 identifier. This is the language of the controller name\r
122 that that the caller is requesting, and it must match one\r
123 of the languages specified in SupportedLanguages. The\r
124 number of languages supported by a driver is up to the\r
125 driver writer.\r
126\r
127 @param ControllerName[out] A pointer to the Unicode string to return. This Unicode\r
128 string is the name of the controller specified by \r
129 ControllerHandle and ChildHandle in the language \r
130 specified by Language from the point of view of the \r
131 driver specified by This. \r
132\r
133 @retval EFI_SUCCESS The Unicode string for the user readable name in the \r
134 language specified by Language for the driver \r
135 specified by This was returned in DriverName.\r
136\r
137 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
138\r
139 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
140\r
141 @retval EFI_INVALID_PARAMETER Language is NULL.\r
142\r
143 @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
144\r
145 @retval EFI_UNSUPPORTED The driver specified by This is not currently managing\r
146 the controller specified by ControllerHandle and ChildHandle.\r
147\r
148 @retval EFI_UNSUPPORTED The driver specified by This does not support the \r
149 language specified by Language.\r
150\r
151**/\r
6a690e23 152EFI_STATUS\r
153EFIAPI\r
154IScsiComponentNameGetControllerName (\r
155 IN EFI_COMPONENT_NAME_PROTOCOL *This,\r
156 IN EFI_HANDLE ControllerHandle,\r
157 IN EFI_HANDLE ChildHandle OPTIONAL,\r
158 IN CHAR8 *Language,\r
159 OUT CHAR16 **ControllerName\r
160 )\r
6a690e23 161{\r
162 return EFI_UNSUPPORTED;\r
163}\r