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.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/configfs.hlinux/device.hlinux/mod_devicetable.hlinux/msi.hlinux/pci.h
Detected Declarations
struct pci_epfstruct pci_epc_featuresstruct pci_epf_headerstruct pci_epf_opsstruct pci_epc_event_opsstruct pci_epf_driverstruct pci_epf_bar_submapstruct pci_epf_barstruct pci_epf_doorbell_msgstruct pci_epfstruct pci_epf_msix_tblenum pci_epc_interface_typeenum pci_barnofunction __pci_epf_register_driver
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
- Immediate include surface: `linux/configfs.h`, `linux/device.h`, `linux/mod_devicetable.h`, `linux/msi.h`, `linux/pci.h`.
- Detected declarations: `struct pci_epf`, `struct pci_epc_features`, `struct pci_epf_header`, `struct pci_epf_ops`, `struct pci_epc_event_ops`, `struct pci_epf_driver`, `struct pci_epf_bar_submap`, `struct pci_epf_bar`, `struct pci_epf_doorbell_msg`, `struct pci_epf`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: pattern implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.