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