]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Include/Library/PciIncompatibleDeviceSupportLib.h
Add #ifndef statement for header file.
[mirror_edk2.git] / IntelFrameworkModulePkg / Include / Library / PciIncompatibleDeviceSupportLib.h
1 /** @file
2 PCI Incompatible device support Libary.
3
4 Copyright (c) 2006 - 2007, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this 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,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef __PCI_INCOMPATIBLE_DEVICE_SUPPORT_LIB_H__
16 #define __PCI_INCOMPATIBLE_DEVICE_SUPPORT_LIB_H__
17
18 #define PCI_REGISTER_READ 0xfffffffffffffff1ULL
19 #define PCI_REGISTER_WRITE 0xfffffffffffffff2ULL
20 #define VALUE_NOCARE 0xffffffffffffffffULL
21
22 //
23 // PCI device device information
24 //
25 typedef struct {
26 UINT64 VendorID;
27 UINT64 DeviceID;
28 UINT64 RevisionID;
29 UINT64 SubsystemVendorID;
30 UINT64 SubsystemID;
31 } EFI_PCI_DEVICE_INFO;
32
33
34 //
35 // store hardcode value of resgister
36 //
37 typedef struct {
38 UINT64 AndValue;
39 UINT64 OrValue;
40 } EFI_PCI_REGISTER_VALUE_DATA;
41
42 //
43 // store access width information
44 //
45 typedef struct {
46 UINT64 StartOffset;
47 UINT64 EndOffset;
48 UINT64 Width;
49 } EFI_PCI_REGISTER_ACCESS_DATA;
50
51
52 //
53 // ACPI resource descriptor
54 //
55 typedef struct {
56 UINT64 ResType;
57 UINT64 GenFlag;
58 UINT64 SpecificFlag;
59 UINT64 AddrSpaceGranularity;
60 UINT64 AddrRangeMin;
61 UINT64 AddrRangeMax;
62 UINT64 AddrTranslationOffset;
63 UINT64 AddrLen;
64 } EFI_PCI_RESOUCE_DESCRIPTOR;
65
66 /**
67 Checks the incompatible device list for ACPI resource update and return
68 the configuration.
69
70 This function searches the incompatible device list according to request
71 information. If the PCI device belongs to the devices list, corresponding
72 configuration informtion will be returned, in the meantime return EFI_SUCCESS.
73
74 @param PciDeviceInfo A pointer to PCI device information.
75 @param Configuration Returned information.
76
77 @retval returns EFI_SUCCESS if check incompatible device ok.
78 Otherwise return EFI_UNSUPPORTED.
79 **/
80 RETURN_STATUS
81 EFIAPI
82 PciResourceUpdateCheck (
83 IN EFI_PCI_DEVICE_INFO *PciDeviceInfo,
84 OUT VOID *Configuration
85 );
86
87 /**
88 Checks the incompatible device list and return configuration register mask values.
89
90 This function searches the incompatible device list according to request
91 information. If the PCI device belongs to the devices list, corresponding
92 configuration informtion will be returned, in the meantime return EFI_SUCCESS.
93
94 @param PciDeviceInfo A pointer to EFI_PCI_DEVICE_INFO.
95 @param AccessType Access Type, READ or WRITE.
96 @param Offset The address within the PCI configuration space.
97 @param Configuration Returned information.
98
99 @retval returns EFI_SUCCESS if check incompatible device ok.
100 Otherwise return EFI_UNSUPPORTED.
101 **/
102 RETURN_STATUS
103 EFIAPI
104 PciRegisterUpdateCheck (
105 IN EFI_PCI_DEVICE_INFO *PciDeviceInfo,
106 IN UINT64 AccessType,
107 IN UINT64 Offset,
108 OUT VOID *Configuration
109 );
110
111 /**
112 Checks the incompatible device list for access width incompatibility and
113 return the configuration
114
115 This function searches the incompatible device list for access width
116 incompatibility according to request information. If the PCI device
117 belongs to the devices list, corresponding configuration informtion
118 will be returned, in the meantime return EFI_SUCCESS.
119
120 @param PciDeviceInfo A pointer to PCI device information.
121 @param AccessType Access type, READ or WRITE.
122 @param Offset The address within the PCI configuration space.
123 @param AccessWidth Access width needs to check incompatibility.
124 @param Configuration Returned information.
125
126 @retval returns EFI_SUCCESS if check incompatible device ok.
127 Otherwise return EFI_UNSUPPORTED.
128 **/
129 RETURN_STATUS
130 EFIAPI
131 PciRegisterAccessCheck (
132 IN EFI_PCI_DEVICE_INFO *PciDeviceInfo,
133 IN UINT64 AccessType,
134 IN UINT64 Offset,
135 IN UINT64 AccessWidth,
136 OUT VOID *Configuration
137 );
138
139 #endif
140