/** @file Copyright (c) 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License that accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #ifndef _EFI_PCI_CALLBACK_H #define _EFI_PCI_CALLBACK_H #include #include #include // // Global Id for PCI callback // #define EFI_PCI_CALLBACK_PROTOCOL_GUID \ { \ 0x1ca0e202, 0xfe9e, 0x4776, 0x9f, 0xaa, 0x57, 0xc, 0x19, 0x61, 0x7a, 0x06 \ } typedef struct _EFI_PCI_CALLBACK_PROTOCOL EFI_PCI_CALLBACK_PROTOCOL; typedef enum { EfiPciEnumerationDeviceScanning = 1, EfiPciEnumerationBusNumberAssigned = 2, EfiPciEnumerationResourceAssigned = 4, } EFI_PCI_ENUMERATION_PHASE; typedef struct { PCI_TYPE00 PciHeader; EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo; EFI_CPU_IO2_PROTOCOL *CpuIo; } EFI_PCI_CALLBACK_CONTEXT; typedef VOID (EFIAPI *EFI_PCI_CALLBACK_FUNC) ( IN EFI_HANDLE RootBridgeHandle, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS PciAddress, IN EFI_PCI_ENUMERATION_PHASE Phase, IN EFI_PCI_CALLBACK_CONTEXT *Context ); typedef EFI_STATUS (EFIAPI *EFI_REGISTER_PCI_CALLBACK) ( IN EFI_PCI_CALLBACK_PROTOCOL *This, IN EFI_PCI_CALLBACK_FUNC Function, IN EFI_PCI_ENUMERATION_PHASE Phase ) /*++ Routine Description: Register a callback during PCI bus enumeration Arguments: This - Protocol instance pointer. Function - Callback function pointer. Phase - PCI enumeration phase. Returns: EFI_SUCCESS - Function has registed successfully EFI_UNSUPPORTED - The function has been regisered EFI_InVALID_PARAMETER - The parameter is incorrect --*/ ; // // Protocol definition // typedef struct _EFI_PCI_CALLBACK_PROTOCOL { EFI_REGISTER_PCI_CALLBACK RegisterPciCallback; } EFI_PCI_CALLBACK_PROTOCOL; extern EFI_GUID gEfiPciCallbackProtocolGuid; #endif