]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/IScsiDxe/ComponentName.c
update file header
[mirror_edk2.git] / MdeModulePkg / Universal / Network / IScsiDxe / ComponentName.c
1 /** @file
2 UEFI Component Name(2) protocol implementation for iSCSI.
3
4 Copyright (c) 2004 - 2008, Intel Corporation.<BR>
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 **/
14
15 #include "IScsiImpl.h"
16
17 //
18 // EFI Component Name Protocol
19 //
20 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gIScsiComponentName = {
21 IScsiComponentNameGetDriverName,
22 IScsiComponentNameGetControllerName,
23 "eng"
24 };
25
26 //
27 // EFI Component Name 2 Protocol
28 //
29 GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gIScsiComponentName2 = {
30 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) IScsiComponentNameGetDriverName,
31 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) IScsiComponentNameGetControllerName,
32 "en"
33 };
34
35 GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mIScsiDriverNameTable[] = {
36 {"eng;en", L"iSCSI Driver"},
37 {NULL, NULL}
38 };
39
40 /**
41 Retrieves a Unicode string that is the user readable name of the EFI Driver.
42
43 This function retrieves the user readable name of a driver in the form of a
44 Unicode string. If the driver specified by This has a user readable name in
45 the language specified by Language, then a pointer to the driver name is
46 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
47 by This does not support the language specified by Language,
48 then EFI_UNSUPPORTED is returned.
49
50 @param[in] This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
51 @param[in] Language A pointer to a three character ISO 639-2 language identifier.
52 This is the language of the driver name that that the caller
53 is requesting, and it must match one of the languages specified
54 in SupportedLanguages. The number of languages supported by a
55 driver is up to the driver writer.
56 @param[out] DriverName A pointer to the Unicode string to return. This Unicode string
57 is the name of the driver specified by This in the language
58 specified by Language.
59
60 @retval EFI_SUCCESS The Unicode string for the Driver specified by This
61 and the language specified by Language was returned
62 in DriverName.
63 @retval EFI_INVALID_PARAMETER Language is NULL.
64 @retval EFI_INVALID_PARAMETER DriverName is NULL.
65 @retval EFI_UNSUPPORTED The driver specified by This does not support the
66 language specified by Language.
67 **/
68 EFI_STATUS
69 EFIAPI
70 IScsiComponentNameGetDriverName (
71 IN EFI_COMPONENT_NAME_PROTOCOL *This,
72 IN CHAR8 *Language,
73 OUT CHAR16 **DriverName
74 )
75 {
76 return LookupUnicodeString2 (
77 Language,
78 This->SupportedLanguages,
79 mIScsiDriverNameTable,
80 DriverName,
81 (BOOLEAN)(This == &gIScsiComponentName)
82 );
83 }
84
85 /**
86 Retrieves a Unicode string that is the user readable name of the controller
87 that is being managed by an EFI Driver.Currently not implemented.
88
89 @param[in] This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
90 @param[in] ControllerHandle The handle of a controller that the driver specified by
91 This is managing. This handle specifies the controller
92 whose name is to be returned.
93 @param[in] ChildHandle The handle of the child controller to retrieve the name
94 of. This is an optional parameter that may be NULL. It
95 will be NULL for device drivers. It will also be NULL
96 for a bus drivers that wish to retrieve the name of the
97 bus controller. It will not be NULL for a bus driver
98 that wishes to retrieve the name of a child controller.
99 @param[in] Language A pointer to a three character ISO 639-2 language
100 identifier. This is the language of the controller name
101 that that the caller is requesting, and it must match one
102 of the languages specified in SupportedLanguages. The
103 number of languages supported by a driver is up to the
104 driver writer.
105 @param[out] ControllerName A pointer to the Unicode string to return. This Unicode
106 string is the name of the controller specified by
107 ControllerHandle and ChildHandle in the language specified
108 by Language from the point of view of the driver specified
109 by This.
110
111 @retval EFI_SUCCESS The Unicode string for the user readable name in the
112 language specified by Language for the driver
113 specified by This was returned in DriverName.
114 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
115 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
116 @retval EFI_INVALID_PARAMETER Language is NULL.
117 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
118 @retval EFI_UNSUPPORTED The driver specified by This is not currently managing
119 the controller specified by ControllerHandle and
120 ChildHandle.
121 @retval EFI_UNSUPPORTED The driver specified by This does not support the
122 language specified by Language.
123 **/
124 EFI_STATUS
125 EFIAPI
126 IScsiComponentNameGetControllerName (
127 IN EFI_COMPONENT_NAME_PROTOCOL *This,
128 IN EFI_HANDLE ControllerHandle,
129 IN EFI_HANDLE ChildHandle OPTIONAL,
130 IN CHAR8 *Language,
131 OUT CHAR16 **ControllerName
132 )
133 {
134 return EFI_UNSUPPORTED;
135 }