]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.h
MdeModulePkg/NonDiscoverablePciDev: Fix type mismatch in switch/case
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / NonDiscoverablePciDeviceDxe / NonDiscoverablePciDeviceIo.h
CommitLineData
a42e6d44
AB
1/** @file\r
2\r
3 Copyright (C) 2016, Linaro Ltd. All rights reserved.<BR>\r
4\r
5 This program and the accompanying materials are licensed and made available\r
6 under the terms and conditions of the BSD License which accompanies this\r
7 distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
11 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef __NON_DISCOVERABLE_PCI_DEVICE_IO_H__\r
16#define __NON_DISCOVERABLE_PCI_DEVICE_IO_H__\r
17\r
18#include <Library/BaseMemoryLib.h>\r
19#include <Library/DebugLib.h>\r
20#include <Library/MemoryAllocationLib.h>\r
21#include <Library/UefiBootServicesTableLib.h>\r
22#include <Library/UefiLib.h>\r
23\r
24#include <IndustryStandard/Pci.h>\r
25\r
26#include <Protocol/ComponentName.h>\r
27#include <Protocol/NonDiscoverableDevice.h>\r
28#include <Protocol/PciIo.h>\r
29\r
30#define NON_DISCOVERABLE_PCI_DEVICE_SIG SIGNATURE_32 ('P', 'P', 'I', 'D')\r
31\r
32#define NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO(PciIoPointer) \\r
33 CR (PciIoPointer, NON_DISCOVERABLE_PCI_DEVICE, PciIo, \\r
34 NON_DISCOVERABLE_PCI_DEVICE_SIG)\r
35\r
36#define PCI_ID_VENDOR_UNKNOWN 0xffff\r
37#define PCI_ID_DEVICE_DONTCARE 0x0000\r
38\r
39#define PCI_MAX_BARS 6\r
40\r
41typedef struct {\r
42 UINT32 Signature;\r
43 //\r
44 // The bound non-discoverable device protocol instance\r
45 //\r
46 NON_DISCOVERABLE_DEVICE *Device;\r
47 //\r
48 // The exposed PCI I/O protocol instance.\r
49 //\r
50 EFI_PCI_IO_PROTOCOL PciIo;\r
51 //\r
52 // The emulated PCI config space of the device. Only the minimally required\r
53 // items are assigned.\r
54 //\r
55 PCI_TYPE00 ConfigSpace;\r
56 //\r
57 // The first virtual BAR to assign based on the resources described\r
58 // by the non-discoverable device.\r
59 //\r
60 UINT32 BarOffset;\r
61 //\r
62 // The number of virtual BARs we expose based on the number of\r
63 // resources\r
64 //\r
65 UINT32 BarCount;\r
66 //\r
67 // The PCI I/O attributes for this device\r
68 //\r
69 UINT64 Attributes;\r
70 //\r
71 // Whether this device has been enabled\r
72 //\r
73 BOOLEAN Enabled;\r
74} NON_DISCOVERABLE_PCI_DEVICE;\r
75\r
76VOID\r
77InitializePciIoProtocol (\r
78 NON_DISCOVERABLE_PCI_DEVICE *Device\r
79 );\r
80\r
81extern EFI_COMPONENT_NAME_PROTOCOL gComponentName;\r
82extern EFI_COMPONENT_NAME2_PROTOCOL gComponentName2;\r
83\r
84#endif\r