19060e3ec6dfd6048724832947933650cde873381davidhuang/** @file
29060e3ec6dfd6048724832947933650cde873381davidhuang  EFI Component Name functions declaration for PCI Bus module.
39060e3ec6dfd6048724832947933650cde873381davidhuang
4284ee2e829ab2453293b7dc4539727ad6c047163niruiyuCopyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
5cd5ebaa06dca3e6ef3c464081e6defe00d358c69hhtianThis program and the accompanying materials
69060e3ec6dfd6048724832947933650cde873381davidhuangare licensed and made available under the terms and conditions of the BSD License
79060e3ec6dfd6048724832947933650cde873381davidhuangwhich accompanies this distribution.  The full text of the license may be found at
89060e3ec6dfd6048724832947933650cde873381davidhuanghttp://opensource.org/licenses/bsd-license.php
99060e3ec6dfd6048724832947933650cde873381davidhuang
109060e3ec6dfd6048724832947933650cde873381davidhuangTHE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
119060e3ec6dfd6048724832947933650cde873381davidhuangWITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
129060e3ec6dfd6048724832947933650cde873381davidhuang
139060e3ec6dfd6048724832947933650cde873381davidhuang**/
149060e3ec6dfd6048724832947933650cde873381davidhuang
159060e3ec6dfd6048724832947933650cde873381davidhuang
169060e3ec6dfd6048724832947933650cde873381davidhuang#ifndef _EFI_PCI_BUS_COMPONENT_NAME_H_
179060e3ec6dfd6048724832947933650cde873381davidhuang#define _EFI_PCI_BUS_COMPONENT_NAME_H_
189060e3ec6dfd6048724832947933650cde873381davidhuang
199060e3ec6dfd6048724832947933650cde873381davidhuangextern EFI_COMPONENT_NAME_PROTOCOL   gPciBusComponentName;
209060e3ec6dfd6048724832947933650cde873381davidhuangextern EFI_COMPONENT_NAME2_PROTOCOL  gPciBusComponentName2;
219060e3ec6dfd6048724832947933650cde873381davidhuang
229060e3ec6dfd6048724832947933650cde873381davidhuang//
239060e3ec6dfd6048724832947933650cde873381davidhuang// EFI Component Name Functions
249060e3ec6dfd6048724832947933650cde873381davidhuang//
259060e3ec6dfd6048724832947933650cde873381davidhuang/**
269060e3ec6dfd6048724832947933650cde873381davidhuang  Retrieves a Unicode string that is the user readable name of the driver.
279060e3ec6dfd6048724832947933650cde873381davidhuang
289060e3ec6dfd6048724832947933650cde873381davidhuang  This function retrieves the user readable name of a driver in the form of a
299060e3ec6dfd6048724832947933650cde873381davidhuang  Unicode string. If the driver specified by This has a user readable name in
309060e3ec6dfd6048724832947933650cde873381davidhuang  the language specified by Language, then a pointer to the driver name is
319060e3ec6dfd6048724832947933650cde873381davidhuang  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
329060e3ec6dfd6048724832947933650cde873381davidhuang  by This does not support the language specified by Language,
339060e3ec6dfd6048724832947933650cde873381davidhuang  then EFI_UNSUPPORTED is returned.
349060e3ec6dfd6048724832947933650cde873381davidhuang
359060e3ec6dfd6048724832947933650cde873381davidhuang  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
369060e3ec6dfd6048724832947933650cde873381davidhuang                                EFI_COMPONENT_NAME_PROTOCOL instance.
379060e3ec6dfd6048724832947933650cde873381davidhuang
389060e3ec6dfd6048724832947933650cde873381davidhuang  @param  Language[in]          A pointer to a Null-terminated ASCII string
399060e3ec6dfd6048724832947933650cde873381davidhuang                                array indicating the language. This is the
409060e3ec6dfd6048724832947933650cde873381davidhuang                                language of the driver name that the caller is
419060e3ec6dfd6048724832947933650cde873381davidhuang                                requesting, and it must match one of the
429060e3ec6dfd6048724832947933650cde873381davidhuang                                languages specified in SupportedLanguages. The
439060e3ec6dfd6048724832947933650cde873381davidhuang                                number of languages supported by a driver is up
449060e3ec6dfd6048724832947933650cde873381davidhuang                                to the driver writer. Language is specified
459060e3ec6dfd6048724832947933650cde873381davidhuang                                in RFC 4646 or ISO 639-2 language code format.
469060e3ec6dfd6048724832947933650cde873381davidhuang
479060e3ec6dfd6048724832947933650cde873381davidhuang  @param  DriverName[out]       A pointer to the Unicode string to return.
489060e3ec6dfd6048724832947933650cde873381davidhuang                                This Unicode string is the name of the
499060e3ec6dfd6048724832947933650cde873381davidhuang                                driver specified by This in the language
509060e3ec6dfd6048724832947933650cde873381davidhuang                                specified by Language.
519060e3ec6dfd6048724832947933650cde873381davidhuang
529060e3ec6dfd6048724832947933650cde873381davidhuang  @retval EFI_SUCCESS           The Unicode string for the Driver specified by
539060e3ec6dfd6048724832947933650cde873381davidhuang                                This and the language specified by Language was
549060e3ec6dfd6048724832947933650cde873381davidhuang                                returned in DriverName.
559060e3ec6dfd6048724832947933650cde873381davidhuang
569060e3ec6dfd6048724832947933650cde873381davidhuang  @retval EFI_INVALID_PARAMETER Language is NULL.
579060e3ec6dfd6048724832947933650cde873381davidhuang
589060e3ec6dfd6048724832947933650cde873381davidhuang  @retval EFI_INVALID_PARAMETER DriverName is NULL.
599060e3ec6dfd6048724832947933650cde873381davidhuang
609060e3ec6dfd6048724832947933650cde873381davidhuang  @retval EFI_UNSUPPORTED       The driver specified by This does not support
619060e3ec6dfd6048724832947933650cde873381davidhuang                                the language specified by Language.
629060e3ec6dfd6048724832947933650cde873381davidhuang
639060e3ec6dfd6048724832947933650cde873381davidhuang**/
649060e3ec6dfd6048724832947933650cde873381davidhuangEFI_STATUS
659060e3ec6dfd6048724832947933650cde873381davidhuangEFIAPI
669060e3ec6dfd6048724832947933650cde873381davidhuangPciBusComponentNameGetDriverName (
679060e3ec6dfd6048724832947933650cde873381davidhuang  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,
689060e3ec6dfd6048724832947933650cde873381davidhuang  IN  CHAR8                        *Language,
699060e3ec6dfd6048724832947933650cde873381davidhuang  OUT CHAR16                       **DriverName
709060e3ec6dfd6048724832947933650cde873381davidhuang  );
719060e3ec6dfd6048724832947933650cde873381davidhuang
729060e3ec6dfd6048724832947933650cde873381davidhuang
739060e3ec6dfd6048724832947933650cde873381davidhuang/**
749060e3ec6dfd6048724832947933650cde873381davidhuang  Retrieves a Unicode string that is the user readable name of the controller
759060e3ec6dfd6048724832947933650cde873381davidhuang  that is being managed by a driver.
769060e3ec6dfd6048724832947933650cde873381davidhuang
779060e3ec6dfd6048724832947933650cde873381davidhuang  This function retrieves the user readable name of the controller specified by
789060e3ec6dfd6048724832947933650cde873381davidhuang  ControllerHandle and ChildHandle in the form of a Unicode string. If the
799060e3ec6dfd6048724832947933650cde873381davidhuang  driver specified by This has a user readable name in the language specified by
809060e3ec6dfd6048724832947933650cde873381davidhuang  Language, then a pointer to the controller name is returned in ControllerName,
819060e3ec6dfd6048724832947933650cde873381davidhuang  and EFI_SUCCESS is returned.  If the driver specified by This is not currently
829060e3ec6dfd6048724832947933650cde873381davidhuang  managing the controller specified by ControllerHandle and ChildHandle,
839060e3ec6dfd6048724832947933650cde873381davidhuang  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not
849060e3ec6dfd6048724832947933650cde873381davidhuang  support the language specified by Language, then EFI_UNSUPPORTED is returned.
859060e3ec6dfd6048724832947933650cde873381davidhuang
869060e3ec6dfd6048724832947933650cde873381davidhuang  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
879060e3ec6dfd6048724832947933650cde873381davidhuang                                EFI_COMPONENT_NAME_PROTOCOL instance.
889060e3ec6dfd6048724832947933650cde873381davidhuang
899060e3ec6dfd6048724832947933650cde873381davidhuang  @param  ControllerHandle[in]  The handle of a controller that the driver
909060e3ec6dfd6048724832947933650cde873381davidhuang                                specified by This is managing.  This handle
919060e3ec6dfd6048724832947933650cde873381davidhuang                                specifies the controller whose name is to be
929060e3ec6dfd6048724832947933650cde873381davidhuang                                returned.
939060e3ec6dfd6048724832947933650cde873381davidhuang
949060e3ec6dfd6048724832947933650cde873381davidhuang  @param  ChildHandle[in]       The handle of the child controller to retrieve
959060e3ec6dfd6048724832947933650cde873381davidhuang                                the name of.  This is an optional parameter that
969060e3ec6dfd6048724832947933650cde873381davidhuang                                may be NULL.  It will be NULL for device
979060e3ec6dfd6048724832947933650cde873381davidhuang                                drivers.  It will also be NULL for a bus drivers
989060e3ec6dfd6048724832947933650cde873381davidhuang                                that wish to retrieve the name of the bus
999060e3ec6dfd6048724832947933650cde873381davidhuang                                controller.  It will not be NULL for a bus
1009060e3ec6dfd6048724832947933650cde873381davidhuang                                driver that wishes to retrieve the name of a
1019060e3ec6dfd6048724832947933650cde873381davidhuang                                child controller.
1029060e3ec6dfd6048724832947933650cde873381davidhuang
1039060e3ec6dfd6048724832947933650cde873381davidhuang  @param  Language[in]          A pointer to a Null-terminated ASCII string
1049060e3ec6dfd6048724832947933650cde873381davidhuang                                array indicating the language.  This is the
1059060e3ec6dfd6048724832947933650cde873381davidhuang                                language of the driver name that the caller is
1069060e3ec6dfd6048724832947933650cde873381davidhuang                                requesting, and it must match one of the
1079060e3ec6dfd6048724832947933650cde873381davidhuang                                languages specified in SupportedLanguages. The
1089060e3ec6dfd6048724832947933650cde873381davidhuang                                number of languages supported by a driver is up
1099060e3ec6dfd6048724832947933650cde873381davidhuang                                to the driver writer. Language is specified in
1109060e3ec6dfd6048724832947933650cde873381davidhuang                                RFC 4646 or ISO 639-2 language code format.
1119060e3ec6dfd6048724832947933650cde873381davidhuang
1129060e3ec6dfd6048724832947933650cde873381davidhuang  @param  ControllerName[out]   A pointer to the Unicode string to return.
1139060e3ec6dfd6048724832947933650cde873381davidhuang                                This Unicode string is the name of the
1149060e3ec6dfd6048724832947933650cde873381davidhuang                                controller specified by ControllerHandle and
1159060e3ec6dfd6048724832947933650cde873381davidhuang                                ChildHandle in the language specified by
1169060e3ec6dfd6048724832947933650cde873381davidhuang                                Language from the point of view of the driver
1179060e3ec6dfd6048724832947933650cde873381davidhuang                                specified by This.
1189060e3ec6dfd6048724832947933650cde873381davidhuang
1199060e3ec6dfd6048724832947933650cde873381davidhuang  @retval EFI_SUCCESS           The Unicode string for the user readable name in
1209060e3ec6dfd6048724832947933650cde873381davidhuang                                the language specified by Language for the
1219060e3ec6dfd6048724832947933650cde873381davidhuang                                driver specified by This was returned in
1229060e3ec6dfd6048724832947933650cde873381davidhuang                                DriverName.
1239060e3ec6dfd6048724832947933650cde873381davidhuang
124284ee2e829ab2453293b7dc4539727ad6c047163niruiyu  @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
1259060e3ec6dfd6048724832947933650cde873381davidhuang
1269060e3ec6dfd6048724832947933650cde873381davidhuang  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
1279060e3ec6dfd6048724832947933650cde873381davidhuang                                EFI_HANDLE.
1289060e3ec6dfd6048724832947933650cde873381davidhuang
1299060e3ec6dfd6048724832947933650cde873381davidhuang  @retval EFI_INVALID_PARAMETER Language is NULL.
1309060e3ec6dfd6048724832947933650cde873381davidhuang
1319060e3ec6dfd6048724832947933650cde873381davidhuang  @retval EFI_INVALID_PARAMETER ControllerName is NULL.
1329060e3ec6dfd6048724832947933650cde873381davidhuang
1339060e3ec6dfd6048724832947933650cde873381davidhuang  @retval EFI_UNSUPPORTED       The driver specified by This is not currently
1349060e3ec6dfd6048724832947933650cde873381davidhuang                                managing the controller specified by
1359060e3ec6dfd6048724832947933650cde873381davidhuang                                ControllerHandle and ChildHandle.
1369060e3ec6dfd6048724832947933650cde873381davidhuang
1379060e3ec6dfd6048724832947933650cde873381davidhuang  @retval EFI_UNSUPPORTED       The driver specified by This does not support
1389060e3ec6dfd6048724832947933650cde873381davidhuang                                the language specified by Language.
1399060e3ec6dfd6048724832947933650cde873381davidhuang
1409060e3ec6dfd6048724832947933650cde873381davidhuang**/
1419060e3ec6dfd6048724832947933650cde873381davidhuangEFI_STATUS
1429060e3ec6dfd6048724832947933650cde873381davidhuangEFIAPI
1439060e3ec6dfd6048724832947933650cde873381davidhuangPciBusComponentNameGetControllerName (
1449060e3ec6dfd6048724832947933650cde873381davidhuang  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,
1459060e3ec6dfd6048724832947933650cde873381davidhuang  IN  EFI_HANDLE                                      ControllerHandle,
1469060e3ec6dfd6048724832947933650cde873381davidhuang  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,
1479060e3ec6dfd6048724832947933650cde873381davidhuang  IN  CHAR8                                           *Language,
1489060e3ec6dfd6048724832947933650cde873381davidhuang  OUT CHAR16                                          **ControllerName
1499060e3ec6dfd6048724832947933650cde873381davidhuang  );
1509060e3ec6dfd6048724832947933650cde873381davidhuang
1519060e3ec6dfd6048724832947933650cde873381davidhuang
1529060e3ec6dfd6048724832947933650cde873381davidhuang#endif
153