Vishal Bhoj | 82c8071 | 2015-12-15 21:13:33 +0530 | [diff] [blame] | 1 | /*++
|
| 2 |
|
| 3 | Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
|
| 4 | 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 "BiosVideo.h"
|
| 21 |
|
| 22 | EFI_STATUS
|
| 23 | EFIAPI
|
| 24 | BiosVideoComponentNameGetDriverName (
|
| 25 | IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
| 26 | IN CHAR8 *Language,
|
| 27 | OUT CHAR16 **DriverName
|
| 28 | );
|
| 29 |
|
| 30 | EFI_STATUS
|
| 31 | EFIAPI
|
| 32 | BiosVideoComponentNameGetControllerName (
|
| 33 | IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
| 34 | IN EFI_HANDLE ControllerHandle,
|
| 35 | IN EFI_HANDLE ChildHandle OPTIONAL,
|
| 36 | IN CHAR8 *Language,
|
| 37 | OUT CHAR16 **ControllerName
|
| 38 | );
|
| 39 |
|
| 40 | //
|
| 41 | // EFI Component Name Protocol
|
| 42 | //
|
| 43 |
|
| 44 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gBiosVideoComponentName = {
|
| 45 | BiosVideoComponentNameGetDriverName,
|
| 46 | BiosVideoComponentNameGetControllerName,
|
| 47 | "eng"
|
| 48 | };
|
| 49 |
|
| 50 | GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gBiosVideoComponentName2 = {
|
| 51 | (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) BiosVideoComponentNameGetDriverName,
|
| 52 | (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) BiosVideoComponentNameGetControllerName,
|
| 53 | "en"
|
| 54 | };
|
| 55 |
|
| 56 |
|
| 57 | static EFI_UNICODE_STRING_TABLE mBiosVideoDriverNameTable[] = {
|
| 58 | {
|
| 59 | "eng;en",
|
| 60 | L"BIOS[INT10] Video Driver"
|
| 61 | },
|
| 62 | {
|
| 63 | NULL,
|
| 64 | NULL
|
| 65 | }
|
| 66 | };
|
| 67 |
|
| 68 | EFI_STATUS
|
| 69 | EFIAPI
|
| 70 | BiosVideoComponentNameGetDriverName (
|
| 71 | IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
| 72 | IN CHAR8 *Language,
|
| 73 | OUT CHAR16 **DriverName
|
| 74 | )
|
| 75 | /*++
|
| 76 |
|
| 77 | Routine Description:
|
| 78 | Retrieves a Unicode string that is the user readable name of the EFI Driver.
|
| 79 |
|
| 80 | Arguments:
|
| 81 | This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
| 82 | Language - A pointer to a three character ISO 639-2 language identifier.
|
| 83 | This is the language of the driver name that that the caller
|
| 84 | is requesting, and it must match one of the languages specified
|
| 85 | in SupportedLanguages. The number of languages supported by a
|
| 86 | driver is up to the driver writer.
|
| 87 | DriverName - A pointer to the Unicode string to return. This Unicode string
|
| 88 | is the name of the driver specified by This in the language
|
| 89 | specified by Language.
|
| 90 |
|
| 91 | Returns:
|
| 92 | EFI_SUCCESS - The Unicode string for the Driver specified by This
|
| 93 | and the language specified by Language was returned
|
| 94 | in DriverName.
|
| 95 | EFI_INVALID_PARAMETER - Language is NULL.
|
| 96 | EFI_INVALID_PARAMETER - DriverName is NULL.
|
| 97 | EFI_UNSUPPORTED - The driver specified by This does not support the
|
| 98 | language specified by Language.
|
| 99 |
|
| 100 | --*/
|
| 101 | {
|
| 102 | return LookupUnicodeString2 (
|
| 103 | Language,
|
| 104 | This->SupportedLanguages,
|
| 105 | mBiosVideoDriverNameTable,
|
| 106 | DriverName,
|
| 107 | (BOOLEAN)(This == &gBiosVideoComponentName)
|
| 108 | );
|
| 109 | }
|
| 110 |
|
| 111 | EFI_STATUS
|
| 112 | EFIAPI
|
| 113 | BiosVideoComponentNameGetControllerName (
|
| 114 | IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
| 115 | IN EFI_HANDLE ControllerHandle,
|
| 116 | IN EFI_HANDLE ChildHandle OPTIONAL,
|
| 117 | IN CHAR8 *Language,
|
| 118 | OUT CHAR16 **ControllerName
|
| 119 | )
|
| 120 | /*++
|
| 121 |
|
| 122 | Routine Description:
|
| 123 | Retrieves a Unicode string that is the user readable name of the controller
|
| 124 | that is being managed by an EFI Driver.
|
| 125 |
|
| 126 | Arguments:
|
| 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. It
|
| 133 | will be NULL for device drivers. It will also be NULL
|
| 134 | for a bus drivers that wish to retrieve the name of the
|
| 135 | bus controller. It will not be NULL for a bus driver
|
| 136 | that wishes to retrieve the name of a child controller.
|
| 137 | Language - A pointer to a three character ISO 639-2 language
|
| 138 | identifier. This is the language of the controller name
|
| 139 | that that the caller is requesting, and it must match one
|
| 140 | of the languages specified in SupportedLanguages. The
|
| 141 | number of languages supported by a driver is up to the
|
| 142 | driver writer.
|
| 143 | ControllerName - A pointer to the Unicode string to return. This Unicode
|
| 144 | string is the name of the controller specified by
|
| 145 | ControllerHandle and ChildHandle in the language specified
|
| 146 | by Language from the point of view of the driver specified
|
| 147 | by This.
|
| 148 |
|
| 149 | Returns:
|
| 150 | EFI_SUCCESS - The Unicode string for the user readable name in the
|
| 151 | language specified by Language for the driver
|
| 152 | specified by This was returned in DriverName.
|
| 153 | EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
|
| 154 | EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid EFI_HANDLE.
|
| 155 | EFI_INVALID_PARAMETER - Language is NULL.
|
| 156 | EFI_INVALID_PARAMETER - ControllerName is NULL.
|
| 157 | EFI_UNSUPPORTED - The driver specified by This is not currently managing
|
| 158 | the controller specified by ControllerHandle and
|
| 159 | ChildHandle.
|
| 160 | EFI_UNSUPPORTED - The driver specified by This does not support the
|
| 161 | language specified by Language.
|
| 162 |
|
| 163 | --*/
|
| 164 | {
|
| 165 | return EFI_UNSUPPORTED;
|
| 166 | }
|