1 | /** @file
|
---|
2 | Header file for Pci shell Debug1 function.
|
---|
3 |
|
---|
4 | Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
|
---|
5 | Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR>
|
---|
6 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
7 |
|
---|
8 | **/
|
---|
9 |
|
---|
10 | #ifndef _EFI_SHELL_PCI_H_
|
---|
11 | #define _EFI_SHELL_PCI_H_
|
---|
12 |
|
---|
13 | typedef enum {
|
---|
14 | PciDevice,
|
---|
15 | PciP2pBridge,
|
---|
16 | PciCardBusBridge,
|
---|
17 | PciUndefined
|
---|
18 | } PCI_HEADER_TYPE;
|
---|
19 |
|
---|
20 | #define INDEX_OF(Field) ((UINT8 *) (Field) - (UINT8 *) mConfigSpace)
|
---|
21 |
|
---|
22 | #define IS_PCIE_ENDPOINT(DevicePortType) \
|
---|
23 | ((DevicePortType) == PCIE_DEVICE_PORT_TYPE_PCIE_ENDPOINT || \
|
---|
24 | (DevicePortType) == PCIE_DEVICE_PORT_TYPE_LEGACY_PCIE_ENDPOINT || \
|
---|
25 | (DevicePortType) == PCIE_DEVICE_PORT_TYPE_ROOT_COMPLEX_INTEGRATED_ENDPOINT)
|
---|
26 |
|
---|
27 | #define IS_PCIE_SWITCH(DevicePortType) \
|
---|
28 | ((DevicePortType == PCIE_DEVICE_PORT_TYPE_UPSTREAM_PORT) || \
|
---|
29 | (DevicePortType == PCIE_DEVICE_PORT_TYPE_DOWNSTREAM_PORT))
|
---|
30 |
|
---|
31 | #pragma pack(1)
|
---|
32 | //
|
---|
33 | // Data region after PCI configuration header(for cardbus bridge)
|
---|
34 | //
|
---|
35 | typedef struct {
|
---|
36 | UINT16 SubVendorId; // Subsystem Vendor ID
|
---|
37 | UINT16 SubSystemId; // Subsystem ID
|
---|
38 | UINT32 LegacyBase; // Optional 16-Bit PC Card Legacy
|
---|
39 | // Mode Base Address
|
---|
40 | //
|
---|
41 | UINT32 Data[46];
|
---|
42 | } PCI_CARDBUS_DATA;
|
---|
43 |
|
---|
44 | typedef union {
|
---|
45 | PCI_DEVICE_HEADER_TYPE_REGION Device;
|
---|
46 | PCI_BRIDGE_CONTROL_REGISTER Bridge;
|
---|
47 | PCI_CARDBUS_CONTROL_REGISTER CardBus;
|
---|
48 | } NON_COMMON_UNION;
|
---|
49 |
|
---|
50 | typedef struct {
|
---|
51 | PCI_DEVICE_INDEPENDENT_REGION Common;
|
---|
52 | NON_COMMON_UNION NonCommon;
|
---|
53 | UINT32 Data[48];
|
---|
54 | } PCI_CONFIG_SPACE;
|
---|
55 |
|
---|
56 | #pragma pack()
|
---|
57 |
|
---|
58 | #endif // _PCI_H_
|
---|