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