{"id":2220208,"url":"http://patchwork.ozlabs.org/api/patches/2220208/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/patch/20260406155717.880246-2-den@valinux.co.jp/","project":{"id":28,"url":"http://patchwork.ozlabs.org/api/projects/28/?format=json","name":"Linux PCI development","link_name":"linux-pci","list_id":"linux-pci.vger.kernel.org","list_email":"linux-pci@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260406155717.880246-2-den@valinux.co.jp>","list_archive_url":null,"date":"2026-04-06T15:57:11","name":"[v13,1/7] PCI: endpoint: Add auxiliary resource query API","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"7f305d9c3d8a205b9e0ca8a5138d5d712ffad158","submitter":{"id":91573,"url":"http://patchwork.ozlabs.org/api/people/91573/?format=json","name":"Koichiro Den","email":"den@valinux.co.jp"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-pci/patch/20260406155717.880246-2-den@valinux.co.jp/mbox/","series":[{"id":498879,"url":"http://patchwork.ozlabs.org/api/series/498879/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/list/?series=498879","date":"2026-04-06T15:57:10","name":"PCI: endpoint: pci-ep-msi: Add embedded doorbell fallback","version":13,"mbox":"http://patchwork.ozlabs.org/series/498879/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2220208/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2220208/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-pci+bounces-51957-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pci@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=valinux.co.jp header.i=@valinux.co.jp\n header.a=rsa-sha256 header.s=selector1 header.b=KPerpfKS;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-pci+bounces-51957-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=valinux.co.jp header.i=@valinux.co.jp\n header.b=\"KPerpfKS\"","smtp.subspace.kernel.org;\n arc=fail smtp.client-ip=52.101.229.111","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=valinux.co.jp","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=valinux.co.jp","dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=valinux.co.jp;"],"Received":["from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fqDVj4hJMz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 07 Apr 2026 01:57:33 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 8843A3016D2C\n\tfor <incoming@patchwork.ozlabs.org>; Mon,  6 Apr 2026 15:57:28 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 17143336883;\n\tMon,  6 Apr 2026 15:57:28 +0000 (UTC)","from TY3P286CU002.outbound.protection.outlook.com\n (mail-japaneastazon11020111.outbound.protection.outlook.com [52.101.229.111])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 67DBC3321BF;\n\tMon,  6 Apr 2026 15:57:26 +0000 (UTC)","from TY7P286MB7722.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:38f::10)\n by TYYP286MB4187.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:10b::5) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.17; Mon, 6 Apr\n 2026 15:57:22 +0000","from TY7P286MB7722.JPNP286.PROD.OUTLOOK.COM\n ([fe80::2305:327c:28ec:9b32]) by TY7P286MB7722.JPNP286.PROD.OUTLOOK.COM\n ([fe80::2305:327c:28ec:9b32%5]) with mapi id 15.20.9769.017; Mon, 6 Apr 2026\n 15:57:22 +0000"],"ARC-Seal":["i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775491047; cv=fail;\n b=EJXQ/q0d1gkJlCj8Q6PufTAz+IWeqWF3VSZ50q4LAY7pjdROuNYtSJAefVXuJYB8/zD5PuXSPz408PWv95jj/3MdhZr30rBQ/aARlAbC9Kc2mXJ9PaxnVv/uxVhCQPotdnBY3ZSqD1P+OQJvssyQ8y9pXuXIMAV8KKc0PFSfVf8=","i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=NtsJSVaOQyZfXZsW4wBBLzUW6sRL2sillhGOpsTav2TxGA4lmgTfd8IDux+4M8ih+Hq0EkgF7DJp9pB7nbVaHcTo/a0dPjREPqHOQQ0YZQ0u9otW/+RqVf44UBbrIhRy+Snx8IM38yuFkZUiPTFCHBCFD4v6RKfKvfqCci4bAmGKcgh5kO6+3i/xqWuUDgx3+zcnGZYwpdt7ZoFuUM2wsSTabi2ImL9jqdczaN4L1oLK5g4ZTkZUVgA6uvybIe9bbzjdn68/4POhFIudZmmDPhdNfGZEbJ6XKYy01yqwcIkeQMvo0YyKE20XkWl3jXI2yxwpxD0nDGI2M4Bv5xvgaA=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775491047; c=relaxed/simple;\n\tbh=O1j5LZpxq6I5aX91Kr7iT72vDZEKBNh3pQaIPouKx0k=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t Content-Type:MIME-Version;\n b=Nm88VCkWddmqFcAqhEhtO6A0cAxbS6o+s0VapR941+YchQKqSGKU2NXsnv/m7twEqm8YRFMDi6yyOVNxLHGyH/tzOdy/4Q5o0kfUekiL76d3IYkFOZ49GUIqBKKiMPBd/qo6L4tUMBcSH/s0lXP40ML41NKyrGKLHEi7OIAjsIk=","i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=7T8Gyswva6DI2f39ry6vwmC9Cjo+B5DbSMcPG8o0hxM=;\n b=Gkh7DFrtOf/1t7IyXFHEeDhyk4T89Rrwh72t6vya5/Q+xMYK+3LMt8Ol6Djpq2rhR/RVwkOZuUh1POll/tWB5a2e/2MERD9cLjnm8XdZdr3xDF1Iq1nrANw07p7+lX3kyEy1RADvKH5npmQwR5SRzhWBiEfh1711+HaMJ2bT7ScvanMSxs0CMTjjxnVq5FwG8DjhpgvqN82Qc8MpdtV4f/Ypk7qi6k8My22ljyBOhZGqmezqxXxQMBv8JNnwu4r5VCT0wYu+I6igGkYgyti8toRfN+J1c75mxGnf3B9uWizTjGGlP6+jl/1CA7bEY+AZ3So7ZBzIFX3G4JeJFgLDOQ=="],"ARC-Authentication-Results":["i=2; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=valinux.co.jp;\n spf=pass smtp.mailfrom=valinux.co.jp;\n dkim=pass (1024-bit key) header.d=valinux.co.jp header.i=@valinux.co.jp\n header.b=KPerpfKS; arc=fail smtp.client-ip=52.101.229.111","i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=valinux.co.jp; dmarc=pass action=none\n header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=valinux.co.jp;\n s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=7T8Gyswva6DI2f39ry6vwmC9Cjo+B5DbSMcPG8o0hxM=;\n b=KPerpfKS7lvA7pKnwR7Ki4AMv0c8mR29G4Ym92TfLF/M80OgP5Y8BdA3Lri+tU5vjtJG8h4ScnfQBgshisfSQWToCeLXNpOusydbmz0IfWBhhqDrPtlkE5J6Mv1bt1kx2X7wlbcSfh3WuTISegqMeajcb8pTyNK557a8xy3oiSQ=","From":"Koichiro Den <den@valinux.co.jp>","To":"Jingoo Han <jingoohan1@gmail.com>,\n Manivannan Sadhasivam <mani@kernel.org>,\n Lorenzo Pieralisi <lpieralisi@kernel.org>, =?utf-8?q?Krzysztof_Wilczy=C5=84?=\n\t=?utf-8?q?ski?= <kwilczynski@kernel.org>, Rob Herring <robh@kernel.org>,\n Bjorn Helgaas <bhelgaas@google.com>,\n Kishon Vijay Abraham I <kishon@kernel.org>, Jon Mason <jdmason@kudzu.us>,\n Dave Jiang <dave.jiang@intel.com>, Allen Hubbe <allenbh@gmail.com>,\n Niklas Cassel <cassel@kernel.org>, Frank Li <Frank.Li@nxp.com>,\n Bhanu Seshu Kumar Valluri <bhanuseshukumar@gmail.com>,\n Marco Crivellari <marco.crivellari@suse.com>,\n Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,\n Manikanta Maddireddy <mmaddireddy@nvidia.com>","Cc":"linux-pci@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tntb@lists.linux.dev","Subject":"[PATCH v13 1/7] PCI: endpoint: Add auxiliary resource query API","Date":"Tue,  7 Apr 2026 00:57:11 +0900","Message-ID":"<20260406155717.880246-2-den@valinux.co.jp>","X-Mailer":"git-send-email 2.51.0","In-Reply-To":"<20260406155717.880246-1-den@valinux.co.jp>","References":"<20260406155717.880246-1-den@valinux.co.jp>","Content-Transfer-Encoding":"8bit","Content-Type":"text/plain","X-ClientProxiedBy":"TY4P301CA0027.JPNP301.PROD.OUTLOOK.COM\n (2603:1096:405:2b1::9) To TY7P286MB7722.JPNP286.PROD.OUTLOOK.COM\n (2603:1096:405:38f::10)","Precedence":"bulk","X-Mailing-List":"linux-pci@vger.kernel.org","List-Id":"<linux-pci.vger.kernel.org>","List-Subscribe":"<mailto:linux-pci+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pci+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","X-MS-PublicTrafficType":"Email","X-MS-TrafficTypeDiagnostic":"TY7P286MB7722:EE_|TYYP286MB4187:EE_","X-MS-Office365-Filtering-Correlation-Id":"ef27b04f-524b-442d-41bd-08de93f53088","X-MS-Exchange-SenderADCheck":"1","X-MS-Exchange-AntiSpam-Relay":"0","X-Microsoft-Antispam":"\n\tBCL:0;ARA:13230040|366016|376014|10070799003|1800799024|7416014|56012099003|22082099003|18002099003|921020;","X-Microsoft-Antispam-Message-Info":"\n\tqTK7uqXXN6lGnzp8pJDApyyo10oJV9JMAmC/HN7yX4RXt4dTLMohseWVVJNecxsj2/RzRwz4tShOY1zdNhOvGKwDOJlqvjFmbz9ZKEleNCEOKS5P/RQwWchQMw8YHmxeLwKDnS7SLM0AcMsNVkmha6VejN8Di3AeboBO9zyN6YnCRagyIKoK9MtAQEy1NCqVCZozanLuYhuXTG7vMMx5LDbzmH8hm9zGKuo0q9oXEE6TxPLhiIDkFMxluExEQk7vsmmGWbL36ZQRskNdlUWcUYLEAFodnv9nCH0tkLk3oMDSoBtGPdyERzv/8mD+/bZYbC2xT+EyASM50sGCotIzeGENIbCqxw4ZiUsAy0leAz/5H3sKYB6lhnHvTwENkO3eNy6TdYWrg69n5Efult96/X7wEuWoA36s6DFkfea9H+Ze7SXSMUBoL3nECfJ+72X6xmPlfDjkX5dAqLLxkp2qWpAYjNJmeOsiKSHEnSesQP1lOwpz8B8XF9rB48o25t5Ub0KI7DPON8BSy++LJoo/nLzKo2zaVOgxu/evYhdwUieCSnuFEv74zr+05Idugqiry5jSF20Q1jLc03IxaMI5k2EroV5MvhVMS8Et2shZbusS96LVtQxkt1X6ChoW4pkavgDwZ097h2lU0v6+48MLfhZ58mN0DuRxw/ToyZMRRAKepMIEQqR0hDE2mFalSSacXJt3oQJIIpLs3NWq3pIL/YBbHW6493gV36ncpnAMNFkliwfRNZZuQhsLCL2Lu8V0d2A9Bey/JwMyR5Eu/18Y2g==","X-Forefront-Antispam-Report":"\n\tCIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TY7P286MB7722.JPNP286.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(10070799003)(1800799024)(7416014)(56012099003)(22082099003)(18002099003)(921020);DIR:OUT;SFP:1102;","X-MS-Exchange-AntiSpam-MessageData-ChunkCount":"1","X-MS-Exchange-AntiSpam-MessageData-0":"\n arosqS8dlmRBwKiK6RzQAZOie4iZMxJiFEUzdW9koPomgXPynot1FTzcrDa0dn67KJNymjLzPUnAE4Y+ppxPfF1R+g9I0lmx4ILZKyqZ5EJ9ONrZh1MznNxRVQowjuwURKNBc/j36TdJGwg94aEIb+bujOTRMdv5m368cQLwZGaS65js/+LScsBPJC+5WgptEix/duH4XYbqtG5hhCiHiH+ItmlvcBLZDTzs2B9AM6v9iCP8OZrCLuZDmrw/M3XqlWBii9MwEfC0uj1V+lNugeiwd+hv2DrwrJ0rXhn64hYuYP2HViaktA3S37oT1i+GBEvS7SesyFjzhcM25CM2aDRhQhTvgKBJh2UkFTngDHBFAiT0shOe1HJD4MATsHW9e2o5MbLFcmfxa39d/0KkT84YQ9wKPeNFypHRDRw7DDnm0zXcnhyX6uX4ItExkCsBHZWR9jcptraIaorc3Mtuuwzj2vuDS/jN9wlfqOJ1Rk2q+f/DuH51b0S/aleLiTt/Xc17moT7dxy01h1KVg0lNmqIPQi4gKH5dNtw0nkURAGUoyp9VOLR1GC30CXwmL7NiLlnPJhiMD9YIJqAB4Wkzn2tFoEvEvZSJKvR/5cFvawtGxuN3640C8iVwKBl3YTvz4qbAcouluEdegowKEbk5/LGQ5HASyLpj4osnFXGs3Hi2aHUqmH+m0zSbhcBli2Jul5qQCffCyht2Mt3eFVGDt0yfP1YfEZX4XQnmeIIVlTpEUJKFRO7KoAvXrQb6uY/uz9hFaMhrXu9qtQCVzsRgPgFp8OZwGH1YvuPfDnCgJ0X3syPV+YQxI+oJ1eSiVPhcDqWFTDW3gvE9s5SfLqblZuAeunO9aW/BKdexokLXAWmS1aX66P4bDHXwlbLJdi8MZlqzPHKWUKqkMXZ++i8NqLWDJfhCVlyt7iy9EhOPgEj07cmxvMpOaAMRsh7TdSsU4Ns9Sl3B6PD9Rmw8JfG2frShEtgSr27u6eX+l+rAZPyJzC1+FQlcs7n+ozaHZ6D9fYjV72QUTsbw/63xNLWBvMxt3byIFAgOFCOJGdHy1EXmJgaz6uSKukKEjBXFlXTPxjk8c/N8PVeuolVR+Hfvgo7q0Ridk1Rly6WLiaOSKjy8tVkuaXpP4vo6vRl6XIl2rYT8+LklSeO+a5mQg7PL6dLghZE6Uc/73bP5TiaiPef3v0JZY2wox8KuSoGTYyz2z8NCemufRMKMOSqih+/MWw+FyXIN7VG6s5Ce8+GGdnFqHxi+YjuGsAHqoWutAZsyqhfr5qdfl3NjYQBmp0pa56V9qDiIoNYTxvx/1YsUm9eZEVjxbgMbSJMXAJmlI7DCiRfOlVm7Lj5EBbhSAie1CHZ5Q8Q50a/i6r4g4HwRrgitn3FKcokfKXBE7b/H0Rn5znCLEvQt7rh+AwtoSL+DHkUn+YXOyZ9JTJK2/vCUH/Iycgv7B50uKaTTwA6/zvHYeKfW303EVxWxmPQlt2MFkIs5AmT6kIKbCUILM6DnPKvC8SjoSb9hwulIB2e17RChSanE8xUxn6Ow/7/LVGI2wgFIPny8vphc0TIu5+WPAFjGalyjsvdxsGXK+WZjcv0Q/erwH6ISsxDopmy3oNeqWcRnKhThcmEdcRgK85OdgahduFIJmeqZyW1kjGC1hkWQF3UOoMzdCM81AYeL6JnGc/LtlNGpXOCLD/ObDXO+pAzpbOu81s4N3VvJZCQzqfTUEIJZysmvpp01TWHmNzdvhcBAbWWoMshiCjJpqBUJuazTdPeuZt+Wbdb5wignqjg","X-OriginatorOrg":"valinux.co.jp","X-MS-Exchange-CrossTenant-Network-Message-Id":"\n ef27b04f-524b-442d-41bd-08de93f53088","X-MS-Exchange-CrossTenant-AuthSource":"TY7P286MB7722.JPNP286.PROD.OUTLOOK.COM","X-MS-Exchange-CrossTenant-AuthAs":"Internal","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"06 Apr 2026 15:57:22.4241\n (UTC)","X-MS-Exchange-CrossTenant-FromEntityHeader":"Hosted","X-MS-Exchange-CrossTenant-Id":"7a57bee8-f73d-4c5f-a4f7-d72c91c8c111","X-MS-Exchange-CrossTenant-MailboxType":"HOSTED","X-MS-Exchange-CrossTenant-UserPrincipalName":"\n c4yDGPwc4op7LoIo1/GKUjT6W19hElTDY0/rpTmrK9Env0Dn73dNXlImrzbQH8RFyxkudQ37XZjXohlxdLSAoA==","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"TYYP286MB4187"},"content":"Endpoint controller drivers may integrate auxiliary blocks (e.g. DMA\nengines) whose register windows and descriptor memories metadata need to\nbe exposed to a remote peer. Endpoint function drivers need a generic\nway to discover such resources without hard-coding controller-specific\nhelpers.\n\nAdd pci_epc_get_aux_resources_count() / pci_epc_get_aux_resources() and\nthe corresponding pci_epc_ops callbacks. The count helper returns the\nnumber of available resources, while the get helper fills a\ncaller-provided array of resources described by type, physical address\nand size, plus type-specific metadata.\n\nSuggested-by: Manivannan Sadhasivam <mani@kernel.org>\nSuggested-by: Frank Li <Frank.li@nxp.com>\nSigned-off-by: Koichiro Den <den@valinux.co.jp>\n---\nChanges in v13:\n  - Renamed pci_epc_count_aux_resources() to\n    pci_epc_get_aux_resources_count() and have it return the count\n    directly.\n  - Updated commit message accordingly.\n\n drivers/pci/endpoint/pci-epc-core.c | 80 +++++++++++++++++++++++++++++\n include/linux/pci-epc.h             | 54 +++++++++++++++++++\n 2 files changed, 134 insertions(+)","diff":"diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c\nindex 6c3c58185fc5..efcd0f8b33bc 100644\n--- a/drivers/pci/endpoint/pci-epc-core.c\n+++ b/drivers/pci/endpoint/pci-epc-core.c\n@@ -156,6 +156,86 @@ const struct pci_epc_features *pci_epc_get_features(struct pci_epc *epc,\n }\n EXPORT_SYMBOL_GPL(pci_epc_get_features);\n \n+/**\n+ * pci_epc_get_aux_resources_count() - get the number of EPC-provided auxiliary resources\n+ * @epc: EPC device\n+ * @func_no: function number\n+ * @vfunc_no: virtual function number\n+ *\n+ * Some EPC backends integrate auxiliary blocks (e.g. DMA engines) whose control\n+ * registers and/or descriptor memories can be exposed to the host by mapping\n+ * them into BAR space. This helper queries how many such resources the backend\n+ * provides.\n+ *\n+ * Return: the number of available resources on success, -EOPNOTSUPP if the\n+ * backend does not support auxiliary resource queries, or another -errno on\n+ * failure.\n+ */\n+int pci_epc_get_aux_resources_count(struct pci_epc *epc, u8 func_no,\n+\t\t\t\t    u8 vfunc_no)\n+{\n+\tint count;\n+\n+\tif (!epc || !epc->ops)\n+\t\treturn -EINVAL;\n+\n+\tif (!pci_epc_function_is_valid(epc, func_no, vfunc_no))\n+\t\treturn -EINVAL;\n+\n+\tif (!epc->ops->get_aux_resources_count)\n+\t\treturn -EOPNOTSUPP;\n+\n+\tmutex_lock(&epc->lock);\n+\tcount = epc->ops->get_aux_resources_count(epc, func_no,\n+\t\t\t\t\t          vfunc_no);\n+\tmutex_unlock(&epc->lock);\n+\n+\treturn count;\n+}\n+EXPORT_SYMBOL_GPL(pci_epc_get_aux_resources_count);\n+\n+/**\n+ * pci_epc_get_aux_resources() - query EPC-provided auxiliary resources\n+ * @epc: EPC device\n+ * @func_no: function number\n+ * @vfunc_no: virtual function number\n+ * @resources: output array\n+ * @num_resources: size of @resources array in entries\n+ *\n+ * Some EPC backends integrate auxiliary blocks (e.g. DMA engines) whose control\n+ * registers and/or descriptor memories can be exposed to the host by mapping\n+ * them into BAR space. This helper queries the backend for such resources.\n+ *\n+ * Return: 0 on success, -EOPNOTSUPP if the backend does not support auxiliary\n+ * resource queries, or another -errno on failure.\n+ */\n+int pci_epc_get_aux_resources(struct pci_epc *epc, u8 func_no, u8 vfunc_no,\n+\t\t\t      struct pci_epc_aux_resource *resources,\n+\t\t\t      int num_resources)\n+{\n+\tint ret;\n+\n+\tif (!resources || num_resources <= 0)\n+\t\treturn -EINVAL;\n+\n+\tif (!epc || !epc->ops)\n+\t\treturn -EINVAL;\n+\n+\tif (!pci_epc_function_is_valid(epc, func_no, vfunc_no))\n+\t\treturn -EINVAL;\n+\n+\tif (!epc->ops->get_aux_resources)\n+\t\treturn -EOPNOTSUPP;\n+\n+\tmutex_lock(&epc->lock);\n+\tret = epc->ops->get_aux_resources(epc, func_no, vfunc_no, resources,\n+\t\t\t\t\t  num_resources);\n+\tmutex_unlock(&epc->lock);\n+\n+\treturn ret;\n+}\n+EXPORT_SYMBOL_GPL(pci_epc_get_aux_resources);\n+\n /**\n  * pci_epc_stop() - stop the PCI link\n  * @epc: the link of the EPC device that has to be stopped\ndiff --git a/include/linux/pci-epc.h b/include/linux/pci-epc.h\nindex 1eca1264815b..2f2848542726 100644\n--- a/include/linux/pci-epc.h\n+++ b/include/linux/pci-epc.h\n@@ -61,6 +61,47 @@ struct pci_epc_map {\n \tvoid __iomem\t*virt_addr;\n };\n \n+/**\n+ * enum pci_epc_aux_resource_type - auxiliary resource type identifiers\n+ * @PCI_EPC_AUX_DOORBELL_MMIO: Doorbell MMIO, that might be outside the DMA\n+ *                             controller register window\n+ *\n+ * EPC backends may expose auxiliary blocks (e.g. DMA engines) by mapping their\n+ * register windows and descriptor memories into BAR space. This enum\n+ * identifies the type of each exposable resource.\n+ */\n+enum pci_epc_aux_resource_type {\n+\tPCI_EPC_AUX_DOORBELL_MMIO,\n+};\n+\n+/**\n+ * struct pci_epc_aux_resource - a physical auxiliary resource that may be\n+ *                               exposed for peer use\n+ * @type:       resource type, see enum pci_epc_aux_resource_type\n+ * @phys_addr:  physical base address of the resource\n+ * @size:       size of the resource in bytes\n+ * @bar:        BAR number where this resource is already exposed to the RC\n+ *              (NO_BAR if not)\n+ * @bar_offset: offset within @bar where the resource starts (valid iff\n+ *              @bar != NO_BAR)\n+ * @u:          type-specific metadata\n+ */\n+struct pci_epc_aux_resource {\n+\tenum pci_epc_aux_resource_type type;\n+\tphys_addr_t phys_addr;\n+\tresource_size_t size;\n+\tenum pci_barno bar;\n+\tresource_size_t bar_offset;\n+\n+\tunion {\n+\t\t/* PCI_EPC_AUX_DOORBELL_MMIO */\n+\t\tstruct {\n+\t\t\tint irq; /* IRQ number for the doorbell handler */\n+\t\t\tu32 data; /* write value to ring the doorbell */\n+\t\t} db_mmio;\n+\t} u;\n+};\n+\n /**\n  * struct pci_epc_ops - set of function pointers for performing EPC operations\n  * @write_header: ops to populate configuration space header\n@@ -84,6 +125,9 @@ struct pci_epc_map {\n  * @start: ops to start the PCI link\n  * @stop: ops to stop the PCI link\n  * @get_features: ops to get the features supported by the EPC\n+ * @get_aux_resources_count: ops to get the number of controller-owned\n+ *                           auxiliary resources\n+ * @get_aux_resources: ops to retrieve controller-owned auxiliary resources\n  * @owner: the module owner containing the ops\n  */\n struct pci_epc_ops {\n@@ -115,6 +159,11 @@ struct pci_epc_ops {\n \tvoid\t(*stop)(struct pci_epc *epc);\n \tconst struct pci_epc_features* (*get_features)(struct pci_epc *epc,\n \t\t\t\t\t\t       u8 func_no, u8 vfunc_no);\n+\tint\t(*get_aux_resources_count)(struct pci_epc *epc, u8 func_no,\n+\t\t\t\t       u8 vfunc_no);\n+\tint\t(*get_aux_resources)(struct pci_epc *epc, u8 func_no, u8 vfunc_no,\n+\t\t\t\t     struct pci_epc_aux_resource *resources,\n+\t\t\t\t     int num_resources);\n \tstruct module *owner;\n };\n \n@@ -343,6 +392,11 @@ int pci_epc_start(struct pci_epc *epc);\n void pci_epc_stop(struct pci_epc *epc);\n const struct pci_epc_features *pci_epc_get_features(struct pci_epc *epc,\n \t\t\t\t\t\t    u8 func_no, u8 vfunc_no);\n+int pci_epc_get_aux_resources_count(struct pci_epc *epc, u8 func_no,\n+\t\t\t\t    u8 vfunc_no);\n+int pci_epc_get_aux_resources(struct pci_epc *epc, u8 func_no, u8 vfunc_no,\n+\t\t\t      struct pci_epc_aux_resource *resources,\n+\t\t\t      int num_resources);\n enum pci_barno\n pci_epc_get_first_free_bar(const struct pci_epc_features *epc_features);\n enum pci_barno pci_epc_get_next_free_bar(const struct pci_epc_features\n","prefixes":["v13","1/7"]}