Sync to trunk HEAD (r43416)
[reactos.git] / reactos / ntoskrnl / include / internal / pci.h
1 /*
2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/include/hal.h
5 * PURPOSE: Internal header for PCI Support
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7 */
8 #ifndef _PCI_
9 #define _PCI_
10
11 //
12 // PCI Type 1 Ports
13 //
14 #define PCI_TYPE1_ADDRESS_PORT (PULONG)0xCF8
15 #define PCI_TYPE1_DATA_PORT 0xCFC
16
17 //
18 // PCI Type 2 Ports
19 //
20 #define PCI_TYPE2_CSE_PORT (PUCHAR)0xCF8
21 #define PCI_TYPE2_FORWARD_PORT (PUCHAR)0xCFA
22 #define PCI_TYPE2_ADDRESS_BASE 0xC
23
24 //
25 // PCI Type 1 Configuration Register
26 //
27 typedef struct _PCI_TYPE1_CFG_BITS
28 {
29 union
30 {
31 struct
32 {
33 ULONG Reserved1:2;
34 ULONG RegisterNumber:6;
35 ULONG FunctionNumber:3;
36 ULONG DeviceNumber:5;
37 ULONG BusNumber:8;
38 ULONG Reserved2:7;
39 ULONG Enable:1;
40 } bits;
41
42 ULONG AsULONG;
43 } u;
44 } PCI_TYPE1_CFG_BITS, *PPCI_TYPE1_CFG_BITS;
45
46 //
47 // PCI Type 2 CSE Register
48 //
49 typedef struct _PCI_TYPE2_CSE_BITS
50 {
51 union
52 {
53 struct
54 {
55 UCHAR Enable:1;
56 UCHAR FunctionNumber:3;
57 UCHAR Key:4;
58 } bits;
59
60 UCHAR AsUCHAR;
61 } u;
62 } PCI_TYPE2_CSE_BITS, PPCI_TYPE2_CSE_BITS;
63
64 //
65 // PCI Type 2 Address Register
66 //
67 typedef struct _PCI_TYPE2_ADDRESS_BITS
68 {
69 union
70 {
71 struct
72 {
73 USHORT RegisterNumber:8;
74 USHORT Agent:4;
75 USHORT AddressBase:4;
76 } bits;
77
78 USHORT AsUSHORT;
79 } u;
80 } PCI_TYPE2_ADDRESS_BITS, *PPCI_TYPE2_ADDRESS_BITS;
81
82 //
83 // PCI Registry Information
84 //
85 typedef struct _PCI_REGISTRY_INFO
86 {
87 UCHAR MajorRevision;
88 UCHAR MinorRevision;
89 UCHAR NoBuses;
90 UCHAR HardwareMechanism;
91 } PCI_REGISTRY_INFO, *PPCI_REGISTRY_INFO;
92
93 //
94 // PCI Card Descriptor in Registry
95 //
96 typedef struct _PCI_CARD_DESCRIPTOR
97 {
98 ULONG Flags;
99 USHORT VendorID;
100 USHORT DeviceID;
101 USHORT RevisionID;
102 USHORT SubsystemVendorID;
103 USHORT SubsystemID;
104 USHORT Reserved;
105 } PCI_CARD_DESCRIPTOR, *PPCI_CARD_DESCRIPTOR;
106
107 #endif