{"id":2198046,"url":"http://patchwork.ozlabs.org/api/1.0/patches/2198046/?format=json","project":{"id":28,"url":"http://patchwork.ozlabs.org/api/1.0/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},"msgid":"<20260219081318.4156901-2-den@valinux.co.jp>","date":"2026-02-19T08:13:12","name":"[v9,1/7] PCI: endpoint: Add auxiliary resource query API","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"207768e76340655956d318227031cf4909ba6616","submitter":{"id":91573,"url":"http://patchwork.ozlabs.org/api/1.0/people/91573/?format=json","name":"Koichiro Den","email":"den@valinux.co.jp"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-pci/patch/20260219081318.4156901-2-den@valinux.co.jp/mbox/","series":[{"id":492647,"url":"http://patchwork.ozlabs.org/api/1.0/series/492647/?format=json","date":"2026-02-19T08:13:11","name":"PCI: endpoint: pci-ep-msi: Add embedded doorbell fallback","version":9,"mbox":"http://patchwork.ozlabs.org/series/492647/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2198046/checks/","tags":{},"headers":{"Return-Path":"\n <linux-pci+bounces-47615-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=SfOh8zi+;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-47615-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=\"SfOh8zi+\"","smtp.subspace.kernel.org;\n arc=fail smtp.client-ip=52.101.125.77","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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fGmQy4j0xz1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 19 Feb 2026 19:15:38 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 312493068F38\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 19 Feb 2026 08:13:28 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 07B812222B2;\n\tThu, 19 Feb 2026 08:13:28 +0000 (UTC)","from TYVP286CU001.outbound.protection.outlook.com\n (mail-japaneastazon11021077.outbound.protection.outlook.com [52.101.125.77])\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 866442AD2C;\n\tThu, 19 Feb 2026 08:13:26 +0000 (UTC)","from TY7P286MB7722.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:38f::10)\n by TYRP286MB5862.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:2ec::12) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9632.15; Thu, 19 Feb\n 2026 08:13: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.9632.010; Thu, 19 Feb 2026\n 08:13:22 +0000"],"ARC-Seal":["i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1771488807; cv=fail;\n b=t2PrWtOiICFMRvG1t+Ch41tXqNv6L62DKnrteubVkn9VoObXNQqP87lj8qoSz4kSys3pSccIbl5Q2h6Gorh512U6ZfR8I9ESk1Ulj+m1xLuxiwUatQL0EQtxJ+wUqxqG0ShWiMNzkJChAqYA4d8zgfHacqxjUrzN3uUh0rCbM5k=","i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=oMd+Zmar4HBIWwDOyvXZiywuk6tAZl8FBWAyZ39n/GoazfPjfpQzDpqq5ibTuvk2BH/19RzM5bHtxPBqLpFVhJ/h5pFaaZtaKHdxDNjjhZnzFYW1D9nTbxJ53cuJdt3BPE84Ey7adtaWQKeshBMBE0NzmNF1zn7v9s+zF/iBq6QRnV+4E2PzVkPbXz+h7nKP9/Nmj2O8X1wxyaRcrNrFmX8LQ29Gc6b1ucxCdkMPip7AtopXJoTEycbmVMxI04DGJvA8mB3rgRQAZuMGVeEHQ5iRB4TbBMMNo+I9NErVGLlfRZBcbFdYTJfhrY6RkPi833mdBWeGRB0XxekCrnrh/w=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1771488807; c=relaxed/simple;\n\tbh=hFad4MztiKu+0LXbEpMdvZEsH5qtIJuJjGZXO3zcx7I=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t Content-Type:MIME-Version;\n b=Leylys3LZGdumjD2ohO9exhD2YJHvsyMn6tVMX4k9QQOEqpCiIVOlbDaw2evAYHlNBsYBWWiajpd9fd6VYBDFX2Gwhc+efLoXWjnxqcEisqZdbpBMBrH8+hh96iIbddh9pemLq1FTHhxSnCBzt2KeQEiOOG/SSKWT0KY8S8ggHo=","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=NpmGhyMNcJwLhX2yiUVPmrJAM89gDo/+2KoUeKhv484=;\n b=mtR2Q93P+U53r11nJ1TW7JdAtvriuCHcmlOO5IWaEm3j8k2QO6T3w6Tji8xifBNo/ELR2YfbZ40qvu0GrBen0wRRvHqIsRpjQqgPYKSKBV8gzIqP29oDCADl5sdozeikWtcFF/7R4fV/nHiq8iiANa6f8SgIXQpWwE3bNUyIjp71iJt+itYHN5NE5140xQ2+cuggA9lidO5aXvl9xRaBx90rjTLPxI/1e1Hqy02Luwuq0dvujYFZtE33BXHxJRPzeztk0czuEKUDlhdLzVu6HmGWX5+GOH/iTwAAzcnowY5R471YxLYCgZUTFSBh2ev52PsiyqAcB5UXHvJ44mF7UQ=="],"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=SfOh8zi+; arc=fail smtp.client-ip=52.101.125.77","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=NpmGhyMNcJwLhX2yiUVPmrJAM89gDo/+2KoUeKhv484=;\n b=SfOh8zi+6ZOmg1q4i5rIxTNIy6ti3OUC1+FTrubIGMuxivVo2xc/5r+ZjG6AacQu9Q702bmqtLZyypXZ0WFQfabJRlnJJ/SVIvghV8ahqZCiOxrVaYP0sact0t0ZBglDQo/R39TcX9i65ngzML83AwOOKIync78vzfal/4+ayQU=","From":"Koichiro Den <den@valinux.co.jp>","To":"jingoohan1@gmail.com,\n\tmani@kernel.org,\n\tlpieralisi@kernel.org,\n\tkwilczynski@kernel.org,\n\trobh@kernel.org,\n\tbhelgaas@google.com,\n\tkishon@kernel.org,\n\tjdmason@kudzu.us,\n\tdave.jiang@intel.com,\n\tallenbh@gmail.com,\n\tcassel@kernel.org,\n\tFrank.Li@nxp.com,\n\tshinichiro.kawasaki@wdc.com,\n\tchristian.bruel@foss.st.com","Cc":"mmaddireddy@nvidia.com,\n\tlinux-pci@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tntb@lists.linux.dev","Subject":"[PATCH v9 1/7] PCI: endpoint: Add auxiliary resource query API","Date":"Thu, 19 Feb 2026 17:13:12 +0900","Message-ID":"<20260219081318.4156901-2-den@valinux.co.jp>","X-Mailer":"git-send-email 2.51.0","In-Reply-To":"<20260219081318.4156901-1-den@valinux.co.jp>","References":"<20260219081318.4156901-1-den@valinux.co.jp>","Content-Transfer-Encoding":"8bit","Content-Type":"text/plain","X-ClientProxiedBy":"TYCP286CA0059.JPNP286.PROD.OUTLOOK.COM\n (2603:1096:400:2b5::16) 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_|TYRP286MB5862:EE_","X-MS-Office365-Filtering-Correlation-Id":"94d64a77-e492-4528-6716-08de6f8ebf81","X-MS-Exchange-SenderADCheck":"1","X-MS-Exchange-AntiSpam-Relay":"0","X-Microsoft-Antispam":"\n\tBCL:0;ARA:13230040|10070799003|376014|7416014|366016|1800799024|921020;","X-Microsoft-Antispam-Message-Info":"\n yWV+v9kEFIECtHPaCQ2Zoz83trmmBq2yMGfeQZwiBUvn8KWt0tkPDHhYvE3ta4W+wOOHts+qV7u4aitFxIJbSqFCDRVlCnBp/TA2Z7Ou/cGttGKPIKXqT4lLiVW3CDz7osFxk2PrvmpPyfEw6ZLBfUD8WzJPSe8p+pqKMx6EF0ldvusGngONX9f4BfsUfv3t2Yvjh2+FiZyZMB5LLtN9yNP3UJcIsZ+/6wjPZ5ORTclQpO7WCzo1yG6DXiGw7LWZkE3Fo5dpArbNEl8hcWzdgKUGT+8XM4Uwp1DkAnqCK/2uWsFZOPSBVx0YIWBfMPmVElZqssgaCtUrdE8xDYiJ08oQKovmy2uGleO0pYF1LhzvllEYtfT8iBVw/UIzuFzoghawd8SKpe4a1CQvyDDZaFPSXWGN5ZkCoW8TlEwwZCIVDI4lhEs2c3DdrPVT/w0FMcsTJhW1oD/VV7zxFggR52ZqtGazdqvNmrWgMnJmRcLc6cJISqVJwVl3chqWhB9oaEaC9FRqNimj1lZvL7re9zpo+QRve4qXrmU/c2Ud25UDbz4+JPmm6QobHTeeiP20ohhhut6V3ym8Yg+WRZvOVavQmJqmVz0QTJcF4EVa86WtxslBUFJkXw0jCkF/8RT+xcxdPqRXN5dEliZDHhbE60lwJ8JOuZd8buu+W6tqwazJYuN3WZeBcHfftdJa6xY2tqd5lui1khiqWY7j+B6q/7E0URLghUfzmZ6kYPDuj5DkQzkk5UshBgkeK/v1QyIYmpcWsYlsgQdmTyqzK98iRuSSS5gYvctYLiP3N0dry2pmKbu6uNy6PYef2RYFALhNk0EZ8Q7II3JHNaeXIPpdYdntNkZiti6071M7mLZtyiWeZfRMNN73aV6QjjY1KjKtT+lEKVYY74FWC7ilre7BXP58W86YMGoVHxF33e/DDA6JdLYTGUn89ZDgpeUwza2ORZcYd30iJDqsx1J5Bb04uCyQs51sVQLpPxD5NR96492P58cT3AdxUD21rMDLAIMs+w0Fpm08nWqiQxdZVDBas3atRp3NPFI/5ySgnSIDbkx4QQ5JFnmllvYZJubhdQ23iMpkO3mp08IO92H0UQUwh0vyd8zegqO6rq7fbO+3ub+B5UmZXRLZnQWGVRluk8MChBUNJsLLHvqzN4460kdGZuHtsuyxf06v3X4R/01cyb8Z+fyoTErgTVGaAnTxje7g7giYDs/b3VTHS/ysoOMxnl+v2ZCUdp8rFFR1hSu+tnaEbTXIeg6VZ3GTDUrSrzDMhmnmcNFT19tA3Fmfn110/okGsmHM8mlMy6VKzfFZbdDkffUSUkibKdHQtW7/r7etc8b8FJHoWYaWYIVCa4nooAZrEAxAABoBDofwu4Q6mlAVaV+/lPkkOkFHKMeltuIlZb0bDueBuptrYMV9towmWKiLQqB04utUkepBPf449RHxqroE5x/Yc89bvv+AjiRy+OpaxMGDTc8TGVbbM9iqRshkMFQJEpJtGxeVZsMySHpLRpWIxQJW9jfip2wPJ8CcLp759LqAhsDAuxd2iIA9kpON/BMuhsEXCBHsIjLEgLHpOl9tnxd59cT8orYhz2C1IMC7QF2F0t2uaodrvXTN4A==","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)(10070799003)(376014)(7416014)(366016)(1800799024)(921020);DIR:OUT;SFP:1102;","X-MS-Exchange-AntiSpam-MessageData-ChunkCount":"1","X-MS-Exchange-AntiSpam-MessageData-0":"\n 61zfPxSidd4mpSNw6Is878Y1BT42QHXMMt6E93jPVeiBLEmwZhCMPD9k6ml7hy3TRjeGiQDDWYCmKPa0K60+zXKBgqvFVZTcQmFJySDx4YXjp3cO+QcOq0e35jZpbO1RFp1u4P9RDb1FXb1XSryfp3nyx/+KxC8Q8xjqiXu0B6svDt/nxwPl7zXpPhfBBKaZsPxb3dtq9jotcZjGCYft4vfRr3inJp16f36XKjzEgD5J7+/zqqJRkPDd6/50xcKO5RL9HwmMrkCWuTUQbCFv1hqfq2fWLCWVHp0maMRHHMdtNhwUpPE45Z8+VEsWn2ReQZOpe52yL8mXbQscwZGaQmOp2c0Iyeyq36YAmtPkDzKpLbDJ3E19YDatlifRTIXoSe+A4GYtLJhAZfUAaakEi+yT0nP5JnT8O8vUtdPVxKFXB1eVnytXj46wpxdElhPNXcM9PO8d7vzlRSVuxD+a9z8YgatKceNKpEETDfX4Mkplrm66u6O7hDViyNVZWzctN24D+ioi0fNvK3w7NK2y/ViCJXZlRHhag5wth77ZOU2j/5/OKej2emOSSW7885iZzCWmfwxERedNNBbrsrbTkG+5k4+2yhAkV2MEIH+2MeaqZmcfOH4FFLcduKdyDZ8i1oRvaXEZlavB8XYbW/aO5PYtinheJXiZpuGBQx+Pjj9nEsvph/77gE9rEf/zbUp1MxMi2OKSI8uL6GbfyoYvwbXC93xxXaZJzktbfUKHlLJSos65qaXWK4+8SwR1eGgjU9VIuPAY3Yom5NoLZj+ehECNuFb9Dg8PdttNGw4xMkxP4hb6BlbFMc0SWettIudGU4DQRretL8V5pzz1BclC5bByOcQ2szRips7kD2CVQRERjxrYzTxzXb/EvkG6aKwJy6f87G3MkWNb5xqN6uZoNyJOWrjZSmnltwKFwS0Ylo1aGwq3yRsIO/rdGaypIZlxP1NTZFsZOcAOM1HgNL/FD6Os1w7UyIo+WMFdw3Ck2kh5Y9SSiqvJOIbRYKdEEoq22Nl9LAjYaZD/VKn6LaObXpIVefdSEElkqo1wcIfyjLVzkuNXKKcfmWDzYyg2HFFC7M/RVJg4dl616mxHHNCGA15Jp6/KcYAuu/FQ8epKn8OtmTOdNmlFmfKGdpUpIM1Q71hbs+Jyi0iuYmYbXl2Mhc+4raieGqz+YYBr70RfnWwDnOtpfjeqq8bl4slacn7JAtrek6FQ4K4Ebv559xHMqFyhJ+JAt58HR7GXWtWrBRbIql/petp3Fy+Lp0XDveSFeoa5Cpd/Xb1KU7mfQ7y8FdvPjG4HteIT+4v2X4ftJECugytv47mi0x3nIRcEeGQVe/LLmqkL2j3xIYune78bAv2neQtUaExe6VDtve/CFzsE4A6wpbEkaaSm/c7tEH4P2ed78PCQdllSrjv2qKhHC0eOKvXcS5o3il0onp2IlZJhlwqDj+sd4gBddE0pHRR500WE5EgZRW6D5N0szlhJQajuI9sxpEby7EgGuSfDraWFN/uMNnXayFJxyyBQn85myvVdR0NllpyWSDqA4C7B/bnGjh8xEKh/fSi24VY9XUBW5U6e25IGp/VbHjD0VSP8coaI4gDdLjwNKSUfSmx9yV9SOpTMGd7+7uY1+N3K5NdCu+ZIw/C4aKcPBPYtaZdt41ofTJD6B7bTjJ+SEwcIHDUvsFlkCdDc83ifG/mwGCsUHFQs7kXh9/TzgJRPrVfd5ELO9vr/fUG282FP12MYgBBwvHtea+0rxWqjryCAlxVEymEureYl4ApI4RIlyJKA","X-OriginatorOrg":"valinux.co.jp","X-MS-Exchange-CrossTenant-Network-Message-Id":"\n 94d64a77-e492-4528-6716-08de6f8ebf81","X-MS-Exchange-CrossTenant-AuthSource":"TY7P286MB7722.JPNP286.PROD.OUTLOOK.COM","X-MS-Exchange-CrossTenant-AuthAs":"Internal","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"19 Feb 2026 08:13:22.2872\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 RLRL2UaDsdFCsX4Rw1WvtXhWbio6z9pSvNix1h6WJzOx6KY6fHIg3sUDCo0PwBsXGQxG8+aFoWz4qDDqStdaCA==","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"TYRP286MB5862"},"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() and the corresponding pci_epc_ops\nget_aux_resources() callback. The API returns a list of resources\ndescribed by type, physical address and size, plus type-specific\nmetadata.\n\nPassing resources == NULL (or num_resources == 0) returns the required\nnumber of entries.\n\nReviewed-by: Frank Li <Frank.Li@nxp.com>\nSigned-off-by: Koichiro Den <den@valinux.co.jp>\n---\n drivers/pci/endpoint/pci-epc-core.c | 41 +++++++++++++++++++++++\n include/linux/pci-epc.h             | 52 +++++++++++++++++++++++++++++\n 2 files changed, 93 insertions(+)","diff":"diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c\nindex 5045e22367cf..10bd392c4667 100644\n--- a/drivers/pci/endpoint/pci-epc-core.c\n+++ b/drivers/pci/endpoint/pci-epc-core.c\n@@ -157,6 +157,47 @@ 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() - query EPC-provided auxiliary resources\n+ * @epc: EPC device\n+ * @func_no: function number\n+ * @vfunc_no: virtual function number\n+ * @resources: output array (may be NULL to query required count)\n+ * @num_resources: size of @resources array in entries (0 when querying count)\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:\n+ *   * >= 0: number of resources returned (or required, if @resources is NULL)\n+ *   * -EOPNOTSUPP: backend does not support auxiliary resource queries\n+ *   * other -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 (!epc || !epc->ops)\n+\t\treturn -EINVAL;\n+\n+\tif (func_no >= epc->max_functions)\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 8687b9c3462b..705026f64ef1 100644\n--- a/include/linux/pci-epc.h\n+++ b/include/linux/pci-epc.h\n@@ -61,6 +61,51 @@ 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_DMA_CTRL_MMIO: Integrated DMA controller register window (MMIO)\n+ * @PCI_EPC_AUX_DMA_CHAN_DESC: Per-channel DMA descriptor\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_DMA_CTRL_MMIO,\n+\tPCI_EPC_AUX_DMA_CHAN_DESC,\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 +129,7 @@ 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: ops to retrieve controller-owned auxiliary resources\n  * @owner: the module owner containing the ops\n  */\n struct pci_epc_ops {\n@@ -115,6 +161,9 @@ 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)(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@@ -348,6 +397,9 @@ 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(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":["v9","1/7"]}