linux-loongson/include/linux/pci-ep-msi.h
Frank Li 1c3b002c6b PCI: endpoint: Add RC-to-EP doorbell support using platform MSI controller
Implement the doorbell feature by mapping the EP's MSI interrupt controller
message address to a dedicated BAR.

The EPF driver should pass the actual message data to be written to the
message address by the host through implementation-specific logic.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
[mani: minor code cleanups and reworded commit message]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
[bhelgaas: fix kernel-doc]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20250710-ep-msi-v21-3-57683fc7fb25@nxp.com
2025-07-24 16:51:17 -05:00

29 lines
607 B
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* PCI Endpoint *Function* side MSI header file
*
* Copyright (C) 2024 NXP
* Author: Frank Li <Frank.Li@nxp.com>
*/
#ifndef __PCI_EP_MSI__
#define __PCI_EP_MSI__
struct pci_epf;
#ifdef CONFIG_PCI_ENDPOINT_MSI_DOORBELL
int pci_epf_alloc_doorbell(struct pci_epf *epf, u16 nums);
void pci_epf_free_doorbell(struct pci_epf *epf);
#else
static inline int pci_epf_alloc_doorbell(struct pci_epf *epf, u16 nums)
{
return -ENODATA;
}
static inline void pci_epf_free_doorbell(struct pci_epf *epf)
{
}
#endif /* CONFIG_GENERIC_MSI_IRQ */
#endif /* __PCI_EP_MSI__ */