]> git.proxmox.com Git - mirror_edk2.git/blob - EdkModulePkg/Universal/Network/Snp32_64/Dxe/ComponentName.c
3cc2d9844046cc02c1f1fed15321e3cbf184e873
[mirror_edk2.git] / EdkModulePkg / Universal / Network / Snp32_64 / Dxe / ComponentName.c
1 /*++
2
3 Copyright (c) 2006, 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 #include "Snp.h"
21
22 //
23 // EFI Component Name Functions
24 //
25 EFI_STATUS
26 EFIAPI
27 SimpleNetworkComponentNameGetDriverName (
28 IN EFI_COMPONENT_NAME_PROTOCOL *This,
29 IN CHAR8 *Language,
30 OUT CHAR16 **DriverName
31 );
32
33 EFI_STATUS
34 EFIAPI
35 SimpleNetworkComponentNameGetControllerName (
36 IN EFI_COMPONENT_NAME_PROTOCOL *This,
37 IN EFI_HANDLE ControllerHandle,
38 IN EFI_HANDLE ChildHandle OPTIONAL,
39 IN CHAR8 *Language,
40 OUT CHAR16 **ControllerName
41 );
42
43 //
44 // EFI Component Name Protocol
45 //
46 EFI_COMPONENT_NAME_PROTOCOL gSimpleNetworkComponentName = {
47 SimpleNetworkComponentNameGetDriverName,
48 SimpleNetworkComponentNameGetControllerName,
49 "eng"
50 };
51
52 static EFI_UNICODE_STRING_TABLE mSimpleNetworkDriverNameTable[] = {
53 {
54 "eng",
55 (CHAR16 *) L"Simple Network Protocol Driver"
56 },
57 {
58 NULL,
59 NULL
60 }
61 };
62
63 EFI_STATUS
64 EFIAPI
65 SimpleNetworkComponentNameGetDriverName (
66 IN EFI_COMPONENT_NAME_PROTOCOL *This,
67 IN CHAR8 *Language,
68 OUT CHAR16 **DriverName
69 )
70 /*++
71
72 Routine Description:
73 Retrieves a Unicode string that is the user readable name of the EFI Driver.
74
75 Arguments:
76 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
77 Language - A pointer to a three character ISO 639-2 language identifier.
78 This is the language of the driver name that that the caller
79 is requesting, and it must match one of the languages specified
80 in SupportedLanguages. The number of languages supported by a
81 driver is up to the driver writer.
82 DriverName - A pointer to the Unicode string to return. This Unicode string
83 is the name of the driver specified by This in the language
84 specified by Language.
85
86 Returns:
87 EFI_SUCCESS - The Unicode string for the Driver specified by This
88 and the language specified by Language was returned
89 in DriverName.
90 EFI_INVALID_PARAMETER - Language is NULL.
91 EFI_INVALID_PARAMETER - DriverName is NULL.
92 EFI_UNSUPPORTED - The driver specified by This does not support the
93 language specified by Language.
94
95 --*/
96 {
97 return LookupUnicodeString (
98 Language,
99 gSimpleNetworkComponentName.SupportedLanguages,
100 mSimpleNetworkDriverNameTable,
101 DriverName
102 );
103 }
104
105 EFI_STATUS
106 EFIAPI
107 SimpleNetworkComponentNameGetControllerName (
108 IN EFI_COMPONENT_NAME_PROTOCOL *This,
109 IN EFI_HANDLE ControllerHandle,
110 IN EFI_HANDLE ChildHandle OPTIONAL,
111 IN CHAR8 *Language,
112 OUT CHAR16 **ControllerName
113 )
114 /*++
115
116 Routine Description:
117 Retrieves a Unicode string that is the user readable name of the controller
118 that is being managed by an EFI Driver.
119
120 Arguments:
121 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
122 ControllerHandle - The handle of a controller that the driver specified by
123 This is managing. This handle specifies the controller
124 whose name is to be returned.
125 ChildHandle - The handle of the child controller to retrieve the name
126 of. This is an optional parameter that may be NULL. It
127 will be NULL for device drivers. It will also be NULL
128 for a bus drivers that wish to retrieve the name of the
129 bus controller. It will not be NULL for a bus driver
130 that wishes to retrieve the name of a child controller.
131 Language - A pointer to a three character ISO 639-2 language
132 identifier. This is the language of the controller name
133 that that the caller is requesting, and it must match one
134 of the languages specified in SupportedLanguages. The
135 number of languages supported by a driver is up to the
136 driver writer.
137 ControllerName - A pointer to the Unicode string to return. This Unicode
138 string is the name of the controller specified by
139 ControllerHandle and ChildHandle in the language specified
140 by Language from the point of view of the driver specified
141 by This.
142
143 Returns:
144 EFI_SUCCESS - The Unicode string for the user readable name in the
145 language specified by Language for the driver
146 specified by This was returned in DriverName.
147 EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
148 EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.
149 EFI_INVALID_PARAMETER - Language is NULL.
150 EFI_INVALID_PARAMETER - ControllerName is NULL.
151 EFI_UNSUPPORTED - The driver specified by This is not currently managing
152 the controller specified by ControllerHandle and
153 ChildHandle.
154 EFI_UNSUPPORTED - The driver specified by This does not support the
155 language specified by Language.
156
157 --*/
158 {
159 return EFI_UNSUPPORTED;
160 }