Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp769473lkm; Wed, 22 Sep 2021 14:33:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9KInLriErVKn3OM4QC2ufeIcXHLvJXfav8XHJuj1z0L1/XSuCJhgGy29FNSdOkpd+atTM X-Received: by 2002:a50:e188:: with SMTP id k8mr1747662edl.119.1632346417538; Wed, 22 Sep 2021 14:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632346417; cv=none; d=google.com; s=arc-20160816; b=WM0NCTFoL+iX8I25Jhr46PVdMOm/v8x1oc2CedM7IXPe9RYDuOBV59ccAp/e2hcluz 5zOXSsBVulHnL3mlVy2TtpPJVIh0N2HoHJRS1rlPZp9dc1yRXZQHB3YBmf14qhjLzM50 DXaebSBFebxJdF8mpMad+IWGgMpXcEXuKRRVYicOUWPuFAst1Df3rkUXn0pyJ7fsCGLi 9C0qy3Mwto7hgVQLJZL6u5qYkihzqRCCykoU9wUH8LM90ZHfCgxvuV9SnelMUErE09QV 2o4u551FF1ff1podhhSoISTdJJnBjaLNg3l5m1NJs9QD5+D3joso7Y6ON6Jl+9q++tJ4 8SPA== 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; bh=AaF/5N1zfFsdSkjCEZyU0jzINH9rO7WFewtCL9evR5E=; b=gmg58JTBDm78aqz7PnzLcke3GgtvjQ+nvUlJqS39rsv/AZtYYisu3jlHb6L6vbwlpp ZGC+CszU7+jIYCGSUtcEYczKHvK53+kPP+uL2kFE4NLf67j1e49+vv6lF2d4DOym5s0k 3b+CQXUYbzl2tU5qV9NfV/hI0v5A3NYkIeeE44IuGJXJ0HXommtEeYgoUTuLbCAr5J8T cXD/jDIphuRMPvrU/pei+s3pfi5+yFEzzq/YYXRdG8ESvp168XK3GVFJ/+7aQCpIsnpO QOZxilb0pdpMDfYulPXNfxzh08W+W5sPW3VtssdCR1ADfWAKV9W62Nw0dDa/ChB/NWF0 JAxg== 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 j3si4422296ejj.448.2021.09.22.14.32.50; Wed, 22 Sep 2021 14:33:37 -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 S238073AbhIVVbu (ORCPT + 99 others); Wed, 22 Sep 2021 17:31:50 -0400 Received: from mga05.intel.com ([192.55.52.43]:33405 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238067AbhIVVbm (ORCPT ); Wed, 22 Sep 2021 17:31:42 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10115"; a="309261969" X-IronPort-AV: E=Sophos;i="5.85,315,1624345200"; d="scan'208";a="309261969" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2021 14:30:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,315,1624345200"; d="scan'208";a="518740347" Received: from linux.intel.com ([10.54.29.200]) by orsmga001.jf.intel.com with ESMTP; 22 Sep 2021 14:30:07 -0700 Received: from debox1-server.jf.intel.com (debox1-server.jf.intel.com [10.54.39.121]) by linux.intel.com (Postfix) with ESMTP id B2BF4580C6E; Wed, 22 Sep 2021 14:30:07 -0700 (PDT) From: "David E. Box" To: lee.jones@linaro.org, bhelgaas@google.com, andy.shevchenko@gmail.com Cc: "David E. Box" , mgross@linux.intel.com, srinivas.pandruvada@intel.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v3 1/5] PCI: Add #defines for accessing PCIE DVSEC fields Date: Wed, 22 Sep 2021 14:30:03 -0700 Message-Id: <20210922213007.2738388-2-david.e.box@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210922213007.2738388-1-david.e.box@linux.intel.com> References: <20210922213007.2738388-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 Acked-by: Bjorn Helgaas --- v3: No change 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