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