include/linux/pci-epf.h

Source file repositories/reference/linux-study-clean/include/linux/pci-epf.h

File Facts

System
Linux kernel
Corpus path
include/linux/pci-epf.h
Extension
.h
Size
9593 bytes
Lines
281
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: operation-table or driver-model contract
Status
pattern implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct device_driver	driver;
	const struct pci_epf_ops *ops;
	struct module		*owner;
	struct list_head	epf_group;
	const struct pci_epf_device_id	*id_table;
};

#define to_pci_epf_driver(drv) container_of_const((drv), struct pci_epf_driver, driver)

/**
 * struct pci_epf_bar_submap - BAR subrange for inbound mapping
 * @phys_addr: target physical/DMA address for this subrange
 * @size: the size of the subrange to be mapped
 *
 * When pci_epf_bar.num_submap is >0, pci_epf_bar.submap describes the
 * complete BAR layout. This allows an EPC driver to program multiple
 * inbound translation windows for a single BAR when supported by the
 * controller. The array order defines the BAR layout (submap[0] at offset
 * 0, and each immediately follows the previous one).
 */
struct pci_epf_bar_submap {
	dma_addr_t	phys_addr;
	size_t		size;
};

/**
 * struct pci_epf_bar - represents the BAR of EPF device
 * @phys_addr: physical address that should be mapped to the BAR
 * @addr: virtual address corresponding to the @phys_addr
 * @size: the size of the address space present in BAR
 * @mem_size: the size actually allocated to accommodate the iATU alignment
 *            requirement
 * @barno: BAR number
 * @flags: flags that are set for the BAR
 * @num_submap: number of entries in @submap
 * @submap: array of subrange descriptors allocated by the caller. See
 *          struct pci_epf_bar_submap for the semantics in detail.
 */
struct pci_epf_bar {
	dma_addr_t	phys_addr;
	void		*addr;
	size_t		size;
	size_t		mem_size;
	enum pci_barno	barno;
	int		flags;

	/* Optional sub-range mapping */
	unsigned int	num_submap;
	struct pci_epf_bar_submap	*submap;
};

/**
 * struct pci_epf_doorbell_msg - represents doorbell message
 * @msg: MSI message
 * @virq: IRQ number of this doorbell MSI message
 */
struct pci_epf_doorbell_msg {
	struct msi_msg msg;
	int virq;
};

/**
 * struct pci_epf - represents the PCI EPF device
 * @dev: the PCI EPF device
 * @name: the name of the PCI EPF device
 * @header: represents standard configuration header
 * @bar: represents the BAR of EPF device
 * @msi_interrupts: number of MSI interrupts required by this function
 * @msix_interrupts: number of MSI-X interrupts required by this function
 * @func_no: unique (physical) function number within this endpoint device
 * @vfunc_no: unique virtual function number within a physical function
 * @epc: the EPC device to which this EPF device is bound
 * @epf_pf: the physical EPF device to which this virtual EPF device is bound
 * @driver: the EPF driver to which this EPF device is bound
 * @id: pointer to the EPF device ID
 * @list: to add pci_epf as a list of PCI endpoint functions to pci_epc
 * @lock: mutex to protect pci_epf_ops
 * @sec_epc: the secondary EPC device to which this EPF device is bound
 * @sec_epc_list: to add pci_epf as list of PCI endpoint functions to secondary
 *   EPC device
 * @sec_epc_bar: represents the BAR of EPF device associated with secondary EPC
 * @sec_epc_func_no: unique (physical) function number within the secondary EPC
 * @group: configfs group associated with the EPF device
 * @is_bound: indicates if bind notification to function driver has been invoked
 * @is_vf: true - virtual function, false - physical function
 * @vfunction_num_map: bitmap to manage virtual function number
 * @pci_vepf: list of virtual endpoint functions associated with this function
 * @event_ops: callbacks for capturing the EPC events
 * @db_msg: data for MSI from RC side
 * @num_db: number of doorbells

Annotation

Implementation Notes