pcie_capabil...and_set_word(9)
π pcie_capability_clear_and_set_word β from the Kernel API Manual β¨
okay so bestie, we're in the Kernel API Manual today and the star of the show is pcie_capability_clear_and_set_word(9). yes it's a long name. yes it's worth it. sit down, hydrate, let's go π«Ά
πΈ NAME πΈ
pcie_capability_clear_and_set_word β the RMW accessor for PCI Express Capability Registers, and honestly? she's iconic. π
β¨ SYNOPSIS β¨
int pcie_capability_clear_and_set_word (struct pci_dev *dev , int pos ,
u16 clear , u16 set );
that's the whole vibe. four args, one int coming back at you. π
π¦ ARGUMENTS π¦
devβ thePCI device structureof your PCI Express device. like, the actual device you're doing stuff to. main character energy fr. πposβ the PCI Express Capability Register. which register we're messing with. πclearβ the Clear bitmask. bits in here get yeeted to0. π₯setβ the Set bitmask. bits in here get boosted up to1. β
π DESCRIPTION π
so what actually happens? this function does a Read-Modify-Write (that's RMW, iykyk) operation on the PCI Express Capability Register sitting at pos, using the clear and set bitmasks to figure out which bits flip which way. π§
and here's the part where it gets good: certain PCI Express Capability Registers get accessed concurrently in RMW fashion, so they genuinely need locking. and this function? handles all that locking for you. transparently. to the caller. you don't have to think about it, bestie. you just call, and it slays on your behalf. ππ«Ά
π SEE ALSO π
the whole extended friend group, no cap β all from the Kernel file ./include/linux/pci.h:
enum pci_interrupt_pin(9)pci_channel_state_t(9)pci_is_bridge(9)pci_is_vga(9)pci_is_display(9)struct pci_driver(9)PCI_DEVICE(9)PCI_DEVICE_DRIVER_OVERRIDE(9)PCI_DRIVER_OVERRIDE_DEVICE_VFIO(9)PCI_DEVICE_SUB(9)PCI_DEVICE_CLASS(9)PCI_VDEVICE(9)PCI_VDEVICE_SUB(9)PCI_DEVICE_DATA(9)pci_bus_for_each_resource(9)module_pci_driver(9)builtin_pci_driver(9)pci_irq_type(9)pci_irqd_intx_xlate(9)pci_resource_is_io(9)pci_resource_is_mem(9)pci_pcie_cap(9)pci_is_pcie(9)pcie_caps_reg(9)pci_pcie_type(9)pcie_find_root_port(9)pci_vpd_alloc(9)pci_vpd_find_id_string(9)pci_vpd_find_ro_info_keyword(9)pci_vpd_check_csum(9)pci_ari_enabled(9)pci_is_thunderbolt_attached(9)
π reminder bestie: this lives in./include/linux, dated October 2026, and it's pagepcie_capabil...and_set_word(9)of the Kernel API Manual. go read the source, it's giving scholarly. πβ¨
k bye, love u, happy hacking πππ
π¦ 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