From patchwork Thu Apr 19 20:16:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 10351563 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 2CCB560231 for ; Thu, 19 Apr 2018 20:16:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DD9E28471 for ; Thu, 19 Apr 2018 20:16:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 126AE28521; Thu, 19 Apr 2018 20:16:30 +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 BBA1428471 for ; Thu, 19 Apr 2018 20:16:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752900AbeDSUQ3 (ORCPT ); Thu, 19 Apr 2018 16:16:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:58220 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752507AbeDSUQ2 (ORCPT ); Thu, 19 Apr 2018 16:16:28 -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 EFF532077A; Thu, 19 Apr 2018 20:16:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EFF532077A 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 1/4] lspci: Clarify unknown capability IDs From: Bjorn Helgaas To: Martin Mares Cc: linux-pci@vger.kernel.org Date: Thu, 19 Apr 2018 15:16:26 -0500 Message-ID: <152416898648.71364.15417323482028209640.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 For capabilities we don't know how to decode, we print the config address, version, and capability ID: Capabilities: [220 v1] #19 This doesn't clearly identify the capability ID ("19"), whether it is a PCI-compatible Capability ID or an Extended Capability ID (although you can infer this by whether the address is 2 or 3 digits), or the fact that the ID is printed in hex, which makes it hard to parse this manually. Add a label ("Capability ID" or "Extended Capability ID") and print a "0x" prefix so it's clear the value is in hex: Capabilities: [220 v1] Extended Capability ID 0x19 Signed-off-by: Bjorn Helgaas --- ls-caps.c | 2 +- ls-ecaps.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ls-caps.c b/ls-caps.c index 3135224..bc7829c 100644 --- a/ls-caps.c +++ b/ls-caps.c @@ -1599,7 +1599,7 @@ show_caps(struct device *d, int where) cap_ea(d, where, cap); break; default: - printf("#%02x [%04x]\n", id, cap); + printf("Capability ID %#02x [%04x]\n", id, cap); } where = next; } diff --git a/ls-ecaps.c b/ls-ecaps.c index 800a032..cb3d46d 100644 --- a/ls-ecaps.c +++ b/ls-ecaps.c @@ -802,7 +802,7 @@ show_ext_caps(struct device *d, int type) cap_ptm(d, where); break; default: - printf("#%02x\n", id); + printf("Extended Capability ID %#02x\n", id); break; } where = (header >> 20) & ~3;