mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-08-31 22:23:05 +00:00

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
29 lines
607 B
C
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__ */
|