#ifdef CONFIG_PCIE_DPC /** * dpc_tlp_log_len - Calculate DPC RP PIO TLP Header/Prefix Log length * @dev: PCIe device * * Return: TLP Header/Prefix Log length
*/ unsignedint dpc_tlp_log_len(struct pci_dev *dev)
{ /* Remove ImpSpec Log register from the count */ if (dev->dpc_rp_log_size >= PCIE_STD_NUM_TLP_HEADERLOG + 1) return dev->dpc_rp_log_size - 1;
return dev->dpc_rp_log_size;
} #endif
/** * pcie_read_tlp_log - read TLP Header Log * @dev: PCIe device * @where: PCI Config offset of TLP Header Log * @where2: PCI Config offset of TLP Prefix Log * @tlp_len: TLP Log length (Header Log + TLP Prefix Log in DWORDs) * @flit: TLP Logged in Flit mode * @log: TLP Log structure to fill * * Fill @log from TLP Header Log registers, e.g., AER or DPC. * * Return: 0 on success and filled TLP Log structure, <0 on error.
*/ int pcie_read_tlp_log(struct pci_dev *dev, int where, int where2, unsignedint tlp_len, bool flit, struct pcie_tlp_log *log)
{ unsignedint i; int off, ret;
if (tlp_len > ARRAY_SIZE(log->dw))
tlp_len = ARRAY_SIZE(log->dw);
memset(log, 0, sizeof(*log));
for (i = 0; i < tlp_len; i++) { if (i < PCIE_STD_NUM_TLP_HEADERLOG)
off = where + i * 4; else
off = where2 + (i - PCIE_STD_NUM_TLP_HEADERLOG) * 4;
ret = pci_read_config_dword(dev, off, &log->dw[i]); if (ret) return pcibios_err_to_errno(ret);
}
/* * Hard-code non-Flit mode to 4 DWORDs, for now. The exact length * can only be known if the TLP is parsed.
*/
log->header_len = flit ? tlp_len : 4;
log->flit = flit;
return 0;
}
#define EE_PREFIX_STR " E-E Prefixes:"
/** * pcie_print_tlp_log - Print TLP Header / Prefix Log contents * @dev: PCIe device * @log: TLP Log structure * @level: Printk log level * @pfx: String prefix * * Prints TLP Header and Prefix Log information held by @log.
*/ void pcie_print_tlp_log(conststruct pci_dev *dev, conststruct pcie_tlp_log *log, constchar *level, constchar *pfx)
{ /* EE_PREFIX_STR fits the extended DW space needed for the Flit mode */ char buf[11 * PCIE_STD_MAX_TLP_HEADERLOG + 1]; unsignedint i; int len;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.