STRUCT PCI_PWRCTRL(9)
π struct pci_pwrctrl β the Kernel API Manual, but make it make sense
okay bestie so the manual name is struct pci_pwrctrl, and yes she's from the Kernel API Manual section 9 β the big-girl section for kernel internals, periodt. this whole page is about a PCI device power control context, and honestly? it's giving "small struct, huge responsibility." π
β¨ NAME β¨
struct pci_pwrctrl β the PCI device power control context. that's it, that's the vibe. it's the little object that holds the power-controlling device and the two callbacks that turn it on and off. iconic behavior tbh π¦
πΈ SYNOPSIS πΈ
here's what she looks like, literally verbatim, no notes, copy her exactly:
struct pci_pwrctrl {
struct device *dev;
int (*power_on)(struct pci_pwrctrl *pwrctrl);
int (*power_off)(struct pci_pwrctrl *pwrctrl);
};
three members. that's the whole struct. short but slaying π
π Members π
each one gets her moment, bestie:
devβ address of the power controlling device. like, where it lives. the address. of the power controlling device. πpower_onβ callback to power on the power controlling device. she does exactly what it says on the tin. βpower_offβ callback to power off the power controlling device. the opposite of the one above, and she's just as important. π
π§ Description π§
okay so here's the lore. an object of this type must be allocated by the PCI power control device β like, that's a hard requirement, "must," no cap β and then passed to the pwrctrl subsystem.
and what does the pwrctrl subsystem do with it? two things, bestie, and they're both kind of a big deal:
- it triggers a bus rescan π₯
- it sets up a device link with the device once it's up π
so yeah. allocate it in the PCI power control device, hand it over to pwrctrl, and let the subsystem do her thing. that's the whole flow. iykyk π«Ά
like for real though β the "must be allocated by the PCI power control device" part is not a suggestion, it's the rule. don't be out here allocating this thing in random places and expecting it to work π
π¦ SEE ALSO π¦
one (1) whole reference, and here she is:
- Kernel file
./include/linux/pci-pwrctrl.hβ go read the header, the header knows all π
πΈβ¨π that's the page!! this came to you from the ./include/linux desk, and the date on it is October 2026, so mark your calendars bestie. mwah, go power-cycle something responsibly π
πβ
π¦ 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