From patchwork Mon Sep 9 23:13:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 2863381 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E389BBF43F for ; Mon, 9 Sep 2013 23:13:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0094F20260 for ; Mon, 9 Sep 2013 23:13:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2504A2024F for ; Mon, 9 Sep 2013 23:13:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755557Ab3IIXN4 (ORCPT ); Mon, 9 Sep 2013 19:13:56 -0400 Received: from mail-ye0-f182.google.com ([209.85.213.182]:45276 "EHLO mail-ye0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755528Ab3IIXN4 (ORCPT ); Mon, 9 Sep 2013 19:13:56 -0400 Received: by mail-ye0-f182.google.com with SMTP id l10so1794009yen.13 for ; Mon, 09 Sep 2013 16:13:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=BjT36wVhXznrVKQNq/GsY+P6qmAs2+LyNc9wQTvDXvM=; b=iMMNSGVjnuG4iBW4X5hP+NNsMuUoV/MT6hoAGe7O98Bytf0hVQBxW8SouIG2e2FJC3 pLppa4nw5s5Ejs2ZY05+UWTERljsrg3t4wHmX6AV0X7gvdi/C5zxcd8zCN7XrIk6pm7/ AKtVkqZ42QcKeYNNHHvkFrIG5tpstG9VwVKNJTJTk5IKzhb03IzPXFbJbqkKXKQzR69U EvlbQR9Kdu7ZbANcpnqmwjLSgP9JUQguolWLdqWaHE9yR5EkTRszwARFuYrc9ooR2EsQ q65UZTXHBlvKbvXVOildLUvmoxkmgRMI/Fj2K0NozwgZinGPzv/zbXWeb571Q3MluL+z +w1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=BjT36wVhXznrVKQNq/GsY+P6qmAs2+LyNc9wQTvDXvM=; b=ReVd6lFp3tC2YwzUbK+fJtHZk3NbA+HNiPLLX/9CymObLkp/gvKFFk554jzj1bL7+o RBuDm/TgT0KtpYv2ga83koshL2nbncOqzNi2ctpOaIwtXjPuoOpgk1q3wJlCOHlrwksW eFGF9ye5VYz19p1bqaQ59TzGGdl5L+7JwBhGypDDOVT9YqHXLnEXjyssSBQx0He5/gTX 2Gy8XO/5egORA6kLWk1rwN5f1zxA+kqq8/8Zzgg+oucktucmb8drD2lwz4dSRRWfV6kb wwdaLIOms6LoJBheMlA5svD77QbJXw4oZsjFzLqym1w+0CNi1mk+HjO4BDBf0iUwli3O 3Rpg== X-Gm-Message-State: ALoCoQnK+hM5a7dG/GQi+Rgenzq42iTUmHMizZiJQogEVbq8vixmRpFQyVOLqzbeU6uKDDrqJVrqRvbziNnUUu39c5Jk0Bu3kxShezobWfTCgV14a9O/6M8u4167YI6yXr574u7eop7EN86cW9HV3UxrHFSmBJ4J2L7KkhJGWNsGc5scVCGyY5fNAIK4tqphpbhPObh722zkvNh18jZOzu3jJFeLdHLz6A== X-Received: by 10.236.119.142 with SMTP id n14mr18696093yhh.31.1378768435331; Mon, 09 Sep 2013 16:13:55 -0700 (PDT) Received: from localhost ([172.16.51.73]) by mx.google.com with ESMTPSA id a10sm20687172yhm.20.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 09 Sep 2013 16:13:54 -0700 (PDT) Subject: [PATCH 2/7] lspci: Decode PCIe DevCap "Acceptable Latencies" only for Endpoints To: Martin Mares From: Bjorn Helgaas Cc: linux-pci@vger.kernel.org Date: Mon, 09 Sep 2013 17:13:53 -0600 Message-ID: <20130909231353.30095.44801.stgit@bhelgaas-glaptop> In-Reply-To: <20130909231345.30095.61638.stgit@bhelgaas-glaptop> References: <20130909231345.30095.61638.stgit@bhelgaas-glaptop> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- ls-caps.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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))