\r
@param[in] Id - The protocol GUID for callback\r
@param[in] CallBackFunction - The callback function\r
- @param[in] Context - The context of the callback\r
\r
@retval EFI_STATUS - Callback function failed.\r
\r
EFI_STATUS\r
EFIAPI\r
VisitAllInstancesOfProtocol (\r
- IN EFI_GUID *Id,\r
- IN PROTOCOL_INSTANCE_CALLBACK CallBackFunction,\r
- IN VOID *Context\r
+ IN EFI_GUID *Id,\r
+ IN SIMPLE_PROTOCOL_INSTANCE_CALLBACK CallBackFunction\r
)\r
{\r
EFI_STATUS Status;\r
\r
Status = (*CallBackFunction)(\r
HandleBuffer[Index],\r
- Instance,\r
- Context\r
+ Instance\r
);\r
}\r
\r
}\r
\r
/**\r
- For every PCI instance execute a callback function.\r
+ Do platform specific PCI Device check and add them to\r
+ ConOut, ConIn, ErrOut.\r
\r
- @param[in] Handle - The PCI device handle\r
- @param[in] Instance - The instance of the PciIo protocol\r
- @param[in] Context - The context of the callback\r
+ @param[in] Handle - Handle of PCI device instance\r
+ @param[in] Instance - The instance of PCI device\r
\r
- @retval EFI_STATUS - Callback function failed.\r
+ @retval EFI_SUCCESS - PCI Device check and Console variable update successfully.\r
+ @retval EFI_STATUS - PCI Device check or Console variable update fail.\r
\r
**/\r
EFI_STATUS\r
EFIAPI\r
-VisitingAPciInstance (\r
+DetectAndPreparePlatformPciDevicePath (\r
IN EFI_HANDLE Handle,\r
- IN VOID *Instance,\r
- IN VOID *Context\r
+ IN VOID *Instance\r
)\r
{\r
EFI_STATUS Status;\r
return Status;\r
}\r
\r
- return (*(VISIT_PCI_INSTANCE_CALLBACK)(UINTN)Context)(\r
- Handle,\r
- PciIo,\r
- &Pci\r
- );\r
-}\r
-\r
-/**\r
- For every PCI instance execute a callback function.\r
-\r
- @param[in] CallBackFunction - Callback function pointer\r
-\r
- @retval EFI_STATUS - Callback function failed.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-VisitAllPciInstances (\r
- IN VISIT_PCI_INSTANCE_CALLBACK CallBackFunction\r
- )\r
-{\r
- return VisitAllInstancesOfProtocol (\r
- &gEfiPciIoProtocolGuid,\r
- VisitingAPciInstance,\r
- (VOID *)(UINTN)CallBackFunction\r
- );\r
-}\r
-\r
-/**\r
- Do platform specific PCI Device check and add them to\r
- ConOut, ConIn, ErrOut.\r
-\r
- @param[in] Handle - Handle of PCI device instance\r
- @param[in] PciIo - PCI IO protocol instance\r
- @param[in] Pci - PCI Header register block\r
-\r
- @retval EFI_SUCCESS - PCI Device check and Console variable update successfully.\r
- @retval EFI_STATUS - PCI Device check or Console variable update fail.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-DetectAndPreparePlatformPciDevicePath (\r
- IN EFI_HANDLE Handle,\r
- IN EFI_PCI_IO_PROTOCOL *PciIo,\r
- IN PCI_TYPE00 *Pci\r
- )\r
-{\r
- EFI_STATUS Status;\r
-\r
Status = PciIo->Attributes (\r
PciIo,\r
EfiPciIoAttributeOperationEnable,\r
//\r
// Here we decide whether it is LPC Bridge\r
//\r
- if ((IS_PCI_LPC (Pci)) ||\r
- ((IS_PCI_ISA_PDECODE (Pci)) &&\r
- (Pci->Hdr.VendorId == 0x8086)\r
+ if ((IS_PCI_LPC (&Pci)) ||\r
+ ((IS_PCI_ISA_PDECODE (&Pci)) &&\r
+ (Pci.Hdr.VendorId == 0x8086)\r
)\r
)\r
{\r
//\r
// Here we decide which Serial device to enable in PCI bus\r
//\r
- if (IS_PCI_16550SERIAL (Pci)) {\r
+ if (IS_PCI_16550SERIAL (&Pci)) {\r
//\r
// Add them to ConOut, ConIn, ErrOut.\r
//\r
//\r
// Enable all display devices\r
//\r
- if (IS_PCI_DISPLAY (Pci)) {\r
+ if (IS_PCI_DISPLAY (&Pci)) {\r
//\r
// Add them to ConOut.\r
//\r
BOOLEAN DetectDisplayOnly\r
)\r
{\r
+ EFI_STATUS Status;\r
+\r
mDetectDisplayOnly = DetectDisplayOnly;\r
\r
EfiBootManagerUpdateConsoleVariable (\r
NULL\r
);\r
\r
- return VisitAllPciInstances (DetectAndPreparePlatformPciDevicePath);\r
+ Status = VisitAllInstancesOfProtocol (\r
+ &gEfiPciIoProtocolGuid,\r
+ DetectAndPreparePlatformPciDevicePath\r
+ );\r
+ return Status;\r
}\r
\r
/**\r