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