]> git.proxmox.com Git - mirror_edk2.git/blob - EdkModulePkg/Bus/Pci/AtapiPassThru/Dxe/ComponentName.c
Check in patch to refine DevicePath Module and USB2HostController Module.
[mirror_edk2.git] / EdkModulePkg / Bus / Pci / AtapiPassThru / Dxe / ComponentName.c
1 /** @file
2 Copyright (c) 2006, Intel Corporation
3 All rights reserved. This program and the accompanying materials
4 are licensed and made available under the terms and conditions of the BSD License
5 which accompanies this distribution. The full text of the license may be found at
6 http://opensource.org/licenses/bsd-license.php
7
8 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
9 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
10
11 Module Name: ComponentName.c
12
13 **/
14 #include "AtapiPassThru.h"
15
16 //
17 // EFI Component Name Functions
18 //
19 EFI_STATUS
20 EFIAPI
21 AtapiScsiPassThruComponentNameGetDriverName (
22 IN EFI_COMPONENT_NAME_PROTOCOL *This,
23 IN CHAR8 *Language,
24 OUT CHAR16 **DriverName
25 );
26
27 EFI_STATUS
28 EFIAPI
29 AtapiScsiPassThruComponentNameGetControllerName (
30 IN EFI_COMPONENT_NAME_PROTOCOL *This,
31 IN EFI_HANDLE ControllerHandle,
32 IN EFI_HANDLE ChildHandle OPTIONAL,
33 IN CHAR8 *Language,
34 OUT CHAR16 **ControllerName
35 );
36
37 ///
38 /// EFI Component Name Protocol
39 ///
40 EFI_COMPONENT_NAME_PROTOCOL gAtapiScsiPassThruComponentName = {
41 AtapiScsiPassThruComponentNameGetDriverName,
42 AtapiScsiPassThruComponentNameGetControllerName,
43 "eng"
44 };
45
46 static EFI_UNICODE_STRING_TABLE mAtapiScsiPassThruDriverNameTable[] = {
47 { "eng", (CHAR16 *) L"ATAPI SCSI Pass Thru Driver" },
48 { NULL , NULL }
49 };
50
51 /**
52 Retrieves a Unicode string that is the user readable name of the EFI Driver.
53
54 @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
55 @param Language A pointer to a three character ISO 639-2 language identifier.
56 This is the language of the driver name that that the caller
57 is requesting, and it must match one of the languages specified
58 in SupportedLanguages. The number of languages supported by a
59 driver is up to the driver writer.
60 @param DriverName A pointer to the Unicode string to return. This Unicode string
61 is the name of the driver specified by This in the language
62 specified by Language.
63
64 @retval EFI_SUCCESS The Unicode string for the Driver specified by This
65 and the language specified by Language was returned
66 in DriverName.
67 @retval EFI_INVALID_PARAMETER Language is NULL.
68 @retval EFI_INVALID_PARAMETER DriverName is NULL.
69 @retval EFI_UNSUPPORTED The driver specified by This does not support the
70 language specified by Language.
71
72 **/
73 EFI_STATUS
74 EFIAPI
75 AtapiScsiPassThruComponentNameGetDriverName (
76 IN EFI_COMPONENT_NAME_PROTOCOL *This,
77 IN CHAR8 *Language,
78 OUT CHAR16 **DriverName
79 )
80 {
81 return LookupUnicodeString (
82 Language,
83 gAtapiScsiPassThruComponentName.SupportedLanguages,
84 mAtapiScsiPassThruDriverNameTable,
85 DriverName
86 );
87 }
88
89 /**
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 @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
94 @param ControllerHandle The handle of a controller that the driver specified by
95 This is managing. This handle specifies the controller
96 whose name is to be returned.
97 @param ChildHandle The handle of the child controller to retrieve the name
98 of. This is an optional parameter that may be NULL. It
99 will be NULL for device drivers. It will also be NULL
100 for a bus drivers that wish to retrieve the name of the
101 bus controller. It will not be NULL for a bus driver
102 that wishes to retrieve the name of a child controller.
103 @param Language A pointer to a three character ISO 639-2 language
104 identifier. This is the language of the controller name
105 that that the caller is requesting, and it must match one
106 of the languages specified in SupportedLanguages. The
107 number of languages supported by a driver is up to the
108 driver writer.
109 @param ControllerName A pointer to the Unicode string to return. This Unicode
110 string is the name of the controller specified by
111 ControllerHandle and ChildHandle in the language
112 specified by Language from the point of view of the
113 driver specified by This.
114
115 @retval EFI_SUCCESS The Unicode string for the user readable name in the
116 language specified by Language for the driver
117 specified by This was returned in DriverName.
118 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
119 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
120 EFI_HANDLE.
121 @retval EFI_INVALID_PARAMETER Language is NULL.
122 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
123 @retval EFI_UNSUPPORTED The driver specified by This is not currently
124 managing the controller specified by
125 ControllerHandle and ChildHandle.
126 @retval EFI_UNSUPPORTED The driver specified by This does not support the
127 language specified by Language.
128
129 **/
130 EFI_STATUS
131 EFIAPI
132 AtapiScsiPassThruComponentNameGetControllerName (
133 IN EFI_COMPONENT_NAME_PROTOCOL *This,
134 IN EFI_HANDLE ControllerHandle,
135 IN EFI_HANDLE ChildHandle OPTIONAL,
136 IN CHAR8 *Language,
137 OUT CHAR16 **ControllerName
138 )
139 {
140 return EFI_UNSUPPORTED;
141 }