]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/ComponentName.c
MdeModulePkg: implement generic PCI I/O driver for non-discoverable devices
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / NonDiscoverablePciDeviceDxe / ComponentName.c
1 /** @file
2
3 Copyright (C) 2016, Linaro Ltd. All rights reserved.<BR>
4
5 This program and the accompanying materials are licensed and made available
6 under the terms and conditions of the BSD License which accompanies this
7 distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
11 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #include "NonDiscoverablePciDeviceIo.h"
16
17 //
18 // The purpose of the following scaffolding (EFI_COMPONENT_NAME_PROTOCOL and
19 // EFI_COMPONENT_NAME2_PROTOCOL implementation) is to format the driver's name
20 // in English, for display on standard console devices. This is recommended for
21 // UEFI drivers that follow the UEFI Driver Model. Refer to the Driver Writer's
22 // Guide for UEFI 2.3.1 v1.01, 11 UEFI Driver and Controller Names.
23 //
24
25 STATIC
26 EFI_UNICODE_STRING_TABLE mDriverNameTable[] = {
27 { "eng;en", L"PCI I/O protocol emulation driver for non-discoverable devices" },
28 { NULL, NULL }
29 };
30
31 EFI_COMPONENT_NAME_PROTOCOL gComponentName;
32
33 STATIC
34 EFI_STATUS
35 EFIAPI
36 NonDiscoverablePciGetDriverName (
37 IN EFI_COMPONENT_NAME_PROTOCOL *This,
38 IN CHAR8 *Language,
39 OUT CHAR16 **DriverName
40 )
41 {
42 return LookupUnicodeString2 (
43 Language,
44 This->SupportedLanguages,
45 mDriverNameTable,
46 DriverName,
47 (BOOLEAN)(This == &gComponentName) // Iso639Language
48 );
49 }
50
51 STATIC
52 EFI_STATUS
53 EFIAPI
54 NonDiscoverablePciGetDeviceName (
55 IN EFI_COMPONENT_NAME_PROTOCOL *This,
56 IN EFI_HANDLE DeviceHandle,
57 IN EFI_HANDLE ChildHandle,
58 IN CHAR8 *Language,
59 OUT CHAR16 **ControllerName
60 )
61 {
62 return EFI_UNSUPPORTED;
63 }
64
65 EFI_COMPONENT_NAME_PROTOCOL gComponentName = {
66 &NonDiscoverablePciGetDriverName,
67 &NonDiscoverablePciGetDeviceName,
68 "eng" // SupportedLanguages, ISO 639-2 language codes
69 };
70
71 EFI_COMPONENT_NAME2_PROTOCOL gComponentName2 = {
72 (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) &NonDiscoverablePciGetDriverName,
73 (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) &NonDiscoverablePciGetDeviceName,
74 "en" // SupportedLanguages, RFC 4646 language codes
75 };