]>
Commit | Line | Data |
---|---|---|
392a3146 LE |
1 | /** @file\r |
2 | Work with PCI capabilities in PCI config space -- internal type definitions.\r | |
3 | \r | |
4 | Copyright (C) 2018, Red Hat, Inc.\r | |
5 | \r | |
b26f0cf9 | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
392a3146 LE |
7 | **/\r |
8 | \r | |
9 | #ifndef __BASE_PCI_CAP_LIB_H__\r | |
10 | #define __BASE_PCI_CAP_LIB_H__\r | |
11 | \r | |
12 | #include <Library/OrderedCollectionLib.h>\r | |
13 | \r | |
14 | #include <Library/PciCapLib.h>\r | |
15 | \r | |
16 | //\r | |
17 | // Structure that uniquely identifies a capability instance and serves as key\r | |
18 | // for insertion and lookup.\r | |
19 | //\r | |
20 | typedef struct {\r | |
21 | PCI_CAP_DOMAIN Domain;\r | |
22 | UINT16 CapId;\r | |
23 | UINT16 Instance;\r | |
24 | } PCI_CAP_KEY;\r | |
25 | \r | |
26 | //\r | |
27 | // In Instance==0 PCI_CAP objects, store NumInstances directly. In Instance>0\r | |
28 | // PCI_CAP objects, link Instance#0 of the same (Domain, CapId). This way\r | |
29 | // NumInstances needs maintenance in one object only, per (Domain, CapId) pair.\r | |
30 | //\r | |
31 | typedef union {\r | |
32 | UINT16 NumInstances;\r | |
33 | PCI_CAP *InstanceZero;\r | |
34 | } PCI_CAP_NUM_INSTANCES;\r | |
35 | \r | |
36 | //\r | |
37 | // Complete the incomplete PCI_CAP structure here.\r | |
38 | //\r | |
39 | struct PCI_CAP {\r | |
40 | PCI_CAP_KEY Key;\r | |
41 | PCI_CAP_NUM_INSTANCES NumInstancesUnion;\r | |
42 | UINT16 Offset;\r | |
43 | UINT16 MaxSizeHint;\r | |
44 | UINT8 Version;\r | |
45 | };\r | |
46 | \r | |
47 | //\r | |
48 | // Complete the incomplete PCI_CAP_LIST structure here.\r | |
49 | //\r | |
50 | struct PCI_CAP_LIST {\r | |
51 | ORDERED_COLLECTION *Capabilities;\r | |
52 | };\r | |
53 | \r | |
54 | #endif // __BASE_PCI_CAP_LIB_H__\r |