]> git.proxmox.com Git - mirror_edk2.git/blob - ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.h
cbc1b0235af7a8d186a278385c2bc54b92a7c1da
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / Pci.h
1 /** @file
2 Header file for Pci shell Debug1 function.
3
4 Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
5 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 _EFI_SHELL_PCI_H_
16 #define _EFI_SHELL_PCI_H_
17
18 typedef enum {
19 PciDevice,
20 PciP2pBridge,
21 PciCardBusBridge,
22 PciUndefined
23 } PCI_HEADER_TYPE;
24
25 #define HEADER_TYPE_MULTI_FUNCTION 0x80
26
27 #define MAX_BUS_NUMBER 255
28 #define MAX_DEVICE_NUMBER 31
29 #define MAX_FUNCTION_NUMBER 7
30
31 #define EFI_PCI_CAPABILITY_ID_PCIEXP 0x10
32 #define EFI_PCI_CAPABILITY_ID_PCIX 0x07
33
34 #define CALC_EFI_PCI_ADDRESS(Bus, Dev, Func, Reg) \
35 ((UINT64) ((((UINTN) Bus) << 24) + (((UINTN) Dev) << 16) + (((UINTN) Func) << 8) + ((UINTN) Reg)))
36
37 #define CALC_EFI_PCIEX_ADDRESS(Bus, Dev, Func, ExReg) ( \
38 (UINT64) ((((UINTN) Bus) << 24) + (((UINTN) Dev) << 16) + (((UINTN) Func) << 8) + (LShiftU64 ((UINT64) ExReg, 32))) \
39 );
40
41 #define INDEX_OF(Field) ((UINT8 *) (Field) - (UINT8 *) mConfigSpace)
42
43 #define PCI_BIT_0 0x00000001
44 #define PCI_BIT_1 0x00000002
45 #define PCI_BIT_2 0x00000004
46 #define PCI_BIT_3 0x00000008
47 #define PCI_BIT_4 0x00000010
48 #define PCI_BIT_5 0x00000020
49 #define PCI_BIT_6 0x00000040
50 #define PCI_BIT_7 0x00000080
51 #define PCI_BIT_8 0x00000100
52 #define PCI_BIT_9 0x00000200
53 #define PCI_BIT_10 0x00000400
54 #define PCI_BIT_11 0x00000800
55 #define PCI_BIT_12 0x00001000
56 #define PCI_BIT_13 0x00002000
57 #define PCI_BIT_14 0x00004000
58 #define PCI_BIT_15 0x00008000
59
60 //
61 // PCIE device/port types
62 //
63 #define PCIE_PCIE_ENDPOINT 0
64 #define PCIE_LEGACY_PCIE_ENDPOINT 1
65 #define PCIE_ROOT_COMPLEX_ROOT_PORT 4
66 #define PCIE_SWITCH_UPSTREAM_PORT 5
67 #define PCIE_SWITCH_DOWNSTREAM_PORT 6
68 #define PCIE_PCIE_TO_PCIX_BRIDGE 7
69 #define PCIE_PCIX_TO_PCIE_BRIDGE 8
70 #define PCIE_ROOT_COMPLEX_INTEGRATED_PORT 9
71 #define PCIE_ROOT_COMPLEX_EVENT_COLLECTOR 10
72 #define PCIE_DEVICE_PORT_TYPE_MAX 11
73
74 #define IS_PCIE_ENDPOINT(DevicePortType) \
75 ((DevicePortType) == PCIE_PCIE_ENDPOINT || \
76 (DevicePortType) == PCIE_LEGACY_PCIE_ENDPOINT || \
77 (DevicePortType) == PCIE_ROOT_COMPLEX_INTEGRATED_PORT)
78
79 #define IS_PCIE_SWITCH(DevicePortType) \
80 ((DevicePortType == PCIE_SWITCH_UPSTREAM_PORT) || \
81 (DevicePortType == PCIE_SWITCH_DOWNSTREAM_PORT))
82
83 //
84 // Capabilities Register
85 //
86 #define PCIE_CAP_VERSION(PcieCapReg) \
87 ((PcieCapReg) & 0x0f)
88 #define PCIE_CAP_DEVICEPORT_TYPE(PcieCapReg) \
89 (((PcieCapReg) >> 4) & 0x0f)
90 #define PCIE_CAP_SLOT_IMPLEMENTED(PcieCapReg) \
91 (((PcieCapReg) >> 8) & 0x1)
92 #define PCIE_CAP_INT_MSG_NUM(PcieCapReg) \
93 (((PcieCapReg) >> 9) & 0x1f)
94 //
95 // Device Capabilities Register
96 //
97 #define PCIE_CAP_MAX_PAYLOAD(PcieDeviceCap) \
98 ((PcieDeviceCap) & 0x7)
99 #define PCIE_CAP_PHANTOM_FUNC(PcieDeviceCap) \
100 (((PcieDeviceCap) >> 3) & 0x3)
101 #define PCIE_CAP_EXTENDED_TAG(PcieDeviceCap) \
102 (((PcieDeviceCap) >> 5) & 0x1)
103 #define PCIE_CAP_L0sLatency(PcieDeviceCap) \
104 (((PcieDeviceCap) >> 6) & 0x7)
105 #define PCIE_CAP_L1Latency(PcieDeviceCap) \
106 (((PcieDeviceCap) >> 9) & 0x7)
107 #define PCIE_CAP_ERR_REPORTING(PcieDeviceCap) \
108 (((PcieDeviceCap) >> 15) & 0x1)
109 #define PCIE_CAP_SLOT_POWER_VALUE(PcieDeviceCap) \
110 (((PcieDeviceCap) >> 18) & 0x0ff)
111 #define PCIE_CAP_SLOT_POWER_SCALE(PcieDeviceCap) \
112 (((PcieDeviceCap) >> 26) & 0x3)
113 #define PCIE_CAP_FUNC_LEVEL_RESET(PcieDeviceCap) \
114 (((PcieDeviceCap) >> 28) & 0x1)
115 //
116 // Device Control Register
117 //
118 #define PCIE_CAP_COR_ERR_REPORTING_ENABLE(PcieDeviceControl) \
119 ((PcieDeviceControl) & 0x1)
120 #define PCIE_CAP_NONFAT_ERR_REPORTING_ENABLE(PcieDeviceControl) \
121 (((PcieDeviceControl) >> 1) & 0x1)
122 #define PCIE_CAP_FATAL_ERR_REPORTING_ENABLE(PcieDeviceControl) \
123 (((PcieDeviceControl) >> 2) & 0x1)
124 #define PCIE_CAP_UNSUP_REQ_REPORTING_ENABLE(PcieDeviceControl) \
125 (((PcieDeviceControl) >> 3) & 0x1)
126 #define PCIE_CAP_RELAXED_ORDERING_ENABLE(PcieDeviceControl) \
127 (((PcieDeviceControl) >> 4) & 0x1)
128 #define PCIE_CAP_MAX_PAYLOAD_SIZE(PcieDeviceControl) \
129 (((PcieDeviceControl) >> 5) & 0x7)
130 #define PCIE_CAP_EXTENDED_TAG_ENABLE(PcieDeviceControl) \
131 (((PcieDeviceControl) >> 8) & 0x1)
132 #define PCIE_CAP_PHANTOM_FUNC_ENABLE(PcieDeviceControl) \
133 (((PcieDeviceControl) >> 9) & 0x1)
134 #define PCIE_CAP_AUX_PM_ENABLE(PcieDeviceControl) \
135 (((PcieDeviceControl) >> 10) & 0x1)
136 #define PCIE_CAP_NO_SNOOP_ENABLE(PcieDeviceControl) \
137 (((PcieDeviceControl) >> 11) & 0x1)
138 #define PCIE_CAP_MAX_READ_REQ_SIZE(PcieDeviceControl) \
139 (((PcieDeviceControl) >> 12) & 0x7)
140 #define PCIE_CAP_BRG_CONF_RETRY(PcieDeviceControl) \
141 (((PcieDeviceControl) >> 15) & 0x1)
142 //
143 // Device Status Register
144 //
145 #define PCIE_CAP_COR_ERR_DETECTED(PcieDeviceStatus) \
146 ((PcieDeviceStatus) & 0x1)
147 #define PCIE_CAP_NONFAT_ERR_DETECTED(PcieDeviceStatus) \
148 (((PcieDeviceStatus) >> 1) & 0x1)
149 #define PCIE_CAP_FATAL_ERR_DETECTED(PcieDeviceStatus) \
150 (((PcieDeviceStatus) >> 2) & 0x1)
151 #define PCIE_CAP_UNSUP_REQ_DETECTED(PcieDeviceStatus) \
152 (((PcieDeviceStatus) >> 3) & 0x1)
153 #define PCIE_CAP_AUX_POWER_DETECTED(PcieDeviceStatus) \
154 (((PcieDeviceStatus) >> 4) & 0x1)
155 #define PCIE_CAP_TRANSACTION_PENDING(PcieDeviceStatus) \
156 (((PcieDeviceStatus) >> 5) & 0x1)
157 //
158 // Link Capabilities Register
159 //
160 #define PCIE_CAP_SUP_LINK_SPEEDS(PcieLinkCap) \
161 ((PcieLinkCap) & 0x0f)
162 #define PCIE_CAP_MAX_LINK_WIDTH(PcieLinkCap) \
163 (((PcieLinkCap) >> 4) & 0x3f)
164 #define PCIE_CAP_ASPM_SUPPORT(PcieLinkCap) \
165 (((PcieLinkCap) >> 10) & 0x3)
166 #define PCIE_CAP_L0s_LATENCY(PcieLinkCap) \
167 (((PcieLinkCap) >> 12) & 0x7)
168 #define PCIE_CAP_L1_LATENCY(PcieLinkCap) \
169 (((PcieLinkCap) >> 15) & 0x7)
170 #define PCIE_CAP_CLOCK_PM(PcieLinkCap) \
171 (((PcieLinkCap) >> 18) & 0x1)
172 #define PCIE_CAP_SUP_DOWN_ERR_REPORTING(PcieLinkCap) \
173 (((PcieLinkCap) >> 19) & 0x1)
174 #define PCIE_CAP_LINK_ACTIVE_REPORTING(PcieLinkCap) \
175 (((PcieLinkCap) >> 20) & 0x1)
176 #define PCIE_CAP_LINK_BWD_NOTIF_CAP(PcieLinkCap) \
177 (((PcieLinkCap) >> 21) & 0x1)
178 #define PCIE_CAP_PORT_NUMBER(PcieLinkCap) \
179 (((PcieLinkCap) >> 24) & 0x0ff)
180 //
181 // Link Control Register
182 //
183 #define PCIE_CAP_ASPM_CONTROL(PcieLinkControl) \
184 ((PcieLinkControl) & 0x3)
185 #define PCIE_CAP_RCB(PcieLinkControl) \
186 (((PcieLinkControl) >> 3) & 0x1)
187 #define PCIE_CAP_LINK_DISABLE(PcieLinkControl) \
188 (((PcieLinkControl) >> 4) & 0x1)
189 #define PCIE_CAP_COMMON_CLK_CONF(PcieLinkControl) \
190 (((PcieLinkControl) >> 6) & 0x1)
191 #define PCIE_CAP_EXT_SYNC(PcieLinkControl) \
192 (((PcieLinkControl) >> 7) & 0x1)
193 #define PCIE_CAP_CLK_PWR_MNG(PcieLinkControl) \
194 (((PcieLinkControl) >> 8) & 0x1)
195 #define PCIE_CAP_HW_AUTO_WIDTH_DISABLE(PcieLinkControl) \
196 (((PcieLinkControl) >> 9) & 0x1)
197 #define PCIE_CAP_LINK_BDW_MNG_INT_EN(PcieLinkControl) \
198 (((PcieLinkControl) >> 10) & 0x1)
199 #define PCIE_CAP_LINK_AUTO_BDW_INT_EN(PcieLinkControl) \
200 (((PcieLinkControl) >> 11) & 0x1)
201 //
202 // Link Status Register
203 //
204 #define PCIE_CAP_CUR_LINK_SPEED(PcieLinkStatus) \
205 ((PcieLinkStatus) & 0x0f)
206 #define PCIE_CAP_NEGO_LINK_WIDTH(PcieLinkStatus) \
207 (((PcieLinkStatus) >> 4) & 0x3f)
208 #define PCIE_CAP_LINK_TRAINING(PcieLinkStatus) \
209 (((PcieLinkStatus) >> 11) & 0x1)
210 #define PCIE_CAP_SLOT_CLK_CONF(PcieLinkStatus) \
211 (((PcieLinkStatus) >> 12) & 0x1)
212 #define PCIE_CAP_DATA_LINK_ACTIVE(PcieLinkStatus) \
213 (((PcieLinkStatus) >> 13) & 0x1)
214 #define PCIE_CAP_LINK_BDW_MNG_STAT(PcieLinkStatus) \
215 (((PcieLinkStatus) >> 14) & 0x1)
216 #define PCIE_CAP_LINK_AUTO_BDW_STAT(PcieLinkStatus) \
217 (((PcieLinkStatus) >> 15) & 0x1)
218 //
219 // Slot Capabilities Register
220 //
221 #define PCIE_CAP_ATT_BUT_PRESENT(PcieSlotCap) \
222 ((PcieSlotCap) & 0x1)
223 #define PCIE_CAP_PWR_CTRLLER_PRESENT(PcieSlotCap) \
224 (((PcieSlotCap) >> 1) & 0x1)
225 #define PCIE_CAP_MRL_SENSOR_PRESENT(PcieSlotCap) \
226 (((PcieSlotCap) >> 2) & 0x1)
227 #define PCIE_CAP_ATT_IND_PRESENT(PcieSlotCap) \
228 (((PcieSlotCap) >> 3) & 0x1)
229 #define PCIE_CAP_PWD_IND_PRESENT(PcieSlotCap) \
230 (((PcieSlotCap) >> 4) & 0x1)
231 #define PCIE_CAP_HOTPLUG_SUPPRISE(PcieSlotCap) \
232 (((PcieSlotCap) >> 5) & 0x1)
233 #define PCIE_CAP_HOTPLUG_CAPABLE(PcieSlotCap) \
234 (((PcieSlotCap) >> 6) & 0x1)
235 #define PCIE_CAP_SLOT_PWR_LIMIT_VALUE(PcieSlotCap) \
236 (((PcieSlotCap) >> 7) & 0x0ff)
237 #define PCIE_CAP_SLOT_PWR_LIMIT_SCALE(PcieSlotCap) \
238 (((PcieSlotCap) >> 15) & 0x3)
239 #define PCIE_CAP_ELEC_INTERLOCK_PRESENT(PcieSlotCap) \
240 (((PcieSlotCap) >> 17) & 0x1)
241 #define PCIE_CAP_NO_COMM_COMPLETED_SUP(PcieSlotCap) \
242 (((PcieSlotCap) >> 18) & 0x1)
243 #define PCIE_CAP_PHY_SLOT_NUM(PcieSlotCap) \
244 (((PcieSlotCap) >> 19) & 0x1fff)
245 //
246 // Slot Control Register
247 //
248 #define PCIE_CAP_ATT_BUT_ENABLE(PcieSlotControl) \
249 ((PcieSlotControl) & 0x1)
250 #define PCIE_CAP_PWR_FLT_DETECT_ENABLE(PcieSlotControl) \
251 (((PcieSlotControl) >> 1) & 0x1)
252 #define PCIE_CAP_MRL_SENSOR_CHANGE_ENABLE(PcieSlotControl) \
253 (((PcieSlotControl) >> 2) & 0x1)
254 #define PCIE_CAP_PRES_DETECT_CHANGE_ENABLE(PcieSlotControl) \
255 (((PcieSlotControl) >> 3) & 0x1)
256 #define PCIE_CAP_COMM_CMPL_INT_ENABLE(PcieSlotControl) \
257 (((PcieSlotControl) >> 4) & 0x1)
258 #define PCIE_CAP_HOTPLUG_INT_ENABLE(PcieSlotControl) \
259 (((PcieSlotControl) >> 5) & 0x1)
260 #define PCIE_CAP_ATT_IND_CTRL(PcieSlotControl) \
261 (((PcieSlotControl) >> 6) & 0x3)
262 #define PCIE_CAP_PWR_IND_CTRL(PcieSlotControl) \
263 (((PcieSlotControl) >> 8) & 0x3)
264 #define PCIE_CAP_PWR_CTRLLER_CTRL(PcieSlotControl) \
265 (((PcieSlotControl) >> 10) & 0x1)
266 #define PCIE_CAP_ELEC_INTERLOCK_CTRL(PcieSlotControl) \
267 (((PcieSlotControl) >> 11) & 0x1)
268 #define PCIE_CAP_DLINK_STAT_CHANGE_ENABLE(PcieSlotControl) \
269 (((PcieSlotControl) >> 12) & 0x1)
270 //
271 // Slot Status Register
272 //
273 #define PCIE_CAP_ATT_BUT_PRESSED(PcieSlotStatus) \
274 ((PcieSlotStatus) & 0x1)
275 #define PCIE_CAP_PWR_FLT_DETECTED(PcieSlotStatus) \
276 (((PcieSlotStatus) >> 1) & 0x1)
277 #define PCIE_CAP_MRL_SENSOR_CHANGED(PcieSlotStatus) \
278 (((PcieSlotStatus) >> 2) & 0x1)
279 #define PCIE_CAP_PRES_DETECT_CHANGED(PcieSlotStatus) \
280 (((PcieSlotStatus) >> 3) & 0x1)
281 #define PCIE_CAP_COMM_COMPLETED(PcieSlotStatus) \
282 (((PcieSlotStatus) >> 4) & 0x1)
283 #define PCIE_CAP_MRL_SENSOR_STATE(PcieSlotStatus) \
284 (((PcieSlotStatus) >> 5) & 0x1)
285 #define PCIE_CAP_PRES_DETECT_STATE(PcieSlotStatus) \
286 (((PcieSlotStatus) >> 6) & 0x1)
287 #define PCIE_CAP_ELEC_INTERLOCK_STATE(PcieSlotStatus) \
288 (((PcieSlotStatus) >> 7) & 0x1)
289 #define PCIE_CAP_DLINK_STAT_CHANGED(PcieSlotStatus) \
290 (((PcieSlotStatus) >> 8) & 0x1)
291 //
292 // Root Control Register
293 //
294 #define PCIE_CAP_SYSERR_ON_CORERR_EN(PcieRootControl) \
295 ((PcieRootControl) & 0x1)
296 #define PCIE_CAP_SYSERR_ON_NONFATERR_EN(PcieRootControl) \
297 (((PcieRootControl) >> 1) & 0x1)
298 #define PCIE_CAP_SYSERR_ON_FATERR_EN(PcieRootControl) \
299 (((PcieRootControl) >> 2) & 0x1)
300 #define PCIE_CAP_PME_INT_ENABLE(PcieRootControl) \
301 (((PcieRootControl) >> 3) & 0x1)
302 #define PCIE_CAP_CRS_SW_VIS_ENABLE(PcieRootControl) \
303 (((PcieRootControl) >> 4) & 0x1)
304 //
305 // Root Capabilities Register
306 //
307 #define PCIE_CAP_CRS_SW_VIS(PcieRootCap) \
308 ((PcieRootCap) & 0x1)
309 //
310 // Root Status Register
311 //
312 #define PCIE_CAP_PME_REQ_ID(PcieRootStatus) \
313 ((PcieRootStatus) & 0x0ffff)
314 #define PCIE_CAP_PME_STATUS(PcieRootStatus) \
315 (((PcieRootStatus) >> 16) & 0x1)
316 #define PCIE_CAP_PME_PENDING(PcieRootStatus) \
317 (((PcieRootStatus) >> 17) & 0x1)
318
319 #pragma pack(1)
320 //
321 // Common part of the PCI configuration space header for devices, P2P bridges,
322 // and cardbus bridges
323 //
324 typedef struct {
325 UINT16 VendorId;
326 UINT16 DeviceId;
327
328 UINT16 Command;
329 UINT16 Status;
330
331 UINT8 RevisionId;
332 UINT8 ClassCode[3];
333
334 UINT8 CacheLineSize;
335 UINT8 PrimaryLatencyTimer;
336 UINT8 HeaderType;
337 UINT8 BIST;
338
339 } PCI_COMMON_HEADER;
340
341 //
342 // PCI configuration space header for devices(after the common part)
343 //
344 typedef struct {
345 UINT32 Bar[6]; // Base Address Registers
346 UINT32 CardBusCISPtr; // CardBus CIS Pointer
347 UINT16 SubVendorId; // Subsystem Vendor ID
348 UINT16 SubSystemId; // Subsystem ID
349 UINT32 ROMBar; // Expansion ROM Base Address
350 UINT8 CapabilitiesPtr; // Capabilities Pointer
351 UINT8 Reserved[3];
352
353 UINT32 Reserved1;
354
355 UINT8 InterruptLine; // Interrupt Line
356 UINT8 InterruptPin; // Interrupt Pin
357 UINT8 MinGnt; // Min_Gnt
358 UINT8 MaxLat; // Max_Lat
359 } PCI_DEVICE_HEADER;
360
361 //
362 // PCI configuration space header for pci-to-pci bridges(after the common part)
363 //
364 typedef struct {
365 UINT32 Bar[2]; // Base Address Registers
366 UINT8 PrimaryBus; // Primary Bus Number
367 UINT8 SecondaryBus; // Secondary Bus Number
368 UINT8 SubordinateBus; // Subordinate Bus Number
369 UINT8 SecondaryLatencyTimer; // Secondary Latency Timer
370 UINT8 IoBase; // I/O Base
371 UINT8 IoLimit; // I/O Limit
372 UINT16 SecondaryStatus; // Secondary Status
373 UINT16 MemoryBase; // Memory Base
374 UINT16 MemoryLimit; // Memory Limit
375 UINT16 PrefetchableMemBase; // Pre-fetchable Memory Base
376 UINT16 PrefetchableMemLimit; // Pre-fetchable Memory Limit
377 UINT32 PrefetchableBaseUpper; // Pre-fetchable Base Upper 32 bits
378 UINT32 PrefetchableLimitUpper; // Pre-fetchable Limit Upper 32 bits
379 UINT16 IoBaseUpper; // I/O Base Upper 16 bits
380 UINT16 IoLimitUpper; // I/O Limit Upper 16 bits
381 UINT8 CapabilitiesPtr; // Capabilities Pointer
382 UINT8 Reserved[3];
383
384 UINT32 ROMBar; // Expansion ROM Base Address
385 UINT8 InterruptLine; // Interrupt Line
386 UINT8 InterruptPin; // Interrupt Pin
387 UINT16 BridgeControl; // Bridge Control
388 } PCI_BRIDGE_HEADER;
389
390 //
391 // PCI configuration space header for cardbus bridges(after the common part)
392 //
393 typedef struct {
394 UINT32 CardBusSocketReg; // Cardus Socket/ExCA Base
395 // Address Register
396 //
397 UINT8 CapabilitiesPtr; // 14h in pci-cardbus bridge.
398 UINT8 Reserved;
399 UINT16 SecondaryStatus; // Secondary Status
400 UINT8 PciBusNumber; // PCI Bus Number
401 UINT8 CardBusBusNumber; // CardBus Bus Number
402 UINT8 SubordinateBusNumber; // Subordinate Bus Number
403 UINT8 CardBusLatencyTimer; // CardBus Latency Timer
404 UINT32 MemoryBase0; // Memory Base Register 0
405 UINT32 MemoryLimit0; // Memory Limit Register 0
406 UINT32 MemoryBase1;
407 UINT32 MemoryLimit1;
408 UINT32 IoBase0;
409 UINT32 IoLimit0; // I/O Base Register 0
410 UINT32 IoBase1; // I/O Limit Register 0
411 UINT32 IoLimit1;
412
413 UINT8 InterruptLine; // Interrupt Line
414 UINT8 InterruptPin; // Interrupt Pin
415 UINT16 BridgeControl; // Bridge Control
416 } PCI_CARDBUS_HEADER;
417
418 //
419 // Data region after PCI configuration header(for cardbus bridge)
420 //
421 typedef struct {
422 UINT16 SubVendorId; // Subsystem Vendor ID
423 UINT16 SubSystemId; // Subsystem ID
424 UINT32 LegacyBase; // Optional 16-Bit PC Card Legacy
425 // Mode Base Address
426 //
427 UINT32 Data[46];
428 } PCI_CARDBUS_DATA;
429
430 typedef struct {
431 PCI_COMMON_HEADER Common;
432 union {
433 PCI_DEVICE_HEADER Device;
434 PCI_BRIDGE_HEADER Bridge;
435 PCI_CARDBUS_HEADER CardBus;
436 } NonCommon;
437 UINT32 Data[48];
438 } PCI_CONFIG_SPACE;
439
440 typedef struct {
441 UINT8 PcieCapId;
442 UINT8 NextCapPtr;
443 UINT16 PcieCapReg;
444 UINT32 PcieDeviceCap;
445 UINT16 DeviceControl;
446 UINT16 DeviceStatus;
447 UINT32 LinkCap;
448 UINT16 LinkControl;
449 UINT16 LinkStatus;
450 UINT32 SlotCap;
451 UINT16 SlotControl;
452 UINT16 SlotStatus;
453 UINT16 RsvdP;
454 UINT16 RootControl;
455 UINT32 RootStatus;
456 } PCIE_CAP_STURCTURE;
457
458 #pragma pack()
459
460 #endif // _PCI_H_