Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp995064pxj; Thu, 17 Jun 2021 19:38:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxgWpe96S+u8jq9NFxa41/b6fK3DlkIQ7TzALdDHCQAkIwmGWuCE5JiJQOKp1dgctLEqFg X-Received: by 2002:a92:dd89:: with SMTP id g9mr5820007iln.209.1623983900925; Thu, 17 Jun 2021 19:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623983900; cv=none; d=google.com; s=arc-20160816; b=PXHnTV+Iaa3Fpwu46f4yaxgobL43U58gA0R4K+FWTMDK2Kx1JPmIgFetEstBpW326o cWNk9O20XV+a8BFOWasE6q8brSzgIDhQoH6F6dJoDrSCczZCcCAWeH5IpgKLKvINwwjQ PgrtWQuUOETK/L81c2AJOBt2AU1lub5aqwE0cQDeS/R7Tw/YFg2nTJSewnvb+cttRNyN TsKtBlKcuwhjDnqJueTNrDSvBesNw4h75usofoOMvrmOJmL8QngLfNGV/ndSho8Phn7K JEFwG6HNVptD/K8w8ejXR+P+Ydw8qjSRSkDH4aEj5x3/DWTWDZLL4fQtaljE/7zOpQGc 5/7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=6IMURHx7QQgLLyZUlFXWiJCJIBexd84lX9Ty+VRaCVk=; b=hG5lEElvPjI33uIJaXH4qSMvdGiz4Oc85Xb4Z89ZLfVZsqItjJm7x4aD6+YOxW/E9p Ngm2zwsMifabqIcPhMUuhQ7V1LjkYLzuzwY2Z3Af+fDOeJyYK/ommcPBMIC5SSHY+TNQ nGe8XaBXKzy6TCKHNEddefWpD4LSEZxrafxaQiLNf2M39E25FXdicTxHmfU1AeaPR5p7 vgFJbgPswQouSYXV3FYOMyLpbDCkYE2JnTOn79e5VA8P+1zmjoYda0qcWE/fA/TvZJlD U+Rg9pvpJ+duREdUvEJF8gFf79q/CZvtZC9hnTRAv86YpAH8mCKMnQR82wcB4/5iCNv/ MOWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 15si811879ilj.36.2021.06.17.19.38.09; Thu, 17 Jun 2021 19:38:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231683AbhFQV5y (ORCPT + 99 others); Thu, 17 Jun 2021 17:57:54 -0400 Received: from mga07.intel.com ([134.134.136.100]:16700 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231346AbhFQV5u (ORCPT ); Thu, 17 Jun 2021 17:57:50 -0400 IronPort-SDR: OafdZrKb+fyKfhj7KUiWvgP/sPornXN6Zq8xeSXILFjNaqDC7z+kOQENE85PfXu7oGRUU6VfnW e/T9CGP6CmYw== X-IronPort-AV: E=McAfee;i="6200,9189,10018"; a="270304154" X-IronPort-AV: E=Sophos;i="5.83,281,1616482800"; d="scan'208";a="270304154" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2021 14:55:41 -0700 IronPort-SDR: d1uXucnokJUrcuWABapY2QjkyjrWrPwJ7s8SmCO4bblp/x7EeVu6OcS7cbn6ZRBkXNSqAh5w1n ZBe8YX7oYxGA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,281,1616482800"; d="scan'208";a="488810896" Received: from linux.intel.com ([10.54.29.200]) by fmsmga002.fm.intel.com with ESMTP; 17 Jun 2021 14:55:40 -0700 Received: from debox1-desk2.jf.intel.com (debox1-desk2.jf.intel.com [10.54.75.16]) by linux.intel.com (Postfix) with ESMTP id B0DFF5801A3; Thu, 17 Jun 2021 14:55:40 -0700 (PDT) From: "David E. Box" To: lee.jones@linaro.org, david.e.box@linux.intel.com, hdegoede@redhat.com, mgross@linux.intel.com, bhelgaas@google.com Cc: linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH 1/4] PCI: Add #defines for accessing PCIE DVSEC fields Date: Thu, 17 Jun 2021 14:54:05 -0700 Message-Id: <20210617215408.1412409-2-david.e.box@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210617215408.1412409-1-david.e.box@linux.intel.com> References: <20210617215408.1412409-1-david.e.box@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add #defines for accessing Vendor ID, Revision, Length, and ID offsets in the Designated Vendor Specific Extended Capability (DVSEC). Defined in PCIe r5.0, sec 7.9.6. Signed-off-by: David E. Box --- include/uapi/linux/pci_regs.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h index e709ae8235e7..57ee51f19283 100644 --- a/include/uapi/linux/pci_regs.h +++ b/include/uapi/linux/pci_regs.h @@ -1080,7 +1080,11 @@ /* Designated Vendor-Specific (DVSEC, PCI_EXT_CAP_ID_DVSEC) */ #define PCI_DVSEC_HEADER1 0x4 /* Designated Vendor-Specific Header1 */ +#define PCI_DVSEC_HEADER1_VID(x) ((x) & 0xffff) +#define PCI_DVSEC_HEADER1_REV(x) (((x) >> 16) & 0xf) +#define PCI_DVSEC_HEADER1_LEN(x) (((x) >> 20) & 0xfff) #define PCI_DVSEC_HEADER2 0x8 /* Designated Vendor-Specific Header2 */ +#define PCI_DVSEC_HEADER2_ID(x) ((x) & 0xffff) /* Data Link Feature */ #define PCI_DLF_CAP 0x04 /* Capabilities Register */ -- 2.25.1