TianoCore EDK2 master
|
#include "UefiShellDebug1CommandsLib.h"
#include <Protocol/PciRootBridgeIo.h>
#include <Library/ShellLib.h>
#include <IndustryStandard/Pci.h>
#include <IndustryStandard/Acpi.h>
#include "Pci.h"
Go to the source code of this file.
Data Structures | |
struct | PCI_CLASS_STRINGS |
struct | PCI_CLASS_ENTRY_TAG |
struct | PCIE_EXPLAIN_STRUCT |
Typedefs | |
typedef struct PCI_CLASS_ENTRY_TAG | PCI_CLASS_ENTRY |
typedef EFI_STATUS(* | PCIE_EXPLAIN_FUNCTION) (IN PCI_CAPABILITY_PCIEXP *PciExpressCap) |
Main file for Pci shell Debug1 function.
Copyright (c) 2005 - 2021, Intel Corporation. All rights reserved.
(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Pci.c.
typedef EFI_STATUS(* PCIE_EXPLAIN_FUNCTION) (IN PCI_CAPABILITY_PCIEXP *PciExpressCap) |
EFI_STATUS ExplainPcieCapReg | ( | IN PCI_CAPABILITY_PCIEXP * | PciExpressCap | ) |
EFI_STATUS ExplainPcieDeviceCap | ( | IN PCI_CAPABILITY_PCIEXP * | PciExpressCap | ) |
EFI_STATUS ExplainPcieDeviceControl | ( | IN PCI_CAPABILITY_PCIEXP * | PciExpressCap | ) |
EFI_STATUS ExplainPcieDeviceStatus | ( | IN PCI_CAPABILITY_PCIEXP * | PciExpressCap | ) |
EFI_STATUS ExplainPcieLinkCap | ( | IN PCI_CAPABILITY_PCIEXP * | PciExpressCap | ) |
EFI_STATUS ExplainPcieLinkControl | ( | IN PCI_CAPABILITY_PCIEXP * | PciExpressCap | ) |
EFI_STATUS ExplainPcieLinkStatus | ( | IN PCI_CAPABILITY_PCIEXP * | PciExpressCap | ) |
EFI_STATUS ExplainPcieRootCap | ( | IN PCI_CAPABILITY_PCIEXP * | PciExpressCap | ) |
EFI_STATUS ExplainPcieRootControl | ( | IN PCI_CAPABILITY_PCIEXP * | PciExpressCap | ) |
EFI_STATUS ExplainPcieRootStatus | ( | IN PCI_CAPABILITY_PCIEXP * | PciExpressCap | ) |
EFI_STATUS ExplainPcieSlotCap | ( | IN PCI_CAPABILITY_PCIEXP * | PciExpressCap | ) |
EFI_STATUS ExplainPcieSlotControl | ( | IN PCI_CAPABILITY_PCIEXP * | PciExpressCap | ) |
EFI_STATUS ExplainPcieSlotStatus | ( | IN PCI_CAPABILITY_PCIEXP * | PciExpressCap | ) |
UINT8 LocatePciCapability | ( | IN PCI_CONFIG_SPACE * | ConfigSpace, |
IN UINT8 | CapabilityId | ||
) |
Locate capability register block per capability ID.
[in] | ConfigSpace | Data in PCI configuration space. |
[in] | CapabilityId | The capability ID. |
Locate capability register block per capability ID.
[in] | ConfigSpace | Data in PCI configuration space. |
[in] | CapabilityId | The capability ID. |
EFI_STATUS PciExplainBar | ( | IN UINT32 * | Bar, |
IN UINT16 * | Command, | ||
IN UINT64 | Address, | ||
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * | IoDev, | ||
IN OUT UINTN * | Index | ||
) |
Explain the Base Address Register(Bar) in PCI configuration space.
[in] | Bar | Points to the Base Address Register intended to interpret. |
[in] | Command | Points to the register Command. |
[in] | Address | Address used to access configuration space of this PCI device. |
[in] | IoDev | Handle used to access configuration space of PCI device. |
[in,out] | Index | The Index. |
EFI_SUCCESS | The command completed successfully. |
EFI_STATUS PciExplainBridgeControl | ( | IN UINT16 * | BridgeControl, |
IN PCI_HEADER_TYPE | HeaderType | ||
) |
EFI_STATUS PciExplainBridgeData | ( | IN PCI_BRIDGE_CONTROL_REGISTER * | Bridge, |
IN UINT64 | Address, | ||
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * | IoDev | ||
) |
Explain the bridge specific part of data in PCI configuration space.
[in] | Bridge | Bridge specific data region in PCI configuration space. |
[in] | Address | Address used to access configuration space of this PCI device. |
[in] | IoDev | Handle used to access configuration space of PCI device. |
EFI_SUCCESS | The command completed successfully. |
EFI_STATUS PciExplainCardBusData | ( | IN PCI_CARDBUS_CONTROL_REGISTER * | CardBus, |
IN UINT64 | Address, | ||
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * | IoDev | ||
) |
Explain the cardbus specific part of data in PCI configuration space.
[in] | CardBus | CardBus specific region of PCI configuration space. |
[in] | Address | Address used to access configuration space of this PCI device. |
[in] | IoDev | Handle used to access configuration space of PCI device. |
EFI_SUCCESS | The command completed successfully. |
EFI_STATUS PciExplainCommand | ( | IN UINT16 * | Command | ) |
EFI_STATUS PciExplainDeviceData | ( | IN PCI_DEVICE_HEADER_TYPE_REGION * | Device, |
IN UINT64 | Address, | ||
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * | IoDev | ||
) |
Explain the device specific part of data in PCI configuration space.
[in] | Device | Data in PCI configuration space. |
[in] | Address | Address used to access configuration space of this PCI device. |
[in] | IoDev | Handle used to access configuration space of PCI device. |
EFI_SUCCESS | The command completed successfully. |
VOID PciExplainPci | ( | IN PCI_CONFIG_SPACE * | ConfigSpace, |
IN UINT64 | Address, | ||
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * | IoDev | ||
) |
Explain the data in PCI configuration space. The part which is common for PCI device and bridge is interpreted in this function. It calls other functions to interpret data unique for device or bridge.
[in] | ConfigSpace | Data in PCI configuration space. |
[in] | Address | Address used to access configuration space of this PCI device. |
[in] | IoDev | Handle used to access configuration space of PCI device. |
VOID PciExplainPciExpress | ( | IN PCI_CAPABILITY_PCIEXP * | PciExpressCap, |
IN UINT8 * | ExtendedConfigSpace, | ||
IN UINTN | ExtendedConfigSize, | ||
IN CONST UINT16 | ExtendedCapability | ||
) |
Display Pcie device structure.
[in] | PciExpressCap | PCI Express capability buffer. |
[in] | ExtendedConfigSpace | PCI Express extended configuration space. |
[in] | ExtendedConfigSize | PCI Express extended configuration size. |
[in] | ExtendedCapability | PCI Express extended capability ID to explain. |
EFI_STATUS PciExplainStatus | ( | IN UINT16 * | Status, |
IN BOOLEAN | MainStatus, | ||
IN PCI_HEADER_TYPE | HeaderType | ||
) |
Explain each meaningful bit of register Status. The definition of Status is slightly different depending on the PCI header type.
[in] | Status | Points to the content of register Status. |
[in] | MainStatus | Indicates if this register is main status(not secondary status). |
[in] | HeaderType | Header type of this PCI device. |
EFI_SUCCESS | The command completed successfully. |
EFI_STATUS PciFindProtocolInterface | ( | IN EFI_HANDLE * | HandleBuf, |
IN UINTN | HandleCount, | ||
IN UINT16 | Segment, | ||
IN UINT16 | Bus, | ||
OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL ** | IoDev | ||
) |
This function finds out the protocol which is in charge of the given segment, and its bus range covers the current bus number. It lookes each instances of RootBridgeIoProtocol handle, until the one meets the criteria is found.
[in] | HandleBuf | Buffer which holds all PCI_ROOT_BRIDIGE_IO_PROTOCOL handles. |
[in] | HandleCount | Count of all PCI_ROOT_BRIDIGE_IO_PROTOCOL handles. |
[in] | Segment | Segment number of device we are dealing with. |
[in] | Bus | Bus number of device we are dealing with. |
[out] | IoDev | Handle used to access configuration space of PCI device. |
EFI_SUCCESS | The command completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
VOID PciGetClassStrings | ( | IN UINT32 | ClassCode, |
IN OUT PCI_CLASS_STRINGS * | ClassStrings | ||
) |
Generates printable Unicode strings that represent PCI device class, subclass and programmed I/F based on a value passed to the function.
[in] | ClassCode | Value representing the PCI "Class Code" register read from a PCI device. The encodings are: bits 23:16 - Base Class Code bits 15:8 - Sub-Class Code bits 7:0 - Programming Interface |
[in,out] | ClassStrings | Pointer of PCI_CLASS_STRINGS structure, which contains printable class strings corresponding to ClassCode. The caller must not modify the strings that are pointed by the fields in ClassStrings. |
EFI_STATUS PciGetNextBusRange | ( | IN OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR ** | Descriptors, |
OUT UINT16 * | MinBus, | ||
OUT UINT16 * | MaxBus, | ||
OUT BOOLEAN * | IsEnd | ||
) |
This function get the next bus range of given address space descriptors. It also moves the pointer backward a node, to get prepared to be called again.
[in,out] | Descriptors | Points to current position of a serial of address space descriptors. |
[out] | MinBus | The lower range of bus number. |
[out] | MaxBus | The upper range of bus number. |
[out] | IsEnd | Meet end of the serial of descriptors. |
EFI_SUCCESS | The command completed successfully. |
EFI_STATUS PciGetProtocolAndResource | ( | IN EFI_HANDLE | Handle, |
OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL ** | IoDev, | ||
OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR ** | Descriptors | ||
) |
This function gets the protocol interface from the given handle, and obtains its address space descriptors.
[in] | Handle | The PCI_ROOT_BRIDIGE_IO_PROTOCOL handle. |
[out] | IoDev | Handle used to access configuration space of PCI device. |
[out] | Descriptors | Points to the address space descriptors. |
EFI_SUCCESS | The command completed successfully |
EFI_STATUS PrintInterpretedExtendedCompatibilityAcs | ( | IN CONST PCI_EXP_EXT_HDR * | HeaderAddress, |
IN CONST PCI_EXP_EXT_HDR * | HeadersBaseAddress | ||
) |
EFI_STATUS PrintInterpretedExtendedCompatibilityAer | ( | IN CONST PCI_EXP_EXT_HDR * | HeaderAddress, |
IN CONST PCI_EXP_EXT_HDR * | HeadersBaseAddress | ||
) |
EFI_STATUS PrintInterpretedExtendedCompatibilityAri | ( | IN CONST PCI_EXP_EXT_HDR * | HeaderAddress, |
IN CONST PCI_EXP_EXT_HDR * | HeadersBaseAddress | ||
) |
EFI_STATUS PrintInterpretedExtendedCompatibilityDynamicPowerAllocation | ( | IN CONST PCI_EXP_EXT_HDR * | HeaderAddress, |
IN CONST PCI_EXP_EXT_HDR * | HeadersBaseAddress | ||
) |
EFI_STATUS PrintInterpretedExtendedCompatibilityECEA | ( | IN CONST PCI_EXP_EXT_HDR * | HeaderAddress, |
IN CONST PCI_EXP_EXT_HDR * | HeadersBaseAddress | ||
) |
EFI_STATUS PrintInterpretedExtendedCompatibilityLatencyToleranceReporting | ( | IN CONST PCI_EXP_EXT_HDR * | HeaderAddress, |
IN CONST PCI_EXP_EXT_HDR * | HeadersBaseAddress | ||
) |
EFI_STATUS PrintInterpretedExtendedCompatibilityLinkControl | ( | IN CONST PCI_EXP_EXT_HDR * | HeaderAddress, |
IN CONST PCI_EXP_EXT_HDR * | HeadersBaseAddress | ||
) |
EFI_STATUS PrintInterpretedExtendedCompatibilityLinkDeclaration | ( | IN CONST PCI_EXP_EXT_HDR * | HeaderAddress, |
IN CONST PCI_EXP_EXT_HDR * | HeadersBaseAddress | ||
) |
EFI_STATUS PrintInterpretedExtendedCompatibilityMulticast | ( | IN CONST PCI_EXP_EXT_HDR * | HeaderAddress, |
IN CONST PCI_EXP_EXT_HDR * | HeadersBaseAddress, | ||
IN CONST PCI_CAPABILITY_PCIEXP * | PciExpressCapPtr | ||
) |
Function to interpret and print out the multicast structure
[in] | HeaderAddress | The Address of this capability header. |
[in] | HeadersBaseAddress | The address of all the extended capability headers. |
[in] | PciExpressCapPtr | The address of the PCIe capabilities structure. |
EFI_STATUS PrintInterpretedExtendedCompatibilityPowerBudgeting | ( | IN CONST PCI_EXP_EXT_HDR * | HeaderAddress, |
IN CONST PCI_EXP_EXT_HDR * | HeadersBaseAddress | ||
) |
EFI_STATUS PrintInterpretedExtendedCompatibilityRcrb | ( | IN CONST PCI_EXP_EXT_HDR * | HeaderAddress, |
IN CONST PCI_EXP_EXT_HDR * | HeadersBaseAddress | ||
) |
EFI_STATUS PrintInterpretedExtendedCompatibilityResizeableBar | ( | IN CONST PCI_EXP_EXT_HDR * | HeaderAddress, |
IN CONST PCI_EXP_EXT_HDR * | HeadersBaseAddress | ||
) |
EFI_STATUS PrintInterpretedExtendedCompatibilitySecondary | ( | IN CONST PCI_EXP_EXT_HDR * | HeaderAddress, |
IN CONST PCI_EXP_EXT_HDR * | HeadersBaseAddress, | ||
IN CONST PCI_CAPABILITY_PCIEXP * | PciExpressCap | ||
) |
Function to interpret and print out the secondary PCIe capability structure
[in] | HeaderAddress | The Address of this capability header. |
[in] | HeadersBaseAddress | The address of all the extended capability headers. |
[in] | PciExpressCapPtr | The address of the PCIe capabilities structure. |
EFI_STATUS PrintInterpretedExtendedCompatibilitySerialNumber | ( | IN CONST PCI_EXP_EXT_HDR * | HeaderAddress, |
IN CONST PCI_EXP_EXT_HDR * | HeadersBaseAddress | ||
) |
EFI_STATUS PrintInterpretedExtendedCompatibilityTph | ( | IN CONST PCI_EXP_EXT_HDR * | HeaderAddress, |
IN CONST PCI_EXP_EXT_HDR * | HeadersBaseAddress | ||
) |
EFI_STATUS PrintInterpretedExtendedCompatibilityVendorSpecific | ( | IN CONST PCI_EXP_EXT_HDR * | HeaderAddress, |
IN CONST PCI_EXP_EXT_HDR * | HeadersBaseAddress | ||
) |
EFI_STATUS PrintInterpretedExtendedCompatibilityVirtualChannel | ( | IN CONST PCI_EXP_EXT_HDR * | HeaderAddress, |
IN CONST PCI_EXP_EXT_HDR * | HeadersBaseAddress | ||
) |
EFI_STATUS PrintPciExtendedCapabilityDetails | ( | IN CONST PCI_EXP_EXT_HDR * | HeadersBaseAddress, |
IN CONST PCI_EXP_EXT_HDR * | HeaderAddress, | ||
IN CONST PCI_CAPABILITY_PCIEXP * | PciExpressCapPtr | ||
) |
SHELL_STATUS EFIAPI ShellCommandRunPci | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
CHAR16* ASPMCtrlStrTable[] |
CHAR16* DevicePortTypeTable[] |
PCI_CLASS_ENTRY gClassStringList[] |
CHAR16* IndicatorTable[] |
CHAR16* L0sLatencyStrTable[] |
CHAR16* L1LatencyStrTable[] |
PCI_CONFIG_SPACE* mConfigSpace = NULL |
STATIC CONST SHELL_PARAM_ITEM ParamList[] |
PCI_CLASS_ENTRY PCIBlankEntry |
PCIE_EXPLAIN_STRUCT PcieExplainList[] |
PCI_CLASS_ENTRY PCIPIFClass_0100 |
PCI_CLASS_ENTRY PCIPIFClass_0101 |
PCI_CLASS_ENTRY PCIPIFClass_0105 |
PCI_CLASS_ENTRY PCIPIFClass_0106 |
PCI_CLASS_ENTRY PCIPIFClass_0107 |
PCI_CLASS_ENTRY PCIPIFClass_0108 |
PCI_CLASS_ENTRY PCIPIFClass_0109 |
PCI_CLASS_ENTRY PCIPIFClass_0300 |
PCI_CLASS_ENTRY PCIPIFClass_0604 |
PCI_CLASS_ENTRY PCIPIFClass_0609 |
PCI_CLASS_ENTRY PCIPIFClass_060b |
PCI_CLASS_ENTRY PCIPIFClass_0700 |
PCI_CLASS_ENTRY PCIPIFClass_0701 |
PCI_CLASS_ENTRY PCIPIFClass_0703 |
PCI_CLASS_ENTRY PCIPIFClass_0800 |
PCI_CLASS_ENTRY PCIPIFClass_0801 |
PCI_CLASS_ENTRY PCIPIFClass_0802 |
PCI_CLASS_ENTRY PCIPIFClass_0803 |
PCI_CLASS_ENTRY PCIPIFClass_0904 |
PCI_CLASS_ENTRY PCIPIFClass_0c00 |
PCI_CLASS_ENTRY PCIPIFClass_0c03 |
PCI_CLASS_ENTRY PCIPIFClass_0c07 |
PCI_CLASS_ENTRY PCIPIFClass_0d01 |
PCI_CLASS_ENTRY PCIPIFClass_0e00 |
PCI_CLASS_ENTRY PCISubClass_00 |
PCI_CLASS_ENTRY PCISubClass_01 |
PCI_CLASS_ENTRY PCISubClass_02 |
PCI_CLASS_ENTRY PCISubClass_03 |
PCI_CLASS_ENTRY PCISubClass_04 |
PCI_CLASS_ENTRY PCISubClass_05 |
PCI_CLASS_ENTRY PCISubClass_06 |
PCI_CLASS_ENTRY PCISubClass_07 |
PCI_CLASS_ENTRY PCISubClass_08 |
PCI_CLASS_ENTRY PCISubClass_09 |
PCI_CLASS_ENTRY PCISubClass_0a |
PCI_CLASS_ENTRY PCISubClass_0b |
PCI_CLASS_ENTRY PCISubClass_0c |
PCI_CLASS_ENTRY PCISubClass_0d |
PCI_CLASS_ENTRY PCISubClass_0e |
PCI_CLASS_ENTRY PCISubClass_0f |
PCI_CLASS_ENTRY PCISubClass_10 |
PCI_CLASS_ENTRY PCISubClass_11 |
PCI_CLASS_ENTRY PCISubClass_12 |
PCI_CLASS_ENTRY PCISubClass_13 |