]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/Tcp4Dxe/ComponentName.c
Import ArpDxe, Dhcp4Dxe, Ip4Dxe, Mtftp4Dxe, PxeBcDxe and PxeDhcp4Dxe.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Tcp4Dxe / 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 Module Name:
13
14 ComponentName.c
15
16 Abstract:
17
18
19 **/
20
21 #include "Tcp4Main.h"
22
23 //
24 // EFI Component Name Functions
25 //
26 EFI_STATUS
27 EFIAPI
28 TcpComponentNameGetDriverName (
29 IN EFI_COMPONENT_NAME_PROTOCOL *This,
30 IN CHAR8 *Language,
31 OUT CHAR16 **DriverName
32 );
33
34 EFI_STATUS
35 EFIAPI
36 TcpComponentNameGetControllerName (
37 IN EFI_COMPONENT_NAME_PROTOCOL *This,
38 IN EFI_HANDLE ControllerHandle,
39 IN EFI_HANDLE ChildHandle OPTIONAL,
40 IN CHAR8 *Language,
41 OUT CHAR16 **ControllerName
42 );
43
44 //
45 // EFI Component Name Protocol
46 //
47 EFI_COMPONENT_NAME_PROTOCOL gTcp4ComponentName = {
48 TcpComponentNameGetDriverName,
49 TcpComponentNameGetControllerName,
50 "eng"
51 };
52
53 static EFI_UNICODE_STRING_TABLE mTcpDriverNameTable[] = {
54 {
55 "eng",
56 L"Tcp Network Service Driver"
57 },
58 {
59 NULL,
60 NULL
61 }
62 };
63
64 EFI_STATUS
65 EFIAPI
66 TcpComponentNameGetDriverName (
67 IN EFI_COMPONENT_NAME_PROTOCOL *This,
68 IN CHAR8 *Language,
69 OUT CHAR16 **DriverName
70 )
71 /*++
72
73 Routine Description:
74
75 Retrieves a Unicode string that is the user readable name of the EFI Driver.
76
77 Arguments:
78
79 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
80 Language - A pointer to a three character ISO 639-2 language identifier.
81 This is the language of the driver name that that the caller
82 is requesting, and it must match one of the languages
83 specified in SupportedLanguages. The number of languages
84 supported by a driver is up to the driver writer.
85 DriverName - A pointer to the Unicode string to return. This Unicode
86 string is the name of the driver specified by This in the
87 language specified by Language.
88
89 Returns:
90
91 EFI_SUCCES - The Unicode string for the Driver specified by
92 This and the language specified by Language was
93 returned 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 gTcp4ComponentName.SupportedLanguages,
104 mTcpDriverNameTable,
105 DriverName
106 );
107 }
108
109 EFI_STATUS
110 EFIAPI
111 TcpComponentNameGetControllerName (
112 IN EFI_COMPONENT_NAME_PROTOCOL *This,
113 IN EFI_HANDLE ControllerHandle,
114 IN EFI_HANDLE ChildHandle OPTIONAL,
115 IN CHAR8 *Language,
116 OUT CHAR16 **ControllerName
117 )
118 /*++
119
120 Routine Description:
121
122 Retrieves a Unicode string that is the user readable name of the controller
123 that is being managed by an EFI Driver.
124
125 Arguments:
126
127 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
128 ControllerHandle - The handle of a controller that the driver specified by
129 This is managing. This handle specifies the controller
130 whose name is to be returned.
131 ChildHandle - The handle of the child controller to retrieve the name
132 of. This is an optional parameter that may be NULL.
133 It will be NULL for device drivers. It will also be
134 NULL for a bus drivers that wish to retrieve the name of
135 the bus controller. It will not be NULL for a bus
136 driver that wishes to retrieve the name of a child
137 controller.
138 Language - A pointer to a three character ISO 639-2 language
139 identifier. This is the language of the controller
140 name that that the caller is requesting, and it must
141 match one of the languages specified in supported
142 languages. The number of languages supported by a driver
143 is up to the 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
147 specified by Language from the point of view of the
148 driver specified by This.
149
150 Returns:
151
152 EFI_SUCCESS - The Unicode string for the user readable name in
153 the 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
157 EFI_HANDLE.
158 EFI_INVALID_PARAMETER - Language is NULL.
159 EFI_INVALID_PARAMETER - ControllerName is NULL.
160 EFI_UNSUPPORTED - The driver specified by This is not currently
161 managing the controller specified by
162 ControllerHandle and ChildHandle.
163 EFI_UNSUPPORTED - The driver specified by This does not support the
164 language specified by Language.
165
166 --*/
167 {
168 return EFI_UNSUPPORTED;
169 }