diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2013-09-09 17:13:53 -0600 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 2013-11-10 12:32:55 +0100 |
commit | 0dc85d673d0748d638cc9be67d243cd0aa6cd67d (patch) | |
tree | ed221e418a3c733edc9843a33ece84657e73f50c | |
parent | 1e6e1d901ea9f21541644e9b95762bda63377759 (diff) | |
download | pciutils-0dc85d673d0748d638cc9be67d243cd0aa6cd67d.tar.gz |
lspci: Decode PCIe DevCap "Acceptable Latencies" only for Endpoints
The PCIe Device Capabilities "Endpoint L0s Acceptable Latency" and
"Endpoint L1 Acceptable Latency" are defined only for Endpoint functions,
so don't display them unless this is an endpoint.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r-- | ls-caps.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -659,11 +659,14 @@ static void cap_express_dev(struct device *d, int where, int type) u16 w; t = get_conf_long(d, where + PCI_EXP_DEVCAP); - printf("\t\tDevCap:\tMaxPayload %d bytes, PhantFunc %d, Latency L0s %s, L1 %s\n", + printf("\t\tDevCap:\tMaxPayload %d bytes, PhantFunc %d", 128 << (t & PCI_EXP_DEVCAP_PAYLOAD), - (1 << ((t & PCI_EXP_DEVCAP_PHANTOM) >> 3)) - 1, + (1 << ((t & PCI_EXP_DEVCAP_PHANTOM) >> 3)) - 1); + if ((type == PCI_EXP_TYPE_ENDPOINT) || (type == PCI_EXP_TYPE_LEG_END)) + printf(", Latency L0s %s, L1 %s", latency_l0s((t & PCI_EXP_DEVCAP_L0S) >> 6), latency_l1((t & PCI_EXP_DEVCAP_L1) >> 9)); + printf("\n"); printf("\t\t\tExtTag%c", FLAG(t, PCI_EXP_DEVCAP_EXT_TAG)); if ((type == PCI_EXP_TYPE_ENDPOINT) || (type == PCI_EXP_TYPE_LEG_END) || (type == PCI_EXP_TYPE_UPSTREAM) || (type == PCI_EXP_TYPE_PCI_BRIDGE)) |