__pci_enable_wake(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so bestie, meet __pci_enable_wake β€” the Kernel API Manual entry that literally does one thing: it enables a PCI device as a wakeup event source. that's the whole vibe. ✨


🌸 SYNOPSIS 🌸

int __pci_enable_wake (struct pci_dev *dev , pci_power_t state , bool
enable );

no cap, that's the whole signature β€” three args, one int coming back at you. 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the PCI device getting the whole treatment. this is the one whose life you're changing. πŸ‘‘
  • state β€” the PCI state that the device is gonna be issuing wakeup events from. like, the power state it's chilling in when it decides to wake the system up. πŸ’€
  • enable β€” true means "yes bestie, generate those events", false means "nope, turn it off". binary queen behavior, honestly. πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does it actually do? two things, and only two things:

  • it enables the device as a wakeup event source
  • or it disables it

that's it. that's the function. 🌈

when those events involve platform-specific hooks, those hooks get called automatically by this routine β€” you don't have to go track them down yourself, it handles the plumbing. iconic. ✨

now for the part where you need to pay attention: devices with legacy power management (meaning: no standard PCI PM capabilities) always require those platform hooks. like, always always. no standard PM capabilities = platform hooks are non-negotiable, periodt. πŸ’€

πŸ’œ RETURN VALUE πŸ’œ

here's the rundown, keep it in your notes app:

  • 0 is returned on success. slay. πŸŽ‰
  • -EINVAL is returned if the device is not supposed to wake up the system. rude, but okay. πŸ™ˆ
  • an error code depending on the platform is returned if both the platform and the native mechanism fail to enable the generation of wake-up events. that's the double-fail scenario, and yes, you get a platform-dependent error code for it. 😭

⭐ SEE ALSO ⭐

first up, the source, because iykyk: Kernel file ./drivers/pci/pci.c πŸ”₯

and then the extended fam β€” the whole PCI cinematic universe, all (9):

pci_bus_max_busnr(9), pci_status_get_and_clear_errors(9), pci_dev_str_match_path(9), pci_dev_str_match(9), pci_find_capability(9), pci_bus_find_capability(9), pci_find_next_ext_capability(9), pci_find_ext_capability(9), pci_get_dsn(9), pci_find_next_ht_capability(9), pci_find_ht_capability(9), pci_find_vsec_capability(9), pci_find_dvsec_capability(9), pci_find_parent_resource(9), pci_find_resource(9), pci_resource_name(9), pci_wait_for_pending(9), pci_request_acs(9), pci_std_enable_acs(9), pci_enable_acs(9), pci_restore_bars(9), pci_update_current_state(9), pci_refresh_power_state(9), pci_platform_power_transition(9), pci_resume_bus(9), pci_power_up(9), pci_set_full_power_state(9), __pci_dev_set_current_state(9), pci_bus_set_current_state(9), pci_set_low_power_state(9), pci_set_power_state(9), pci_save_state(9), pci_restore_state(9), pci_store_saved_state(9), pci_load_saved_state(9), pci_load_and_free_saved_state(9), pci_reenable_device(9), pci_enable_device_mem(9), pci_enable_device(9), pcibios_release_device(9), pcibios_disable_device(9), pci_disable_enabled_device(9), pci_disable_device(9), pcibios_set_pcie_reset_state(9), pci_set_pcie_reset_state(9), pcie_clear_root_pme_status(9), pci_check_pme_status(9), pci_pme_wakeup(9), pci_pme_wakeup_bus(9), pci_pme_capable(9), pci_pme_restore(9), pci_pme_active(9), pci_enable_wake(9), pci_wake_from_d3(9), pci_target_state(9), pci_prepare_to_sleep(9), pci_back_from_sleep(9), pci_finish_runtime_suspend(9), pci_dev_run_wake(9), pci_dev_need_resume(9), pci_dev_adjust_pme(9), pci_dev_complete_resume(9), pci_choose_state(9), pci_suspend_retains_context(9), pci_bridge_d3_possible(9), pci_d3cold_enable(9), pci_d3cold_disable(9), pci_pm_init(9), _pci_add_cap_save_buffer(9), pci_allocate_cap_save_buffers(9), pci_configure_ari(9), pci_acs_enabled(9), pci_acs_path_enabled(9), pci_acs_init(9), pci_enable_atomic_ops_to_root(9), pci_release_region(9), __pci_request_region(9), pci_request_region(9), pci_release_selected_regions(9), pci_request_selected_regions(9), pci_request_selected_regions_exclusive(9), pci_release_regions(9), pci_request_regions(9), pci_request_regions_exclusive(9), pci_remap_iospace(9), pci_unmap_iospace(9), pcibios_setup(9), pcibios_set_master(9), pci_set_master(9), pci_clear_master(9), pci_set_cacheline_size(9), pci_set_mwi(9), pci_try_set_mwi(9), pci_clear_mwi(9), pci_disable_parity(9), pci_intx(9), pci_wait_for_pending_transaction(9), pcie_flr(9), pcie_reset_flr(9), pci_pm_reset(9), pcie_wait_for_link_status(9), pcie_retrain_link(9), pcie_wait_for_link_delay(9), pcie_wait_for_link(9), pci_bridge_wait_for_secondary_bus(9), pci_bridge_secondary_bus_reset(9), __pci_reset_function_locked(9), pci_init_reset_methods(9), pci_reset_function(9), pci_reset_function_locked(9), pci_try_reset_function(9), pci_probe_reset_slot(9), pci_try_reset_slot(9), pci_try_reset_bus(9), pci_reset_bridge(9), pci_bus_error_reset(9), pci_probe_reset_bus(9), pci_reset_bus(9), pcix_get_max_mmrbc(9), pcix_get_mmrbc(9), pcix_set_mmrbc(9), pcie_get_readrq(9), pcie_set_readrq(9), pcie_get_mps(9), pcie_set_mps(9), pcie_bandwidth_available(9), pcie_get_supported_speeds(9), pcie_get_speed_cap(9), pcie_get_width_cap(9), pcie_bandwidth_capable(9), __pcie_print_link_status(9), pcie_print_link_status(9), pci_select_bars(9), pci_set_vga_state(9), pci_add_dma_alias(9), pci_real_dma_dev(9), pci_specified_resource_alignment(9), pci_bus_find_emul_domain_nr(9), pci_ext_cfg_avail(9)

like, the whole friend group showed up. πŸ«ΆπŸ’–


ok that's the page!! now go enable some wakeup events responsibly bestie, and remember: legacy PM devices always need the platform hooks. no exceptions, no cap. πŸ’…βœ¨

and that's a wrap on this little kernel moment, brought to you by the source tree at ./drivers/pci 🌸, vintage October 2026 πŸŽ€ β€” mwah, go touch some registers, ily, bye!! πŸ’œπŸ¦‹β­

πŸ“¦ where this page comes from