STRUCT PCI_EPC_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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