STRUCT PCI_EPC_OPS(9)
π struct pci_epc_ops(9) β the Kernel API Manual, but make it make sense
okay so bestie, picture this: it's a struct and it's literally just a whole set of function pointers for performing EPC operations. that's it. that's the vibe. it's giving "interface contract but make it couture" β¨
manual name? Kernel API Manual, periodt. and yes this is the glow-up of the struct pci_epc_ops(9) page, you're welcome π
β¨ SYNOPSIS β¨
struct pci_epc_ops {
int (*write_header)(struct pci_epc *epc, u8 func_no, u8 vfunc_no, struct pci_epf_header *hdr);
int (*set_bar)(struct pci_epc *epc, u8 func_no, u8 vfunc_no, struct pci_epf_bar *epf_bar);
void (*clear_bar)(struct pci_epc *epc, u8 func_no, u8 vfunc_no, struct pci_epf_bar *epf_bar);
u64 (*align_addr)(struct pci_epc *epc, u64 pci_addr, size_t *size, size_t *offset);
int (*map_addr)(struct pci_epc *epc, u8 func_no, u8 vfunc_no, phys_addr_t addr, u64 pci_addr, size_t size);
void (*unmap_addr)(struct pci_epc *epc, u8 func_no, u8 vfunc_no, phys_addr_t addr);
int (*set_msi)(struct pci_epc *epc, u8 func_no, u8 vfunc_no, u8 nr_irqs);
int (*get_msi)(struct pci_epc *epc, u8 func_no, u8 vfunc_no);
int (*set_msix)(struct pci_epc *epc, u8 func_no, u8 vfunc_no, u16 nr_irqs, enum pci_barno, u32 offset);
int (*get_msix)(struct pci_epc *epc, u8 func_no, u8 vfunc_no);
int (*raise_irq)(struct pci_epc *epc, u8 func_no, u8 vfunc_no, unsigned int type, u16 interrupt_num);
int (*map_msi_irq)(struct pci_epc *epc, u8 func_no, u8 vfunc_no, phys_addr_t phys_addr, u8 interrupt_num, u32 entry_size, u32 *msi_data, u32 *msi_addr_offset);
int (*start)(struct pci_epc *epc);
void (*stop)(struct pci_epc *epc);
const struct pci_epc_features* (*get_features)(struct pci_epc *epc, u8 func_no, u8 vfunc_no);
int (*get_aux_resources_count)(struct pci_epc *epc, u8 func_no, u8 vfunc_no);
int (*get_aux_resources)(struct pci_epc *epc, u8 func_no, u8 vfunc_no, struct pci_epc_aux_resource *resources, int num_resources);
struct module *owner;
};
no cap, that's the whole squad right there π
πΈ Members πΈ
okay now let's do the roll call, one by one, because every single one of these pointers has main character energy:
write_headerβ ops to populate configuration space header πset_barβ ops to configure the BAR β¨clear_barβ ops to reset the BAR π§Ήalign_addrβ the operation to get the mapping address, mapping size and offset into a controller memory window needed to map an RC PCI address region π― (yes, all three, it's an overachiever)map_addrβ ops to map CPU address to PCI address πΊοΈunmap_addrβ ops to unmap CPU address and PCI address π«Άset_msiβ ops to set the requested number of MSI interrupts in the MSI capability register π₯get_msiβ ops to get the number of MSI interrupts allocated by the RC from the MSI capability register πset_msixβ ops to set the requested number of MSI-X interrupts in the MSI-X capability register βget_msixβ ops to get the number of MSI-X interrupts allocated by the RC from the MSI-X capability register π¦raise_irqβ ops to raise a legacy, MSI or MSI-X interrupt π¨ (pick your fighter)map_msi_irqβ ops to map physical address to MSI address and return MSI data π¬startβ ops to start the PCI link πstopβ ops to stop the PCI link πget_featuresβ ops to get the features supported by the EPC πget_aux_resources_countβ ops to get the number of controller-owned auxiliary resources π’get_aux_resourcesβ ops to retrieve controller-owned auxiliary resources πownerβ the module owner containing the ops π (somebody's gotta hold the keys)
π¦ SEE ALSO π¦
literally go read these next, iykyk:
Kernel file ./include/linux/pci-epc.h, then struct pci_epc_map(9), enum pci_epc_aux_resource_type(9), struct pci_epc_aux_resource(9), struct pci_epc_mem_window(9), struct pci_epc_mem(9), struct pci_epc(9), enum pci_epc_bar_type(9), enum pci_epc_bar_rsvd_region_type(9), struct pci_epc_bar_rsvd_region(9), struct pci_epc_bar_desc(9), struct pci_epc_features(9) π
bestie heads up: this whole page is ./include/linux business, and the page itself is dated October 2026 β so yeah, sleep on it, but not for that long π
k that's the whole page, mwah π go forth and populate those function pointers, you absolute icon π§ββοΈβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms