linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: Martin Mares <mj@ucw.cz>
Cc: linux-pci@vger.kernel.org
Subject: [PATCH 2/7] lspci: Decode PCIe DevCap "Acceptable Latencies" only for Endpoints
Date: Mon, 09 Sep 2013 17:13:53 -0600	[thread overview]
Message-ID: <20130909231353.30095.44801.stgit@bhelgaas-glaptop> (raw)
In-Reply-To: <20130909231345.30095.61638.stgit@bhelgaas-glaptop>

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>
---
 ls-caps.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/ls-caps.c b/ls-caps.c
index a1a1546..347f50a 100644
--- a/ls-caps.c
+++ b/ls-caps.c
@@ -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))


  reply	other threads:[~2013-09-09 23:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-09 23:13 [PATCH 1/7] lspci: Label PCIe LnkCap "L0s Exit Latency" as "L0s", not "L0" Bjorn Helgaas
2013-09-09 23:13 ` Bjorn Helgaas [this message]
2013-09-09 23:14 ` [PATCH 3/7] lspci: Decode PCIe DevCap/DevCtl FLReset only for Endpoints Bjorn Helgaas
2013-09-09 23:14 ` [PATCH 4/7] lspci: Clarify "PCIe-to-PCI/PCI-X" desc and Bridge Retry Config Enable Bjorn Helgaas
2013-09-09 23:14 ` [PATCH 5/7] lspci: Decode PCIe LnkCtl "Read Completion Boundary" for PCIe-to-PCI bridges Bjorn Helgaas
2013-09-09 23:14 ` [PATCH 6/7] lspci: Drop PCIe LnkCtl "Retrain Link" decoding Bjorn Helgaas
2013-09-09 23:14 ` [PATCH 7/7] lspci: Decode PCIe LnkSta "Link Training" only for relevant functions Bjorn Helgaas
2013-11-10 11:33 ` [PATCH 1/7] lspci: Label PCIe LnkCap "L0s Exit Latency" as "L0s", not "L0" Martin Mares

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130909231353.30095.44801.stgit@bhelgaas-glaptop \
    --to=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=mj@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).