]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/Udp4Dxe/ComponentName.c
Import SnpDxe, Tcp4Dxe, Udp4Dxe and MnpDxe.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Udp4Dxe / ComponentName.c
1 /** @file
2
3 Copyright (c) 2006 - 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 Module Name:
13
14 ComponentName.c
15
16 Abstract:
17
18
19 **/
20
21
22 #include "Udp4Impl.h"
23
24 //
25 // EFI Component Name Functions
26 //
27 EFI_STATUS
28 EFIAPI
29 UdpComponentNameGetDriverName (
30 IN EFI_COMPONENT_NAME_PROTOCOL *This,
31 IN CHAR8 *Language,
32 OUT CHAR16 **DriverName
33 );
34
35 EFI_STATUS
36 EFIAPI
37 UdpComponentNameGetControllerName (
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 gUdp4ComponentName = {
49 UdpComponentNameGetDriverName,
50 UdpComponentNameGetControllerName,
51 "eng"
52 };
53
54 static EFI_UNICODE_STRING_TABLE mUdpDriverNameTable[] = {
55 {
56 "eng",
57 L"UDP Network Service Driver"
58 },
59 {
60 NULL,
61 NULL
62 }
63 };
64
65 EFI_STATUS
66 EFIAPI
67 UdpComponentNameGetDriverName (
68 IN EFI_COMPONENT_NAME_PROTOCOL *This,
69 IN CHAR8 *Language,
70 OUT CHAR16 **DriverName
71 )
72 /*++
73
74 Routine Description:
75
76 Retrieves a Unicode string that is the user readable name of the EFI Driver.
77
78 Arguments:
79
80 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
81 Language - A pointer to a three character ISO 639-2 language identifier.
82 This is the language of the driver name that that the caller
83 is requesting, and it must match one of the languages specified
84 in SupportedLanguages. The number of languages supported by a
85 driver is up to the driver writer.
86 DriverName - A pointer to the Unicode string to return. This Unicode string
87 is the name of the driver specified by This in the language
88 specified by Language.
89
90 Returns:
91
92 EFI_SUCCES - The Unicode string for the Driver specified by This
93 and the language specified by Language was returned
94 in DriverName.
95 EFI_INVALID_PARAMETER - Language is NULL.
96 EFI_INVALID_PARAMETER - DriverName is NULL.
97 EFI_UNSUPPORTED - The driver specified by This does not support the
98 language specified by Language.
99
100 --*/
101 {
102 return LookupUnicodeString (
103 Language,
104 gUdp4ComponentName.SupportedLanguages,
105 mUdpDriverNameTable,
106 DriverName
107 );
108 }
109
110 EFI_STATUS
111 EFIAPI
112 UdpComponentNameGetControllerName (
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
123 Retrieves a Unicode string that is the user readable name of the controller
124 that is being managed by an EFI Driver.
125
126 Arguments:
127
128 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
129 ControllerHandle - The handle of a controller that the driver specified by
130 This is managing. This handle specifies the controller
131 whose name is to be returned.
132 ChildHandle - The handle of the child controller to retrieve the name
133 of. This is an optional parameter that may be NULL. It
134 will be NULL for device drivers. It will also be NULL
135 for a bus drivers that wish to retrieve the name of the
136 bus controller. It will not be NULL for a bus driver
137 that wishes to retrieve the name of a child controller.
138 Language - A pointer to a three character ISO 639-2 language
139 identifier. This is the language of the controller name
140 that that the caller is requesting, and it must match one
141 of the languages specified in SupportedLanguages. The
142 number of languages supported by a driver is up to the
143 driver writer.
144 ControllerName - A pointer to the Unicode string to return. This Unicode
145 string is the name of the controller specified by
146 ControllerHandle and ChildHandle in the language specified
147 by Language from the point of view of the driver specified
148 by This.
149
150 Returns:
151
152 EFI_SUCCESS - The Unicode string for the user readable name in the
153 language specified by Language for the driver
154 specified by This was returned in DriverName.
155 EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
156 EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.
157 EFI_INVALID_PARAMETER - Language is NULL.
158 EFI_INVALID_PARAMETER - ControllerName is NULL.
159 EFI_UNSUPPORTED - The driver specified by This is not currently managing
160 the controller specified by ControllerHandle and
161 ChildHandle.
162 EFI_UNSUPPORTED - The driver specified by This does not support the
163 language specified by Language.
164
165 --*/
166 {
167 return EFI_UNSUPPORTED;
168 }
169