From patchwork Fri Nov 11 13:56:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 18800 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp755781wru; Fri, 11 Nov 2022 06:02:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf5QAuNealDIl+izG/8LJ1vfpdqtb87iDMt+UcxBIScR5lCsSBf8gVTQhxbutHnGhdkPEyxu X-Received: by 2002:a17:906:9143:b0:7a1:b555:6f1 with SMTP id y3-20020a170906914300b007a1b55506f1mr2075551ejw.29.1668175338303; Fri, 11 Nov 2022 06:02:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668175338; cv=none; d=google.com; s=arc-20160816; b=limXkrcxWX24nGln0cZIg2jIqmIWajf4V4uZtG9g+vFKXH2eS1VJIh5LKCasy6dkbO Z49JQKJzkWY7uatVve0UL1b05vKELQs0OmPYgwSbjRgqJDQusK6fFDP6eg4uDHWtmQfa 1+B/YE/LxIKOjTUSTmZugadHAcNXu3spEWexj/RZSt+k5ydTj99/HYtz/x+INReYLf6E W65zy67h3D6Zm8unxg2JL1C4IpnXWW43g5QvZUWMLLBdP79QPhBDQPLRucUoG8Iz3GIH RSiQpYP0xq+8oQfqkB0/Xifb51m6+DO3E6Ax26Nd6W0Pi8+7yDcbf9wOO7CCK9Sk8cK6 cRiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=+wWUy0xddNMXZ4KiuU4oL7F6PKUict1lpTyY0niJbHA=; b=05RPh247G3iJZUjWAE9FHd6+DzCqzezlCyICSazZ0cK4/5uF/isfWtWly0ZWyTVucb WnpFC4k3MC2CSVqet9hdQKiQZOvX57giN5ZSZp3q+BImng9un1g5KlfAcQ3OXpbjeOvu 87ePhYK3oV6rX2RSjQ75+SVZcTXYXVEwO+fAcGGRwiUPur+DwfPcBrPwVDpDyy1gDknH lOx8XVGosQwZTCIrPyo/4wDvqwraARzhYVrxiIGlHNeW/GaiEAvh+FvMSOa7SM1y1V60 MUItcISFse7+tQ0Dt5chDrmjF8Pk5lTiHcrkPYT/eRSGPoBDUcZTdk66IpDLoHrD/qmG 6BRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="4Ve/5OQD"; dkim=neutral (no key) header.i=@linutronix.de header.b=pOkuRxfa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jr13-20020a170906a98d00b007a835c56b70si1559959ejb.267.2022.11.11.06.01.49; Fri, 11 Nov 2022 06:02:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="4Ve/5OQD"; dkim=neutral (no key) header.i=@linutronix.de header.b=pOkuRxfa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234188AbiKKOA6 (ORCPT + 99 others); Fri, 11 Nov 2022 09:00:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233783AbiKKOA3 (ORCPT ); Fri, 11 Nov 2022 09:00:29 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAD7F7F554; Fri, 11 Nov 2022 05:56:44 -0800 (PST) Message-ID: <20221111132706.220687198@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668175002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=+wWUy0xddNMXZ4KiuU4oL7F6PKUict1lpTyY0niJbHA=; b=4Ve/5OQD46++Ka7BIfp6pYk3HWqMRwK4G/JS7GSgmA9f3Mu3CWK7KMTuwExQ7K4rujCAeG bJeGyjMRNgVEUB/cWXx6B6xThz7osKQ6aIyXmmfaVHyqAJfz43nfgHXnWujZ+YGMoQUNar WL9Gz+YoeFb5iiMMatgSx9F6yY5BrM0FKyOf5fdjVPl4tOq2k+cNduEb3syKLcmVNwVU8V E3ngIzlwgGsjgUBDx0j4pVFQ+mjBcjmut7w8pTWgQy7L4QLKAgLRbdBolqpsak4MTJVXSa 5/D4aUp85YEa28AhVS3vwSYQCupki/2oycF8jbAekLNqa3kydN8CTkT8QL3W6Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668175002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=+wWUy0xddNMXZ4KiuU4oL7F6PKUict1lpTyY0niJbHA=; b=pOkuRxfa/fpZvtbipaYIMhhpLDSFbLFUaARwteFpOtcpeRYQ2BCkJnMVLmqAnRuYtneAF3 OFRQsDkKeuwdxdBg== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Joerg Roedel , Will Deacon , linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Marc Zyngier , Greg Kroah-Hartman , Jason Gunthorpe , Dave Jiang , Alex Williamson , Kevin Tian , Dan Williams , Logan Gunthorpe , Ashok Raj , Jon Mason , Allen Hubbe , "Ahmed S. Darwish" , Reinette Chatre Subject: [patch 03/20] genirq/msi: Create msi_api.h References: <20221111131813.914374272@linutronix.de> MIME-Version: 1.0 Date: Fri, 11 Nov 2022 14:56:42 +0100 (CET) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749208623403457940?= X-GMAIL-MSGID: =?utf-8?q?1749208623403457940?= Create a API header for MSI specific functions which are relevant to device drivers. Signed-off-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe --- include/linux/msi.h | 6 ++++-- include/linux/msi_api.h | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -13,11 +13,14 @@ * * Regular device drivers have no business with any of these functions and * especially storing MSI descriptor pointers in random code is considered - * abuse. The only function which is relevant for drivers is msi_get_virq(). + * abuse. + * + * Device driver relevant functions are available in */ #include #include +#include #include #include #include @@ -184,7 +187,6 @@ struct msi_device_data { int msi_setup_device_data(struct device *dev); -unsigned int msi_get_virq(struct device *dev, unsigned int index); void msi_lock_descs(struct device *dev); void msi_unlock_descs(struct device *dev); --- /dev/null +++ b/include/linux/msi_api.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef LINUX_MSI_API_H +#define LINUX_MSI_API_H + +/* + * APIs which are relevant for device driver code for allocating and + * freeing MSI interrupts and querying the associations between + * hardware/software MSI indices and the Linux interrupt number. + */ + +struct device; + +unsigned int msi_get_virq(struct device *dev, unsigned int index); + +#endif