From patchwork Mon Sep 9 23:14:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 2863391 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 CB12DBF43F for ; Mon, 9 Sep 2013 23:14:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EF3D020260 for ; Mon, 9 Sep 2013 23:14:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3365D2024F for ; Mon, 9 Sep 2013 23:14:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755350Ab3IIXOE (ORCPT ); Mon, 9 Sep 2013 19:14:04 -0400 Received: from mail-yh0-f50.google.com ([209.85.213.50]:53779 "EHLO mail-yh0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755528Ab3IIXOD (ORCPT ); Mon, 9 Sep 2013 19:14:03 -0400 Received: by mail-yh0-f50.google.com with SMTP id a41so2579035yho.9 for ; Mon, 09 Sep 2013 16:14:02 -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=VuGmz3T42p/8ayiXPf5XmH0FeHewm41e9T2QaSf3rG8=; b=YQyemBfROQF+eQwjze+Uax8CWHTx3/6ZTTxxrVCRndTWd5JNQATfG1bo6TL5PyD5r8 srz3jmcWIk4PUDejFXsoFNNThIJxBWVreNpQ6/OSI0rL0E0cWi1UgjbQrC543wF2W7rs idxJtGTdJiZUcgu4+2zRhmzeLFkpN/F2s1ZejBl/nNyZhytI6YnvYkBmoJazsWwMIjBD p13VVZwHMUeIYLmL+Mba7It64wIFqc7nEn3MqEF8kb2a4qROoxCGdjm4oQ2M8PvoQSvf WbiJqXrVqgzffZtrhHJVxuQetqfuwEmZs2+37vxybho5Hxs5JxdYPPQU0A/KxYcdHvVV fISA== 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=VuGmz3T42p/8ayiXPf5XmH0FeHewm41e9T2QaSf3rG8=; b=grBoUqEqZb4rRmDWjWuWgBVXniDE9pNpNb5nKaofL4gKiBOM3B2cC1eRhTKww6/u2j DoIsQc3eDh9vr9UL+EO3TbN1TW5h6PJH11awRwT9bXAnPSoCxV8iMtxZySUWgluYi5uQ neq3uXIGPeHQNC3jpAFia/QMpSXEQW9E9ueO1lkfr8MuQLhcsTr5uyPDL4ZuLxmW7lV3 UVu/V8TpDF96pJ2G4IGQ/XFSUASGEsGMo9XuNvfnSnUvEMGY6MGJOf7dU+iGK3EJV5jp O6Ve5htEzlwyHFvpuV9Cri3oRifb7K0gsSFtYo2RYwI67VxNnh6OxzZX38tz49K1ibAX k9Vg== X-Gm-Message-State: ALoCoQmS/C1v/8DBlNTCcKIcCmNEzeIkJCPV4p91lxbmnnnqi75oIEEdMDzuA/MEZR2nA5RdPO8kyYSJjldmX0cz1dftaaPL/YOQyD4B05RJz9IodWyOl2xTfQ59Mu0Vtlf2qpwn0pekKW7LSMr+w3H/vBBBnCHbi2CoGbgNo1f8qr094/1YN/3Lu7U5ohnnMGE50ZHFmyFMBrGxPBPYjENi6mZj706aGw== X-Received: by 10.236.34.168 with SMTP id s28mr18575907yha.50.1378768442416; Mon, 09 Sep 2013 16:14:02 -0700 (PDT) Received: from localhost ([172.16.51.73]) by mx.google.com with ESMTPSA id x29sm20720579yhd.4.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 09 Sep 2013 16:14:02 -0700 (PDT) Subject: [PATCH 3/7] lspci: Decode PCIe DevCap/DevCtl FLReset only for Endpoints To: Martin Mares From: Bjorn Helgaas Cc: linux-pci@vger.kernel.org Date: Mon, 09 Sep 2013 17:14:00 -0600 Message-ID: <20130909231400.30095.17089.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=ham 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 and Control bits related to Function Level Reset are valid only for Endpoints, so only decode them in that case. Signed-off-by: Bjorn Helgaas --- ls-caps.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 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 347f50a..7621010 100644 --- a/ls-caps.c +++ b/ls-caps.c @@ -673,11 +673,13 @@ static void cap_express_dev(struct device *d, int where, int type) printf(" AttnBtn%c AttnInd%c PwrInd%c", FLAG(t, PCI_EXP_DEVCAP_ATN_BUT), FLAG(t, PCI_EXP_DEVCAP_ATN_IND), FLAG(t, PCI_EXP_DEVCAP_PWR_IND)); - printf(" RBE%c FLReset%c", - FLAG(t, PCI_EXP_DEVCAP_RBE), + printf(" RBE%c", + FLAG(t, PCI_EXP_DEVCAP_RBE)); + if ((type == PCI_EXP_TYPE_ENDPOINT) || (type == PCI_EXP_TYPE_LEG_END)) + printf(" FLReset%c", FLAG(t, PCI_EXP_DEVCAP_FLRESET)); if (type == PCI_EXP_TYPE_UPSTREAM) - printf("SlotPowerLimit %.3fW", + printf(" SlotPowerLimit %.3fW", power_limit((t & PCI_EXP_DEVCAP_PWR_VAL) >> 18, (t & PCI_EXP_DEVCAP_PWR_SCL) >> 26)); printf("\n"); @@ -696,7 +698,8 @@ static void cap_express_dev(struct device *d, int where, int type) FLAG(w, PCI_EXP_DEVCTL_NOSNOOP)); if (type == PCI_EXP_TYPE_PCI_BRIDGE || type == PCI_EXP_TYPE_PCIE_BRIDGE) printf(" BrConfRtry%c", FLAG(w, PCI_EXP_DEVCTL_BCRE)); - if (type == PCI_EXP_TYPE_ENDPOINT && (t & PCI_EXP_DEVCAP_FLRESET)) + if (((type == PCI_EXP_TYPE_ENDPOINT) || (type == PCI_EXP_TYPE_LEG_END)) && + (t & PCI_EXP_DEVCAP_FLRESET)) printf(" FLReset%c", FLAG(w, PCI_EXP_DEVCTL_FLRESET)); printf("\n\t\t\tMaxPayload %d bytes, MaxReadReq %d bytes\n", 128 << ((w & PCI_EXP_DEVCTL_PAYLOAD) >> 5),