From patchwork Thu Apr 19 20:16:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 10351565 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9E724602B7 for ; Thu, 19 Apr 2018 20:16:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E65428471 for ; Thu, 19 Apr 2018 20:16:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 834EB28521; Thu, 19 Apr 2018 20:16:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3587028471 for ; Thu, 19 Apr 2018 20:16:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753179AbeDSUQg (ORCPT ); Thu, 19 Apr 2018 16:16:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:58240 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753011AbeDSUQg (ORCPT ); Thu, 19 Apr 2018 16:16:36 -0400 Received: from localhost (unknown [69.71.5.252]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 635E72077A; Thu, 19 Apr 2018 20:16:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 635E72077A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=helgaas@kernel.org Subject: [PATCH 2/4] lspci: Decode Null Capability From: Bjorn Helgaas To: Martin Mares Cc: linux-pci@vger.kernel.org Date: Thu, 19 Apr 2018 15:16:33 -0500 Message-ID: <152416899351.71364.17915245982467561819.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <152416880512.71364.16029919502694064334.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <152416880512.71364.16029919502694064334.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.18 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bjorn Helgaas The PCI Code and ID Assignment spec, r1.9, sec 2, defines a "Null Capability" containing no registers other than the 8-bit Capability ID (00h) and an 8-bit Next Capability Pointer. Some devices, e.g., the Intel [8086:2058] implement this Capability. Signed-off-by: Bjorn Helgaas --- lib/header.h | 2 ++ ls-caps.c | 3 +++ ls-ecaps.c | 3 +++ 3 files changed, 8 insertions(+) diff --git a/lib/header.h b/lib/header.h index 0b12b2c..1f0e460 100644 --- a/lib/header.h +++ b/lib/header.h @@ -185,6 +185,7 @@ /* Capability lists */ #define PCI_CAP_LIST_ID 0 /* Capability ID */ +#define PCI_CAP_ID_NULL 0x00 /* Null Capability */ #define PCI_CAP_ID_PM 0x01 /* Power Management */ #define PCI_CAP_ID_AGP 0x02 /* Accelerated Graphics Port */ #define PCI_CAP_ID_VPD 0x03 /* Vital Product Data */ @@ -211,6 +212,7 @@ /* Capabilities residing in the PCI Express extended configuration space */ +#define PCI_EXT_CAP_ID_NULL 0x00 /* Null Capability */ #define PCI_EXT_CAP_ID_AER 0x01 /* Advanced Error Reporting */ #define PCI_EXT_CAP_ID_VC 0x02 /* Virtual Channel */ #define PCI_EXT_CAP_ID_DSN 0x03 /* Device Serial Number */ diff --git a/ls-caps.c b/ls-caps.c index bc7829c..8b707c2 100644 --- a/ls-caps.c +++ b/ls-caps.c @@ -1536,6 +1536,9 @@ show_caps(struct device *d, int where) } switch (id) { + case PCI_CAP_ID_NULL: + printf("Null\n"); + break; case PCI_CAP_ID_PM: cap_pm(d, where, cap); break; diff --git a/ls-ecaps.c b/ls-ecaps.c index cb3d46d..3f6a364 100644 --- a/ls-ecaps.c +++ b/ls-ecaps.c @@ -737,6 +737,9 @@ show_ext_caps(struct device *d, int type) } switch (id) { + case PCI_EXT_CAP_ID_NULL: + printf("Null\n"); + break; case PCI_EXT_CAP_ID_AER: cap_aer(d, where, type); break;